<?php session_start(); echo "Load Time : ".date("Y-m-d H:i:s"); $strSearch = $_POST["mySearch"]; $strPage = $_POST["myPage"]; include("config.inc.php"); mysql_query("set NAMES'UTF8'"); $sql = "SELECT * FROM member where username='$_SESSION[programmer]'"; $result = mysql_query($sql) or die ("Error Query [".$sql."]"); $arr = mysql_fetch_array($result); $strSQL = "SELECT * FROM fservice WHERE admin = '$arr[adminname]' and fid LIKE '%".$strSearch."%'and status2='No' "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $rows = mysql_num_rows($objQuery); $sqlCount = "SELECT count( 'read' ) FROM fservice WHERE admin = '$arr[adminname]' AND readStat = 0"; $result2 = mysql_query($sqlCount); $row = mysql_fetch_row($result2); $Per_Page = 15; $Page = $strPage; if(!$strPage) { $Page = 1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_Start = (($Per_Page*$Page)-$Per_Page); if($rows<=$Per_Page) { $Num_Page =1; } else if(($rows%$Per_Page)==0) { $Num_Page = ($rows/$Per_Page); } else { $Num_Page = ($rows/$Per_Page)+1; $Num_Page = (int)$Num_Page; } $strSQL .="order by fdate DESC LIMIT $Page_Start, $Per_Page"; $objQuery = mysql_query($strSQL); if ($rows <=0){ echo "<table width=800 align=center>"; echo "<font color=#FF0000><strong>ไม่พบรายงานที่ค้นหา</strong></font>"; echo "</table>"; } else{ ?> <style type="text/css"> <!-- a:link { color: #0000FF; } a:visited { color: #0000FF; } a:hover { color: #FFFFFF; } a:active { color: #FFFFFF; } .style 22{ font-size: 5px; } .style4 {color: #FFFFFF} --> </style> <?php if ($row[0] != 0) { echo " <font color='00CC00' size='5'><b>คุณมี $row[0] รายงานที่ยังไม่ได้อ่าน</b></font>"; } ?> <table width="850" border="0" align="center"> <tr> <th width="164" bgcolor="#009E8E" scope="col"><span class="style22 style4">รหัสรายงาน</span></th> <th width="177" bgcolor="#009E8E" scope="col"><span class="style22 style4">ผู้ประสานงาน</span></th> <th width="138" bgcolor="#009E8E" scope="col"><span class="style22 style4">หน่วยงาน</span></th> <th width="173" bgcolor="#009E8E" scope="col"><span class="style22 style4">เบอร์โทรศัพท์</span></th> <th width="100" bgcolor="#009E8E" scope="col"><span class="style22 style4">สถานะงาน</span></th> </tr> <? for ($i=0; $i<$rows; $i++){ $arr = mysql_fetch_array($objQuery); ?> <tr> <td><div align="center"><?php if($arr['readStat'] == 0){ echo "<img src=\"images/new.gif\" width=\"25\" height=\"9\" title=\"รายงานใหม่\">"; } ?><a href="read_update.php?fid=<?=$arr['fid'];?>&pagename=<?=$arr['serviceFile'];?>" target="_blank"> <?=$arr['fid']; ?></a></div></td> <td><?=$arr["fname"];?></td> <td><?=$arr["fdiv"];?></td> <td><?=$arr["ftel"];?></td> <td align="center"><?php if ($arr['status2']=="Yes"){ echo "<img src=\"images/true.png\" width=\"12\" height=\"12\" title=\"เสร็จเรียบร้อย\">"; }else{ echo "<img src=\"images/false.png\" width=\"12\" height=\"12\" title=\"ยังไม่เสร็จ\">"; } ?></td> <td width="18"> <input type="checkbox" id="<?=$arr['fid'];?>" onclick="javascript:if(confirm('ยืนยัน [<?=$arr['fid']?>]')==true){doClick(this);}" \> </td> </tr> <? } } ?> </table> <br/> <center> Total <?= $rows;?> Record : <?=$Num_Page;?> Page : <? if($Prev_Page) { echo " <a href=\"JavaScript:doCallAjax(document.getElementById('txtSearch').value,'$Prev_Page')\"><< Back</a> "; } for($i=1; $i<=$Num_Page; $i++){ if($i != $Page) { echo "[ <a href=\"JavaScript:doCallAjax(document.getElementById('txtSearch').value,'$i')\">$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Page) { echo " <a href=\"JavaScript:doCallAjax(document.getElementById('txtSearch').value,'$Next_Page')\">Next >></a> "; } ?> </center>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง