<form name="frmSearch" method="get" action="<?=$_SERVER['SCRIPT_NAME'];?>"> <SELECT NAME="txtKeyword" size="1" id="txtKeyword" value="<?=$_GET["txtKeyword"];?>"> <?php $strSQL = "SELECT [Tbl DesingISO DwgRevise].[Iso No] FROM [Tbl DesingISO DwgRevise] Group By [Iso No]"; $objExec = odbc_exec($objConnect, $strSQL) or die ("Error Execute [".$strSQL."]"); while($result = odbc_fetch_array($objExec)){ $i = $result["Iso No"]; echo"<OPTION VALUE='$i'>$i</OPTION>"; } ?> </SELECT> <INPUT TYPE="submit" value='Search'> </form> </td> <td> <!-- คีย์ข้อมูลค้นหาเอง --> <form name="frmSearch" method="get" action="<?=$_SERVER['SCRIPT_NAME'];?>"> <INPUT TYPE="text" NAME="txtKeyword" size='15'> <INPUT TYPE="submit" value='Search'> </form> </td> </table> <? if($_GET["txtKeyword"] != ""){ $strSQL = "SELECT * FROM [Tbl DesingISO DwgRevise] WHERE ([Iso No] LIKE '%".$_GET["txtKeyword"]."%')"; $objExec = odbc_exec($objConnect, $strSQL) or die ("Error Execute [".$strSQL."]"); $Num_Rows = 0; while(odbc_fetch_row($objExec)){$Num_Rows++;} // Count Record $Per_Page = 20; // 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)+1; 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; } $Page_End = $Per_Page * $Page; if($Page_End > $Num_Rows) { $Page_End = $Num_Rows; } ?> <table width="100%" class='tbSearch'> <tr> <th width="75"> <div align="center">FWDrawingno</div></th> <th width="70"> <div align="center">Iso No</div></th> <th width="50"> <div align="center">For</div></th> <th width="50"> <div align="center">DSN</div></th> <th width="70"> <div align="center">Trans No</div></th> <th width="40"> <div align="center">FW Rev</div></th> <th width="68"> <div align="center">DateRev</div></th> <th width="33"> <div align="center">Edit</div></th> <th width="33"> <div align="center">Delete</div></th> </tr> <? //while($objResult = odbc_fetch_array($objExec)){ for($i=$Page_Start;$i<=$Page_End;$i++){ $objResult = odbc_fetch_array($objExec,$i); $g += 1; $a=$g%2; if($a==0){$bg='#CCFFFF';}else{$bg='#E6DFF2';} ?> <tr bgcolor="<? echo $bg ?>"> <td><div align="center"><?=$objResult["FWDrawingno"];?></div></td> <td><div align="center"><?=$objResult["Iso No"];?></div></td> <td><div align="center"><?=$objResult["For"];?></div></td> <td><div align="center"><?=$objResult["DSN"];?></div></td> <td><div align="center"><?=$objResult["Trans No"];?></div></td> <td><div align="center"><?=$objResult["FW Rev"];?></div></td> <td><div align="center"><?=$objResult["DateRev"];?></div></td> <td><div align="center">Edit</div></td> <td><div align="center">Delete</div></td> </tr> <? //} } ?> </table> <br> Total <?= $Num_Rows;?> Record : <?=$Num_Pages;?> Page : <? if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo "<a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'> Next>></a> "; } odbc_close($objConnect); } else{ echo"Not found data"; } ?>
echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i&txtKeyword=".$_GET['txtKeyword']."'>$i</a> ]";
<? $txtKeyword=$_GET['txtKeyword']; if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page&txtKeyword=$txtKeyword'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i&txtKeyword=$txtKeyword'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo "<a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page&txtKeyword=$txtKeyword'> Next>></a> "; } odbc_close($objConnect); } else{ echo"Not found data"; } ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง