001.
<?
002.
include
(
"config.php"
);
003.
?>
005.
<head>
006.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
007.
<title>Untitled Document</title>
008.
<link href=
"../stylesheet/tableapply.css"
rel=
"stylesheet"
type=
"text/css"
/>
009.
</head>
010.
<body>
011.
<div
class
=
"head"
>ข้อมูลการสมัครงาน</div>
012.
<?php
013.
$strSQL
=
"SELECT * FROM application ORDER BY ApplyID DESC"
;
014.
$objQuery
= mysql_query(
$strSQL
)
or
die
(
"Error Query ["
.
$strSQL
.
"]"
);
015.
$Num_Rows
= mysql_num_rows(
$objQuery
);
016.
$Per_Page
= 10;
017.
018.
$Page
=
$_GET
[
"Page"
];
019.
if
(!
$_GET
[
"Page"
])
020.
{
021.
$Page
=1;
022.
}
023.
024.
$Prev_Page
=
$Page
-1;
025.
$Next_Page
=
$Page
+1;
026.
027.
$Page_Start
= ((
$Per_Page
*
$Page
)-
$Per_Page
);
028.
if
(
$Num_Rows
<=
$Per_Page
)
029.
{
030.
$Num_Pages
=1;
031.
}
032.
else
if
((
$Num_Rows
%
$Per_Page
)==0)
033.
{
034.
$Num_Pages
=(
$Num_Rows
/
$Per_Page
) ;
035.
}
036.
else
037.
{
038.
$Num_Pages
=(
$Num_Rows
/
$Per_Page
)+1;
039.
$Num_Pages
= (int)
$Num_Pages
;
040.
}
041.
$Page_End
=
$Per_Page
*
$Page
;
042.
IF (
$Page_End
>
$Num_Rows
)
043.
{
044.
$Page_End
=
$Num_Rows
;
045.
}
046.
?>
047.
<table
class
=
"simply"
summary=
"PremierShip Top5"
>
048.
<thead>
049.
<tr>
050.
<th width=
"10"
scope=
"col"
>#</th>
051.
<th width=
"25"
scope=
"col"
>ชื่อ</th>
052.
<th width=
"25"
scope=
"col"
>ตำแหน่งที่1</th>
053.
<th width=
"25"
scope=
"col"
>ตำแหน่งที่2</th>
054.
<th width=
"25"
scope=
"col"
>เงินเดือนที่ต้องการ</th>
055.
<th width=
"5"
scope=
"col"
></th>
056.
</tr>
057.
</thead>
058.
<tbody>
059.
<?
060.
for
(
$i
=
$Page_Start
;
$i
<
$Page_End
;
$i
++)
061.
{
062.
?>
063.
<tr>
064.
<td><?=mysql_result(
$objQuery
,
$i
,
"ApplyID"
);?></td>
065.
<td><?=mysql_result(
$objQuery
,
$i
,
"Name"
);?></td>
066.
<td><?
067.
$strPos1
= mysql_result(
$objQuery
,
$i
,
"Position1ID"
);
068.
$queryPos
=
"SELECT * FROM Position where PositionID = '$strPos1'"
;
069.
$resultPos
= mysql_query(
$queryPos
);
070.
$dataPos
= mysql_fetch_array(
$resultPos
);
071.
echo
$dataPos
[
'PositionName'
];
072.
?></td>
073.
<td><?
074.
$strPos2
= mysql_result(
$objQuery
,
$i
,
"Position2ID"
);
075.
$queryPos
=
"SELECT * FROM Position where PositionID = '$strPos2'"
;
076.
$resultPos
= mysql_query(
$queryPos
);
077.
$dataPos
= mysql_fetch_array(
$resultPos
);
078.
echo
$dataPos
[
'PositionName'
];
079.
?></td>
080.
<td><?=mysql_result(
$objQuery
,
$i
,
"NeedSalary"
);?></td>
081.
<td>
082.
<input type=
"hidden"
name=
"ApplyID"
value=
"<?=mysql_result($objQuery,$i,"
ApplyID
");?>"
>
083.
<a href=
"./private.php?pagename=applyinfo&ApplyID=<?=mysql_result($objQuery,$i,"
ApplyID
");?>"
>รายละเอียด</a></td>
084.
</tr>
085.
<?
086.
}
087.
?>
088.
</tbody>
089.
</table>
090.
<br>
091.
รวม <?=
$Num_Rows
;?> Record : <?=
$Num_Pages
;?> หน้า :
092.
<?
093.
if
(
$Prev_Page
)
094.
{
095.
echo
" <a href='$_SERVER[SCRIPT_NAME]?pagename=showapply&Page=$Prev_Page'><< Back</a> "
;
096.
}
097.
098.
for
(
$i
=1;
$i
<=
$Num_Pages
;
$i
++){
099.
if
(
$i
!=
$Page
)
100.
{
101.
echo
"[ <a href='$_SERVER[SCRIPT_NAME]?pagename=showapply&Page=$i'>$i</a> ]"
;
102.
}
103.
else
104.
{
105.
echo
"<b> $i </b>"
;
106.
}
107.
}
108.
if
(
$Page
!=
$Num_Pages
)
109.
{
110.
echo
" <a href ='$_SERVER[SCRIPT_NAME]?pagename=showapply&Page=$Next_Page'>Next>></a> "
;
111.
}
112.
?>
113.
</body>
114.
</html>