0byt3m1n1-V2
Path:
/
home
/
bangtoey
/
domains
/
bangtoey.go.th
/
public_html
/
webboard
/
[
Home
]
File: admin.php
<? session_start(); if($user==""){ $message = "กรุณา Login ก่อน."; $url = "../admin/index.php"; include("../admin/alert.php"); exit; } ?> <!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" --><!-- 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="750" border=0 cellpadding=0 cellspacing=0 > <TR> <TD class="title2"><div align="center"><img src="../images/botton/borad.png" width="640" height="78"></div></TD> </TR> <TR> <td align="left" 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 valign="top"> </TD> </TR> <TR> <TD valign="top"><div align="center"> <? include("./config.inc.php"); //ตั้งค่าต่างๆของเวปบอร์ด include("./function.php"); //ฟังก์ชั่นที่ใช้ในเวปบอร์ด if (empty($sequence)) { $selected[0]=selected; } if ($sequence == 1) { $selected[1]=selected; } if ($sequence == 2) { $selected[2]=selected; } ?> <? if (empty($page)){ $page=1; } $stop = $page * $list_page; $start = $stop - $list_page; if(file_exists($fileQuestion)) { $question = file($fileQuestion); // เรียงตาม ( วันที่ ) ที่มีคนตอบ if($sequence==1){ for ($i=0 ; $i<(sizeof($question)-1); $i++) { for ($j=0 ; $j<(sizeof($question)-1); $j++) { // แยกข้อมูลในแต่ละบรรทัด ออกเป็นฟิลด์ย่อย $split = explode("|X|",$question[$j]); $split1 = explode("|X|",$question[$j+1]); if($split1[6] >= $split[6]){ $swap = $question[$j]; $question[$j] = $question[$j+1]; $question[$j+1] = $swap; } //จบ if } //จบ for j } //จบ for i } //จบ if $sequence .. 1 // เรียงตามจำนวนคนตอบ if($sequence==2){ for ($i=0 ; $i<(sizeof($question)-1); $i++) { for ($j=0 ; $j<(sizeof($question)-1); $j++) { // แยกข้อมูลในแต่ละบรรทัด ออกเป็นฟิลด์ย่อย $split = explode("|X|",$question[$j]); $split1 = explode("|X|",$question[$j+1]); //======================================== // วนลูปอ่านข้อมูลหาจำนวนผู้เข้าชม และวันที่ล่าสุดที่ตอบคำถาม $fileVisitor = "./$dataDir/$split[0].dat"; if(file_exists($fileVisitor)) { $lineVisitor = file($fileVisitor); // แยกข้อมูลในแต่ละบรรทัด ออกเป็นฟิลด์ย่อย $chkVisitor = explode("||",$lineVisitor[0]); $ReplyNum = $chkVisitor[0]; //จำนวนผู้ตอบคำถาม } $fileVisitor = "./$dataDir/$split1[0].dat"; if(file_exists($fileVisitor)) { $lineVisitor = file($fileVisitor); // แยกข้อมูลในแต่ละบรรทัด ออกเป็นฟิลด์ย่อย $chkVisitor = explode("||",$lineVisitor[0]); $ReplyNum1 = $chkVisitor[0]; //จำนวนผู้ตอบคำถาม }//======================================== if($ReplyNum1 >= $ReplyNum){ $swap = $question[$j]; $question[$j] = $question[$j+1]; $question[$j+1] = $swap; } //จบ if } //จบ for j } //จบ for i } //จบ if $sequence .. 2 //จำนวนหัวข้อคำถาม $All_Q = sizeof($question); // แสดงจำนวนของกระทู้ทั้งหมด และที่เป็นตารางเพราะสืบเนื่องมาจากตารางก่อนหน้านี้ echo "<table width=98%><tr>"; echo "<td width='44%' class='styles3'>จํานวนหัวข้อทั้งหมด<b><font color=red> $All_Q </font></b>หัวข้อ</td>"; echo "</tr>"; echo "</table><br>"; // แสดงหัวข้อต่างๆ ของตารางแสดงกระทู้ echo "<TABLE align=center cellSpacing=0 cellPadding=0 width=98% border=0 bgcolor=#000000>"; echo "<TR><TD>"; echo "<table width='100%' border=0 cellpadding=3 cellspacing=1 align='center'>"; echo "<tr bgcolor=$headColor>"; echo "<td align=center width=9% class=title3 background=\"../images/bg4.gif\">หัวข้อที่</td>\n"; echo "<td align=center width=47% class=title3 background=\"../images/bg4.gif\">หัวข้อ</td>\n"; echo "<td align=center width=27% class=title3 background=\"../images/bg4.gif\">ผู้ตั้งกระทู้ [วันที่ตั้ง]</td>\n"; echo "<td align=center width=7% class=title3 background=\"../images/bg4.gif\">ตอบ</td>\n"; echo "<td align=center width=10% class=title3 background=\"../images/bg4.gif\">ลบ</td>\n"; echo "</tr>\n\n"; for ($i=$start ; $i<$All_Q ; $i++) { if($i<$stop){ // แยกข้อมูลในแต่ละบรรทัด ออกเป็นฟิลด์ย่อย $split = explode("|X|",$question[$i]); $numQuestion = $split[0]; // หมายเลขคำถามที่ไม่มีเลข ศูนย์ นำหน้า $Question = $split[1]; //คำถาม $Name = $split[2]; //ผู้ถาม $Date = trim($split[3]); //วันที่ถาม $NumReplyDate = $split[6]; //วันที่ตอบคำถามล่าสุด (ค่าเป็นวินาทีนับจากปี ค.ศ. 1900) // เพิ่มเลข ศูนย์ หน้าหมายเลขคำถาม 4 ตัว $No = sprintf("%04d",$split[0]); // หาจำนวนผู้ตอบทั้งหมด $countR = CountReply($numQuestion); // เป็นตัวบอกว่ามีจำนวนคนตอบกี่คน // วนลูปอ่านข้อมูลหาจำนวนผู้เข้าชม และวันที่ล่าสุดที่ตอบคำถาม $fileVisitor = "./$dataDir/$numQuestion.dat"; if(file_exists($fileVisitor)) { $lineVisitor = file($fileVisitor); // แยกข้อมูลในแต่ละบรรทัด ออกเป็นฟิลด์ย่อย $chkVisitor = explode("||",$lineVisitor[0]); $ReplyDate = $chkVisitor[2]; //วันที่ตอบคำถามล่าสุด } // กำหนดสีของตาราง เพื่อให้มีการสลับสี ค่าของตัวแปร $rowColor อยู่ในไฟล์ config $bgc = ($bgc==$rowColor1) ? $rowColor2 : $rowColor1; // ตรวจสอบว่ามีรูปอยู่ในกระทู้หรือเปล่า $imgOK= (CheckImage($numQuestion)==1) ? "<img src='./pic/cam.gif'>" : ""; //ตรวจสอบคนตอบ ในวันนี้ if($Logtime<=($NumReplyDate+86400)) { //86400 วินาที = หนึ่งวัน echo "<tr bgcolor=$rowHiLight>\n"; $chknew="<font color=666666>(มีผู้ตอบวันนี้)</font>"; }else { echo "<tr bgcolor=$bgc>\n"; $chknew=""; } // กำหนดภาพ icon หน้าหมายเลขกระทู้ // ถ้าต้องการให้ icon ของคำถามฮอต แสดงที่จำนวนคนตอบ ที่เท่าไหร่ก็เปลี่ยนตัวเลขเองนะครับ (ในที่นี้คือตอบตั้งแต่ 10 คนขึ้นไป) if($ReplyDate!="-") { $icon = ($countR>=10) ? "<img src='./pic/hotfd.gif'>" : "<img src='./pic/openfd.gif'>"; } else { $icon = ($Date==$mdate) ? "<img src='./pic/newfd.gif'>" : "<img src='./pic/closefd.gif'>"; } // แสดงคำถาม echo "<td align='center' class='styles1'> $icon <b>$No</b></td>\n"; echo "<td><a href='./admindel_reply.php?No=$numQuestion' class='styles2'> $Question</a></td>\n"; echo "<td class='styles1'><b> $Name </b>[$Date]</td>\n"; echo "<td align='center' class='styles1'>$countR</td>\n"; echo "<td align=center ><a href=\"./edit.php?key=$key&select=0&admin_Q=$numQuestion\">\n"; echo "<img src=\"./pic/delete.gif\" border=0 alt=\"ลบกระทู้หมายเลข $No\"></a></td>\n"; echo "</tr>\n\n"; } // end if } // end for // ปิดตารางแสดงผลกระทู้ echo "</table>\n"; echo "</TD></TR>\n"; echo "</TABLE>\n"; $rt = $All_Q%$list_page; if($rt!=0) { $totalpage = floor($All_Q/$list_page)+1; } else { $totalpage = floor($All_Q/$list_page); } echo "<table width='98%' border=0 cellpadding=2 cellspacing=0 align='center'><tr><td valign=top colspan='5' class='styles3'>\n"; echo "<img src='./pic/newfd.gif'> = กระทู้ใหม่ \n"; echo "<img src='./pic/closefd.gif'> = กระทู้ที่ยังไม่มีคนตอบ \n"; echo "<img src='./pic/openfd.gif'> = กระทู้ที่ถูกตอบแล้ว \n"; echo "<img src='./pic/hotfd.gif'> = กระทู้สุดฮอต \n"; echo "</td><td align=right>\n"; echo "</td></tr>\n\n"; echo "<tr><td valign=top colspan='5' class='styles3'>\n"; // สร้าง link เพื่อไปหน้าก่อน-หน้าถัดไป if($page>1 && $page<=$totalpage) { $prevpage = $page-1; echo "[<a href='./admin.php?key=$key&page=$prevpage'>หน้าก่อน = $prevpage</a>] \n"; } echo "<font color=green>กำลังแสดงหน้าที่ $page/$totalpage</font>\n"; if($page!=$totalpage) { $nextpage = $page+1; echo " [<a href='./admin.php?key=$key&page=$nextpage'>หน้าถัดไป = $nextpage</a>]\n"; } echo "<br>[ <b>"; // วนลูปแสดงเลขหน้าทั้งหมด for($i=1 ; $i<$page ; $i++) { echo "<a href='./admin.php?key=$key&page=$i'>$i</a> \n"; } echo "<font color=red>$page</font> \n"; for($i=$page+1 ; $i<=$totalpage ; $i++) { echo "<a href='./admin.php?key=$key&page=$i'>$i</a>\n"; } echo "</b> ]</td></tr></table>\n\n"; } // ถ้าไม่มีไฟล์ หัวข้อคำถาม ให้ทำตามนี้ else { echo "</table>"; // ปิดตารางของข้อความ [ ตั้งกระทู้ใหม่ | กลับหน้าแรก ] ที่อยู่ในแทก html echo "<br><br><font color=red ><b>\n"; echo "<p align=center>ยังไม่มีหัวข้อเสวนา<br></p></b>\n"; echo "</font> <br><br>\n\n"; } ?> </div></TD> </TR> <TR> <TD> <div align="center"></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.