ÿØÿà 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_good/ |
Upload File : |
<? include "../../Lib/config.php"; if( ($_COOKIE['MemberLevel'] == $cf['agent_level'] || $_COOKIE['MemberLevel'] == $cf['trade_level']) ) { $b2b_mode = true; //대리점 또는 공급처 include "../include/top_agent.html"; } else { $b2b_mode = false; //대리점 또는 공급처 외 include "../include/top.html"; if(empty($search_lang)) $search_lang = 'hk'; //default 번체 } include "_common.html"; //p($cf['lang']); $baseTerm = 90; $today = date("Y-m-d"); //검색 기본 설정 if(!$siteType){ $siteType = 'tk'; } if(isset($date_s1) && !isset($date_s2)){ $date_s2 = $date_s1; } if(!$date_s1){ $date_s1 = $today; } if(!$date_s2){ $date_s2 = strtotime($today); $date_s2 += (86400 * $baseTerm); $date_s2 = date("Y-m-d", $date_s2); } if(!$tourType){ $tourType = 'busTour'; } if(!$periodType){ $periodType = 'day'; } //당일투어 //간체 132, 영어 125, 번체 118, 여행대장 //1박2일 투어 //번체 119, 영어 126, 간체133 $lang = $cf['lang']; if($lang != 'KO'){ $siteType = 'tk'; } if($siteType == 'tb'){ $data_bc_tb = TO_get_bc("","N"," and b_lang='ko' and tab in ('P') AND b_uid NOT IN(162, 114)"); //162 픽업/샌딩, 114버스렌트 $data_bc_tk = array(); }else if($siteType == 'tk'){ // $data_bc_tk = TO_get_bc("","N"," and b_lang IN ('en','cn','hk','ag') and tab in ('D','P') AND b_uid NOT IN(127,130,135,138,143,124)"); //127 Airport transfer, 130 Car rental, 135 机场接送, 138 客制化行程, 143 機場接送, 124 客製化行程 $data_bc_tk = TO_get_bc("","N"," and b_lang IN ('{$lang}') and tab in ('D','P') AND b_uid NOT IN(127,130,135,138,143,124)"); //127 Airport transfer, 130 Car rental, 135 机场接送, 138 客制化行程, 143 機場接送, 124 客製化行程 $data_bc_tb = array(); } else if($siteType == 'all'){ $data_bc_tb = TO_get_bc("","N"," and b_lang='ko' and tab in ('P') AND b_uid NOT IN(162, 114)"); //162 픽업/샌딩, 114버스렌트 $data_bc_tk = TO_get_bc("","N"," and b_lang IN ('en','cn','hk','ag') and tab in ('D','P') AND b_uid NOT IN(127,130,135,138,143,124)"); //127 Airport transfer, 130 Car rental, 135 机场接送, 138 客制化行程, 143 機場接送, 124 客製化行程 } //if(devCookie()){ // p($data_bc_tk); //132,133,137 <-buid // exit; //} //간체 상품을 출발일정에 일괄 안나오게 하기 //$s = "UPDATE good SET is_depart_schedule_show = 'N' WHERE b_uid IN (132,133,137)"; //나중에 간체 상품 나오게 하려면 Y로 변경하여 실행 $allBuid = ""; $tbBuid = ""; $tkBuid = ""; foreach($data_bc_tk as $item){ if(!$allBuid){ $allBuid .= $item['b_uid']; }else{ $allBuid .= ','.$item['b_uid']; } if(!$tkBuid){ $tkBuid .= $item['b_uid']; }else{ $tkBuid .= ','.$item['b_uid']; } } foreach($data_bc_tb as $item){ if(!$allBuid){ $allBuid .= $item['b_uid']; }else{ $allBuid .= ','.$item['b_uid']; } if(!$tbBuid){ $tbBuid .= $item['b_uid']; }else{ $tbBuid .= ','.$item['b_uid']; } } if(!$d_title){ $d_title = ""; } $sqlWhere = ""; if($siteType == 'all'){ $sqlWhere = " AND b_uid IN ({$allBuid}) AND is_depart_schedule_show = 'Y' "; }else if($siteType == 'tk'){ //번체 간체 영어 $sqlWhere = " AND b_uid IN ({$tkBuid}) AND is_depart_schedule_show = 'Y'"; }else if($siteType == 'tb'){ $sqlWhere = " AND b_uid IN ({$tbBuid}) AND is_depart_schedule_show = 'Y'"; } $startDateList = array(); $startDateTimeStamp = strtotime($date_s1); $endDateTimeStamp = strtotime($date_s2); $strDate = date("Y-m-d", $startDateTimeStamp); $startDateList[$strDate] = array(); while(true){ $startDateTimeStamp += 86400; $strDate = date("Y-m-d", $startDateTimeStamp); // array_push($startDateList, $strDate); $startDateList[$strDate] = array(); if($startDateTimeStamp >= $endDateTimeStamp){ break; } } if($g_uid){ $sqlWhere .= " AND g_uid LIKE '{$g_uid}'"; }else{ if($g_title){ $sqlWhere .= " AND g_title LIKE '%{$g_title}%'"; } } //검색 불가한 상품명 //尋找楓葉~報恩俗離山國立公園 蓮花咖啡廳一日 /*if(devCookie()){ p($sqlWhere); }*/ $goodList = good_list($sqlWhere); //행사 $goodDataDateList = array(); $sqlWhereDate = ""; /*if($d_title){ $sqlWhereDate = " AND d.d_title LIKE '%{$d_title}%'"; }*/ $total = 0; foreach($goodList as $item){ //상품 $g_uid = $item['g_uid']; if(devCookie()){ // p($g_uid); } $sql = "SELECT * FROM date d WHERE d.g_uid = {$g_uid} AND d.d_start >= '{$date_s1}' AND d.d_start <= '{$date_s2}' {$sqlWhereDate} AND d.d_ok = 'A' ORDER BY d.d_start ASC LIMIT 1"; $sql = "SELECT * FROM date d WHERE d.g_uid = {$g_uid} AND d.d_start >= '{$date_s1}' AND d.d_start <= '{$date_s2}' {$sqlWhereDate} ORDER BY d.d_start ASC"; // $sql = "SELECT * FROM date d WHERE d.g_uid = {$g_uid} AND d.d_start >= '{$date_s1}' AND d.d_start <= '{$date_s2}' {$sqlWhereDate} ORDER BY d.d_start ASC LIMIT 1"; $rs = db_query($sql); $eventList = array(); //행사목록 //행사리스트 생성 while($row = db_fetch_array($rs)){ array_push($eventList, $row); } $firstStartDate = ""; //이 상품에 있는 행사의 예약수 합 foreach($eventList as $item2){ if($periodType == 'all'){ // 전체 }else if($periodType == 'day'){ // 당일 if($item2['period'] > 1){ continue; } }else if($periodType == 'days'){ // 숙박 if($item2['period'] == 0 || $item2['period'] == 1){ continue; } } if(!isset($startDateList[$item2['d_start']][$g_uid])){ $resPeopleCnt = $item2['d_people1']; $startDateList[$item2['d_start']][$g_uid] = array( 'g_uid' => $item['g_uid'], 'period' => $item2['period'], 'g_title' => $item['g_title'], 'd_ok_A' => $resPeopleCnt, 'd_start' => $item2['d_start'], 'd_end' => $item2['d_end'], 'remaining_seats' => $item['remaining_seats'], 'wait_depart' => $item['wait_depart'], 'confirmed_depart' => $item['confirmed_depart'], 'guide_name' => $item['guide_name'], ); //예약확정인원수 가져오기 //해당 예약건 $sql = "SELECT res_no FROM TB_RES_GOOD WHERE g_uid = {$g_uid} AND ev_start = '{$item2['d_start']}' AND order_state IN ('B','F')"; $rs = db_query($sql); $resNoList = ""; while ($row = db_fetch_array($rs)) { if(devCookie()){ // p($row['res_no']); } if(!$resNoList){ $resNoList = "'".$row['res_no']."'"; }else{ $resNoList .= ",'".$row['res_no']."'"; } } $resPeopleCnt = 0; if($resNoList){ $sql2 = "SELECT count(*) AS total FROM TB_RES_GOOD_PERSON WHERE res_no IN ($resNoList)"; $rs2 = db_fetch($sql2); $resPeopleCnt = $rs2['total']; } $startDateList[$item2['d_start']][$g_uid]['d_ok_A'] = $resPeopleCnt; $total += 1; }else{ continue; //예약인원 // if($item2['d_ok'] == 'A'){ $startDateList[$item2['d_start']][$g_uid]['d_ok_A'] += $item2['d_people1']; // } } } // break; //test } //행사명 불러오기 $yoil = array("일","월","화","수","목","금","토"); ?> <style> .label_btn {display:block; float:left; -moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; border:1px solid #333; color:#333; cursor:pointer; text-align:center;padding:4px 5px 5px 5px; margin-top:3px; font-size:11px;} .color_type1 {background-color:#f2f2f2;color:white; margin-right: 3px;} .color_type2 {background-color:#478fd1;color:white; margin-right: 3px;} .color_type3 {background-color:#ffc000;color:white; margin-right: 3px;} .color_type4 {background-color:#00b050;color:white; margin-right: 3px;} .color_type5 {background-color:#ff0000;color:white; margin-right: 3px;} /*테이블 헤드 픽스*/ .container {height: 700px; overflow: auto;} .fixedheader{position: -webkit-sticky; position: sticky; top: 0; border-top: 1px solid #777 !important;} .fixedheader_2{position: -webkit-sticky; position: sticky; top: 42px;} .fixedheader_3{position: -webkit-sticky; position: sticky; top: 83px;} .tdBottom{border-bottom: 1px solid #445163 !important;} </style> <script> objCenter("ajax_loading_bar","on");//중앙에 보이기. </script> <div class="contents_wrap"> <div class="contents_wrap_in" style="background-color:#EEEEEE;"> <div class="title"> <strong><?=_e2('투어확정달력')?></strong> </div> <div class="contents_detail"> <?php // 검색폼 require_once("b2b_good_res_bustour_search.php"); ?> <div id="Content_box"> <!-- 폼 --> <form name="frm_list" id="frm_list" method="post"> <input type="hidden" name="SqlType" value="chg_order_state"> <table border="0" cellspacing="0" cellpadding="0" class="t_list tourSchedultTb" width="100%"> <thead> <tr> <th style="width:150px"><?=_e('출발일')?></th> <th style="width:120px"><?=_e('여행구분')?></th> <th style="width:120px"><?=_e('여행기간')?></th> <th style="width:350px"><?=_e('상품명')?></th> <th style="width:80px"><?=_e('예약인원')?></th> <th style="width:80px"><?=_e('잔여석')?></th> <th style="width:80px"><?=_e('최대출발')?></th> <th style="width:80px"><?=_e('출발상태')?></th> </tr> </thead> <tbody> <?php foreach($startDateList as $key => $value){ $isRowDateStart = true; $eventCnt = count($value); $i = 0; foreach($value as $item){ $i += 1; $isLastRow = false; if($eventCnt == $i){ $isLastRow = true; } ?> <tr> <?php if($isRowDateStart){ $startDate = explode('-',$key); $startYear = $startDate[0]; $startMonth = $startDate[1]; $startDay = $startDate[2]; $dayStr = $yoil[date('w', strtotime($key))]; ?> <td class="tdBottom" style="font-weight:bold" rowspan="<?=count($startDateList[$key])?>"> <?=_e($startYear.'년 '.$startMonth.'월 '.$startDay.'일')?> <?=(($dayStr == '토' || $dayStr == '일') ? "<span style='color:red'>("._e($dayStr.'1').")</span>" : "("._e($dayStr.'1').")" )?></td> <?php } ?> <td class="<?=(($isLastRow) ? 'tdBottom' : '')?> trguid<?=$item['g_uid']?> hoverTr" guid="<?=$item['g_uid']?>"><?=_e('버스투어')?></td> <td class="<?=(($isLastRow) ? 'tdBottom' : '')?> trguid<?=$item['g_uid']?> hoverTr" guid="<?=$item['g_uid']?>"><?=(($item['period'] == 0 || $item['period'] == 1) ? _e('당일여행') : _e(($item['period']-1).'박 '.($item['period']).'일'))?></td> <td class="<?=(($isLastRow) ? 'tdBottom' : '')?> trguid<?=$item['g_uid']?> hoverTr" guid="<?=$item['g_uid']?>" style="padding-left:10px;text-align:left;font-weight:bold"> <a class="evLink" href="/admin/res_good/b2b_tour_res.html?g_uid=<?=$item['g_uid']?>" target="_blank"><?=$item['g_title']?></a> </td> <td class="<?=(($isLastRow) ? 'tdBottom' : '')?> trguid<?=$item['g_uid']?> hoverTr" guid="<?=$item['g_uid']?>"><?=$item['d_ok_A']?></td> <td class="<?=(($isLastRow) ? 'tdBottom' : '')?> trguid<?=$item['g_uid']?> hoverTr" guid="<?=$item['g_uid']?>" style="color:red;font-weight:bold"><?=$item['remaining_seats']?></td> <td class="<?=(($isLastRow) ? 'tdBottom' : '')?> trguid<?=$item['g_uid']?> hoverTr" guid="<?=$item['g_uid']?>"><?=$item['wait_depart']?></td> <td class="<?=(($isLastRow) ? 'tdBottom' : '')?> trguid<?=$item['g_uid']?> hoverTr" guid="<?=$item['g_uid']?>" style="text-align:center"> <input type="submit" value="<?=_e2('출발대기')?>" class="Table_btn blue2" style="margin:auto;font-weight:bold;font-size:12px;width:80px;padding:0px !important; height:28px !important;<?=(($item['d_ok_A'] < $item['confirmed_depart']) ? 'display:block;':'display:none;')?>"> <input type="submit" value="<?=_e2('예약가능')?>" class="Tbtn red" style="margin:auto;font-weight:bold;height: 28px;width:80px;padding: 0px;<?=(($item['d_ok_A'] >= $item['confirmed_depart']) ? 'display:block;':'display:none;')?>"> </td> </tr> <?php $isRowDateStart = false; } } ?> </tbody> </table> </form> <!-- 폼 --> </div> </div> </div> </div> <script type="text/javascript"> $(window).ready(function(){ objCenter("ajax_loading_bar","off");//로딩바 off }); $(document).ready(function(){ //언어 선택 $('#search_lang2').on('change',function(){ $('#search_lang').val($(this).val()); document.frm_search.submit(); }); }); </script> <? include "../include/footer.html" ?>