Server IP : 119.59.102.212 / Your IP : 3.22.217.190 Web Server : Apache/2 System : Linux narin 2.6.32-042stab142.1 #1 SMP Tue Jan 28 23:44:17 MSK 2020 x86_64 User : yangkam ( 1022) PHP Version : 5.6.40 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/yangkam/domains/yangkam.go.th/public_html/coremain/module/calendar/ |
Upload File : |
<?php $per = id_top_permission("2"); if (!isset($_SESSION)) session_start(); import_request_variables('pG', 'p_'); if ($p_Y != "") { $Y = trim($p_Y); } if ($p_m != "") { $m = trim($p_m); } $contact = $_GET['contact']; $now = gmmktime(); $lt = localtime($now, 1); $is_dst = $lt["tm_isdst"]; $now_year = intval(gmdate("Y", $now)); $now_month = intval(gmdate("m", $now)); $now_date = intval(gmdate("d", $now)); $now_hour = gmdate(gmdate("H", $now)); $now_min = gmdate(gmdate("i", $now)); $now_sec = gmdate(gmdate("s", $now)); $nowthai_year = $now_year + 543; if (!empty($_SERVER["PHP_SELF"])) $PHP_SELF = $_SERVER["PHP_SELF"]; if (!empty($_SERVER["SCRIPT_NAME"])) $SCRIPT_NAME = $_SERVER["SCRIPT_NAME"]; if (!empty($_SERVER["SERVER_NAME"])) $SERVER_NAME = $_SERVER["SERVER_NAME"]; if (!empty($_SERVER["REMOTE_ADDR"])) $REMOTE_ADDR = $_SERVER["REMOTE_ADDR"]; $_mo="จ"; $_tu="อ"; $_we="พ"; $_th="พฤ"; $_fr="ศ"; $_sa="ส"; $_su="อา"; $_month_name=array(); $_month_name[1]="มกราคม"; $_month_name[2]="กุมภาพันธ์"; $_month_name[3]="มีนาคม"; $_month_name[4]="เมษายน"; $_month_name[5]="พฤษภาคม"; $_month_name[6]="มิถุนายน"; $_month_name[7]="กรกฎาคม"; $_month_name[8]="สิงหาคม"; $_month_name[9]="กันยายน"; $_month_name[10]="ตุลาคม"; $_month_name[11]="พฤศจิกายน"; $_month_name[12]="ธันวาคม"; if (!empty($Y)) $cal_year = $Y; else $cal_year = $now_year; $thai_year = ($cal_year) + 543; if (!empty($m)) $cal_month = $m; else $cal_month = $now_month; if (!empty($HTTP_GET_VARS["d"])) $cal_day = $HTTP_GET_VARS["d"]; else $cal_day = $now_day; $cal_next_year = $cal_year; if ($cal_month < 12) { $cal_next_month = $cal_month + 1; } else { $cal_next_month = 1; $cal_next_year = $cal_year + 1; } $cal_prev_year = $cal_year; if ($cal_month > 1) { $cal_prev_month = $cal_month - 1; } else { $cal_prev_month = 12; $cal_prev_year = $cal_year - 1; } function num_days($year, $month) { $num = 31; while (!checkdate($month, $num, $year)) { $num--; } return $num; } echo <<<CALENDAR_HEAD <table width=100% border=0 cellspacing=1 cellpadding=0 bgcolor='$_SESSION[tb_head_bgcolor]'> <tr> <td align=center class=norm width=10%><a href="index.php?Y=$cal_prev_year&m=$cal_prev_month"><IMG SRC="coremain/images/p.gif" BORDER=0 ></a></td> <td align=center class=norm colspan=5> $_month_name[$cal_month] $thai_year </td> <td align=center class=norm width=10%><a href="index.php?Y=$cal_next_year&m=$cal_next_month"><IMG SRC="coremain/images/n.gif" BORDER=0 ></a></td> </tr> <tr align=center class=norm> <td width=10% bgcolor=$datatm[color1]><font color=white>$_su</font></td> <td width=10% bgcolor=$datatm[heder_color]>$_mo</td> <td width=10% bgcolor=$datatm[heder_color]>$_tu</td> <td width=10% bgcolor=$datatm[heder_color]>$_we</td> <td width=10% bgcolor=$datatm[heder_color]>$_th</td> <td width=10% bgcolor=$datatm[heder_color]>$_fr</td> <td width=10% bgcolor=$datatm[heder_color]>$_sa</td> </tr> CALENDAR_HEAD; if (($cal_year == $now_year) && ($cal_month == $now_month)) { $today_day = $now_day; } else $today_day = 0; $days_last_month = num_days($cal_prev_year, $cal_prev_month); $days_this_month = num_days($cal_year, $cal_month); $first_day_pos = gmdate("w", gmmktime(1, 0, 0, $cal_month, 2, $cal_year, $is_dst)); if ($first_day_pos == 0) $first_day_pos = 7; $day_num = $days_last_month - ($first_day_pos - 2); $class = "norm"; echo $now_date; for ($y = 1; $y <= 6; $y++) { echo"<tr align=center>\n"; for ($x = 1; $x <= 7; $x++) { if (($y == 1) && ($x == $first_day_pos)) { $day_num = 1; $class = ""; } if (($y > 1) && ($day_num == $days_this_month + 1)) { $day_num = 1; $class = "norm"; } //echo $day_num."===".($days_this_month+1)." - - class = $class"; if ($class != "") { $ap1 = ""; $ap2 = ""; } else { //echo_r ($_SESSION); $mydate = sprintf("%04d-%02d-%02d", $cal_year, $cal_month, $day_num); $ap0 = "coremain/module/calendar/showevent.php"; $ap1 = "<a href=javascript:open_window('" . $ap0 . "?per=$per&date=$day_num&month=$cal_month&year=$cal_year&dbname=$_SESSION[web_name]') class=date>"; $ap2 = '</a>'; // "'.$ap0."?member_c=".$_SESSION["member"].'&date=$day_num&month=$cal_month&year=$cal_year&dbnmae=$_SESSION[webname]" } //echo $day_num."---".$now_date."class = $class<br/>"; if (($class == "") && ($day_num == $now_date)) { echo'<td bgcolor=#ffcc33><b>' . $ap1 . '' . $day_num . $ap2 . '</b></td>' . "\n"; // วันที่ปัจจุบัน } else if ($class == "") { $dates = substr($mydate, 8, 2); $ch_date = substr($dates, 0, 1); if ($ch_date == "0") $dates = substr($dates, 1, 1); $months = substr($mydate, 5, 2); $years = substr($mydate, 0, 4); $date_color = $dates . "-" . $months . "-" . $years; $sql = "SELECT date FROM cms_calendar WHERE `date`='$date_color'"; $re = mysql_query($sql); $data = mysql_fetch_array($re); if ($data[0] != "") {// วันที่ที่มีจริงในแต่ละเดือน echo'<td bgcolor=#cccccc>' . $ap1 . '' . $day_num . $ap2 . '</td>' . "\n"; } else { echo'<td bgcolor=#fdfef1>' . $ap1 . '' . $day_num . $ap2 . '</td>' . "\n"; } } else { echo'<td class=today1 bgcolor=#ffffff><font color="#dbdbdb">' . $ap1 . $day_num . $ap2 . '</font></td>' . "\n"; // วันที่ที่ไม่มีจริงในแต่ละเดือน } $day_num++; } echo"</tr>"; } echo <<<CALENDAR_TAIL <tr> <td colspan=7 align=center bgcolor=#ffffff >วันที่ $now_date $_month_name[$now_month] $nowthai_year</td> </tr> CALENDAR_TAIL; echo "<tr>"; echo"<td colspan=7 bgcolor=#ffffff>"; $sql = "SELECT * FROM cms_calendar WHERE date = '$date-$month-$year' ORDER BY id DESC"; $re = mysql_query($sql); while ($data = mysql_fetch_array($re)) { echo " <img src='coremain/images/marker.gif' border=0> " . $data['event'] . "<br>"; } echo"</td>"; echo"</tr>"; echo"</table>"; ?> </center> <script language="JavaScript"> <!-- function open_window(url) { awindow = window.open(url,"thewindow",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=580,height=300'); } // --> </script>