001.
<?
002.
session_start();
003.
if
(
$_SESSION
[
'ADMINID'
] ==
""
) {
004.
header(
"Location:login.php"
);
005.
}
006.
include
(
"connect.php"
);
007.
$strSQL
=
"SELECT * FROM members WHERE UserID = '"
.
$_SESSION
['ADMINID
']."'
";
008.
$objQuery
= mysql_query(
$strSQL
);
009.
$objResult
= mysql_fetch_array(
$objQuery
);
010.
mysql_query(
"SET character_set_results=UTF8"
);
011.
mysql_query(
"SET character_set_client=UTF8"
);
012.
mysql_query(
"SET character_set_connection=UTF8"
);
013.
?>
016.
<head>
017.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
018.
<title>Untitled Document</title>
019.
<script type=
"text/javascript"
>
020.
function
MM_openBrWindow(URL, N, W, H, S) {
021.
var
winleft = (screen.width - W) / 2;
022.
var
winup = (screen.height - H) / 2;
023.
winProp =
'width='
+W+
',height='
+H+
',left='
+winleft+
',top='
+winup+
',scrollbars='
+S+
',resizable'
+
',status=no'
024.
Win = window.open(URL, N, winProp)
025.
}
026.
</script>
027.
<style type=
"text/css"
>
028.
<!--
029.
.style1 {
030.
font-size: 12px;
031.
font-weight: bold;
032.
}
033.
.style3 {font-size: 12px; color: #FFFFFF; }
034.
a:link {
035.
color: #0033FF;
036.
text-decoration: none;
037.
}
038.
a:visited {
039.
text-decoration: none;
040.
color: #0033FF;
041.
}
042.
a:hover {
043.
text-decoration: none;
044.
color: #00FF00;
045.
}
046.
a:active {
047.
text-decoration: none;
048.
color: #FF0000;
049.
}
050.
.style6 {font-size: 12px; font-weight: bold; color: #FFFFFF; }
051.
body {
052.
background-repeat: no-repeat;
053.
}
054.
.style7 {color: #FF0000}
055.
-->
056.
</style>
057.
</head>
058.
<body background=
"image/(246).jpg"
bgproperties=
"fixed"
>
059.
</p>
060.
<table width=
"1062"
border=
"0"
align=
"center"
cellpadding=
"3"
cellspacing=
"1"
bgcolor=
"#0033FF"
>
061.
<tr>
062.
<th colspan=
"4"
align=
"left"
>
063.
<form name=
"frmSearch"
method=
"post"
action=
"<?=$_SERVER['SCRIPT_NAME'];?>"
>
064.
<table width=
"599"
border=
"0"
cellpadding=
"3"
cellspacing=
"1"
>
065.
<tr>
066.
<th align=
"left"
>Select
067.
<select name=
"ddlSelect"
id=
"ddlSelect"
>
068.
<option selected=
"selected"
>- Select -</option>
069.
<option value=
"worker1"
<?
if
(
$_POST
[
"ddlSelect"
]==
"worker1"
){
echo
"selected"
;}?>>ชื่อผู้ปฏิบัติงาน</option>
070.
<option value=
"date"
<?
if
(
$_POST
[
"ddlSelect"
]==
"date"
){
echo
"selected"
;}?>>วันที่ดำเนินการ</option>
071.
<option value=
"status"
<?
if
(
$_POST
[
"ddlSelect"
]==
"status"
){
echo
"selected"
;}?>>ผลการปฏิบัติงาน</option>
072.
</select>
073.
Keyword
074.
<input name=
"txtKeyword"
type=
"text"
id=
"txtKeyword"
value=
"<?=$_POST["
txtKeyword
"];?>"
>
075.
<input type=
"submit"
value=
"Search"
></th>
076.
</tr>
077.
</table>
078.
</form></th>
079.
<?
080.
081.
082.
083.
$workSQL
=
"SELECT * FROM workorder WHERE 1 "
;
084.
if
(
$_POST
[
"ddlSelect"
] !=
""
and
$_POST
[
"txtKeyword"
] !=
''
)
085.
{
086.
$workSQL
.=
" AND ("
.
$_POST
[
"ddlSelect"
].
" LIKE '%"
.
$_POST
[
"txtKeyword"
].
"%' ) ORDER BY IDwork DESC"
;
087.
}
088.
$workQuery
= mysql_query(
$workSQL
)
or
die
(
"Error Query ["
.
$workSQL
.
"]"
);
089.
?>
090.
<th colspan=
"3"
align=
"right"
><span
class
=
"style6"
>ID <?php
echo
$objResult
[
"UserID"
];?> ชื่อ <?php
echo
$objResult
[
"fname"
];?></span></th>
091.
<th colspan=
"2"
align=
"right"
bgcolor=
"#FFFFFF"
><a href=
"admin_page.php"
><img src=
"image/home1.gif"
width=
"53"
height=
"22"
/></a></th>
092.
</tr>
093.
<tr bgcolor=
"#FFFFFF"
>
094.
<th colspan=
"9"
height=
"5"
> </th>
095.
</tr>
096.
<tr>
097.
<th width=
"43"
><span
class
=
"style3"
>ลำดับ</span></th>
098.
<th width=
"271"
><span
class
=
"style3"
>งานที่มอบหมาย</span></th>
099.
<th width=
"114"
><span
class
=
"style3"
>วัน-เวลาดำเนินการ</span></th>
100.
<th width=
"154"
><span
class
=
"style3"
>ผู้ปฏิบัติงาน</span></th>
101.
<th width=
"99"
><span
class
=
"style3"
>ผลการปฏิบัติงาน</span></th>
102.
<th width=
"82"
><span
class
=
"style3"
>รหัสผู้บันทึก</span></th>
103.
<th width=
"98"
><span
class
=
"style3"
>ชื่อผู้บันทึก</span></th>
104.
<th width=
"64"
> </th>
105.
<th width=
"73"
> </th>
106.
</tr>
107.
<?
108.
while
(
$workResult
= mysql_fetch_array(
$workQuery
))
109.
{
110.
$i
++;
111.
if
(
$i
%2==0){
$bg
=
"#FFFFCC"
;}
112.
else
{
$bg
=
"#FFFFFF"
;}
113.
?>
114.
<tr valign=
"top"
bgcolor=
"<?=$bg;?>"
>
115.
<td align=
"center"
valign=
"top"
bgcolor=
"<?=$bg;?>"
><?=
$workResult
[
"IDwork"
];?> </td>
116.
<td valign=
"top"
bgcolor=
"<?=$bg;?>"
> <?=
$workResult
[
"work"
];?> </td>
117.
<td align=
"center"
valign=
"top"
bgcolor=
"<?=$bg;?>"
><?=
$workResult
[
"date"
];?></td>
118.
<td valign=
"top"
bgcolor=
"<?=$bg;?>"
><?
if
(
$workResult
[
"worker1"
] !=
''
){
echo
$workResult
[
"worker1"
].
"<br />"
;}?>
119.
<?
if
(
$workResult
[
"worker2"
] !=
''
){
echo
$workResult
[
"worker2"
].
"<br />"
;}?>
120.
<?
if
(
$workResult
[
"worker3"
] !=
''
){
echo
$workResult
[
"worker3"
].
"<br />"
;} ?>
121.
<?
if
(
$workResult
[
"worker4"
] !=
''
){
echo
$workResult
[
"worker4"
].
""
;} ?></td>
122.
<td valign=
"top"
bgcolor=
"<?=$bg;?>"
>
123.
<?
124.
if
(
$workResult
[
"status"
]==
'เรียบร้อย'
){
125.
echo
'เรียบร้อย'
;}
126.
else
{
127.
echo
'<span class="style7"><b><u>ไม่เรียบร้อย</u></b></span></td>'
;}
128.
?>
129.
<td align=
"center"
valign=
"top"
bgcolor=
"<?=$bg;?>"
><?=
$workResult
[
"UserID"
];?></td>
130.
<td valign=
"top"
bgcolor=
"<?=$bg;?>"
><?=
$workResult
[
"fname"
];?></td>
131.
<td valign=
"top"
bgcolor=
"#FFFFFF"
><a href=
"javascript:MM_openBrWindow('show_detail_workorder_ADMIN.php?IDwork=<?=$workResult["
IDwork
"];?>','detail','480','300','no')"
class
=
"style9 style1"
>รายละเอียด</a></td>
132.
<td align=
"center"
bgcolor=
"#FFFFFF"
><a href=
"Editwork_ADMIN.php?IDwork=<?=$workResult["
IDwork
"];?>"
><img src=
"image/edit_24.png"
width=
"24"
height=
"24"
/></a>
133.
<a href=
"JavaScript:if(confirm('ต้องการที่จะลบ?')==true){window.location='delete_workorder_ADMIN.php?IDwork=<?=$workResult["
IDwork
"];?>';}"
><img src=
"image/del_24.png"
width=
"24"
height=
"24"
/></a></td>
134.
</tr>
135.
<?
136.
}
137.
?>
138.
</table>
139.
<?
140.
mysql_close();
141.
?>
142.
</body>
143.
</html>