0byt3m1n1-V2
Path:
/
home
/
bangtoey
/
domains
/
bangtoey.go.th
/
public_html
/
webboard
/
admin
/
[
Home
]
File: admin.php
<?php session_start(); if($user==""){ $message = "กรุณา Login ก่อน."; $url = "../../admin/index.php"; include("../../admin/alert.php"); exit; } ?> <? include("../config.inc.php"); mysql_connect($host,$user_db,$passwd_db); mysql_query ("SET NAMES 'tis620'"); $c_sql1 = "select * from webboard_category "; $c_result1 = mysql_db_query($dbname,$c_sql1); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><!-- InstanceBegin template="/Templates/template_a.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <!-- 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" --> <script type="text/JavaScript"> <!-- function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } //--> </script> <!-- 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="98%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2" class="title2"><div align="center">สำหรับผู้ดูแลระบบ</div></td> </tr> <tr> <td colspan="2" class="link-b"> </td> </tr> <tr> <td width="30%" height="19" class="link-b"><div align="left"></div></td> <td width="70%" class="styles1"><div align="right"><a href="../../admin/main.php" class="styles2">หน้า Admin</a> | ลบกระทู้ | <a href="../../admin/signout.php" class="styles2">ออกจากระบบ</a> | </div></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><div align="left"> <SELECT name=board class="styles3" onChange="MM_jumpMenu('parent',this,0)"> <option value="" selected>== เลือกเว็บบอร์ดที่ต้องการ ==</option> <? $k=1; while( $cn = mysql_fetch_row( $c_result1 )) { ?> <option value="admin.php?Category=<? echo $cn[1]; ?>"><? echo $cn[2]; ?></option> <? $k++; } ?> </SELECT> </div></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2" class="red"><div align="center"> <? // table อธิบายความหมายของรูปคำถาม $chk_date = substr(date("Y-m-d H:i:s"),-19,-9); if (empty($page)){ $page=1; } // ติดต่อ database เพื่ออ่านข้อมูล // หาจำนวนหน้าทั้งหมด $sql = "select No from webboard_data where Category='$Category' and pst='0' "; $result = mysql_db_query($dbname,$sql); $NRow = mysql_num_rows($result); $rt = $NRow%$list_page; if($rt!=0) { $totalpage = floor($NRow/$list_page)+1; } else { $totalpage = floor($NRow/$list_page); } $goto = ($page-1)*$list_page; $w1 = "No"; $w2 = "No"; $w3 = "pageview"; $w4 = "Reply"; if ($sequence=="") { $lists = $w1; } elseif ($sequence=="No") { $lists = $w2; } elseif ($sequence=="pageview") { $lists = $w3; } elseif ($sequence=="Reply") { $lists = $w4; } else { } // Query ข้อมูลตามจำนวนที่กำหนด $sql = "select * from webboard_data where Category='$Category' and pst='0' order by $lists DESC limit $goto,$list_page"; $result = mysql_db_query($dbname,$sql); $NRow = mysql_num_rows($result); $sql2 = "select * from webboard_data where pst='1' order by No DESC limit 0,$list_news"; $result2 = mysql_db_query($dbname,$sql2); $NRow2 = mysql_num_rows($result2); if($NRow==0) { echo "<center>"; echo "<br><br>"; echo "<font size=2 face='MS Sans Serif'>ยังไม่มีคำถาม</font><br><br><br>\n"; echo "<center>"; } // แสดงหัวข้อของบอร์ด else { echo "<table width=100% border=0 bgcolor=#000000 cellspacing=0 cellpadding=0>\n"; echo "<table width=100% border=0 cellspacing=1 cellpadding=3 bgcolor=#CCCCCC>\n"; echo "<tr bgcolor=#CCCCCC height=25>\n"; echo "\t<td align=center width=11% class=styles background=../../images/bg4.gif>คำถามที่</td>\n"; echo "\t<td align=center width=64% class=styles background=../../images/bg4.gif>หัวข้อคำถาม</td>\n"; echo "\t<td align=center width=10% class=styles background=../../images/bg4.gif>เข้าชม</td>\n"; echo "\t<td align=center width=10% class=styles background=../../images/bg4.gif>ผู้ตอบ</td>\n"; echo "\t<td align=center width=5% class=styles background=../../images/bg4.gif>ลบ</td>\n"; echo "</tr>\n\n"; echo "</table>\n"; echo "<table width=100% border=0 cellpadding=0 cellspacing=1 bgcolor=#CCCCCC><tr><td>\n"; echo "<table width=100% border=0 cellspacing=0 cellpadding=3 bgcolor=#FFFFFF>\n"; echo "<tr>\n"; echo "</tr>\n\n"; $j=1; // วนลูปแสดงข้อมูลที่อ่านได้ while ($row2 = mysql_fetch_array($result2)) { // กำหนดค่าตัวแปร 2 $No2 = sprintf("%05d",$row2["No"]); $Question2 = $row2["Question"]; $Name2 = $row2["Name"]; $Namer2 = $row2["Namer"]; $Member2 = $row2["Member"]; $Memberr2 = $row2["Memberr"]; $nphoto2 = $row2["nphoto"]; $Date2 = trim(substr($row2["Date"],-19,-9)); // แสดงเฉพาะวันที่ $Dated2 = $row2["Date"]; $Reply2 = $row2["Reply"]; $ReplyDate2 = trim(substr($row2["ReplyDate"],-19,-9)); $pageviewdata2 = $row2["pageview"]; // เช็คว่าเป็นสมาชิกไหม $sql3 = "select * from webboard_member where User='$Name2'"; $result3 = mysql_db_query($dbname,$sql3); $row3 = mysql_fetch_array($result3); // กำหนดค่าตัวแปร เพื่อนำไปแสดง $icons3 = $row3["icons"]; echo "<tr><td align=center width=11% class=styles><img src='../pic/pin_topic.gif'> <b>xxxxx</b></td>"; echo "<td width=57% class=styles><a href='show.php?Category=$Category&No=$row2[No]' class=styles2>$Question2</a><br>โดย : <span class=styles2>$Name2</span เมื่อ : <span class=styles2>$Dated2</span></td>"; if($Member2) { echo "<td width=7%><center><img src='../pic/avartar/$icons3'></center></td>"; } else { echo "<td width=7%> </td>"; } echo "<td width=10% class=styles1><center>$pageviewdata2</center></td>"; echo "<td width=10% class=styles1><center>$Reply2</center></td>"; echo "\t<td width=5% class=styles1><center><a href=deltopic.php?Category=$Category&No=$row2[No] onClick='return Q_confirm1(\"$row2[No]\");'><img src='../pic/delete.gif' border=0></a></center></td>\n"; echo "</tr>"; echo "<TR bgColor=#ffffff><TD colspan=6 align=middle><table width=100% border=0 cellspacing=0 cellpadding=0>"; echo "<tr><td bgcolor=#CCCCCC class=styles2><img src=../pic/0.gif width=1 height=1></td></tr></table></TD></TR>"; $j++; } $i=1; // วนลูปแสดงข้อมูลที่อ่านได้ while ($row = mysql_fetch_array($result)) { // กำหนดสีของตาราง เพื่อให้มีการสลับสี //$bgc = ($bgc=="lightcyan") ? "powderblue" : "lightcyan"; $bgc = ($bgc==$rowColor1) ? $rowColor2 : $rowColor1; // กำหนดค่าตัวแปร 1 $No = sprintf("%05d",$row["No"]); $Question = $row["Question"]; $Name = $row["Name"]; $Namer = $row["Namer"]; $Member = $row["Member"]; $Memberr = $row["Memberr"]; $nphoto = $row["nphoto"]; $Date = trim(substr($row["Date"],-19,-9)); // แสดงเฉพาะวันที่ $Dated = $row["Date"]; $Reply = $row["Reply"]; $ReplyDate = trim(substr($row["ReplyDate"],-19,-9)); $pageviewdata = $row["pageview"]; // เช็คว่าเป็นสมาชิกไหม $sql1 = "select * from webboard_member where User='$Name'"; $result1 = mysql_db_query($dbname,$sql1); $NRow1 = mysql_num_rows($result1); $row1 = mysql_fetch_array($result1); // กำหนดค่าตัวแปร เพื่อนำไปแสดง $icons = $row1["icons"]; // แสดงเฉพาะวันที่ if($Date==$chk_date) { echo "<tr bgcolor=$rowHiLight>\n"; }else { echo "<tr bgcolor=$bgc>\n"; } // แสดงรูป folder ////new if($Reply>="10" ) { echo "\t<td align=center width=11% class=styles1><img src='../pic/hotfd.gif'> $No</td>\n"; } elseif($ReplyDate!="") { echo "\t<td align=center width=11% class=styles1><img src='../pic/openfd.gif'> $No</td>\n"; } elseif($Date==$chk_date) { echo "\t<td align=center width=11% class=styles1><img src='../pic/newfd.gif'> $No</td>\n"; } else { echo "\t<td align=center width=11% class=styles1><img src='../pic/closefd.gif'> $No</td>\n"; } if(($ReplyDate==$chk_date)&&($nphoto!='')&&($Date==$chk_date)) { echo "\t<td width=57% class=styles1><a href='show.php?Category=$Category&No=$row[No]' class=styles2>$Question</a> <img src='../pic/cam.gif' border=\"0\"><img src='../pic/new2day.gif' border=\"0\"> <img src='../pic/update2day.gif' border=\"0\"></font><br>โดย : <font color=red>$Name</font> เมื่อ : $Dated</td>\n"; } elseif(($ReplyDate==$chk_date)&&($nphoto!='')) { echo "\t<td width=57% class=styles1><a href='show.php?Category=$Category&No=$row[No]' class=styles2>$Question</a> <img src='../pic/cam.gif' border=\"0\"><font color=red size='2'> <img src='../pic/update2day.gif' border=\"0\"></font><br>โดย : <font color=red>$Name</font> เมื่อ : $Dated</td>\n"; } elseif(($ReplyDate==$chk_date) &&($Date==$chk_date)) {echo "\t<td width=57% class=styles1><a href='show.php?Category=$Category&No=$row[No]' class=styles2>$Question</a> <font color=red size='2'> <img src='../pic/new2day.gif' border=\"0\"> <img src='../pic/update2day.gif' border=\"0\"></font><br>โดย : <font color=red>$Name</font> เมื่อ : $Dated</td>\n"; } elseif($ReplyDate==$chk_date) {echo "\t<td width=57% class=styles1><a href='show.php?Category=$Category&No=$row[No]' class=styles2>$Question</a> <font color=red size='2'> <img src='../pic/update2day.gif' border=\"0\" align=absmiddle></font><br>โดย : <font color=red>$Name</font> เมื่อ : $Dated</td>\n"; } elseif(($nphoto!='') &&($Date==$chk_date)) {echo "\t<td width=57% class=styles1><a href='show.php?Category=$Category&No=$row[No]' class=styles2>$Question </a><img src='../pic/new2day.gif' border=\"0\"> <img src='../pic/cam.gif' border=\"0\"><br>โดย : <font color=red>$Name</font> เมื่อ : $Dated</td>\n"; } elseif($nphoto!='') {echo "\t<td width=57% class=styles1><a href='show.php?Category=$Category&No=$row[No]' class=styles2>$Question </a> <img src='../pic/cam.gif' border=\"0\"><br>โดย : <font color=red>$Name</font> เมื่อ : $Dated</td>\n"; } else if($Date==$chk_date) {echo "\t<td width=57% class=styles1><a href='show.php?Category=$Category&No=$row[No]' class=styles2>$Question </a> <img src='../pic/new2day.gif' border=\"0\"><br>โดย : <font color=red>$Name</font> เมื่อ : $Dated</td>\n"; } else{ echo "\t<td width=62% class=styles1><a href='show.php?Category=$Category&No=$row[No]' class=\"styles2\">$Question</a><br>โดย : <font color=red>$Name</font> เมื่อ : $Dated</td>\n"; } echo "\t<td width=10% class=styles1><center>$pageviewdata</center></td>\n"; echo "\t<td width=10% class=styles1><center>$Reply</center></td>\n"; echo "\t<td width=5% class=styles1><center><a href=deltopic.php?Category=$Category&No=$row[No] onClick='return Q_confirm(\"$row[No]\");'><img src='../pic/delete.gif' border=0></a></center></td>\n"; if ($NRow > $i) { echo "<TR bgColor=#ffffff><TD colspan=6 align=middle><table width=100% border=0 cellspacing=0 cellpadding=0>"; echo "<tr><td bgcolor=#CCCCCC><img src=../pic/0.gif width=1 height=1></td></tr></table></TD></TR>"; } else { echo "<tr><td bgcolor=#FFFFFF><img src=../pic/0.gif width=1 height=1></td></tr>"; } $i++; } echo "</table>\n\n"; echo "</td></tr></table>\n"; // table อธิบายความหมายของรูป echo "<table width=98% border=0 bordercolor=black cellspacing=0 cellpadding=2>\n"; echo "<tr><td align=left class=styles1>\n"; echo "\t<img src='../pic/pin_topic.gif'> - ข่าวประกาศ \n"; echo "\t <img src='../pic/newfd.gif'> - คำถามใหม่ \n"; echo "\t <img src='../pic/closefd.gif'> - คำถามเก่า \n"; echo "\t <img src='../pic/openfd.gif'> - คำถามที่ถูกตอบแล้ว\n"; echo "\t <img src='../pic/hotfd.gif'> - คำถามที่มีคนตอบมาก\n"; echo "\t <img src='../pic/cam.gif'> - คำถามที่มีรูป\n"; echo "</td></tr>\n"; echo "</table>\n\n"; // table แสดงเลขหน้า echo "<table width=98% border=0 bordercolor=black cellspacing=0 cellpadding=2>\n"; echo "<tr><td align=left class=styles1>\n"; echo "\t<font size=2 color=#9400D3>\n"; #################################### $r1 = ""; $r2 = "&sequence=$sequence"; if ($sequence=="") { $lists1 = $r1; } else { $lists1 = $r2; } // สร้าง link เพื่อไปหน้าก่อน-หน้าถัดไป if($page>1 && $page<=$totalpage) { $prevpage = $page-1; echo "\t<a href='admin.php?Category=$Category$lists1&page=$prevpage' class=styles2>[หน้าก่อน = $prevpage]</a>\n"; } echo "\t กำลังแสดงหน้าที่ $page/$totalpage \n"; if($page!=$totalpage) { $nextpage = $page+1; echo "\t<a href='admin.php?Category=$Category$lists1&page=$nextpage' class=styles2>[หน้าถัดไป = $nextpage]</a>\n"; } echo "\t</font>\n"; echo "</td></tr>\n"; echo "<tr><td>\n"; // วนลูปแสดงเลขหน้าทั้งหมด for($i=1 ; $i<$page ; $i++) { echo "\t<a href='admin.php?Category=$Category$lists1&page=$i' class=styles2>$i</a> \n"; } echo "\t<font size=2 color=red><b>$page</b></font> \n"; for($i=$page+1 ; $i<=$totalpage ; $i++) { echo "\t<a href='admin.php?Category=$Category$lists1&page=$i' class=styles2>$i</a> \n"; } echo "</td></tr>\n"; echo "</table>\n"; } //mysql_close(); ?> </div></td> </tr> <tr> <td colspan="2"> </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>
©
2018.