<html> <head> <title>ThaiCreate.Com PHP & MySQL Tutorial</title> <style type="text/css"> <!-- @import url("Font.css"); --> </style> </head> <body> <form name="frmPatitPage" id="frmPatitPage" method="get"> <table width="970" border="0"> <tr> <th height="50" colspan="14" class="Header_FontWite"><table width="560" align="left"> <tr> <td width="37"><div align="center"><img src="Picture/confirm-icon.jpg" alt="Confirmed" width="28" height="28" /></div></td> <td width="511"><div align="left" class="Header_Browse_subH">Invoice data confirmed.</div></td> </tr> </table></th> </tr> <tr> <th height="35" colspan="14" class="Header_FontWite"><table width="600" align="left"> <tr> <td><div align="left"><span class="Header_Table">Preview :</span><span class="Menu_A"> <select name="SearchType" id="SearchType"> <option value="PO">PO</option> <option value="Item">Item</option> <option value="Due Date">Due Date</option> </select> <input name="keyword" type="text" id="keyword" value="<?php echo $keyword ?>" size="25" maxlength="50" /> <span class="Body_Red"> </span> <input type="submit" name="Search" id="Search" value="Display Data" /> </span></div></td> </tr> </table> <? include("DB-config.php"); if($_POST['SearchType']=="PO"){ $strSQL="SELECT * FROM tbPO WHERE PO LIKE '%$keyword%'"; }else if($_POST['SearchType']=="Item"){ $strSQL="SELECT * FROM tbPO WHERE Item LIKE '%$keyword%' "; }else if($_POST['SearchType']=="Due Date"){ $strSQL="SELECT * FROM tbPO WHERE Due_Date LIKE '%$keyword%' "; }else{ $strSQL="SELECT * FROM tbPO WHERE Due_Date LIKE '%$keyword%' and PO LIKE '%$keyword%' and Item LIKE '%$keyword%'"; }; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $Num_Rows = mysql_num_rows($objQuery); $Per_Page = 5; // 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 Vendor ASC LIMIT $Page_Start , $Per_Page"; $objQuery = mysql_query($strSQL); ?></th> </tr> <tr> <th width="53" bgcolor="#666666" class="Header_FontWite"> <div align="center">Vendor </div></th> <th width="68" bgcolor="#666666" class="Header_FontWite"> <div align="center">Order Date </div></th> <th width="59" bgcolor="#666666" class="Header_FontWite"> <div align="center">PO</div></th> <th width="30" bgcolor="#666666" class="Header_FontWite"> <div align="center">Line </div></th> <th width="28" bgcolor="#666666" class="Header_FontWite"> <div align="center">Seq </div></th> <th width="99" bgcolor="#666666" class="Header_FontWite"> <div align="center">Item </div></th> <td width="248" bgcolor="#666666" class="Header_FontWite"><div align="center">Description</div></td> <td width="37" bgcolor="#666666" class="Header_FontWite"><div align="center">Qty Order</div></td> <td width="25" bgcolor="#666666" class="Header_FontWite"><div align="center">Unit</div></td> <td width="29" bgcolor="#666666" class="Header_FontWite"><div align="center">Unit Cost</div></td> <td width="51" bgcolor="#666666" class="Header_FontWite"><div align="center">Amount</div></td> <td width="68" bgcolor="#666666" class="Header_FontWite"><div align="center">Due Date</div></td> <td width="68" bgcolor="#666666" class="Header_FontWite"><div align="center">Del No.</div></td> <td width="49" bgcolor="#666666" class="Header_FontWite"><div align="center">Firmed</div></td> </tr> <? while($objResult = mysql_fetch_array($objQuery)) { ?> <tr> <td height="27" bgcolor="#E9E9E9" class="Body_Black"><div align="center"><?=$objResult["Vendor"];?></div></td> <td height="27" bgcolor="#E9E9E9" class="Body_Black"><div align="center"> <?=$objResult["Order_Date"];?> </div></td> <td height="27" bgcolor="#E9E9E9" class="Body_Black"><div align="center"> <?=$objResult["PO"];?> </div></td> <td height="27" bgcolor="#E9E9E9" class="Body_Black"><div align="center"><?=$objResult["Line"];?></div></td> <td height="27" align="right" bgcolor="#E9E9E9" class="Body_Black"><div align="center"> <?=$objResult["Seq"];?> </div> </td> <td height="27" align="right" bgcolor="#E9E9E9" class="Body_Black"><div align="left"> <?=$objResult["Item"];?> </div> </td> <td height="27" bgcolor="#E9E9E9" class="Body_Black"><div align="left"><?=$objResult["Description"];?></div></td> <td height="27" bgcolor="#E9E9E9" class="Body_Black"><div align="center" class="Header_Browse_Body"><?=$objResult["Qty_Order"];?></div></td> <td height="27" bgcolor="#E9E9E9" class="Body_Black"><div align="center"><?=$objResult["Unit"];?></div></td> <td height="27" bgcolor="#E9E9E9" class="Body_Black"><div align="center"><?=$objResult["Unit_Cost"];?></div></td> <td height="27" bgcolor="#E9E9E9" class="Body_Black"><div align="center"><?=$objResult["Amount"];?></div></td> <td height="27" bgcolor="#E9E9E9" class="Body_Black"><div align="center"><?=$objResult["Due_Date"];?></div></td> <td height="27" bgcolor="#E9E9E9" class="Body_Black"><div align="left"><?=$objResult["Del_No"];?></div></td> <td height="27" bgcolor="#E9E9E9" class="Body_Black"><div align="center" class="Header_Browse_Body"> <? if($objResult["Firm"]=='2') { echo "firmed"; }else{ echo "Notfirm"; } ?> </div></td> </tr> <? } ?> </table> <div align="center"><span class="Menu_A2">Total <span class="Body_Red"><?= $Num_Rows;?></span> Record : <span class="Body_Red"><?=$Num_Pages;?></span> Page : <? if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?id=frmEditForIssue&Page=$Prev_Page'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?id=frmEditForIssue&Page=$i'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?id=frmEditForIssue&Page=$Next_Page'>Next>></a> "; //echo " <a href ='$_SERVER[SCRIPT_NAME]?id=ttttt&Page=$Next_Page'>Next>></a>"; //http://127.0.0.1/edi/Index_Center.php?id=ttttt&Page=2 //http://127.0.0.1/edi/Index_Center.php?id=frmEditForIssue&Page=2 } mysql_close(); ?></span></div> </form> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง