ÿØÿà JFIF ` ` ÿþ
Server : Apache System : Linux ruga7-004.fmcity.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : tkt_travelbus ( 1137) PHP Version : 7.0.0p1 Disable Function : mysql_pconnect Directory : /tkt_travelbus/www/admin/reservation/ |
Upload File : |
<? include "../include/top.html"; include "_common.php"; $class_AccountCustomer = new AccountCustomer(); //테이블명 $table = " TB_RES_HOTEL "; if (!$key_date_s) $key_date_s = "b.ins_dt"; if(!$key_date2_s) $key_date2_s = date("Y-m-d",strtotime(" -2 month")); // 기간 검색 if(!$key_date3_s) $key_date3_s = date("Y-m-d",strtotime(" +2 month")); // 기간 검색 // 검색 설정 $sql_where = " "; if($key_date_s) $sql_where .= " and {$key_date_s} between '{$key_date2_s}' and '{$key_date3_s}' "; if($res_stat_cd_s) $sql_where .= " and a.res_stat_cd = '{$res_stat_cd_s}' "; if($key_nm_s) $sql_where .= " and {$key_nm_s} like '%{$key_nm2_s}%' "; //if($mode=="agent") $sql_where .= " and b.agent_id is not null "; // 대리점예약 //elseif($mode=="person") $sql_where .= " and b.agent_id is null "; // 개인예약 //elseif($mode=="bank") $sql_where .= " and b.pgcase_cd='inst001' "; // 통장입금 //elseif($mode=="card") $sql_where .= " and b.pgcase_cd='inst002' ";// 카드결제 // 리스트 수 가져옴 $sql = "select count(*) as total from TB_RES_HOTEL_ROOM a, "; $sql .= " ( SELECT d1.*,d2.pgcase_cd "; $sql .= " FROM TB_RES_HOTEL AS d1 "; $sql .= " LEFT JOIN (SELECT res_no,pgcase_cd,delflag FROM TB_ACCOUNT_CUSTOMER WHERE pgcase_cd IN ('inst001','inst002') ) d2 "; $sql .= " ON d1.res_no=d2.res_no AND d2.delflag='N' "; $sql .= ") b "; $sql .= " where a.res_no=b.res_no {$sql_where} "; $row = db_fetch($sql); $total = $row[total]; // 페이지수 설정 if (!$page) $page = 1; // 페이지 번호 $line = 20; // 보여줄 갯수 $list = 10; // 블럭 갯수 $total_page = ceil($total / $line); // 총페이지 if ($total == 0) $total_page = 1; // 데이터가 하나도 없으면 총페이지 1 if ($page > $total_page) $page = $total_page; // 페이지가 전체 페이지보다 크면 페이지 번호를 바꿈 $total_list = intval($total_page / $list); if ($total_page % $list == 0) $total_list--; $curr_list = intval($page / $list); if ($page % $list == 0) $curr_list--; $start_page = $curr_list * $list + 1; $prev_list = $start_page - $list; $next_list = $start_page + $list; $olds = $line * ($page - 1); // 정렬 설정 $sql_order=" {$key_date_s} desc "; //배열에 저장 $data = array(); $data = toad_res_hotel_roomdate($sql_where,$sql_order,$olds,$line); // 예약상태별 집계 $sql_cnt = ""; if ($mode=="agent") $sql_cnt = " and b.agent_id is not null "; elseif($mode=="person") $sql_cnt = " and b.agent_id is null "; //elseif($mode=="bank") $sql_cnt = " and b.pgcase_cd='inst001' "; elseif($mode=="card") $sql_cnt = " and b.pgcase_cd='inst002' "; $sql = "SELECT a.res_stat_cd,COUNT(a.idx) AS cnt FROM (SELECT idx,res_no,agent_id,res_stat_cd FROM TB_RES_HOTEL_ROOM where delflag='N') AS a, "; $sql .= " ( SELECT d1.*,d2.pgcase_cd "; $sql .= " FROM TB_RES_HOTEL AS d1 "; $sql .= " LEFT JOIN (SELECT res_no,pgcase_cd,delflag FROM TB_ACCOUNT_CUSTOMER WHERE pgcase_cd IN ('inst001','inst002') ) d2 "; $sql .= " ON d1.res_no=d2.res_no AND d2.delflag='N' "; $sql .= ") b "; $sql .= " WHERE a.res_no=b.res_no {$sql_cnt} GROUP BY a.res_stat_cd"; $rs = db_query($sql); $cnt_data = db_fetch_all($rs); $code_res = base_codec("PRD","RES");//접수상태 ?> <div class="contents_wrap"> <div class="contents_wrap_in"> <div class="title">예약목록</div> <div class="contents_detail"> <div class="c_top_bar"> <!-- 폼 --> <form name="frm_search" id="frm_search" method="get" style="margin:0px;padding:0px;"> <input type="hidden" name="mode" value="<?=$mode?>"> <div class="lo_left"> <select name="key_date_s" style="width:70px;"> <option value="b.ins_dt" <?=($key_date_s=="b.ins_dt")?"selected":""?>>예약일</option> <option value="a.checkin_dt" <?=($key_date_s=="a.checkin_dt")?"selected":""?>>입실일</option> </select> <input type="text" name="key_date2_s" class="cal_input" value="<?=$key_date2_s?>" size="15" onclick="AjaxCal(this,event);" readonly> ~ <input type="text" name="key_date3_s" class="cal_input" value="<?=$key_date3_s?>" size="15" onclick="AjaxCal(this,event);" readonly> </div> <select name="key_nm_s" id="key_nm_s" class="lo_left top_input mr5"> <option value="">==선택==</option> <option value="b.res_no" <?=($key_nm_s=="b.res_no")?"selected":""?>>예약번호</option> <option value="b.res_cust_nm" <?=($key_nm_s=="b.res_cust_nm")?"selected":""?>>예약자명</option> <option value="b.cust_nm" <?=($key_nm_s=="b.cust_nm")?"selected":""?>>숙박자명</option> <option value="b.tel" <?=($key_nm_s=="b.tel")?"selected":""?>>전화번호</option> <option value="b.hp" <?=($key_nm_s=="b.hp")?"selected":""?>>핸드폰</option> <option value="b.cust_email" <?=($key_nm_s=="b.cust_email")?"selected":""?>>이메일</option> </select> <input class="search_box search_box_bg" id="key_nm2_s" name="key_nm2_s" type="text" value="<?=$key_nm2_s?>" /><input type="image" src="../image/btn/btn_search.gif" align="top" alt="검색" class="input_img input_btn_search" /> </form> <!-- /폼 --> </div> <? include "../res_good/_tab_menu.html"; ?> <div class="top_txt_s"> <div class="bar_wrap"> <p class="search_result_txt lo_left"><span>Total : <?=$total?></span></p> </div> </div> <div class="hotel_wrap"> <div style="width:100%;overflow-x:auto;overflow-y:hidden;"> <table width="1600px" border="0" cellspacing="0" cellpadding="0" class="t_list"> <thead> <tr> <td colspan="21" class="t_top_line"></td> </tr> <tr> <th width="30">No.</th> <th width="120">예약번호</th> <th width="60">진행전달</th> <th width="60">예약상태</th> <th width="65">입금상태</th> <th width="80">예약자</th> <th width="80">입실일</th> <th width="80">퇴실일</th> <th>호텔명</th> <th>룸타입</th> <th width="50">박수/룸수</th> <th width="80">판매액</th> <th width="80">미납액</th> <th width="80">총비용</th> <th width="80">수수료수익</th> <th width="80">총수익</th> <th width="60">담당자</th> <th width="80">입력일</th> <th width="60">-</th> </tr> </thead> <tbody> <? // 합계액 리셋 $gnd_sales = 0; $gnd_pre = 0; $gnd_exes = 0; $gnd_comm = 0; $gnd_incom = 0; $gnd_d_people2 = 0; $gnd_d_people1 = 0; for($i=0 ; $i < count($data) ; $i++){ $row = $data[$i]; $num = $total - ($page - 1) * $line - $i; // 합계 $gnd_sales += $row['price_total']; $gnd_pre += $row['account']['pre_money']; // 예약확정이면 정산가능 $button_acc = ""; $acc_data = array(); if ( $row['res_stat_cd'] == "C" ) { $button_acc = "<input type='button' class='btn_orange_left' value='정산' "; $button_acc .= " onclick=\"to_dialog.iframe('../calculate/hotel_cal_res.html?res_no={$row[res_no]}','개별정산 - {$row[res_no]}','750','500',true,true,'yes');\" "; $button_acc .="><span class='btn_orange_right'></span>"; // 정산정보 $acc_data = $class_AccountCustomer->acc_hotel_date($row['res_no']); // 합계 $gnd_exes += $acc_data['calu']['exes_tot'] ; $gnd_comm += $acc_data['calu']['comm_tot'] ; $gnd_incom += $acc_data['calu']['incom_tot'] ; } ?> <tr <?if($row['res_stat_cd']=="D")echo "class='cancel_line'";?> height="30"> <td><?=$num?></td> <td><b><a href="javascript:;" onclick="to_dialog.iframe('../res_hotel/hotel_res_edit.html?res_no=<?=$row['res_no']?>','호텔예약 수정 - <?=$row['res_no']?>','860','600',true,true,'yes');"><?=$row['res_no']?></a></b></td> <td title="<?=$row['order_state_str']?>"><div style="width:50px;height:17px;overflow:hidden;"><font color="<?=$row['order_state_color']?>"><?=$row['order_state_str']?></font></div></td><!-- 진행전달 --> <td><font color="<?=$row['res_stat_cd_color']?>"><?=$row['res_stat_cd_str']?></font></td> <td><?=$row['proc_str']?></td> <td><?=$row['res_cust_nm']?></td> <td><?=$row['checkin_dt']?></td> <td><?=$row['checkout_dt']?></td> <td class="t_hotel_name"><?=$row['hotel_nm']?></td> <td><?=$row['room_type']?></td> <td><?=$row['lodg_day']?>/<?=$row['room_cnt']?></td> <td style="text-align:right;"><?=number_format($row['price_total'])?></td> <td style="text-align:right;"><?=number_format($row['account']['pre_money'])?></td> <td style="text-align:right;"><?=number_format($acc_data['calu']['exes_tot'])?></td><!-- 총비용 --> <td style="text-align:right;"><?=number_format($acc_data['calu']['comm_tot'])?></td><!-- 수수료수익 --> <td style="text-align:right;"><?=number_format($acc_data['calu']['incom_tot'])?></td><!-- 총수익 --> <td><?=$row['admin_nm']?></td> <td title="<?=$row['ins_dt']?>"><?=$row['ins_dt2']?></td> <td> <?if($TK_MEMBER['mb_level']==1 and $row['res_stat_cd']=="D"){?> <input type="button" value="삭제" class="btn_gray_left" onclick="if(!confirm('정말삭제하시겠습니까?\n정산산정보도 삭제됩니다.'))return;ajax_loader('person_reserve_proc.php?SqlType=delete_reserv&res_no=<?=$row['res_no']?>');"><span class="btn_gray_right"></span> <?}?> <?=$button_acc?> </td> </tr> <?}?> <tr> <td colspan="11" style="text-align:right">계 </td> <td style="text-align:right;"><?=number_format($gnd_sales)?> </td><!-- 판매액 계--> <td style="text-align:right;"><?=number_format($gnd_pre)?> </td><!-- 미입금액 계--> <td style="text-align:right;"><?=number_format($gnd_exes)?> </td><!-- 비용 계--> <td style="text-align:right;"><?=number_format($gnd_comm)?> </td><!-- 수수료수익 계--> <td style="text-align:right;"><?=number_format($gnd_incom)?> </td><!-- 총수익 계--> <td colspan="4"></td> </tr> </tbody> </table> </div> </div> <?=adm_get_paging($total_page, $page, $list, "?$href&page=", "")?> </div> </div> </div> <? include "../include/footer.html" ?> <script type="text/javascript"> // 엑셀출력 function to_excel(sql_where,olds,line) { if(!sql_where) return; if(!confirm('시간이 소요될수 있습니다.엑셀파일을 다운로드 하시겠습니까?')) return; document.location.href='person_reserve_excel.html?mode=<?=$mode?>&sql_where='+sql_where+'&olds='+olds+'&line='+line; } $(document).ready(function(){ $(".t_list tbody td").each(function(){ var _html = $(this).html(); $(this).html("<div style='width:100%;height:19px;overflow:hidden;'>"+_html+"</div>"); }); }); </script>