ข้อมูลวิชา
include "config.inc.php";
if($_GET["txtKeyword"] != "")
{
$strSQL = "SELECT * FROM subject WHERE (Sub_ID = '".$_GET["txtKeyword"]."' or Sub_NameTh LIKE '%".$_GET["txtKeyword"]."%' or Sub_NameEn LIKE '%".$_GET["txtKeyword"]."%')";
}else{
$strSQL = "SELECT * FROM subject ";
}
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$Num_Rows = mysql_num_rows($objQuery);
$Per_Page = 15; // Per Page
$Page = $_GET["Page"];
if(!$_GET["Page"])
{
$Page=1;
}
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($Num_Rows<=$Per_Page)
{
$Num_Pages =1;
}
else if(($Num_Rows % $Per_Page)==0)
{
$Num_Pages =($Num_Rows/$Per_Page) ;
}
else
{
$Num_Pages =($Num_Rows/$Per_Page)+1;
$Num_Pages = (int)$Num_Pages;
}
$strSQL .=" order by row_id ASC LIMIT $Page_Start , $Per_Page";
$objQuery = mysql_query($strSQL);
?>
# |
ชื่อวิชา:ไทย |
ชื่อวิชา:อังกฤษ |
นก. |
กลุ่ม |
if($_SESSION['login_status']=="ADM"){?>
เพิ่ม |
} ?>
while($objResult = mysql_fetch_array($objQuery))
{
?>
|
|
|
|
|
if($_SESSION['login_status']=="ADM"){?>
 |
 |
} ?>
}
?>
|
Total Record : Page :
if($Prev_Page)
{
echo "
<< Back ";
}
for($i=1; $i<=$Num_Pages; $i++){
if($i != $Page)
{
echo "[
$i ]";
}
else
{
echo "
$i ";
}
}
if($Page!=$Num_Pages)
{
echo "
Next>> ";
}
?>