รายละเอียดของการตอบ ::
<? session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
background-color: #CCCAAA;
}
.style2 { font-size: 14px;
font-family: Arial, Helvetica, sans-serif;
}
.style22 {font-size: 16px}
.style23 {font-family: Arial, Helvetica, sans-serif}
.style3 {font-size: 12px}
.style28 {font-size: 12px; font-weight: bold; }
.style30 {font-size: 12px; font-family: Arial, Helvetica, sans-serif; }
-->
</style></head>
<?php
session_start(); //เปิด session
$ses_admin1id =$_SESSION[ses_admin1id]; //สร้าง session สำหรับเก็บค่า ID
$ses_admin1usn = $_SESSION[ses_admin1usn]; //สร้าง session สำหรับเก็บค่า username
//ตรวจสอบว่าทำการ Login เข้าสู่ระบบมารึยัง
if($ses_admin1id <> session_id() or $ses_admin1usn==""){
echo "Please Login to system<br />";
}
//ตรวจสอบสถานะว่าใช่ admin รึเปล่า ถ้าไม่ใช่ให้หยุดอยู่แค่นี้
if($_SESSION[ses_status] != "admin1") {
echo "สำหรับ Admin เท่านั้น";
echo "<a href=admin_login.php>กลับสู่หน้าแรก</a>";
exit();
}
?>
<body><div id="body" align="center">
<table width="1024" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="4" bgcolor="#FFFFFF"><img src="imgs/banner.jpg" width="1024" height="50" /><br />
<img src="imgs/admin_checklogin.php" width="1024" height="5" /></td>
</tr>
<tr valign="top">
<td width="125" bgcolor="#FFFFFF"><a href="admin1_seeall_user.php"><img src="imgs/menu_admin1.jpg" width="125" height="30" border="0" align="top" /></a><br />
<a href="admin1_manage.php"><img src="imgs/menu_admin2.jpg" width="125" height="30" border="0" /></a><br />
<a href="admin1_add_user.php"><img src="imgs/menu_admin3.jpg" width="125" height="30" border="0" /></a><br />
<a href="admin1_report.php"><img src="imgs/menu_admin4.jpg" width="125" height="30" border="0" /></a><br />
<a href="admin1_search_user.php"><img src="imgs/menu_admin5.jpg" width="125" height="30" border="0" /></a><br />
<a href="admin_login.php"><img src="imgs/menu_logout.jpg" width="125" height="30" border="0" /></a></a><br /></td>
<td width="899" colspan="3" bgcolor="#FFFFFF"><p align="center"><br />
</p>
<p align="center" class="style2"><a href="admin1_add_user.php">เพิ่มข้อมูลลูกค้า</a></p>
<p align="center"><span class="style2"><a href="admin1_add_user.php"><img src="imgs/635055380.png" alt="" width="54" height="54" border="0" /></a></span></p>
<p class="style22">
<?
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("bs");
$strSQL = "SELECT * FROM member ";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$Num_Rows = mysql_num_rows($objQuery);
mysql_query("set character_set_results = utf8") or die(mysql_error());
mysql_query("set names utf8") or die(mysql_error());
$Per_Page = 10; // 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 bs_id ASC LIMIT $Page_Start , $Per_Page";
$objQuery = mysql_query($strSQL);
?>
</p>
<table width="95%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#999999">
<tr>
<td width="7%"><div align="center" class="style3 style23"><strong>S/N</strong></div></td>
<td width="10%" bordercolor="#999999"><div align="center" class="style3 style23"><strong>โปรแกรม</strong></div></td>
<td width="14%"><div align="center" class="style3 style23"><strong>ชื่อกิจการ</strong></div></td>
<td width="8%"><div align="center" class="style3 style23"><strong>อำเภอ/เขต</strong></div></td>
<td width="10%"><div align="center" class="style3 style23"><strong>จังหวัด</strong></div></td>
<td width="11%"><div align="center" class="style3 style23"><strong>ชื่อผู้ติดต่อ</strong></div></td>
<td width="9%"><div align="center" class="style3 style23"><strong>Tel.</strong></div></td>
<td width="7%"><div align="center" class="style3 style23"><strong>Email</strong></div></td>
<td width="6%"><div align="center" class="style23"><span class="style28">ลบ</span></div></td>
<td width="5%"><div align="center" class="style23"><span class="style28">แก้ไข</span></div></td>
<td width="13%"><div align="center" class="style3 style23">
<div align="center"><strong>แสดงรายละเอียด</strong></div>
</div></td>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td><div align="center" class="style30">
<div align="center">
<?=$objResult[bs_sn]?>
</div>
</div></td>
<td bordercolor="#999999"><div align="center" class="style30">
<div align="center">
<?=$objResult[bs_namep]?>
</div>
</div></td>
<td><div align="center" class="style30">
<div align="center">
<?=$objResult[bs_company]?>
</div>
</div></td>
<td><div align="center" class="style30">
<div align="center">
<?=$objResult[bs_prefecture]?>
</div>
</div></td>
<td><div align="center" class="style30">
<div align="center">
<?=$objResult[bs_city]?>
</div>
</div></td>
<td><div align="center" class="style30">
<div align="center">
<?=$objResult[bs_name]?>
</div>
</div></td>
<td><div align="center" class="style30">
<div align="center">
<?=$objResult[bs_tel]?>
</div>
</div></td>
<td><div align="center" class="style30">
<div align="center">
<?=$objResult[bs_email1]?>
</div>
</div></td>
<td><div align="center" class="style30">
<div align="center"><a href="del_user.php?bs_id=<?=$objQuery["bs_id"]?>">ลบ</a></div>
</div></td>
<td><div align="center" class="style30">
<div align="center"><a href="admin1_edit_user.php?bs_id=<?=$row["bs_id"]?>">แก้ไข</a></div>
</div></td>
<td><div align="center" class="style30">
<div align="center"><a href="admin1_see_user.php?bs_id=<?=$row["bs_id"]?>">รายละเอียด </a></div>
</div></td>
</tr>
<? } ?>
</table>
<div align="left">Total
<?= $Num_Rows;?>
Record :
<?=$Num_Pages;?>
Page :
<?
if($Prev_Page)
{
echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a> ";
}
for($i=1; $i<=$Num_Pages; $i++){
if($i != $Page)
{
echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]";
}
else
{
echo "<b> $i </b>";
}
}
if($Page!=$Num_Pages)
{
echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a> ";
}
mysql_close($objConnect);
?>
</div>
<p class="style22"></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
</table>
</div>
</body>
</html>