001.
<?php
002.
session_start();
003.
$ses_userID
=
$_SESSION
[
"ses_userID"
];
004.
if
(
$ses_userID
==
""
){
005.
echo
"<meta http-equiv='refresh' content='0;URL=index.php' />"
;
006.
}
else
007.
?>
008.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=tis-620"
/>
009.
<link href=
"css/style.css"
rel=
"stylesheet"
type=
"text/css"
/>
010.
<link href=
"calendar-mos.css"
rel=
"stylesheet"
type=
"text/css"
>
011.
<script language=
"JavaScript"
src=
"calendar.js"
>
012.
</script>
013.
<?php
include
(
"header2.php"
); ?>
014.
<?php
include
(
"menuuser_login.php"
); ?>
015.
<?php
include
(
"config.php"
);?>
016.
017.
<td width=
"80%"
valign=
"top"
><table width=
"50%"
border=
"0"
align=
"left"
cellpadding=
"0"
cellspacing=
"0"
>
018.
<tr>
019.
<td height=
"39"
> ยินดีต้อนรับคุณ
020.
<?php
include
(
"config.php"
);
021.
$result
= mysql_query(
"select * from user where userID ='$_SESSION[ses_userID]' "
);
022.
while
(
$data
= mysql_fetch_array(
$result
) ) {
023.
echo
$data
[
"userName"
],
" "
;
024.
echo
$data
[
"userSurname"
],
""
;
025.
}
026.
?></td>
027.
</tr>
028.
</table>
029.
<p align=
"center"
> </p>
030.
<form action=
"reserv_roomsave.php"
method=
"post"
name=
"form2"
id=
"form2"
onsubmit=
"return check();"
>
031.
<div align=
"center"
><br />
032.
<img src=
"images/reserv_status.png"
width=
"762"
height=
"30"
/><br />
033.
<table width=
"95%"
border=
"3"
bordercolor=
"#33CCFF"
align=
"center"
cellpadding=
"1"
cellspacing=
"1"
>
034.
<tr>
035.
<td width=
"106"
align=
"center"
bgcolor=
"#AAF9FD"
>วันที่บันทึก</td>
036.
<td width=
"309"
align=
"center"
bgcolor=
"#AAF9FD"
>เรื่อง</td>
037.
<td width=
"95"
align=
"center"
bgcolor=
"#AAF9FD"
><p>เวลา</p></td>
038.
<td width=
"100"
align=
"center"
bgcolor=
"#AAF9FD"
>สถานะ</td>
039.
<td width=
"118"
align=
"center"
bgcolor=
"#AAF9FD"
>จัดการข้อมูล</td>
040.
</tr>
041.
<?php
042.
$sql
=
"SELECT * FROM reservroom"
;
043.
$sql
.= " inner join user on (reservroom.userID = user.userID)
044.
WHERE status =
'0'
";
045.
$result
= mysql_query(
$sql
,
$conn
)
046.
or
die
(
"ไม่สามารถดึงข้อมูลจากตาราง reservroom ได้"
.mysql_error());
047.
if
(mysql_num_rows(
$result
)>0){
048.
while
(
$data
= mysql_fetch_array(
$result
)){
049.
?>
050.
<tr>
051.
<td height=
"31"
align=
"center"
><p><?php
echo
$data
[
"dateService"
];
052.
?></p></td>
053.
<td align=
"left"
><?php
echo
$data
[
"subject"
];
054.
?></td>
055.
<td align=
"center"
><?php
echo
$data
[
"timeIn"
];?> - <?php
echo
$data
[
"timeOut"
];?></td>
056.
<td align=
"center"
><span
class
=
"BgSky2"
>
057.
<?php
058.
if
(
$data
[
'status'
]==
'1'
)
echo
'อนุมัติ'
;
059.
if
(
$data
[
'status'
]==
'0'
)
echo
'รออนุมัติ'
;
060.
061.
?>
062.
</span></td>
063.
<td align=
"center"
><a href=
"admin_reservedit.php?serviceID=<?php echo $data["
serviceID
"];?>"
>แก้ไข </a></td>
064.
<?php
065.
}
066.
}
else
{
067.
?>
068.
</tr>
069.
<tr>
070.
<td height=
"31"
colspan=
"5"
align=
"center"
>ไม่มีข้อมูล</td>
071.
</tr>
072.
<?php } ?>
073.
<?php
074.
$total
= mysql_num_rows(
$result
);
075.
?>
076.
</table>
077.
</div>
078.
</form>
079.
<SCRIPT language=JavaScript>
080.
function
check(){
081.
if
(document.form2.subject.value ==
""
) {
082.
alert(
"กรุณาป้อน เรื่อง"
);
083.
document.form2.subject.focus();
084.
return
false;
085.
}
086.
087.
if
(document.form2.dateService.value ==
""
) {
088.
alert(
"กรุณาเลือก วันที่ใช้งาน"
);
089.
document.form2.dateService.focus();
090.
return
false;
091.
}
092.
if
(document.form2.classID .value==
"0"
) {
093.
alert(
"กรุณาเลือก ระดับชั้น"
) ;
094.
document.form2.classID.focus() ;
095.
return
false ;
096.
}
097.
if
(document.form2.departmentsID.value==
"0"
) {
098.
alert(
"กรุณาเลือก แผนก "
) ;
099.
document.form2.departmentsID.focus() ;
100.
return
false ;
101.
}
102.
if
(document.form2.branchID.value==
"0"
) {
103.
alert(
"กรุณาเลือก สาขางาน "
) ;
104.
document.form2.branchID.focus() ;
105.
return
false ;
106.
}
107.
if
(document.form2.amount.value==
""
) {
108.
alert(
"กรุณาป้อน จำนวน"
) ;
109.
document.form2.amount.focus() ;
110.
return
false ;
111.
}
112.
return
true;
113.
}
114.
</script>
115.
</table>
116.
<?php
include
(
"footer.php"
); ?>