ÿØÿà 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/cal/ |
Upload File : |
<?php include $_SERVER['DOCUMENT_ROOT']."/include/top_proc.html"; if (!$viewType) { $viewType = "month"; } /***** 달력 환경설정 (시작) *****/ // 달력 배경 설정 $cal_bg = "/js/ajaxcalendar/cal_bg.gif"; // 요일 영문 (기본) // 달력 글자 색상 $cal_day_color = "#464646"; // 평일 // $cal_day_color = "#fff"; // 평일 $cal_sat_color = "#0066CC"; // 토요일 $cal_sat_color = "#FF0000"; // 토요일 $cal_sun_color = "#FF0000"; // 일요일(공휴일) $cal_today_color = "#2C852C"; // 오늘 $cal_today_color = "#464646"; // 오늘 $cal_none_color = "#BBBBBB"; // 비활성일 // 마지막 날,요일 설정 $cal_lastday = array(1 => 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); // 각 달의 마지막 날 지정 $yyoil = array("일", "월", "화", "수", "목", "금", "토"); // 요일명 지정 /***** 달력 초기화 *****/ // 오늘 $cal_now_yy = (int)date("Y"); $cal_now_mm = (int)date("m"); $cal_now_dd = (int)date("d"); // 파라메터 if (!$yy) $yy = (int)date("Y"); if (!$mm) $mm = (int)date("m"); $sdate = $sdate; // 달력 시작일 $edate = $edate; // 달력 종료일 $format = $format; // 출력 포멧 // 공통 파라메터 $cal_param = "&sdate={$sdate}&edate={$edate}&format={$format}"; // 윤년 계산을 통해 2월의 마지막 날 계산 if ($yy % 4 == 0 && $yy % 100 != 0 || $yy % 400 == 0) { $cal_lastday[2] = 29; } // 전해까지 평년 기준으로 날짜수 계산 및 윤년의 횟수를 더함 $cal_total = ($yy - 1) * 365 + (int)(($yy - 1) / 4) - (int)(($yy - 1) / 100) + (int)(($yy - 1) / 400); // 해당월의 1일 for ($i = 1; $i < $mm; $i++) { $cal_total += $cal_lastday[$i]; // 전달까지의 날짜수 더함 } $cal_total++; // 그 달의 1일 $cal_startday = $cal_total % 7; // 시작 요일을 구함 (0:일요일,...,6:토요일) $endMM = (int) $mm; // 해당월의 마지막 날짜 $cal_endday = $cal_lastday[$endMM]; // 해당월의 마지막 날짜 // $cal_endday = $cal_lastday[$mm]; // DB용 년월 (YYYY-MM); $cur_month = $yy . "-" . str_pad($mm, 2, "0", STR_PAD_LEFT); /***** 이전달, 다음달 *****/ if ($mm == 12) { $cal_ny = $yy + 1; // 다음년 $cal_nm = 1; // 다음월 $cal_py = $yy; // 이전년 $cal_pm = $mm - 1; // 이전월 } elseif ($mm == 1) { $cal_ny = $yy; $cal_nm = $mm + 1; $cal_py = $yy - 1; $cal_pm = 12; } else { $cal_ny = $yy; $cal_nm = $mm + 1; $cal_py = $yy; $cal_pm = $mm - 1; } // 링크 $cal_prev_href = "document.location.href = '{$PHP_SELF}?mb_id={$mb_id}&yy={$cal_py}&mm={$cal_pm}&{$cal_param}&siteType={$siteType}&viewType={$viewType}';"; // 이전달 $cal_next_href = "document.location.href = '{$PHP_SELF}?mb_id={$mb_id}&yy={$cal_ny}&mm={$cal_nm}{$cal_param}&siteType={$siteType}&viewType={$viewType}';"; // 다음달 // 휴일 $sql = "SELECT * FROM TB_HOLIDAY ORDER BY holiday_date ASC"; $rs = db_query($sql); $holidayData = array(); $calendarHolidayData = array(); $calendayNationList = array(); while ($row = db_fetch_array($rs)) { array_push($holidayData, $row); $calendarHolidayData[$row['holiday_date']][$row['nation']] = $row; array_push($calendayNationList, $row['nation']); } //한국 키값제거 $calendayNationList = array_unique($calendayNationList); $koKey = array_search('ko', $calendayNationList); array_splice($calendayNationList, $koKey, 1); //출발 데이터 //$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_tb = TO_get_bc("", "N", " and b_lang='ko'"); //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 客製化行程 //$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,135,143)"); //127 Airport transfer, 130 Car rental, 135 机场接送, 138 客制化行程, 143 機場接送, 124 客製化行程 //$data_bc_tk = TO_get_bc("","N"," and tab in ('D','P')"); //127 Airport transfer, 130 Car rental, 135 机场接送, 138 客制化行程, 143 機場接送, 124 客製化行程 $data_bc_tk = TO_get_bc("", "N", " and b_lang IN ('en','cn','hk','ag','tw')"); //127 Airport transfer, 130 Car rental, 135 机场接送, 138 客制化行程, 143 機場接送, 124 客製化行程 $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 (!$siteType) { $siteType = "all"; } $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(); if (!$yy) { $yy = date("Y"); } if (!$mm) { $mm = date("m"); } $startDateTimeStamp = strtotime($yy . '-' . $mm . '-01'); $endDateTimeStamp = strtotime($yy . '-' . $mm . '-31'); if (!$endDateTimeStamp) { $endDateTimeStamp = strtotime($yy . '-' . $mm . '-30'); } if (!$endDateTimeStamp) { $endDateTimeStamp = strtotime($yy . '-' . $mm . '-29'); } if (!$endDateTimeStamp) { $endDateTimeStamp = strtotime($yy . '-' . $mm . '-28'); } if (!$endDateTimeStamp) { $endDateTimeStamp = strtotime($yy . '-' . $mm . '-27'); } $strDate = date("Y-m-d", $startDateTimeStamp); $startDateList[$strDate] = array(); while (true) { $startDateTimeStamp += 86400; $strDate = date("Y-m-d", $startDateTimeStamp); $startDateList[$strDate] = array(); if ($startDateTimeStamp >= $endDateTimeStamp) { break; } } //p($sqlWhere); //660 g_uid //119 b_uid //269 m_uid //p($sqlWhere); //exit; $goodList = good_list($sqlWhere); //p($goodList); $guidListIn = ""; $goodInfoData = array(); foreach ($goodList as $item) { $goodInfoData[$item['g_uid']] = $item; if (!$guidListIn) { $guidListIn = $item['g_uid']; } else { $guidListIn .= "," . $item['g_uid']; } } //p($guidListIn); $d_startValue = $yy . '-' . $mm; $mmm = $mm; if (strlen($mm) == 1) { $mmm = '0' . $mm; $d_startValue = $yy . '-' . $mmm; } $sqlWhereDate = " AND ev_start LIKE '{$d_startValue}%'"; //행사 $goodDataDateList = array(); $sql = "SELECT * FROM TB_RES_GOOD WHERE g_uid IN ({$guidListIn}) {$sqlWhereDate} AND order_state IN ('B','F')"; $rs = db_query($sql); $resList = array(); // 예약목록 $resNoListIn = ""; //예약리스트 생성 /* $goodTitle = array(); while ($row = db_fetch_array($rs)) { $goodTitle[$row['g_uid']] = array( 'g_title' => $row['g_title'], 'ins_id' => $row['admin_id'], 'wait_depart' => $goodInfoData[$row['g_uid']]['wait_depart'], ); if (!$resNoListIn) { $resNoListIn = "'" . $row['res_no'] . "'"; } else { $resNoListIn .= ",'" . $row['res_no'] . "'"; } }*/ $resCntList = array(); while($dataRowRes = db_fetch_array($rs)){ if(isset($resCntList[$dataRowRes['ev_start']])){ $resCntList[$dataRowRes['ev_start']] += 1; }else{ $resCntList[$dataRowRes['ev_start']] = 1; } } // p($goodTitle); // p($resCntList); // exit; $privateDepartData = array(); //우선 tk만 프라이빗이 나오게하고 나중에 tb용 프라이빗 투어가 필요함. //2022.11.23 by taeyoung //if($siteType == 'tk'){ $mmm = $mm; if (strlen($mm) == 1) { $mmm = '0' . $mm; } $calendarDateFind = $yy . '-' . $mmm; if ($siteType == 'all') { $siteTypeWhereSQL = ""; } else { $siteTypeWhereSQL = " AND site_type = '{$siteType}'"; } $sql = "SELECT * FROM TB_PRIVATE_DEPART WHERE calendar_date LIKE '{$calendarDateFind}%' AND isShow = 'Y' {$siteTypeWhereSQL}"; $rs = db_query($sql); while ($row = db_fetch_array($rs)) { if(isset($resCntList[$row['calendar_date']])){ $resCntList[$row['calendar_date']] += 1; }else{ $resCntList[$row['calendar_date']] = 1; } } //} /** * * '당일투어' => '#4984d9', //당일투어 1, DayTour 5, 當日遊(9) * '버스투어' => '#ace1f0', //버스투어 2, Bus Tour(6), 巴士旅遊(10) * '입장티켓' => '#cedf7f', //입장티켓 3, Ticket(7), 入場券(11) * '버스렌트' => '#333333', //버스렌트 4, Bus Rental(8), 公共汽車租賃(12) * */ //$dayTourBuid = array(1,5,9); //$busTour = array(2,6,10); //$ticket = array(3, 7, 11); //$busRental = array(4, 8, 12); ?> <style> /*.calendarArrow{position:absolute;top:240px;background:rgba(0,0,255,0.5);width:34px;height:34px;border-radius:17px} .calendarArrow i{color:#fff;font-size:20px;position:relative;top:7px;} #leftArrowBtn{left:-40px} #rightArrowBtn{right:-40px}*/ </style> <script> $(function(){ console.log('load main_calendar.php'); /*$(document).on('click', '#leftArrowBtn', function(){ $("#calendarArea").load("/admin/cal/main_calendar.php?viewType=month&yy=<?=$cal_py?>&mm=<?=$cal_pm?>"); }); $(document).on('click', '#rightArrowBtn', function(){ $("#calendarArea").load("/admin/cal/main_calendar.php?viewType=month&yy=<?=$cal_ny?>&mm=<?=$cal_nm?>"); });*/ }) </script> <input type="hidden" id="beforeYear" value="<?=$cal_py?>" /> <input type="hidden" id="nextYear" value="<?=$cal_ny?>" /> <input type="hidden" id="beforeMonth" value="<?=$cal_pm?>" /> <input type="hidden" id="nextMonth" value="<?=$cal_nm?>" /> <!---출발달력(일별)---> <div id="good_res_bustour_list" style="height:411px; display: none;"> <span style="float:right;"> <a href="/admin/res_good/good_res_bustour_list.html" target="_blank"> <img src="../image/btn/btn_more.gif" alt="더보기"> </a> </span> <a href="/admin/work_request/work_request.html" target="_blank"> <span style="float:left; font-weight: bold; padding: 0 10px;"><?= $cal_now_yy ?>년<?= $cal_now_mm ?>월<?= $cal_now_dd ?>일</span> </a> <!-- 폼 --> <ul id=""> <?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; } ?> <?php if ($isRowDateStart) { $startDate = explode('-', $key); $startYear = $startDate[0]; $startMonth = $startDate[1]; $startDay = $startDate[2]; $dayStr = $yoil[date('w', strtotime($key))]; ?> <?php } ?> <li 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/good/good_date.html?g_uid=<?= $item['g_uid'] ?>" target="_blank"><?= $item['g_title'] ?></a></li> <?php $isRowDateStart = false; } } ?></ul> <!-- 폼 --> </div> <div id="good_res_calendar_bustour_list" style="height:411px;display:block;"> <div class="calendarArrow" id="leftArrowBtn"> <i class="arrowIcon xi-angle-left-min"></i> </div> <div class="calendarArrow" id="rightArrowBtn"> <i class="xi-angle-right-min"></i> </div> <span style="float:right;"> <a href="/admin/res_good/good_res_calendar_bustour_list.html" target="_blank"> <img src="../image/btn/btn_more.gif" alt="더보기"> </a> </span> <p style="float: left; font-weight: 1000; font-size: 16px; color: #000; text-align: center; padding-top: 6px; padding-bottom: 7px;"> <a href="/admin/res_good/good_res_calendar_bustour_list.html" target="_blank" style="color:#333"><?=$yy?>년 <?=$mm?>월</a> </p> <!-- 달력 시작 --> <div id="calendarArea"> <!-- 달력 시작 --> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="cal_t" style="padding-top: 10px;"> <thead> <tr style="background-color: #b2d1ff !important;"> <?php $dayStrColor = "#333"; ?> <!-- <th class="c_red">일</th>--> <th style="color:<?= $dayStrColor ?>;width:140px;max-width:140px;padding: 10px 0; border-bottom:1px solid #3f4b5c; border-right: 1px solid #ffffff;font-weight: 800;font-size: 13px"> 일 </th> <th style="color:<?= $dayStrColor ?>;width:140px;max-width:140px;padding: 10px 0; border-bottom:1px solid #3f4b5c;border-right: 1px solid #ffffff;font-weight: 800;font-size: 13px"> 월 </th> <th style="color:<?= $dayStrColor ?>;width:140px;max-width:140px;padding: 10px 0; border-bottom:1px solid #3f4b5c;border-right: 1px solid #ffffff;font-weight: 800;font-size: 13px"> 화 </th> <th style="color:<?= $dayStrColor ?>;width:140px;max-width:140px;padding: 10px 0; border-bottom:1px solid #3f4b5c;border-right: 1px solid #ffffff;font-weight: 800;font-size: 13px"> 수 </th> <th style="color:<?= $dayStrColor ?>;width:140px;max-width:140px;padding: 10px 0; border-bottom:1px solid #3f4b5c;border-right: 1px solid #ffffff;font-weight: 800;font-size: 13px"> 목 </th> <th style="color:<?= $dayStrColor ?>;width:140px;max-width:140px;padding: 10px 0; border-bottom:1px solid #3f4b5c;border-right: 1px solid #ffffff;font-weight: 800;font-size: 13px"> 금 </th> <th style="color:<?= $dayStrColor ?>;width:140px;max-width:140px;padding: 10px 0; border-bottom:1px solid #3f4b5c;font-weight: 800;font-size: 13px"> 토 </th> <!-- <th class="c_red">토</th>--> </tr> </thead> <?php // $day_num 변수 초기화 $day_num = 0; for ($i = 1; $i <= 6; $i++) { // 1주 ~ 마지막주 - 최대 6주까지 있음 echo "<tr>\n"; for ($j = 0; $j < 7; $j++) { // 요일 if ($i == 1 && $cal_startday > 0) { // 첫주의 빈공간 for ($k = 0; $k < $cal_startday; $k++) { echo "<td width='14.2%'> </td>\n"; // 첫주의 빈공간을 표시함 $j++; // 빈공간 만큼 요일 증가 } // 빈공간을 다 채었으므로 2주차부터는 일요일(0)부터 시작함, // 이렇게 안하면 첫주에는 날짜 사이마다 빈공간 입력됨 $cal_startday = 0; } // 일자 증가 $day_num++; // 달력 배경 색상 $cal_bgcolor = "#FFFFFF"; // 마우스 아웃 $cal_over_bgcolor = "#fffde1"; // 마우스 오버 $cal_over_bgcolor = "#FFFFFF"; // 마우스 오버 // 오늘 판단 $is_today = false; if ($yy == $cal_now_yy && $mm == $cal_now_mm && $day_num == $cal_now_dd) { $is_today = true; } // 요일별 출력 if ($j == 0) { // 일요일 $day_color = $cal_sun_color; } elseif ($j == 6) { // 토요일 $day_color = $cal_sat_color; } else { // 평일 $day_color = $cal_day_color; } $todayEffectClass = ""; // 오늘 설정 if ($is_today == true) { // 오늘 $day_color = $cal_today_color; $cal_bgcolor = "#fffde1"; $cal_bgcolor = "#fcfbe8"; $cal_bgcolor = "#f2d73d"; //오늘 배경 $cal_bgcolor = "#fffd76"; //오늘 배경 $cal_textColor = "#fff"; $todayEffectClass = "todayEffect"; } // full_day 설정 $full_day = date("Y-m-d", strtotime($yy . "-" . $mm . "-" . $day_num)); // 출력 포멧 설정 // 필요한 출력 포멧을 직접 추가하면됨 (20100419 ) $format_day = $full_day; switch ($format) { case "1": $format_day = $format_day; break; // YYYY-MM-DD case "2": $format_day = str_replace("-", "", $format_day); break; // YYYYMMDD } // 근무일 강조 표시 if ($working[$full_day]) { if (isset($working[$full_day]['F'])) { $cal_bgcolor = "#e0fafb"; } else if (isset($working[$full_day]['H'])) { $cal_bgcolor = "#e0fafb"; } else { $cal_bgcolor = "#fffcdd"; } } // 날짜 기간 체크 (시작일) if ($sdate) { // 비활성 판단 if ($sdate > $full_day) { $day_color = $cal_none_color; $day_event = ""; } } // 날짜 기간 체크 (종료일) if ($edate) { if ($edate < $full_day) { $day_color = $cal_none_color; $day_event = ""; } } // 공휴일 $isCalendarHoliday = false; $idxMonth = $mm; $idxDay = $day_num; if (strlen($idxMonth) == 1) { $idxMonth = '0' . $idxMonth; } if (strlen($idxDay) == 1) { $idxDay = '0' . $idxDay; } $srchHolidayCalendarIdx = $yy . '-' . $idxMonth . '-' . $idxDay; if (isset($calendarHolidayData[$srchHolidayCalendarIdx]['ko'])) { $isCalendarHoliday = $calendarHolidayData[$srchHolidayCalendarIdx]['ko']; $day_color = "red"; } // 날짜 출력 echo "<td height='47px' align='center' " . $day_event . " style='position:relative;background-color:" . $cal_bgcolor . "; border: 1px solid #ddd; padding: 13px 2px 13px 10px; '>"; echo "<span style='color:" . $day_color . ";cursor:pointer;' >"; echo "<p style='float:left;font-size:13px;font-weight: bold;color:{$day_color};width:unset;margin-right:10px'>" . $day_num . "</p>"; echo (($isCalendarHoliday) ? '<p style="float:left;color:#b4b4b4;font-size:10px;width:unset">' . $isCalendarHoliday['holiday_name'] . '</p>' : '') . "</span>"; foreach ($calendayNationList as $nationName) { if (isset($calendarHolidayData[$srchHolidayCalendarIdx][$nationName])) { $isCalendarHoliday = $calendarHolidayData[$srchHolidayCalendarIdx][$nationName]; $day_color = $cal_sat_color; echo(($isCalendarHoliday) ? '<p style="float:left;font-size:10px;color:' . $day_color . ';margin-left:5px;width:unset">' . $isCalendarHoliday['holiday_name'] . '</p>' : ''); } } echo "<div class='schedule2' style='float:left;width:100%;'>"; $event = 0; ?> <div class="view_content" style='clear:both;float:left;width:100%' date='<?= $full_day ?>'> <?php $day_num2len = ((strlen($day_num) == 1) ? '0' . $day_num : $day_num); $mm = ((strlen($mm) == 1) ? '0' . $mm : $mm); if (strlen($day_num) == 1) { $day_num1 = '0' . $day_num; } else{ $day_num1 = $day_num; } /*if ($day_num == date("d")) { echo '<a href="../res_good/good_res_calendar_bustour_list.html?viewType=month&d=' . date("Y") . date("m") . $day_num1 . '"><span style="color:#333;font-weight:800;">' . number_format($resCntList[$full_day]) . '건</span></a>'; } else { echo '<a style="color:#333;" href="../res_good/good_res_calendar_bustour_list.html?viewType=month&d=' . date("Y") . date("m") . $day_num1 . '">' . number_format($resCntList[$full_day]) . '건</a>'; }*/ if ($day_num == date("d")) { echo '<a href="../res_good/good_res_calendar_bustour_list.html?viewType=month&d=' . date("Y") . date("m") . $day_num1 . '"><span style="color:#333;font-weight:800;">' . number_format($resCntList[$full_day]) . '건</span></a>'; } else { echo '<a style="color:#333;" href="../res_good/good_res_calendar_bustour_list.html?viewType=month&d=' . date("Y") . date("m") . $day_num1 . '">' . number_format($resCntList[$full_day]) . '건</a>'; } ?> </div> <?php echo "</div>"; //버스 예약끝 echo "</td>\n"; if ($day_num >= $cal_endday) { // 마지막 날짜 까지만 for ($h = $j; $h < 6; $h++) { // 마지막 날짜 다음부터는 빈공간 출력 echo "<td> </td>\n"; // 마지막 날짜 다음부처 빈공간 } break; } } // 요일끝 echo "</tr>\n"; if ($day_num >= $cal_endday) { // 마지막 날짜 까지만, 이렇게 안하면 31일이 토요일인 경우 32일도 출력됨 break; } } // ~31 for 끝 ?> </table> </div> <!-- //달력 끝 --> </div>