ÿØÿà 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/res_hotel/ |
Upload File : |
<? include "../include/top_proc.html"; $class_HotelReserv = new HotelReserv(); // 엑셀 파일명 설정 $FileName = "호텔예약목록"; $FileName = $FileName."_".Date("Ymd").".xls"; $FileName = urlencode($FileName); // UTF-8 // 엑셀 파일로 변환 헤더 header("Content-Type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=$FileName"); header("Content-Description: PHP4 Generated Data" ); // 조건 $sql_where = stripslashes($sql_where); // 취소건 제외 (2021.02.07) $sql_where .= " AND order_state != 'F'"; $data = array(); $data = $class_HotelReserv->res_hotel_master($sql_where,$sql_order,0,1000); // 합계 계산 $tot_inwon_adult = $tot_inwon_child = $tot_inwon_baby = 0; $tot_buy_price = $tot_agent_price = $tot_sales_price = 0; for($i=0;$i<count($data);$i++){ $row = $class_HotelReserv->res_hotel_master_replace($data[$i]); //2019-10-17 객실금액, 조식금액 매입가 가져오기 $hotel_res_item_arr = $row['hotel_res_item']; //from TB_RES_HOTEL_ITEM $buy_room = "0"; //객실금액 매입가 if(is_array($hotel_res_item_arr)){ foreach($hotel_res_item_arr as $v){ if($v['gu']=="R") $buy_room += $v['buy_price'] * $v['i_count'];//객실요금 if($v['gu']=="U") $buy_room += $v['buy_price'] * $v['i_count'];//객실초과요금 if($v['gu']=="A") $buy_room += $v['buy_price'] * $v['i_count'];//기타 if($v['gu']=="B") { //조식 $data[$i]['buy_breakfast'] += $v['buy_price'] * $v['i_count']; $data[$i]['breakfast_inwon'] += $v['i_count']; } } } $tot_inwon_adult += $row['room_adult_num']; $tot_inwon_child += $row['room_child_num']; $tot_inwon_breakfast += $data[$i]['breakfast_inwon']; $tot_breakfast_price += $data[$i]['buy_breakfast']; $tot_buy_price += $row['buy_total']; $tot_agent_price += $row['agent_total']; $tot_sales_price += $row['sales_total']; } ?> <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=utf-8"> <meta name=ProgId content=Excel.Sheet> <meta name=Generator content="Microsoft Excel 10"> <style> <!-- table {mso-displayed-decimal-separator:"\."; mso-displayed-thousand-separator:"\,";} @page {margin:1.0in .75in 1.0in .75in; mso-header-margin:.5in; mso-footer-margin:.5in;} --> </style> <!--[if gte mso 9]><xml> <x:ExcelWorkbook> <x:ExcelWorksheets> <x:ExcelWorksheet> <x:Name>Sheet1</x:Name> <x:WorksheetOptions> <x:Print> <x:ValidPrinterInfo/> </x:Print> <x:Selected/> </x:WorksheetOptions> </x:ExcelWorksheet> </x:ExcelWorksheets> </x:ExcelWorkbook> </xml><![endif]--> <meta http-equiv=Content-Language content=ko> </head> <body> 검색날짜 : <?=$date_s1?> ~ <?=$date_s2?><br> 검색결과 : <?=number_format(count($data))?> 건<br> 검색인원 : 대인 <?=number_format($tot_inwon_adult)?> 명 / 소인 <?=number_format($tot_inwon_child)?> 명<br> 조식인원 : <?=number_format($tot_inwon_breakfast)?> 명<br> 조식금액 합계 : <?=number_format($tot_breakfast_price)?> 원<br> 공급가 합계 : <?=number_format($tot_buy_price)?> 원<br> 거래처가(B2B) 합계 : <?=number_format($tot_agent_price)?> 원<br> 판매가(B2C) 합계 : <?=number_format($tot_sales_price)?> 원 <table cellspacing="0" cellpadding="2" bordercolor="#999999" bordercolordark="#FFFFFF" border="1"> <tr height="35"> <th align="center" bgcolor="#E7E7E7">No.</th> <th align="center" bgcolor="#E7E7E7">거래처</th> <th align="center" bgcolor="#E7E7E7">예약접수일</th> <th align="center" bgcolor="#E7E7E7">입실일</th> <th align="center" bgcolor="#E7E7E7">퇴실일</th> <th align="center" bgcolor="#E7E7E7">진행전달</th> <th align="center" bgcolor="#E7E7E7">예약자</th> <th align="center" bgcolor="#E7E7E7">연락처</th> <th align="center" bgcolor="#E7E7E7">국적</th> <th align="center" bgcolor="#E7E7E7">대인</th> <th align="center" bgcolor="#E7E7E7">소인</th> <th align="center" bgcolor="#E7E7E7" style="width:350px;">호텔명/룸타입</th> <th align="center" bgcolor="#E7E7E7">룸수</th> <th align="center" bgcolor="#E7E7E7">박수</th> <th align="center" bgcolor="#E7E7E7">합계</th> <th align="center" bgcolor="#E7E7E7">조식인원</th> <th align="center" bgcolor="#E7E7E7">조식금액</th> <th align="center" bgcolor="#E7E7E7" style="width:100px;">공급가</th> <th align="center" bgcolor="#E7E7E7" style="width:100px;">가래처가(B2B)</th> <th align="center" bgcolor="#E7E7E7" style="width:100px;">판매가(B2C)</th> <th align="center" bgcolor="#E7E7E7">예약번호</th> <th align="center" bgcolor="#E7E7E7">담당자</th> <th align="center" bgcolor="#E7E7E7">메모</th> </tr> <? $j = 1; for($i=0;$i<count($data);$i++){ $row = $class_HotelReserv->res_hotel_master_replace($data[$i]); // 거래처 기본값 if($row['agent_id'] == '') $row['agent_id'] = 'tktravel'; ?> <tr> <td align="center"><?=$j?></td> <td align="center"><?=$row['agent_id']?></td> <td align="center"><?=$row['ins_dt']?></td> <td align="center"><?=$row['room_date']?> (<?=get_yoil($row['room_date'])?>)</td> <td align="center"><?=$row['room_date_out']?> (<?=get_yoil($row['room_date_out'])?>)</td> <td align="center"><?=$row['order_state_str']?><br><?=$row['res_mrecv_str']?></td> <td align="center"><?=$row['res_cust_nm']?></td> <td align="center"> <?=$row['res_cust_hp']?></td> <td align="center"><?=$row['res_cust_nat_cd']?></td> <td align="center"><?=$row['room_adult_num']?></td> <td align="center"><?=$row['room_child_num']?></td> <td><?=$row['hnm']?><br>(<?=$row['rnm']?>)</td> <td align="center"><?=$row['room_cnt']?></td> <td align="center"><?=$row['room_day']?></td> <td align="center"><?=(int)$row['room_day'] * (int)$row['room_cnt'];?></td> <td align="center"><?=number_format($row['breakfast_inwon'])?></td><!--조식인원--> <td align="center"><?=number_format($row['buy_breakfast'])?></td><!--조식매입가--> <td class="txt_r ls-1"><?=number_format($row['buy_total'])?></td> <td class="txt_r ls-1"><?=number_format($row['agent_total'])?></td> <td class="txt_r ls-1"><?=number_format($row['sales_total'])?></td> <td align="center"><?=$row['hotel_voucher']?></td> <td align="center"><?=$row['admin_nm']?></td> <td align="center"><?=strip_tags($row['g_memo'])?></td> </tr> <? $j++; } ?> <!-- <tr> <td align="center">합계</td> <td colspan="8"><?=$tot_count?> 건</td> <td align="center"><?=$tot_adult_num?></td> <td align="center"><?=$tot_child_num?></td> <td></td> <td colspan="3"></td> <td align="center"><?=$tot_breakfast_inwon?></td> <td align="center"></td> <td class="txt_r ls-1"><?=number_format($tot_buy_price)?></td> <td class="txt_r ls-1"><?=number_format($tot_agent_price)?></td> <td class="txt_r ls-1"><?=number_format($tot_seles_price)?></td> <td colspan="3"></td> </tr> --> </table> </body> </html>