<table width="749" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="684" height="384" align="center"><form id="form1" name="form1" method="get" action="show_performance.php"> <p align="center" style="font-size: 14px"> ค้นหาชื่อผลงาน : <input type="text" name="search" id="search" placeholder="ค้นหาชื่อผลงาน"/> <br /> <br /> ค้นหาชื่อพระสงฆ์ : <input name="search1" type="text" id="search1" placeholder="ค้นหาชื่อ-นามสกุล" /> <br/> <br /> ค้นหาวันที่ได้รับผลงาน : <input type="text" name="search2" id="datepicker" placeholder="ค้นหาวัน/เดือน/ปี" /> <br /> <br /> <input type="submit" name="button" id="button" value="ค้นหา"/> <input name="Reset" type="reset" value="เริ่มใหม่" onclick="window.location.href='show_performance.php'"/> </p> </form> <p> <?php include("class_dethai.php"); mysql_connect("localhost","root","") or die("Error Connect to Database"); mysql_select_db("watlang_db"); mysql_query("SET NAMES UTF8"); $sql="SELECT * FROM invitted WHERE Id_in"; @$search = $_GET['search']; @ $search1 = $_GET['search1']; @$search2 = $_GET['search2']; $strSQL1 = "SELECT * FROM monk WHERE Name_m Like '$search1%'"; $objQuery1 = mysql_query($strSQL1); $objResult1 = mysql_fetch_assoc($objQuery1); $Nperformance=$objResult1['Id_m']; if($search=="" && $search1=="" && $search2=="" ){ } else if ($search!="" && $search1!="" && $search2!="")//111 { $sql.=" AND Name_in Like '%$search%' AND Id_m='$Nperformance' AND Date_in like '%$search2%' "; } else if ($search!= "" && $search1!= "" && $search2== "")//110 { $sql.=" AND Name_in Like '%$search%' AND Id_m='$Nperformance' "; } else if ($search!= "" && $search1== "" && $search2!= "")//101 { $sql.=" AND Name_in Like '%$search%' AND Date_in like '%$search2%' "; } else if($search!="" && $search1=="" && $search2=="")//100 { $sql.=" AND Name_in Like '%$search%' " ; } else if($search=="" && $search1!="" && $search2!="")//011 { $sql.=" AND Id_m='$Nperformance' AND Date_in like '%$search2%' "; } else if($search=="" && $search1!="" && $search2=="")//010 { $sql.=" AND Id_m='$Nperformance' "; } else if ($search=="" && $search1=="" && $search2!="")//001 { $sql.=" AND Date_in Like '%$search2%' "; } //echo $sql; $objQuery = mysql_query($sql) or die ("Error Query [".$sql."]"); $Num_Rows = mysql_num_rows($objQuery); $Per_Page = 5; @$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; } if($Num_Rows==0){ } $sql .=" order by Id_in ASC LIMIT $Page_Start , $Per_Page"; $objQuery = mysql_query($sql); ?> <br /> <?php if($Num_Rows==0){ echo "<h3>ไม่มีข้อมูลที่ค้นหา</h3>"; ?> <br /> <?php }else{ while($cols = mysql_fetch_row($objQuery)) { if(@$bg =="#FFFF99"){//ส่วนของการสลับสี $bg="#FFFFCC"; }else{ $bg="#FFFF99"; } ?> </p> <table width="673" border="0" align="center" cellpadding="0" cellspacing="0"> <tr bgcolor="#00FFFF"> <td width="237" rowspan="5" align="center" valign="middle" bordercolor="#000000" bgcolor="#ffffff" border="1"><a class='iframe' href="show_performance_detail2.php?Id_m=<?=$cols[1]?>" title="ข้อมูลพระ"><img src="gallery/<?php echo $cols[5];?>" onerror="this.src='picture/wallpaper.jpg'" alt=""width="225" height="182" align="middle" /></a></td> <td height="32" align="center" bgcolor="#FFD600"></td> <td height="32" align="center" bgcolor="#FCF8C8"></td> <td height="32" align="center" bgcolor="#FCF8C8"></td> </tr> <tr> <td width="140" height="24" align="right" valign="top" bgcolor="#FFD600">ชื่อผลงาน : </td> <td width="296" colspan="2" align="left" valign="top" bgcolor="#FCF8C8"><?php echo $cols[2];?></td> </tr> <tr> <td height="22" align="right" valign="top" bgcolor="#FFD600">รายละเอียด : </td> <td colspan="2" align="left" valign="top" bgcolor="#FCF8C8"><?php echo $cols[3];?></td> </tr> <tr> <td height="25" align="right" valign="top" bgcolor="#FFD600">ผู้ได้รับผลงาน : </td> <?php $Id_m = $cols[1]; $sql2 = "SELECT * FROM monk WHERE Id_m='$Id_m';"; $rs2 = mysql_query($sql2); $cols2 = mysql_fetch_row($rs2); ?> <td colspan="2" align="left" valign="top" bgcolor="#FCF8C8"><a href="show_performance_detail.php?Id_m=<?=$cols[1]; ?>"><?php echo $cols2[4];?></a></td> <?php mysql_free_result($rs2); ?> </tr> <tr> <td height="25" align="right" valign="top" bgcolor="#FFD600">วันที่รับผลงาน : </td> <td colspan="2" align="left" valign="top" bgcolor="#FCF8C8"><?php echo $cols[4];?></td> </tr> </table> <p> <?php } ?></p> <p>ทั้งหมด <?php echo $Num_Rows;?> ผลงาน : หน้า <?php echo $Page; ?> จากทั้งหมด <?php echo $Num_Pages;?> หน้า : <?php if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< ย้อนกลับ</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'>ถัดไป>></a> "; } } mysql_free_result($objQuery); mysql_close(); ?> </p></td> </tr> </table>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง