001.
<?
002.
include
(
"connect/connect.php"
);
003.
?>
004.
<?
005.
session_start();
006.
if
(
$_SESSION
[
'ID'
] ==
""
)
007.
{
008.
echo
"Please Login!"
;
009.
exit
();
010.
}
011.
012.
if
(
$_SESSION
[
'usertype'
] !=
"admin"
)
013.
{
014.
echo
"This page for admin only!"
;
015.
exit
();
016.
}
017.
session_start();
018.
mysql_connect(
"localhost"
,
"root"
,
"1234"
);
019.
mysql_select_db(
"stock"
);
020.
mysql_query(
"SET NAMES UTF8"
);
021.
$strSQL
=
"SELECT * FROM users WHERE ID = '"
.
$_SESSION
['ID
']."'
";
022.
$objQuery
= mysql_query(
$strSQL
);
023.
$objResult
= mysql_fetch_array(
$objQuery
);
024.
025.
$strSQL
=
"SELECT * FROM borrow"
;
026.
$objQuery
= mysql_query(
$strSQL
)
027.
028.
029.
?>
030.
<!DOCTYPE html>
031.
<html>
032.
<head>
033.
<meta http-equiv=
'Content-Type'
content=
'text/html; charset=utf-8'
/>
034.
<meta http-equiv=
'X-UA-Compatible'
content=
'IE=edge,chrome=1'
/>
035.
<link rel=
"stylesheet"
type=
"text/css"
href=
"css/smoothness/jquery-ui-1.7.2.custom.css"
>
036.
<script type=
"text/javascript"
src=
"js/jquery-1.3.2.min.js"
></script>
037.
<script type=
"text/javascript"
src=
"js/jquery-ui-1.7.2.custom.min.js"
></script>
038.
<script type=
"text/javascript"
>
039.
$(
function
(){
040.
041.
042.
043.
$(
"#tabs"
).tabs();
044.
045.
046.
047.
048.
049.
050.
051.
052.
053.
});
054.
$(document).ready(
function
() {
055.
056.
$(
"#parent_cat"
).change(
function
() {
057.
$.get(
'loadsubcat.php?parent_cat='
+ $(this).val(),
function
(data) {
058.
$(
"#kind_type_id"
).html(data);
059.
$(
'#loader'
).slideUp(200,
function
() {
060.
$(this).remove();
061.
});
062.
});
063.
});
064.
065.
});
066.
</script>
067.
<link href=
"style/style.css"
rel=
"stylesheet"
type=
"text/css"
media=
"all"
/>
068.
<script type=
"text/javascript"
src=
"js/jquery-1.9.1.js"
> </script>
069.
<script type=
"text/javascript"
src=
"js/script.js"
></script>
070.
<link rel=
'stylesheet'
type=
'text/css'
href=
"cssmenu_admin/menu_source/styles.css"
/>
071.
<style type=
"text/css"
>
072.
body {
073.
background-image: url(../images/vichy.png);
074.
}
075.
</style>
076.
<link rel=
"stylesheet"
type=
"text/css"
href=
"css/smoothness/jquery-ui-1.7.2.custom.css"
>
077.
<script type=
"text/javascript"
src=
"js/jquery-1.3.2.min.js"
></script>
078.
<script type=
"text/javascript"
src=
"js/jquery-ui-1.7.2.custom.min.js"
></script>
079.
<script type=
"text/javascript"
>
080.
$(
function
(){
081.
082.
083.
$(
"#tabs"
).tabs();
084.
085.
086.
087.
088.
089.
090.
091.
092.
093.
});
094.
</script>
095.
<script>
096.
function
confirmDelete(delUrl) {
097.
if
(confirm(
"Are you sure you want to delete"
)) {
098.
document.location = delUrl;
099.
}
100.
}
101.
</script>
102.
<style type=
"text/css"
>
103.
104.
105.
106.
107.
.ui-tabs{
108.
font-family:tahoma;
109.
font-size:11px;
110.
}
111.
</style>
112.
<script language=
"javascript"
>
113.
function
fncSubmit()
114.
{
115.
if
(document.register_form.username.value ==
""
)
116.
{
117.
alert(
'กรุณากรอกusernameด้วยครับ'
);
118.
document.register_form.username.focus();
119.
return
false;
120.
}
121.
122.
if
(document.register_form.fname.value ==
""
)
123.
{
124.
alert(
'กรุณากรอกชื่อด้วยครับ'
);
125.
document.register_form.fname.focus();
126.
return
false;
127.
}
128.
if
(document.register_form.lname.value ==
""
)
129.
{
130.
alert(
'กรุณากรอกนามสกุลด้วยครับ'
);
131.
document.register_form.lname.focus();
132.
return
false;
133.
}
134.
if
(document.register_form.password.value ==
""
)
135.
{
136.
alert(
'กรุณากรอกรหัสผ่านด้วยครับ'
);
137.
document.register_form.password.focus();
138.
return
false;
139.
}
140.
if
(document.register_form.repassword.value ==
""
)
141.
{
142.
alert(
'กรุณากรอกรหัสผ่านยืนยันด้วยครับ'
);
143.
document.register_form.repassword.focus();
144.
return
false;
145.
}
146.
if
(document.register_form.telephone.value ==
""
)
147.
{
148.
alert(
'กรุณากรอกเบอร์โทรศัพท์ด้วยครับ'
);
149.
document.register_form.telephone.focus();
150.
return
false;
151.
}
152.
if
(document.register_form.usertype.value ==
""
)
153.
{
154.
alert(
'กรุณาเลือกสถานะผู้ใช้ด้วยครับ'
);
155.
document.register_form.usertype.focus();
156.
return
false;
157.
}
158.
159.
}
160.
</script>
161.
<style type=
"text/css"
>
162.
163.
.simply{
164.
font:14px Thonburi, Thonburi;
165.
margin: 45px;
166.
width: 800px;
167.
border-collapse: collapse;
168.
text-align: left;
169.
}
170.
.simply th{
171.
font:normal 14px Thonburi, Thonburi;
172.
color: #222;
173.
background:#CCCCCC;
174.
padding: 10px 8px;
175.
border-bottom: 2px solid #ccc;
176.
}
177.
.simply td{
178.
border-bottom: 1px solid #ccc;
179.
color: #666;
180.
background: #fff;
181.
padding: 5px;
182.
}
183.
.simply tbody tr:hover td{
184.
color: #222;
185.
background: #eee;
186.
}
187.
</style>
188.
</head>
189.
<body>
190.
<table width=
"899"
border=
"0"
align=
"center"
cellpadding=
"0"
cellspacing=
"0"
>
191.
<!--DWLayoutTable-->
192.
193.
<tr>
194.
195.
<td width=
"920"
height=
"19"
valign=
"top"
align=
"center"
><table width=
"850"
border=
"0"
>
196.
<tr>
197.
<td height=
"25"
bgcolor=
"#CCCCCC"
scope=
"col"
><table width=
"893"
border=
"0"
>
198.
<!--DWLayoutTable-->
199.
<tr align=
"left"
>
200.
<th width=
"44"
height=
"28"
bgcolor=
"#CCCCCC"
scope=
"col"
><img src=
"../images/1392011526_user.png"
width=
"22"
height=
"22"
542
" scope="
col"> </th>
201.
<th width=
"110"
bgcolor=
"#CCCCCC"
scope=
"col"
><?=
$objResult
[
"name"
];?></th>
202.
<th width=
"543"
bgcolor=
"#CCCCCC"
scope=
"col"
><?=
$objResult
[
"usertype"
];?></th>
203.
<th width=
"78"
bgcolor=
"#CCCCCC"
scope=
"col"
><img src=../images/1392129723_settings01.png width=
"22"
height=
"22"
>
204.
<th width=
"1"
>
205.
<th width=
"96"
valign=
"top"
bgcolor=
"#CCCCCC"
scope=
"col"
> <a href=
"function/logout.php"
><img src=../images/1392129956_sign-in.png width=
"16"
height=
"16"
></a> </tr>
206.
</table>
207.
</tr>
208.
</table></td>
209.
</tr>
210.
<tr>
211.
<td height=
"165"
valign=
"top"
><img src=
"../images/00000.png"
width=
"899"
height=
"275"
></td>
212.
</tr>
213.
<tr>
214.
<td height=
"48"
valign=
"top"
>
215.
216.
</td>
217.
</tr>
218.
<tr>
219.
<td height=
"522"
valign=
"top"
bgcolor=
"#FFFFFF"
>
220.
<div id=
"tabs"
>
221.
<ul>
222.
<li><a href=
"#tabs-2"
>รายการขอเบิก</a></li>
223.
</ul>
224.
<div id=
"tabs-2"
>
225.
<p>รายการขอเบิก</p>
226.
227.
<table width=
"706"
border=
"0"
>
228.
<tr>
229.
<td width=
"89"
>หมายเลขการเบิก</td>
230.
<td width=
"81"
>ชนิด</td>
231.
<td width=
"80"
>วันที่เบิก</td>
232.
<td width=
"92"
>กำหนดส่งคืน</td>
233.
<td width=
"120"
>เหตุผลการเบิก</td>
234.
<td width=
"64"
>จำนวน</td>
235.
<td width=
"93"
>สถานะการเบิก</td>
236.
<td width=
"53"
>อนุมัติ</td>
237.
</tr>
238.
<?
239.
240.
241.
while
(
$objResult
= mysql_fetch_array(
$objQuery
))
242.
{
243.
244.
?>
245.
246.
247.
<tr>
248.
249.
<td><?=
$objResult
[
"borrow_id"
];?></td>
250.
<td><?=
$objResult
[
"kind_type_id"
];?></td>
251.
<td><?=
$objResult
[
"date_b"
];?></td>
252.
<td><?=
$objResult
[
"date_e"
];?></td>
253.
<td><?=
$objResult
[
"reason"
];?></td>
254.
<td><?=
$objResult
[
"count"
];?></td>
255.
<td> <?
$sql
=
"SELECT * FROM borrow"
;
256.
$qr
=mysql_query(
$sql
);
257.
$fet
=mysql_fetch_assoc(
$qr
);
258.
if
(
$objResult
[
"status"
]==
'0'
){
259.
echo
"ยังไม่อนุมัติ"
;
260.
}
else
{
261.
echo
"อนุมัติแล้ว"
;
262.
} ?></td>
263.
<td align=
"center"
><a href=
"function/edit_status.php?CusID=<?=$objResult["
borrow_id
"];?>"
><img src=
"../images/edit_24.png"
></a></td>
264.
265.
266.
<?
267.
}
268.
?>
269.
</table>
270.
271.
<p> </p>
272.
</div>
273.
</div>
274.
<tr></tr>
275.
</table>
276.
277.
</body>
278.
</html>