|
 |
|
ต้องการให้แบ่งหน้าโดยพิมพ์ตัวเลขให้แสดงจำนวนแถว และให้แสดงข้อมูลโดยเช็คจากสเตตัส |
|
 |
|
|
 |
 |
|
ประมาณนี้มั้งค่ะ
<form id="form1" name="form1" method="post" action="">
<table width="93%" align="left">
<tr>
<td width="36%" align="left" scope="col">จำนวนแถวแสดง:
<input type="text" name="numrows" id="numrows" />
<input type="submit" name="button" id="button" value="แสดง" /></td>
<td width="64%" scope="col">แสดงตามรายการ:
<select name="status" id="status">
<option value="รับของคืนแล้ว">รับของคืนแล้ว</option>
<option value="ยังไม่รับคืน">ยังไม่รับคืน</option>
<option>ทั้งหมด</option>
</select> <input type="submit" name="submitForm" id="submitForm" value="แสดง" /></td>
</tr>
</table>
</form>
<br />
<table width="100%">
<tr>
<td width="8%" align="center" bgcolor="#71B5F9"><p>วันที่</p></td>
<td width="15%" align="center" bgcolor="#71B5F9"><p>ชื่อรายการแจ้ง</p></td>
<td width="5%" align="center" bgcolor="#71B5F9"><p>จำนวน</p></td>
<td width="21%" align="center" bgcolor="#71B5F9"><p>ลักษณะของที่พบ</p></td>
<td width="10%" align="center" bgcolor="#71B5F9">สถานะ</td>
<td width="21%" align="center" bgcolor="#71B5F9">ผู้พบเห็น</td>
<td width="20%" align="center" bgcolor="#71B5F9"><p>ผู้รับ</p></td>
</tr>
<?php
if(isset($_POST["submitForm"])){
include("../AC_student/login/connect2.php");
$sql = "select * from tb_item where status='{$_POST["status"]}' limit {$_POST["numrows"]}"
$res = mysql_query($sql) or die(mysql_error());
$i=1;
while($data = mysql_fetch_assoc($res)){
echo "<tr><td>$i</td><td>{$data["da_te"]}</td>",
"<td>{$data["item"]}</td><td>{$data["num"]}</td>",
"<td>{$data["detial"]}</td><td>{$data["status"]}</td>",
"<td>{$data["inform"]}</td><td>{$data["receive"]}</td></tr>\n";
}
}
?>
</table>
|
 |
 |
 |
 |
Date :
2014-03-12 19:02:56 |
By :
God Blessing |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แก้ไขเรื่องแสดงทั้งหมดค่ะ
<form id="form1" name="form1" method="post" action="">
<table width="93%" align="left">
<tr>
<td width="36%" align="left" scope="col">จำนวนแถวแสดง:
<input type="text" name="numrows" id="numrows" />
<input type="submit" name="button" id="button" value="แสดง" /></td>
<td width="64%" scope="col">แสดงตามรายการ:
<select name="status" id="status">
<option value="รับของคืนแล้ว">รับของคืนแล้ว</option>
<option value="ยังไม่รับคืน">ยังไม่รับคืน</option>
<option value="%">ทั้งหมด</option>
</select> <input type="submit" name="submitForm" id="submitForm" value="แสดง" /></td>
</tr>
</table>
</form>
<br />
<table width="100%">
<tr>
<td width="8%" align="center" bgcolor="#71B5F9"><p>วันที่</p></td>
<td width="15%" align="center" bgcolor="#71B5F9"><p>ชื่อรายการแจ้ง</p></td>
<td width="5%" align="center" bgcolor="#71B5F9"><p>จำนวน</p></td>
<td width="21%" align="center" bgcolor="#71B5F9"><p>ลักษณะของที่พบ</p></td>
<td width="10%" align="center" bgcolor="#71B5F9">สถานะ</td>
<td width="21%" align="center" bgcolor="#71B5F9">ผู้พบเห็น</td>
<td width="20%" align="center" bgcolor="#71B5F9"><p>ผู้รับ</p></td>
</tr>
<?php
if(isset($_POST["submitForm"])){
include("../AC_student/login/connect2.php");
$sql = "select * from tb_item where status like '{$_POST["status"]}' limit {$_POST["numrows"]}"
$res = mysql_query($sql) or die(mysql_error());
$i=1;
while($data = mysql_fetch_assoc($res)){
echo "<tr><td>$i</td><td>{$data["da_te"]}</td>",
"<td>{$data["item"]}</td><td>{$data["num"]}</td>",
"<td>{$data["detial"]}</td><td>{$data["status"]}</td>",
"<td>{$data["inform"]}</td><td>{$data["receive"]}</td></tr>\n";
}
}
?>
</table>
|
 |
 |
 |
 |
Date :
2014-03-12 19:06:09 |
By :
God Blessing |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ
|
 |
 |
 |
 |
Date :
2014-03-12 20:32:17 |
By :
tonmio852 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|