|
|
include'calendar.php'; ?> |
|
if(!$startdate)
{
?>
:: �����š������ͧ��Ъ����Ш��ѹ��� echo $today; ?> :: |
|
����ͧ |
��ͧ����� |
�ӹǹ�� |
���һ�Ъ�� |
������� |
$sql="select bk.book_id, bk.subject, rm.roomname, bk.startdate, bk.enddate, bk.bookname ,bk.starttime, bk.endtime, bk.numpeople
from meeting_booking as bk, meeting_room as rm
where bk.room_id=rm.room_id and bk.conf_status='1' and bk.startdate='$year-$curMonth-$curDay'";
$Per_Page =10;
if(!$Page)
$Page=1;
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
//echo $sql;
$dbquery=mysql_db_query($dbname, $sql);
$Page_start = ($Per_Page*$Page)-$Per_Page;
$Num_Rows = mysql_num_rows($dbquery);
if($Num_Rows<=$Per_Page)
$Num_Pages =1;
else if(($Num_Rows % $Per_Page)==0)
$Num_Pages =($Num_Rows/$Per_Page) ;
else
$Num_Pages =($Num_Rows/$Per_Page) +1;
$Num_Pages = (int)$Num_Pages;
if(($Page>$Num_Pages) || ($Page<0))
print "�ӹǹ $Page �ҡ���� $Num_Pages �ѧ����բ�ͤ���";
$sql .= " Order by bk.room_id ASC LIMIT $Page_start , $Per_Page";
//echo $sql;
$dbquery = mysql_query($sql);
$order=1;
while($result=mysql_fetch_array($dbquery))
{
$book_id=$result[0];
$subject=$result[1];
$room_name=$result[2];
$startdate=$result[3];
$enddate=$result[4];
$bookname=$result[5];
$starttime=$result[6];
$endtime=$result[7];
$num=$result[8];
if($bg == "#DFE6F1") { //��ǹ�ͧ��� ��Ѻ��
$bg = "#F8F7DE";
} else {
$bg = "#DFE6F1";
}
echo"
$subject |
$room_name |
$num |
$starttime - $endtime |
������� |
";
$order++;
}
?>
����¡�èͧ��ͧ��Ъ��������
��¡�� ��
˹�� :
/* ÊÃéÒ§»ØèÁÂé͹¡ÅѺ */
if($Prev_Page)
echo " << ��͹��Ѻ ";
for($i=1; $i<$Num_Pages; $i++){
if($i != $Page)
echo "[$i]";
else
echo " $i ";
}
/*���ҧ�����Թ˹�� */
if($Page!=$Num_Pages)
echo " ˹�ҶѴ�>> ";
?> |
}else if($startdate){?>
:: �����š������ͧ��Ъ����Ш��ѹ���
list($year, $month, $day) = split('[/.-]', $startdate);
$startdate= "$year-$month-$day";
$year=$year+543;
if ($month== '1') { $showmonth = 'Á¡ÃÒ¤Á' ;}else
if ($month== '2') { $showmonth = '¡ØÁÀҾѹ¸ì' ;}else
if ($month== '3') { $showmonth = 'ÁÕ¹Ò¤Á' ;}else
if ($month== '4') { $showmonth = 'àÁÉÒ¹' ;}else
if ($month== '5') { $showmonth = '¾ÄÉÀÒ¤Á' ;}else
if ($month== '6') { $showmonth = 'ÁԶعÒ¹' ;}else
if ($month== '7') { $showmonth = '¡Ã¡¯Ò¤Á' ;}else
if ($month== '8') { $showmonth = 'ÊÔ§ËÒ¤Á' ;}else
if ($month== '9') { $showmonth = '¡Ñ¹ÂÒ¹' ;}else
if ($month== '10') { $showmonth = 'µØÅÒ¤Á' ;}else
if ($month== '11') { $showmonth = '¾ÄȨԡÒ¹' ;}else
if ($month== '12') { $showmonth = '¸Ñ¹ÇÒ¤Á' ;}
$day="$day $showmonth $year";
echo $day;
?> :: |
|
����ͧ |
��ͧ����� |
�ӹǹ�� |
���һ�Ъ�� |
������� |
$sql="select bk.book_id, bk.subject, rm.roomname, bk.startdate, bk.enddate, bk.bookname ,bk.starttime, bk.endtime, bk.numpeople
from meeting_booking as bk, meeting_room as rm
where bk.room_id=rm.room_id and bk.conf_status='1' and bk.startdate='$startdate'";
$Per_Page =10;
if(!$Page)
$Page=1;
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
//echo $sql;
$dbquery=mysql_db_query($dbname, $sql);
$Page_start = ($Per_Page*$Page)-$Per_Page;
$Num_Rows = mysql_num_rows($dbquery);
if($Num_Rows<=$Per_Page)
$Num_Pages =1;
else if(($Num_Rows % $Per_Page)==0)
$Num_Pages =($Num_Rows/$Per_Page) ;
else
$Num_Pages =($Num_Rows/$Per_Page) +1;
$Num_Pages = (int)$Num_Pages;
if(($Page>$Num_Pages) || ($Page<0))
print "�ӹǹ $Page �ҡ���� $Num_Pages �ѧ����բ�ͤ���";
$sql .= " Order by bk.room_id ASC LIMIT $Page_start , $Per_Page";
//echo $sql;
$dbquery = mysql_query($sql);
$order=1;
while($result=mysql_fetch_array($dbquery))
{
$book_id=$result[0];
$subject=$result[1];
$room_name=$result[2];
$startdate=$result[3];
$enddate=$result[4];
$bookname=$result[5];
$starttime=$result[6];
$endtime=$result[7];
$num=$result[8];
if($bg == "#DFE6F1") { //��ǹ�ͧ��� ��Ѻ��
$bg = "#F8F7DE";
} else {
$bg = "#DFE6F1";
}
echo"
$subject |
$room_name |
$num |
$starttime - $endtime |
������� |
";
$order++;
}
?>
����¡�èͧ��ͧ��Ъ��������
��¡�� ��
˹�� :
/* ÊÃéÒ§»ØèÁÂé͹¡ÅѺ */
if($Prev_Page)
echo " << ��͹��Ѻ ";
for($i=1; $i<$Num_Pages; $i++){
if($i != $Page)
echo "[$i]";
else
echo " $i ";
}
/*���ҧ�����Թ˹�� */
if($Page!=$Num_Pages)
echo " ˹�ҶѴ�>> ";
?>
|
}?> |
|
|
include 'footer.php'; ?> |
|