001.
<?
002.
if
(
$_GET
[
"txtKeyword"
]!=
""
)
003.
{
004.
$keyword
=
explode
(
" "
,
$_GET
[
"txtKeyword"
]);
005.
for
(
$h
= 0;
$h
<
count
(
$keyword
);
$h
++){
006.
}
007.
$strSQL
= "SELECT register.*,employee.* FROM register LEFT JOIN employee on register.re_id = employee.re_id WHERE register.enable =
'T'
AND
008.
(register.re_busi LIKE
'%".$keyword[0]."%'
)
009.
and
010.
(register.re_busi LIKE
'%".$keyword[1]."%'
)
011.
and
012.
(register.re_busi LIKE
'%".$keyword[2]."%'
)
013.
and
014.
(register.re_busi LIKE
'%".$keyword[3]."%'
)
015.
and
016.
(register.re_busi LIKE
'%".$keyword[4]."%'
)";
017.
$objQuery
= mysql_query(
$strSQL
)
or
die
(
"Error Query ["
.
$strSQL
.
"]"
);
018.
$Num_Rows
= mysql_num_rows(
$objQuery
);
019.
020.
021.
$Per_Page
= 15;
022.
023.
$Page
=
$_GET
[
"Page"
];
024.
if
(!
$_GET
[
"Page"
])
025.
{
026.
$Page
=1;
027.
}
028.
029.
$Prev_Page
=
$Page
-1;
030.
$Next_Page
=
$Page
+1;
031.
032.
$Page_Start
= ((
$Per_Page
*
$Page
)-
$Per_Page
);
033.
if
(
$Num_Rows
<=
$Per_Page
)
034.
{
035.
$Num_Pages
=1;
036.
}
037.
else
if
((
$Num_Rows
%
$Per_Page
)==0)
038.
{
039.
$Num_Pages
=(
$Num_Rows
/
$Per_Page
) ;
040.
}
041.
else
042.
{
043.
$Num_Pages
=(
$Num_Rows
/
$Per_Page
)+1;
044.
$Num_Pages
= (int)
$Num_Pages
;
045.
}
046.
047.
$strSQL
.=
" order by em_id ASC LIMIT $Page_Start , $Per_Page"
;
048.
$objQuery
= mysql_query(
$strSQL
);
049.
?>
050.
051.
<form name=
"frmMain"
action=
"employee_delete.php"
method=
"POST"
onSubmit=
"return onDelete();"
>
052.
<input type=
"hidden"
name=
"hdnCount"
value=
"<?=$s;?>"
>
053.
<table width=
"80%"
border=
"1"
cellspacing=
"0"
>
054.
<tr bgcolor=
"orange"
class
=
"style1"
>
055.
<th><input type=
"image"
src=
"delete.png"
name=
"btnDelete"
value=
"Delete"
alt=
"ลบ"
width=
"20"
height=
"20"
></th>
056.
<th> <div align=
"center"
>ชื่อบริษัท</div></th>
057.
<th> <div align=
"center"
>ชื่อ</div></th>
058.
<th> <div align=
"center"
>นามสกุล</div></th>
059.
<th> <div align=
"center"
>ตำแหน่ง</div></th>
060.
<th> <div align=
"center"
>สัญญาเริ่ม</div></th>
061.
<th> <div align=
"center"
>หมดสัญญา</div></th>
062.
<th> <div align=
"center"
>แก้ไข</div></th>
063.
</tr>
064.
<?
065.
while
(
$objResult
= mysql_fetch_array(
$objQuery
))
066.
{
067.
if
(
$bg
==
"white"
)
068.
{
069.
$bg
=
"#FFFF99"
;
070.
}
071.
else
072.
{
073.
$bg
=
"white"
;
074.
}
075.
?>
076.
<tr bgcolor=
"<?=$bg;?>"
class
=
"style5"
>
077.
<td align=
"center"
><input type=
"checkbox"
name=
"chkDel[]"
id=
"chkDel<?=$s;?>"
value=
"<?=$objResult['em_id'];?>"
></td>
078.
<td align=
"center"
>
079.
<input type=
"hidden"
name=
"em_id"
value=
"<?=$objResult['em_id'];?>"
/>
080.
<?=
$objResult
[
're_busi'
];?>
081.
</td>
082.
<td>
083.
<?=
$objResult
[
'em_name'
];?>
084.
</td>
085.
<td >
086.
<?=
$objResult
[
'em_lastname'
];?>
087.
</td>
088.
<td align=
"center"
>
089.
<?=
$objResult
[
'em_position'
];?>
090.
</td>
091.
<td align=
"center"
>
092.
<?=
$objResult
[
'em_first'
];?>
093.
</td>
094.
<td align=
"center"
>
095.
<?=
$objResult
[
'em_last'
];?>
096.
</td>
097.
<td align=
"center"
><a href=
"employee_edit.php?em_1=<?=$objResult["
em_id
"];?>"
>แก้ไข</a></td>
098.
</tr>
099.
<?PHP
100.
}
101.
?>
102.
</table>
103.
</form>
104.
105.
mysql_close(
$objConnect
);
106.
}
107.
?>