<? session_start(); if (session_is_registered("valid_uname") && session_is_registered("valid_pwd")) { }else{ header('location:home.php'); exit(); } ?> <html> <title>..:: ระบบจัดการฐานข้อมูล ::..</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" href="../css/styles.css" type="text/css"> <style type="text/css"> <!-- .style10 {font-size: 12px} .style12 { font-family: Tahoma; font-size: 12px; } .style13 { font-family: Tahoma; font-weight: bold; font-size: 12px; } .style9 {font-size: 14px} .style14 {font-family: "MS Sans Serif"} --> </style> <div align="center"><br> <table cellspacing=1 cellpadding=4 width="75%" bgcolor=#CCCCCC border=0 align="center" height="10"> <tbody> <tr bgcolor=#e5e5e5> <td width="100%" bgcolor="#FFFFFF"> <div align="center"></div> <table cellspacing=1 cellpadding=4 width="100%" border=0 align="center" height="10"> <tbody> <tr bgcolor=#e5e5e5> <td width="35%" bgcolor="#FFFFFF"> <div align="left"><b><img src="image/allrowto.gif" width="11" height="11" align="absbottom"> <span class="style12">รายการสั่งซื้อ</span></b></div></td> <td width="22%" align=middle bgcolor="#FFFFFF"> <div align="left"> </div></td> <td width="43%" bgcolor="#FFFFFF"> <div align="right"><a href="customer.php" class="style12">กลับไปหน้าหลัก</a></div></td> </tr> </tbody> </table></td> </tr> </tbody> </table> </div> <table width="68%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="58%"> </td> <td width="42%"> </td> </tr> </table> <table width="839" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#666666"> <tr> <td width="831" class="style9"><table width="833" border="0"> <tr> <td width="671"><div align="center" class="style10"><span class="style13">รายการสั่งซื้อสินค้า</span><br> <a href="admin.php"></a></div></td> </tr> <tr> <td><span class="style10"> <?php include("connect/connect.php"); $txt = trim($txt); ?> </span> <table width="100%" border="1" cellspacing="0" cellpadding="3" bgcolor="#E1E1E1" bordercolor="#CCCCCC" align="center"> <form action="<? $PHP_SELF; ?>" method="post" name="" class="style10"> <tr> <td bgcolor="#E4EFF8"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="62"><div align="center" class="style13 style12"> ค้นหา</div></td> <td width="165"><div align="right" class="style12"> <input type="text" name="txt" style="width=100%" value="<?=$txt;?>"> </div></td> <td width="198"><span class="style12"> <strong>[ โปรดระบุเลขที่ใบสั่งซื้อ] </strong></span></td> <td width="359"><span class="style12"> <input type="submit" name="Submit" value="ค้นหา"> <input type="hidden" name="page" value="1"> </span></td> </tr> </table></td> </tr> </form> </table> <table width=100% border=0 cellpadding=3 cellspacing=1 align=center bgcolor=#A5B8E4> <tr> <td width="7%" bgcolor=#ffffff class="style10"><div align="center"><font face="MS Sans Serif"><b>ลำดับที่</b></font></div></td> <td width="13%" bgcolor=#ffffff class="style10"><div align="center"><font face="MS Sans Serif"><b>เลขที่ใบสั่งซื้อ</b></font><font face="MS Sans Serif" color=#000000> </font></div></td> <td width="15%" bgcolor=#ffffff class="style10"><div align="center"><strong><font color="#000000" face="MS Sans Serif">ชื่อ-สกุลลูกค้า</font></strong></div></td> <td width="12%" bgcolor=#ffffff class="style10"><div align="center"><strong><font color="#000000" face="MS Sans Serif">วันที่สั่งซื้อ</font></strong></div></td> <td width="17%" bgcolor=#ffffff class="style10"><div align="center"><font face="MS Sans Serif"><b>สถานะการชำระเงิน</b></font></div></td> <td width="12%" bgcolor=#ffffff class="style10"><div align="center"><font face="MS Sans Serif"><b>เลขที่ใบชำระ</b></font></div></td> <td width="11%" bgcolor=#ffffff class="style13"><div align="center" class="style14">เลขที่ใบจัดส่ง</div></td> <td width="13%" bgcolor=#ffffff class="style13"><div align="center">หมายเลข EMS </div></td> </tr> </table> <span class="style10"> <? if($txt==""){ $txt=""; $tableSQL ="select * from orders where c_id='$valid_uname' "; } else { $tableSQL ="select * from orders where or_id = '$txt' "; } $tableQUERY= mysql_db_query($db, $tableSQL); $totalrow = mysql_num_rows($tableQUERY); $pagesize = 10; $totalpage = (int)($totalrow/$pagesize); if(($totalrow%$pagesize)!=0){ $totalpage=$totalpage+1; } if(isset($page)){ $pageno = $page; $start = $pagesize*($pageno-1); } else { $pageno = 1; $start = 0; } $tableSQL =$tableSQL." limit $start,$pagesize"; $tableQUERY = mysql_db_query($db, $tableSQL); $count =1; $tableNUM = mysql_num_rows($tableQUERY); ?> </span> <table width=100% border=0 cellpadding=3 cellspacing=1 align=center bgcolor=#A5B8E4> <? $tables = 0; $x=1; while($tables < $tableNUM) { $tablen = mysql_fetch_array($tableQUERY); $o_id=$tablen[or_id]; $o_date=$tablen[or_date]; $o_cid=$tablen[c_id]; $get_status=$tablen[pay_status]; if ($get_status=='2'){ $msg_read = "รอการตรวจสอบ"; } if ($get_status=='1'){ $msg_read = "ชำระเงินแล้ว"; } if ($get_status == '0'){ $msg_read = "แจ้งการชำระเงิน"; } $tableSQLq ="select * from customer where c_id ='$o_cid' "; $tableQUERYq= mysql_db_query($db, $tableSQLq); $ta = mysql_fetch_array($tableQUERYq); $cus_name=$ta[c_fullname]; $tableSQLt ="select * from payments where or_id ='$o_id' and pay_status='1' "; //echo $tableSQLt; $tableQUERYt= mysql_db_query($db, $tableSQLt); $tat = mysql_fetch_array($tableQUERYt); $pay_idd=$tat[pay_id]; //echo $pay_idd; $tableSQLu ="select * from delivery where pay_id ='$pay_idd' "; $tableQUERYu= mysql_db_query($db, $tableSQLu); $tau = mysql_fetch_array($tableQUERYu); $dev_idd=$tau['dev_id']; ?> <tr> <td width="7%" bgcolor=#ffffff class="style10"><font face="MS Sans Serif" color=#000000><? echo"$x"; ?></font></td> <td width="13%" bgcolor=#ffffff class="style10"><div align="center"><span class="style12"><? echo "<a href=\"orderdetail.php?OrID=$tablen[or_id]\">$tablen[or_id] </a>\n"; ?></span></div></td> <td width="15%" bgcolor=#ffffff class="style10"><div align="center"><font face="MS Sans Serif" color=#000000><? echo"$cus_name"; ?></font></div></td> <td width="12%" bgcolor=#ffffff class="style10"><div align="center"><font face="MS Sans Serif" color=#000000><? echo"$o_date"; ?></font></div></td> <td width="17%" bgcolor=#ffffff class="style10"><div align="center"> <font face="MS Sans Serif" color=#000000> <? if ($get_status == '0'){ echo "<a href=\"payment.php?id=$o_id\">" ;?> <? echo "$msg_read"; ?> <? echo "</a>" ; ?> <? }else{ if ($get_status == '1'){ // echo "<a href=\"payment.php?id=$o_id\">" ?> <? echo "$msg_read"; ?> <? echo "</a>" ?> <? } else { echo "$msg_read"; } } ?> <b><font color="#000000" face="MS Sans Serif"><br> </font></b></font> </div></td> <td width="12%" bgcolor=#ffffff class="style10"><div align="center"><span class="style12"><? echo "<a href=\"paydetail.php?PayID=$tat[pay_id]\">$tat[pay_id]</a>\n"; ?></span></div></td> <td width="11%" bgcolor=#ffffff class="style10"><div align="center"><span class="style12"><? echo "<a href=\"senddetail.php?DevID=$tau[dev_id]\">$tau[dev_id]</a>\n"; ?></span></div></td> <td width="13%" bgcolor=#ffffff class="style10"><div align="center"><font face="MS Sans Serif" color=#000000><? echo"$tau[dev_ems]"; ?></font></div></td> </tr> <? $tables++; $x++; } ?> </table> <span class="style10"><br> <? if($totalpage>1) { $pn = $pageno-1; $pn1 = $pageno+1; ?> </span> <table width=100% border=0 cellpadding=1 cellspacing=1 align=right bgcolor=#A5B8E4> <tr> <td bgcolor=#E4EFF8 class="style10"><div align=right><font face="MS Sans Serif" color=#990000> <? if($pageno >1){ echo"<a href=$PHP_SELF?page=$pn&txt=$txt&fields=$fields>ก่อนหน้า</a> |"; } for($i=1;$i<=$totalpage;$i++){ if($totalpage==$i){ echo" <b>" .$i." </b> |"; } else { echo"<a href=$PHP_SELF?page=$pn&txt=$txt&fields=$fields>$i</a> |"; } } if($pageno<$totalpage){ echo"<a href=$PHP_SELF?page=$pn1&txt=$txt&fields=$fields>ถัดไป</a>"; } ?> </font></div></td> </tr> </table> <span class="style10"> <? } ?> </span></td> </tr> <tr> <td bgcolor="#333333"> </td> </tr> </table></td> </tr> </table> <div align="center"><br> <br> </div>
for($i=1;$i<=$totalpage;$i++){ if($totalpage==$i){ echo" <b>" .$i." </b> |"; } else { echo"<a href=$PHP_SELF?page=$i&txt=$txt&fields=$fields>$i</a> |"; } }
if(isset($_GET['page'])){ $pageno = $_GET['page']; $start = $pagesize*($pageno-1); } else { $pageno = 1; $start = 0; }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง