0byt3m1n1-V2
Path:
/
home
/
bangtoey
/
domains
/
bangtoey.go.th
/
public_html
/
webboard
/
[
Home
]
File: webboard.php.bak
<!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> เทศบาลตำบลพวา ถนนบ่อไฟไหม้ - หนองเจ๊กสร้อย อำเภอแก่งหางแมว จังหวัดจันทบุรี 22160 </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 --> <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"> <!-- content --> <div align="center"> <table width="950" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="top"><tr> <td align="center" valign="top"><table width="980" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="780" colspan="3" align="center" valign="top"> </td> </tr> <tr> <td width="222" align="center" valign="top"> </td> <td width="669" align="center" valign="top"><div align="left"><marquee direction="up" behavior="slide" scrollamount="4"><img src="../images/name-office.png" width="629" height="68"></marquee></div></td> <td width="89" align="center" valign="top"> </td> </tr> <tr> <td align="center" valign="top"> </td> <td align="center" valign="top"><div align="left"><marquee direction="down" behavior="slide" scrollamount="1"><img src="../images/name-office2.png" width="302" height="36"></marquee></div></td> <td align="center" valign="top"> </td> </tr> <tr> <td colspan="3" align="center" valign="top"><table width="980" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="top"> <div class="hover13 column"> <div> <figure> <a href="/index.php"><img src="../images/top-menu_01.png" width="136" height="53" border="0"></a> </figure> </div> </td> <td align="center" valign="top"><div class="hover13 column"> <div> <figure> <a href="/news.php?cat_id=1"> <img src="../images/top-menu_02.png" width="186" height="53" border="0"></a> </figure> </div> </td> <td align="center" valign="top"> <div class="hover13 column"> <div> <figure> <a href="/news.php?cat_id=2"> <img src="../images/top-menu_03.png" width="168" height="53" border="0"></a> </figure> </div> </td> <td align="center" valign="top"> <div class="hover13 column"> <div> <figure> <a href="/albums/index.php"> <img src="../images/top-menu_04.png" width="169" height="53" border="0"></a> </figure> </div> </td> <td align="center" valign="top"> <div class="hover13 column"> <div> <figure> <a href="/contacts/?scon_id=1" target="_blank"> <img src="../images/top-menu_05.png" width="176" height="53" border="0"></a> </figure> </div></td> <td align="center" valign="top"> <div class="hover13 column"> <div> <figure> <a href="/news.php?cat_id=14" target="_blank"><img src="../images/top-menu_06.png" width="145" height="53" border="0"></a> </figure> </div></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td align="center" valign="top"> </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"> </td> </tr> <tr> <td align="center" valign="top"><!-- InstanceBeginEditable name="EditRegion3" --> <table width="98%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><div align="center"><img src="../images/botton/borad.png" width="640" height="78"></div></td> </tr> <tr> <td> </td> </tr> <tr> <td><div align="center"><? include("config.inc.php"); // เช็คหมวดของเว็บบอร์ด mysql_connect($host,$user_db,$passwd_db); mysql_query ("SET NAMES 'tis620'"); $c_sql = "select * from webboard_category where cat_name='$Category' "; $c_result = mysql_db_query($dbname,$c_sql); $c_NRow = mysql_num_rows($c_result); $c_row = mysql_fetch_array($c_result); $nlist = $c_row["cat_title"]; $logo = $c_row["cat_logo"]; if($c_NRow==0) { echo "<center><br>"; echo "<font color=red size=+1> กรุณาระบุ Category ให้ตรงกับที่ web เปิดใช้ด้วยครับ</font>"; echo "<br>"; echo "</center>"; exit(); } // ตัวเช็คหมวดเว็บบอร์ด $c_sql1 = "select * from webboard_category "; $c_result1 = mysql_db_query($dbname,$c_sql1); mysql_close // จบการเช็ค ?> </div></td> </tr> <tr> <td height="30" class="title2"><div align="center"><? echo $nlist; ?></div></td> </tr> <tr> <td><div align="left"><a href="postq.php?Category=<? echo $Category; ?>" class="styles2">ตั้งคำถามใหม่</a></div></td> </tr> <tr> <td><div align="right" class="title"><form method=post action="search.php?Category=<? echo $Category; ?>" name="SearchForm" onSubmit="return check()"> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td width="45%" class="styles1"> <div align="left"><font size="2" face="MS Sans Serif, Tahoma, sans-serif"><img src='../pic/new2day.gif' border=0> - คำถามที่มีคนตั้งใหม่วันนี้ <img src='pic/update2day.gif' border=0 align="absmiddle"> - คำถามที่มีคนตอบวันนี้ </font></div></td> <td width="55%" class="title"><div align="right"><img src="pic/find.gif" align="absmiddle"> ค้นหา <input name="search" type=text class="styles3" onClick="document.SearchForm.search.value=''" value="พิมพ์คำค้นหาที่นี่" size=20 maxlength=100> <select name=searchtype class="styles3"> <option value=wb_topic selected>ค้นหาจากหัวข้อกระทู้</option> <option value=wb_detail>ค้นหาจากข้อความ</option> <option value=wb_sender>ค้นหาจากผู้ตั้ง</option> <option value=wb_id>ค้นหาจากหมายเลขกระทู้</option> </select> <input name="Submit" type="submit" class="styles3" value="ค้นหา"> </div></td> </tr> </table> </form> </div></td> </tr> <tr> <td><div align="center"> <? // table อธิบายความหมายของรูปคำถาม $chk_date = substr(date("Y-m-d H:i:s"),-19,-9); if (empty($page)){ $page=1; } // ติดต่อ database เพื่ออ่านข้อมูล // หาจำนวนหน้าทั้งหมด mysql_connect($host,$user_db,$passwd_db); mysql_query ("SET NAMES 'tis620'"); $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"; $w5 = "ReplyDate"; if ($sequence=="") { $lists = $w1; } elseif ($sequence=="No") { $lists = $w2; } elseif ($sequence=="pageview") { $lists = $w3; } elseif ($sequence=="Reply") { $lists = $w4; } elseif ($sequence=="ReplyDate") { $lists = $w5; } 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=98% border=0 bgcolor=#000000 cellspacing=0 cellpadding=0>\n"; echo "<table width=98% border=0 cellspacing=1 cellpadding=3 bgcolor=#CCCCCC>\n"; echo "<tr bgcolor=#FF9900>\n"; echo "\t<td align=center width=11% background=../images/bg4.gif class=styles height=25>คำถามที่</td>\n"; echo "\t<td align=center width=69% background=../images/bg4.gif class=styles>หัวข้อคำถาม</td>\n"; echo "\t<td align=center width=10% background=../images/bg4.gif class=styles>เข้าชม</td>\n"; echo "\t<td align=center width=10% background=../images/bg4.gif class=styles>ผู้ตอบ</td>\n"; echo "</tr>\n\n"; echo "</table>\n"; echo "<table width=98% 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=styles1><img src='pic/pin_topic.gif'> <b>xxxxx</b></td>"; echo "<td width=62% class=styles1><a href='show.php?Category=$Category&No=$row2[No]' target='$No2'><font color=red>$Question2</font></a></font><br>โดย : <font color=green>$Name2</font> เมื่อ : $Dated2</td>"; if($Member2) { echo "<td width=7% class=styles1><center><img src='pic/avartar/$icons3'></center></td>"; } else { echo "<td width=7% class=styles1> </td>"; } echo "<td width=10% class=styles1><center>$pageviewdata2</center></td>"; echo "<td width=10% class=styles1><center>$Reply2</center></td>"; echo "</tr>"; echo "<TR bgColor=#ffffff><TD colspan=5 align=middle class=styles1><table width=100% border=0 cellspacing=0 cellpadding=0>"; echo "<tr><td bgcolor=#CCCCCC class=styles1><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); $row1 = mysql_fetch_array($result1); // กำหนดค่าตัวแปร เพื่อนำไปแสดง $icons = $row1["icons"]; // แสดงเฉพาะวันที่ if($Date==$chk_date) { echo "<tr bgcolor=$rowHiLight>\n"; }else { echo "<tr bgcolor=$bgc>\n"; } // เช็ตประเภทของไฟล์ if(substr($nphoto,-3,3)=="swf") { $picc = "flash.gif"; } else { $picc = "cam.gif"; } // แสดงรูป 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=62% class=styles1><a href='show.php?Category=$Category&No=$row[No]' target='$No' class=\"styles2\">$Question</a> <img src='pic/$picc' 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=62% class=styles1><a href='show.php?Category=$Category&No=$row[No]' target='$No' class=\"styles2\">$Question</a> <img src='pic/$picc' 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=62% class=styles1><a href='show.php?Category=$Category&No=$row[No]' target='$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=62% class=styles1><a href='show.php?Category=$Category&No=$row[No]' target='$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=62% class=styles1><a href='show.php?Category=$Category&No=$row[No]' target='$No' class=\"styles2\">$Question </a><img src='pic/new2day.gif' border=\"0\"> <img src='pic/$picc' border=\"0\"><br>โดย : <font color=red>$Name</font> เมื่อ : $Dated</td>\n"; } elseif($nphoto!='') {echo "\t<td width=62% class=styles1><a href='show.php?Category=$Category&No=$row[No]' target='$No' class=\"styles2\">$Question </a> <img src='pic/$picc' border=\"0\"><br>โดย : <font color=red>$Name</font> เมื่อ : $Dated</td>\n"; } elseif($Date==$chk_date) {echo "\t<td width=62% class=styles1><a href='show.php?Category=$Category&No=$row[No]' target='$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]' target='$No' class=\"styles2\">$Question</a><br>โดย : <font color=red>$Name</font> เมื่อ : $Dated</td>\n"; } if($Member) { echo "\t<td width=7% class=styles1><center><img src='pic/avartar/$icons'></center></td>\n"; } else { echo "\t<td width=7% class=styles1> </td>\n"; } echo "\t<td width=10% class=styles1><center>$pageviewdata</center></td>\n"; echo "\t<td width=10%><center class=styles1>$Reply</center></td>\n"; if ($NRow > $i) { echo "<TR bgColor=#ffffff><TD colspan=5 align=middle class=styles1><table width=100% border=0 cellspacing=0 cellpadding=0>"; echo "<tr><td bgcolor=#CCCCCC class=styles1><img src=pic/0.gif width=1 height=1></td></tr></table></TD></TR>"; } else { echo "<tr><td bgcolor=#FFFFFF class=styles1><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=styles3>\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 "\t <img src='pic/flash.gif' align=absmiddle> - คำถามที่มีไฟล์ Flash\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='webboard.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='webboard.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='webboard.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='webboard.php?Category=$Category$lists1&page=$i' class='styles2'>$i</a> \n"; } echo "</td></tr>\n"; echo "</table>\n"; } ?> </div></td> </tr> <tr> <td><div align="right"><FORM name=select_board action=webboard.php method=post> <table width="400" border="0" cellspacing="2" cellpadding="2"> <tr> <td> <div align="right"> <select name=board class="styles3" id="board" onChange="MM_jumpMenu('parent',this,0)"> <option selected>== เลือกการแสดงผล ==</option> pageview <option value="webboard.php?Category=<? echo $Category; ?>&sequence=No">เรียงตามหมายเลขคำถาม</option> <option value="webboard.php?Category=<? echo $Category; ?>&sequence=pageview">เรียงตามจำนวนเข้าชม</option> <option value="webboard.php?Category=<? echo $Category; ?>&sequence=Reply">เรียงตามจำนวนผู้ตอบ</option> <option value="webboard.php?Category=<? echo $Category; ?>&sequence=ReplyDate">เรียงตามผู้ตอบล่าสุด</option> </select> <SELECT name=select class="styles3" onChange="MM_jumpMenu('parent',this,0)"> <option value="" selected>== เลือกเว็บบอร์ดที่ต้องการ ==</option> <? $k=1; while( $cn = mysql_fetch_row( $c_result1 )) { ?> <option value="webboard.php?Category=<? echo $cn[1]; ?>"><? echo $cn[2]; ?></option> <? $k++; } mysql_close(); ?> </SELECT> <SCRIPT language=JavaScript> <!-- function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } //--> </SCRIPT> </div></td> </tr> </table> </form> </div></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.