?
Path : /home/admin/domains/happytokorea.com/public_html_bk/promice/Admin/ |
Current File : /home/admin/domains/happytokorea.com/public_html_bk/promice/Admin/SearchNow.php |
<? @session_start(); ob_start(); $useradmin = $_SESSION["useradmin"]; if(empty($useradmin)) { echo "<script>alert('หน้านี้จำกัดเฉพาะ Admin เท่านั้น');history.back();</script>"; exit(); } require_once "../include/tdate.php"; require_once "../include/connect.php"; require_once "../include/connectdb.php"; $sql="select * from useradmin where useradmin='$useradmin'"; $db_query=mysql_db_query($db,$sql); $result=mysql_fetch_array($db_query); $id=$result[id]; $adminname=$result[name]; $user_admin=$result[useradmin]; $pass_admin=$result[passadmin]; ?> <html> <head> <title><? echo "$headtxt"; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=tis-620"> <!-- Fireworks MX Dreamweaver MX target. Created Sat Apr 02 10:29:23 GMT+0700 (SE Asia Standard Time) 2011--> <link href="../css/style.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#ffffff"> <div align="center"><strong> </strong> <table width="89%" border="0" align="center" cellpadding="1" cellspacing="1"> <tr valign="top"> <td width="57%"><? echo "$headtxt | $e_date $etime"; ?><br> <div align="left">หน้าปัจจุบันของคุณ : <a href="Main.php">หน้าหลัก</a> --> <strong>แสดงการค้นหารายการสั่งซื้อ</strong></div></td> <td width="43%"> <div align="right">ยินดีต้อนรับคุณ <? echo "<u>$adminname</u>"; ?> เข้าใช้งานในระบบ<br> [ <a href="ChangePass.php">เปลี่ยนรหัสผ่าน</a> ] <a href="logout.php">ออกจากระบบ</a> </div></td> </tr> <tr> <td colspan="2"><table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#E9E9E6"> <tr> <td><div align="center"> <table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td><div align="center"><br> <table width="91%" border="0" align="center" cellpadding="1" cellspacing="1"> <tr> <td><table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td> <? $sqla="select * from tb_order where refid='$_POST[refid]'"; $db_query=mysql_db_query($db,$sqla); $resulta=mysql_fetch_array($db_query); $pPrice=$resulta[pPrice]; $pNum=$resulta[pNum]; $id_cus=$resulta[id_cus]; $date=$resulta[date]; $pId=$resulta[pId]; $paystatus=$resulta[paystatus]; $address2=$resulta[address2]; $sqlm="select * from member where usermem='$id_cus'"; $db_query=mysql_db_query($db,$sqlm); $resultm=mysql_fetch_array($db_query); $name=$resultm[name]; $address=$resultm[address]; $province=$resultm[province]; $zipcode=$resultm[zipcode]; $phone=$resultm[phone]; $email=$resultm[email]; ?> <table width="639" border="0" cellspacing="1" cellpadding="1"> <tr> <td width="126"> <div align="right">ใบสั่งซื้อเลขที่ :</div></td> <td width="506"><b><? echo "$_POST[refid]"; ?></b></td> </tr> <tr> <td> <div align="right">ลูกค้า :</div></td> <td><? echo "$name<br>ที่อยู่ : $address $province $zipcode<br>โทรศัพท์ : $phone Email : $email"; ?></td> </tr> <tr> <td> <div align="right">สถานที่จัดส่ง : </div></td> <td><? echo "$address2"; ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr class="jobscss"> <td bgcolor="#FFFFFF">วันที่สั่งซื้อ : <? echo "$date"; ?></td> </tr> <tr class="jobscss"> <td bgcolor="#FFFFFF"> <table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr bgcolor="#993300"> <td width="285"><div align="center"><strong>ชื่อสินค้า</strong></div></td> <td width="97"><div align="center"><strong>ราคา</strong></div></td> <td width="120"><div align="center"><strong>จำนวน</strong></div></td> <td width="125"><div align="center"><strong>รวม</strong></div></td> </tr> </table> <? $page = $_GET['page']; $select_type="select * from tb_order where refid = '$_POST[refid]' order by id asc"; $query_select=mysql_query($select_type); $num_rows=mysql_num_rows($query_select); if($num_rows<1){ echo "<br><br><center><b>ยังไม่มีการเพิ่มข้อมูลค่ะ</b></center>"; }else{ $select="select * from tb_order where refid = '$_POST[refid]' order by id asc"; $q_ry = mysql_query($select); $num_rows=mysql_num_rows($q_ry); $pagesize=20; $rt=$num_rows%$pagesize; if($rt!=0) { $totalpage=floor($num_rows/$pagesize)+1; } else { $totalpage=floor($num_rows/$pagesize); $toppic_id=1; } if(empty($page)) { $page=1; } mysql_free_result($q_ry); $goto=($page-1)*$pagesize; $sql_select_mem="Select * From tb_order where refid = '$_POST[refid]' order by id asc limit $goto,$pagesize"; $fect=mysql_query($sql_select_mem); if(!$fect) { ("ติดต่อฐานข้อมูลไม่ได้".mysql_error()); exit; } $bgcount=0; while($rows=mysql_fetch_array($fect)) { $idxx =$rows['id']; $pPrice=$rows[pPrice]; $pNum=$rows[pNum]; $id_cus=$rows[id_cus]; $date=$rows[date]; $pId=$rows[pId]; $paystatus=$rows[paystatus]; $sqlp="select * from products where productscode='$pId'"; $db_query=mysql_db_query($db,$sqlp); $resultp=mysql_fetch_array($db_query); $productsname=$resultp[productsname]; $productsprice=$resultp[productsprice]; $bgcount=$bgcount+1; $bgmod=$bgcount%2; if($bgmod==0){ $bgcolor="#E9E9E8"; }else{ $bgcolor="#FFFFFF"; } ?> <table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td width="285"><? echo "$productsname"; ?></td> <td width="97"><div align="center"><? echo "$productsprice"; ?></div></td> <td width="120"><div align="center"><? echo "$pNum"; ?></div></td> <td width="125"><div align="center"> <? $sum1 = $productsprice*$pNum; echo "$sum1"; ?> </div></td> </tr> </table> <? $sum2 = $sum2+$sum1; } } ?> </td> </tr> <tr class="jobscss"> <td height="19"><table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td width="786"><div align="right"><strong>รวมเงินที่ชำระ :</strong> </div></td> <td width="195"><div align="center"><? echo "<b>$sum2</b>"; ?></div></td> </tr> </table></td> </tr> <tr class="jobscss"> <td><strong><span class="maekhawtom">หน้าที่ :</span></strong> <span class="maekhawtom"> <? for($i=1;$i<$page;$i++) { echo"[<a href='$PHP_SELF?page=$i'>$i</a>]"; } echo"[<b>$page</b>]"; for($i=$page+1;$i<=$totalpage;$i++) { echo"[<a href='$PHP_SELF?page=$i'>$i</a>]"; } ?> </span><span class="maekhawtom"> </span></td> </tr> <tr> <td><div align="center"></div></td> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td><div align="center"></div></td> </tr> </table></td> </tr> <tr> <td> </td> </tr> </table> <br> <br> </div></td> </tr> </table> </div></td> </tr> </table></td> </tr> <tr> <td colspan="2"><div align="center"><br> <? echo "$buttomtxt"; ?> </div></td> </tr> </table> </div> </body> </html>