|
 |
|
แบ่งหน้าได้แล้วทำมัยคลิกหน้าต่อไปไม่ได้ เวลาคลิกหน้าต่อไปแล้ว ขึ้นหน้า errorr ทั้งหน้าเลยแปลแล้วบอกว่าไม่มีเพจที่กำหนด |
|
 |
|
|
 |
 |
|
<?
session_start("valid_user");
session_start("id_po");
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
</head>
<body>
<p> </p>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
<tr>
<td width="28%" height="26" valign="top"><div align="left"></div></td>
<td width="34%" valign="top" bordercolor="#000000"> <div align="center"><? echo"P/O.no <font size=2>$id";?></div></td>
<td width="38%"><p align="right"><font color="#000066" size="1"><strong>CHAIMONGKOL
INDUSTRIAL SUPPLY CO.,LTD...</strong> TEL(035)330218,226186,226380,331186,331446
FAX : 226187</font></p></td>
</tr>
</table>
<p align="center">
<?
@$dbpo=mysql_pconnect("localhost","chaimongkol","12345");
if(!$dbpo)
{
echo"เกิดข้อผิดพลาด.";
exit;
}
mysql_select_db("chaimongkol");
session_start("valid_user");
function pu_query($sql,$ListPerPage=10)
{
global $page;
global $totalpage;
$result=mysql_query($sql);
if (empty($page)) $page=1;
$num=mysql_num_rows($result);
$rt = $num%$ListPerPage;
//หาจำนวนหน้าทั้งหมด
$totalpage = ($rt!=0) ? floor($num/$ListPerPage)+1 : floor($num/$ListPerPage);
$goto = ($page-1)*$ListPerPage;
$sql .= " LIMIT $goto,$ListPerPage";
$result=mysql_query($sql);
return $result;
}
function pu_pageloop($option="",$align="left")
{
global $page;
global $totalpage;
// รูปแบบตัวแปร option คือ $option = "id=$c_id";
// ถ้ามีหลายตัวแปรก็จะเป็น $option = "id=$c_id&name=$myname&action=$action";
echo "<table align=center width=100% border=0 bordercolor=black cellspacing=0 cellpadding=2>\n";
echo "<tr><td align=$align>\n";
echo "<font color=#686898>\n";
// สร้าง link เพื่อไปหน้าก่อน-หน้าถัดไป
echo "<font size=2>กำลังแสดงหน้าที่ ";
if($page>1 && $page<=$totalpage) {
$prevpage = $page-1;
echo "<a href='".$_SERVER['PHP_SELF']."?page=$prevpage&$option' title='Back'><-</a>\n";
}
echo " <b>$page/$totalpage</b> ";
if($page!=$totalpage) {
$nextpage = $page+1;
echo "<a href='".$_SERVER['PHP_SELF']."?page=$nextpage&$option' title='Next'>-></a>\n";
}
echo "</font>\n";
echo "</td></tr>\n";
echo "<tr><td align=$align>\n";
// วนลูปแสดงเลขหน้าทั้งหมด แบบเป็นช่วงๆ ช่วงละ 10 หน้า
$b=floor($page/10);
$c=(($b*10));
if($c>1) {
$prevpage = $c-1;
echo "<font size=2><a href='".$_SERVER['PHP_SELF']."?page=$prevpage&$option' title='10 หน้าก่อนนี้'><<</a> \n";
}
else{
echo "<font size=2><<\n";
}
echo " <b>";
for($i=$c; $i<$page ; $i++) {
if($i>0)
echo "<font size=2><a href='".$_SERVER['PHP_SELF']."?page=$i&$option'>$i</a> \n";
}
echo "<font size=2 color=red>$page</font> \n";
for($i=($page+1); $i<($c+10) ; $i++) {
if($i<=$totalpage)
echo "<a href='".$_SERVER['PHP_SELF']."?page=$i&$option'>$i</a> \n";
}
echo "</b> ";
if($c>=0) {
if(($c+10)<$totalpage){
$nextpage = $c+10;
echo "<a href='".$_SERVER['PHP_SELF']."?page=$nextpage&$option' title='10 หน้าถัดไป'>>></a> \n";
}
else
echo ">>\n";
}
else{
echo ">>\n";
}
echo "</td></tr>\n";
echo "</table>\n";
}// จบฟังก์ชั่น pu_split
$sql="select * from insert_order where user='$valid_user' and po= '$id'";
$result=mysql_query($sql);
$result=pu_query($sql,10);
echo"<table width=96% >";
echo"<tr bgcolor=#ccaaff>" ;
echo"<td width=9%><div align=center><font size=2><b>code</div></td></font>";
echo"<td width=65%><div align=center><font size=2><b>description</div></td></font>";
echo"<td width=5%><div align=center><font size=2><b>quantity</div></td></font>";
echo"<td width=8%><div align=center><font size=2><b>unit / price</div></td></font>";
echo"<td width=5%><div align=center><font size=2><b>amount</div></td></font>";
echo"</tr>";
while ($roww=mysql_fetch_array($result,MYSQL_ASSOC))
{
?>
<tr bgcolor="#eeeeff">
<td align="center"><? echo "<font size=2>"; echo"$roww[code]";?></td>
<td align="center"><? echo "<font size=2>";echo"$roww[description]";?></td>
<td align="center"><? echo "<font size=2>";echo"$roww[quantity]";?></td>
<td align="center"><? echo "<font size=2>";echo"$roww[unit_price]";?></td>
<td align="center"><? echo "<font size=2>";echo"$roww[amount]";?></td>
</font>
</tr>
<?
}
echo"</table>";
pu_pageloop("category=$category&valid_user=$valid_user&id=$id");
?>
</font></p>
<table width="79%" border="1" align="center" bordercolor="#FFFFFF" >
<tr>
<td width="368" height="28"><font color="#FF0000" size="2">*กรุณา ปริ้นรายงานออกมา แล้วแฟกส์มายังเราด้วยครับ
เพื่อเป็นการยืนยันไปพร้อมกับการส่งของ</font> </td>
<td width="304" align="center" valign="top"><div align="center"><font color="#FF0000">*</font><font size="2">หากต้องการกลับไป
กรุณาล็อคอินใหม่ครับ</font></div></td>
<td width="98"><form action="report_po.php" method="post" name="form2" target="_blank">
<div align="center">
<input type="submit" name="Submit2" value="REPORT NEXT">
</div>
</form></td>
</tr>
</table>
<?
$id_po=$id;
session_register("id_po")
?></p>
<p align="center"> </p>
</body>
</html>
************************************************************************************
เวลาคลิกหน้าต่อไปแล้ว ขึ้นหน้า errorr ทั้งหน้าเลยแปลแล้วบอกว่าไม่มีเพจที่กำหนด หรือย้ายไปแล้ว
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
1 ก.พ. 2549 11:59:00 |
By :
prakasit |
View :
2483 |
Reply :
0 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|
|

|
Load balance : Server 00
|