ÿØÿà 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/skin/board/service/ |
Upload File : |
<? include_once("_common.php"); // 일정(스케쥴) 스킨 // 게시판의 wr_1 필드에 날짜 형식 20081216 일과 같은 yyyymmdd 형식으로 저장 if (!function_exists("get_first_day")) { // mktime() 함수는 1970 ~ 2038년까지만 계산되므로 사용하지 않음 // 참고 : http://phpschool.com/bbs2/inc_view.html?id=3924&code=tnt2&start=0&mode=search&s_que=mktime&field=title&operator=and&period=all function get_first_day($year, $month) { $day = 1; $spacer = array(0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4); $year = $year - ($month < 3); $result = ($year + (int) ($year/4) - (int) ($year/100) + (int) ($year/400) + $spacer[$month-1] + $day) % 7; return $result; } } include_once("$g4[path]/head.php"); include_once("$g4[bbs_path]/board_head.php"); ?> <style> #schedule_list .sc_ym { font: bold 25px tahoma; letter-spacing:-2px; text-align:center; height:50px; } #schedule_list .sc_tit { font: bold 12px tahoma; text-align:center; height:40px; } #schedule_list .sc_sun { color:#ff0000; } #schedule_list .sc_sat { color:#0000ff; } #schedule_list .sc_day { font: normal 12px tahoma; height:120px; vertical-align:top; text-align:left; border:1px solid #ddd; padding:10px; } #schedule_list .sc_day a { font: bold 13px tahoma; color:#cc3300; } #schedule_list .sc_day .subject a:hover { text-decoration:underline; } #schedule_list .sc_today { text-decoration: underline; } </style> <table width='1155' border='0' id='schedule_list'> <? // 오늘 $today = getdate($g4[server_time]); $year = (int)substr($schedule_ym, 0, 4); $month = (int)substr($schedule_ym, 4, 2); if ($year < 1) $year = $today[year]; if ($month < 1 || $month > 12) $month = $today[mon]; $current_ym = sprintf("%04d-%02d", $year, $month); $end_day = array(1=>31, 28, 31, 30 , 31, 30, 31, 31, 30 ,31 ,30, 31); // 윤년 계산 부분이다. 4년에 한번꼴로 2월이 28일이 아닌 29일이 있다. if( $year%4 == 0 && $year%100 != 0 || $year%400 == 0 ) $end_day[2] = 29; // 조건에 적합할 경우 28을 29로 변경 // 해당월의 1일을 mktime으로 변경 $mktime = mktime(0,0,0,$month,1,$year); $mkdate = getdate(strtotime(date("Y-m-1", $mktime))); // 1일의 첫번째 요일 (0:일, 1:월 ... 6:토) $first_day = get_first_day($year, $month); // 해당월의 마지막 날짜, $last_day = $end_day[$month]; if ($month - 1 < 1) { $before_ym = sprintf("%04d%02d", ($year-1), 12); } else { $before_ym = sprintf("%04d%02d", $year, ($month-1)); } if ($month + 1 > 12) { $after_ym = sprintf("%04d%02d", ($year+1), 1); } else { $after_ym = sprintf("%04d%02d", $year, ($month+1)); } echo "<tr>"; echo "<td colspan='7' align='center' width=1150 class='sc_ym'>"; echo "<a href='$_SERVER[PHP_SELF]?bo_table=$bo_table&dmode=schedule&viewType=calendar&schedule_ym=$before_ym'><img src='$board_skin_path/img/y_prev.gif' border='0'></a> $year / $month <a href='$_SERVER[PHP_SELF]?bo_table=$bo_table&dmode=schedule&viewType=calendar&schedule_ym=$after_ym'><img src='$board_skin_path/img/y_next.gif' border='0'></a>"; echo "</td>"; echo "</tr>"; // 요일 $yoil = array ("일", "월", "화", "수", "목", "금", "토"); echo "<tr><td colspan=7 height=1 bgcolor=#dddddd></td></tr><tr>"; for ($i=0; $i<7; $i++) { $width = '13%'; $class = array(); $class[] = "sc_tit"; if ($i == 0) $class[] = "sc_sun"; else if ($i == 6) { $class[] = "sc_sat"; $width = '12%'; } $class_list = implode(" ", $class); echo "<td height=45 width='$width' align=center background='../images/title_bg.gif'><b>$yoil[$i]</b></td>"; } echo "</tr><tr><td colspan=7 height=1 bgcolor=#dddddd></td></tr>"; $cnt = $day = 0; for ($i=0; $i<6; $i++) { echo "<tr>"; for ($k=0; $k<7; $k++) { $cnt++; echo "<td class='sc_day'>"; if ($cnt > $first_day) { $day++; if ($day <= $last_day) { $class = array(); // 오늘이라면 if ($today[year] == $year && $today[mon] == $month && $today[mday] == $day) { $class[] = "sc_today"; } $current_ymd = $current_ym . sprintf("-%02d", $day); if ($k == 0) $class[] = "sc_sun"; else if ($k == 6) $class[] = "sc_sat"; $class_list = implode(" ", $class); $sql = " select ca_name, wr_3, wr_id from $g4[write_prefix]$bo_table where wr_7 = '$current_ymd' and wr_is_comment = 0 order by wr_num "; $result = sql_query($sql); $num = @mysql_num_rows($result); if ($num) { echo "<table style='border-collapse:collapse;' cellpadding='0' cellspacing='0' width='100%'><tr><td width='100%' height=25 valign=top><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&sfl=wr_7&stx=$current_ymd');\" title='일정건수 : '>"; echo $day; echo "<span style='letter-spacing:-1;font-size:12px;font-weight:normal;'><font color='#cc3300'>일의 일정 </span></a></td></tr></table>"; while ($row=sql_fetch_array($result)) { echo "<table style='border-collapse:collapse;' cellpadding='0' cellspacing='0' width='100%'><tr><td width='100%' height=20><a href='$g4[bbs_path]/board.php?bo_table=$bo_table&wr_id=$row[wr_id]'><span style='letter-spacing:-1;font-size:12px;font-weight:normal;'><font color='#666666'><b> "; echo $row[ca_name]; echo "</b> "; echo $row[wr_3]; echo "<br>"; echo "</font></span></a></td></tr><tr><td width='130' height=1 bgcolor=#dddddd></td></tr></table>"; } } else { echo $day; } } else { echo " "; } } else { echo " "; } echo "</td>"; } echo "</tr>\n"; if ($day >= $last_day) break; } ?> </table>