0byt3m1n1-V2
Path:
/
home
/
bangtoey
/
domains
/
bangtoey.go.th
/
public_html
/
news
/
[
Home
]
File: admin_search.php
<?php session_start(); if($_SESSION[user]==""){ session_destroy(); $message = "กรุณา Login ก่อน."; $url = "../admin/index.php"; include("../admin/alert.php"); exit; } require_once('../admin/Connections/conndb.php'); mysql_select_db($database_conndb, $conndb); if($s_name!="" && $s_cat==""){ $query_rsNews = "SELECT * FROM news_detail WHERE name LIKE '%$s_name%' ORDER BY id DESC, created"; } else if($s_name!="" && $s_cat!=""){ $query_rsNews = "SELECT * FROM news_detail WHERE name LIKE '%$s_name%' AND cat_id LIKE '$s_cat' ORDER BY id DESC, created"; } else if($s_name=="" && $s_cat!=""){ $query_rsNews = "SELECT * FROM news_detail WHERE cat_id LIKE '$s_cat' ORDER BY id DESC, created"; } else{ ?> <SCRIPT LANGUAGE="JavaScript"> alert("กรุณาใส่ข้อมูลที่ต้องการค้นหา"); history.back(); </script> <? } $rsNews = mysql_query($query_rsNews, $conndb) or die(mysql_error()); $row_rsNews = mysql_fetch_assoc($rsNews); $totalRows_rsNews = mysql_num_rows($rsNews); $query_rsCat = "SELECT * FROM news_category ORDER BY cat_id"; $rsCat = mysql_query($query_rsCat, $conndb) or die(mysql_error()); $row_rsCat = mysql_fetch_assoc($rsCat); $totalRows_rsCat = mysql_num_rows($rsCat); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><!-- InstanceBegin template="/Templates/template_a.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <script> function confirmDelete(delUrl) { if (confirm("ยืนยันการลบข้อมูล")) { document.location = delUrl; } } </script> <!-- InstanceEndEditable --> <?php require_once('../admin/Connections/conndb.php'); mysql_select_db($database_conndb, $conndb); ?> <title>องค์การบริหารส่วนตำบลบางเตย ที่อยู่ 8/8 หมู่2 ตำบลบางเตย อำเภอเมืองฉะเชิงเทรา จังหวัดฉะเชิงเทรา 24000 ::www.bangtoey.go.th</title> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"> <link href="../styles.css" rel="stylesheet" type="text/css"> <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable --> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; background-color: #3CFFFF; } --> </style> <!--styles --> <link href="../styles.css" rel="stylesheet" type="text/css" /> <link href="../css/Hover%20Buttons.css" rel="stylesheet" type="text/css"/> <link href="../css/Hoverable-Sidenav.css" rel="stylesheet" type="text/css"/> <!--<script src="https://platform-api.sharethis.com/js/sharethis.js#property=5d255a83d97c100012d80679&product='inline-share-buttons' async='async" type='text/javascript'> --> </script> <!--styles --> <!--menutop hover --> <link href="../imagehover.css-master/css/demo-page.css" rel="stylesheet" media="all"> <link href="../imagehover.css-master/css/imagehover.min.css" rel="stylesheet" media="all"> <link rel='shortcut icon' type='image/x-icon' href='/favicon.ico' /> <!--end --> <style type="text/css"> <!-- a:link { text-decoration: none; } a:visited { text-decoration: none; } a:hover { text-decoration: none; } a:active { text-decoration: none; } .style6 {color: #FFFFFF} --> </style></head> <body background="../images/0bg1.png" style="background-repeat:no-repeat; background-position:top"> <!--<div id="mySidenav" class="sidenav"> <a href="http://new.huayyai.go.th/index.php" id="about"> </a> <a href="http://new.huayyai.go.th/news.php?cat_id=1" id="blog"> </a> <a href="http://new.huayyai.go.th/news.php?cat_id=4" id="projects"> </a> <a href="http://new.huayyai.go.th/albums/index.php" id="contact"> </a> </div> --> <!-- content --> <div align="center"> <table width="950" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="top"><tr> <td height="650" align="center" valign="top" background="../images/head-1.png" style="background-repeat:no-repeat"><table width="980" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="515" align="center" valign="top"> </td> </tr> <tr> <td height="364" align="center" valign="top"><iframe src="/title_head.html" width="980" height="335" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe></td> </tr> <tr> <td align="center" valign="top"><iframe src="/menu-top.html" width="980" height="53" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe></td> </tr> <tr> <td height="150" align="center" valign="top"> </td> </tr> </table></td> </tr> </td> </tr> <tr> <td align="center" valign="top"><table width="980" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="top"> </td> </tr> <tr> <td align="center" valign="top"><!-- InstanceBeginEditable name="EditRegion3" --> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="0"> <tr> <td height="21" class="under"><div align="center" class="title2"> <? if($s_cat!=""){ $query_CatS = "SELECT * FROM news_category where cat_id =$s_cat"; $CatS = mysql_query($query_CatS, $conndb) or die(mysql_error()); $row_CatS = mysql_fetch_assoc($CatS); $cat_id=$row_CatS['cat_id']; echo $row_CatS['cat_name']; }else{ echo "ข้อมูลข่าวสาร สมาคม"; } ?> </div></td> </tr> <tr> <td class="head"> </td> </tr> <tr> <td class="styles1"><div align="right"><a href="../admin/main.php" class="styles2">หน้า Admin </a>| <a href="admin.php" class="styles2"> ดูทั้งหมด</a> | ค้นหาข้อมูล | <a href="add_category.php" class="styles2">เพิ่มหมวดหมู่</a> | <a href="add_detail.php?cat_id=<? echo $cat_id; ?>" class="styles2">เพิ่มข้อมูล</a> | <a href="../admin/signout.php" class="styles2">ออกจากระบบ </a></div></td> </tr> <tr> <td class="styles1"> </td> </tr> <tr> <td colspan="3" align="left" valign="top"><div align="left"> <table width="99%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="60%" class="styles3"><div align="left">ผลการค้น <span class="title"> <? if($s_cat!=""){ echo $row_CatS['cat_name']; }else{ echo "ไม่ได้เลือกหมวด"; } ?> - <? echo $s_name;?></span> เจอทั้งหมด<span class="title"> <?php echo $totalRows_rsNews; ?></span> รายการ </div></td> <td width="40%" valign="top"><div align="right"> <table width="99%" border="0" cellspacing="1" cellpadding="1"> <form action="admin_search.php" method="post" enctype="multipart/form-data" name="webForm" id="webForm"> <tr> <td width="50%"><div align="right"> <select name="s_cat" id="s_cat" style="width: 160px;"> <option value="" class="styles1"> -- เลือกหมวดหมู่-- </option> <?php do { ?> <option value="<? echo $row_rsCat['cat_id']; ?>" class="styles1" <? if($cat_id==$row_rsCat['cat_id']) echo "selected"?>> - <? echo $row_rsCat['cat_name']; ?></option> <?php } while ($row_rsCat = mysql_fetch_assoc($rsCat)); ?> </select> </div></td> <td width="40%"><div align="right"> <input name="s_name" type="text" class="styles4" id="s_name" style="width: 160px;" maxlength="100" /> </div></td> <td width="10%"><div align="left"> <input name="okbutton" type="image" title="ค้นหา" value="ค้นหา " src="images/btn.gif" /> </div></td> </tr> </form> </table> </div></td> </tr> </table> </div></td> </tr> <tr> <td class="styles1"> </td> </tr> <tr> <td colspan="3" align="left" valign="top"><div align="center"> <table width="98%" border="0" cellpadding="2" cellspacing="0"> <?php $pagesize=20; $totalpage=(int)($totalRows_rsNews/$pagesize); if(($totalRows_rsNews% $pagesize )!= 0){ $totalpage += 1; } if(isset($pageid)){ $start=$pagesize * ($pageid - 1); } else{ $pageid = 1; $start = 0 ; } if($totalRows_rsNews!="0"){ mysql_select_db($database_conndb, $conndb); //echo $query_rsNews; $sql=$query_rsNews." Limit $start ,$pagesize "; $res = mysql_query($sql, $conndb) or die(mysql_error()); if($pageid==1){ $jk=1; } else{ $a=$pageid * $pagesize; $jk=$a-$pagesize; } //echo " jk = ".$jk; while($c=mysql_fetch_object($res)){ ?> <tr> <td width="5%" valign="top" class="styles2"><div align="center"> <? if($pageid==1){ echo $jk; } else{ $ak=$jk+1; echo $ak; } ?> </div></td> <td width="85%" valign="top" class="styles1"><div align="left"><a href="detail.php?id=<? echo "$c->id";?>" class="styles2"><?php echo $c->name; ?></a> <?php if ($c->filename <> "") {?> <a href="doc_download/<?php echo $c->filename; ?>" target="_blank"><img src="images/download.gif" alt="ดาวน์โหลดเอกสาร" width="20" height="22" border="0" align="absmiddle" /></a> <?php } ?> <span class="detail-s"> [อ่าน <?php echo $c->click; ?> คน]</span> เมื่อ <? $d=explode("-",$c->d_date); $dd=$d[2]; $mm=$d[1]; switch($mm) { case "1": $printmonth = "ม.ค."; break; case "2": $printmonth = "ก.พ."; break; case "3": $printmonth = "มี.ค."; break; case "4": $printmonth = "เม.ย."; break; case "5": $printmonth = "พ.ค."; break; case "6": $printmonth = "มิ.ย."; break; case "7": $printmonth = "ก.ค."; break; case "8": $printmonth = "ส.ค."; break; case "9": $printmonth = "ก.ย."; break; case "10": $printmonth = "ต.ค."; break; case "11": $printmonth = "พ.ย."; break; case "12": $printmonth = "ธ.ค."; break; } $yyyy=$d[0]; $yy=$yyyy+543; echo $dd." ".$printmonth." ".$yy; ?> </div></td> <td width="5%" align="center"><div align="center"><a href="edit_detail.php?id=<?php echo $c->id ; ?>"><img src="images/edit.gif" alt="แก้ไข" width="13" height="13" border="0"></a></div></td> <td width="5%" align="center"><div align="center"><a href="javascript:confirmDelete('delete_detail.php?cat_id=<?php echo $c->cat_id ; ?>&id=<?php echo $c->id ; ?>')"><img src="images/delete.gif" alt="ลบหัวข้อ" width="18" height="18" border="0"></a><a href="javascript:confirmDelete('delete.php?news_id=<?php echo $c->customerid ; ?>')"></a></div></td> </tr> <?php $jk++; } } else { // Show if recordset empty ?> <tr> <td height="100" colspan="4" class="title"><div align="center">ยังไม่มีข้อมูล</div></td> </tr> <?php } // Show if recordset empty ?> </table> </div></td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td class="styles1" colspan="3"><div align="left">กำลังแสดงหน้า : <? for($i=1;$i<=$totalpage;$i++){ if($i==$pageid){ echo $i." "; } else{ echo "|<a href='admin_search.php?pageid=$i&s_name=".$s_name."&s_cat=".$s_cat."' class='styles2'>$i</a>| "; } } ?> </div></td> </tr> <tr> <td colspan="3"> </td> </tr> </table> <!-- InstanceEndEditable --></td> </tr> </table></td> </tr> <tr> <td align="center" valign="top"> </td> </tr> <tr> <td align="center" valign="top"> </td> </tr> <tr> <td align="center" valign="top" style="background-repeat:no-repeat"><img src="../images/foot.png"></td> </tr> </table> </div> <!-- end_content --> <tr><td><a style="display:scroll;position:fixed;bottom:5px;right:5px;" class="backtotop" href="#top" rel="nofollow" title="Back to Top"><img src="../images/up.png" border="0" /></a></td> </tr> <map name="Map6" id="Map6"><area shape="rect" coords="210,1,302,41" href="http://www.tratlocal.go.th/index.php" target="_blank" /> </map> </body> <!-- InstanceEnd --></html> <?php mysql_free_result($rsNews); if($conndb) { mysql_close($conndb); unset($conndb); } ?>
©
2018.