<a href="user_page.php?id=15"><font size="3"><strong>ตั้งกระทู้ใหม่</strong></font></a> <? include('config.inc.php'); $strSQL = "SELECT * FROM webboard "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $Num_Rows = mysql_num_rows($objQuery); $Per_Page = 10; // Per Page $Page = $_GET["Page"]; if(!$_GET["Page"]) { $Page=1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_Start = (($Per_Page*$Page)-$Per_Page); if($Num_Rows<=$Per_Page) { $Num_Pages =1; } else if(($Num_Rows % $Per_Page)==0) { $Num_Pages =($Num_Rows/$Per_Page) ; } else { $Num_Pages =($Num_Rows/$Per_Page)+1; $Num_Pages = (int)$Num_Pages; } $strSQL .=" order by QuestionID DESC LIMIT $Page_Start , $Per_Page"; $objQuery = mysql_query($strSQL); ?> <table width="820" border="1"> <tr> <th width="80"> <div align="center">QuestionID</div></th> <th width="428"> <div align="center">Question</div></th> <th width="90"> <div align="center">Name</div></th> <th width="130"> <div align="center">CreateDate</div></th> <th width="45"> <div align="center">View</div></th> <th width="47"> <div align="center">Reply</div></th> </tr> <? while($objResult = mysql_fetch_array($objQuery)) { ?> <tr> <td><div align="center"><?=$objResult["QuestionID"];?></div></td> <td><a href="viewwebboard2.php?QuestionID=<?=$objResult["QuestionID"];?>"><?=$objResult["Question"];?></a></td> <td><?=$objResult["Name"];?></td> <td><div align="center"><?=$objResult["CreateDate"];?></div></td> <td align="right"><?=$objResult["View"];?></td> <td align="right"><?=$objResult["Reply"];?></td> </tr> <? } ?> </table> <br> Total <?= $Num_Rows;?> Record : <?=$Num_Pages;?> Page : <? if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a> "; } ?> </td> </tr> <tr> <td height="50" colspan="3" valign="top"><div id="fooster"></div></td> </tr> </table>
<? date_default_timezone_set("Asia/Bangkok"); include('config.inc.php'); if($_GET["Action"] == "Save") { //*** Insert Reply ***// $strSQL = "INSERT INTO reply "; $strSQL .="(QuestionID,CreateDate,Details,Name) "; $strSQL .="VALUES "; $strSQL .="('".$_GET["QuestionID"]."','".date("Y-m-d H:i:s")."','".$_POST["txtDetails"]."','".$_POST["txtName"]."') "; $objQuery = mysql_query($strSQL); //*** Update Reply ***// $strSQL = "UPDATE webboard "; $strSQL .="SET Reply = Reply + 1 WHERE QuestionID = '".$_GET["QuestionID"]."' "; $objQuery = mysql_query($strSQL); } ?> <? //*** Select Question ***// $strSQL = "SELECT * FROM webboard WHERE QuestionID = '".$_GET["QuestionID"]."' "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $objResult = mysql_fetch_array($objQuery); //*** Update View ***// $strSQL = "UPDATE webboard "; $strSQL .="SET View = View + 1 WHERE QuestionID = '".$_GET["QuestionID"]."' "; $objQuery = mysql_query($strSQL); ?> <table width="738" border="1" cellpadding="1" cellspacing="1"> <tr> <td colspan="2"><center><h1><?=$objResult["Question"];?></h1></center></td> </tr> <tr> <td height="53" colspan="2"><?=nl2br($objResult["Details"]);?></td> </tr> <tr> <td width="397">Name : <?=$objResult["Name"];?> Create Date : <?=$objResult["CreateDate"];?></td> <td width="253">View : <?=$objResult["View"];?> Reply : <?=$objResult["Reply"];?></td> </tr> </table> <br> <br> <? $strSQL2 = "SELECT * FROM reply WHERE QuestionID = '".$_GET["QuestionID"]."'"; $objQuery2 = mysql_query($strSQL2) or die ("Error Query [".$strSQL2."]"); $Num_Rows = mysql_num_rows($objQuery2); $Per_Page = 4; // Per Page $Page = $_GET["Page"]; if(!$_GET["Page"]) { $Page=1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_Start = (($Per_Page*$Page)-$Per_Page); if($Num_Rows<=$Per_Page) { $Num_Pages =1; } else if(($Num_Rows % $Per_Page)==0) { $Num_Pages =($Num_Rows/$Per_Page) ; } else { $Num_Pages =($Num_Rows/$Per_Page)+1; $Num_Pages = (int)$Num_Pages; } $strSQL2 .=" order by ReplyID ASC LIMIT $Page_Start , $Per_Page"; $objQuery2 = mysql_query($strSQL2); ?> <? while($objResult2 = mysql_fetch_array($objQuery2)) { ?> <br><br> <table width="738" border="1" cellpadding="1" cellspacing="1"> <tr> <td height="53" colspan="2"><?=nl2br($objResult2["Details"]);?></td> </tr> <tr> <td width="397">Name : <?=$objResult2["Name"];?> </td> <td width="253">Create Date : <?=$objResult2["CreateDate"];?></td> </tr> </table> <? } ?> <br> <br> Total <?= $Num_Rows;?> Record : <?=$Num_Pages;?> Page : <? if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page&QuestionID=$QuestionID'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i&QuestionID=$QuestionID'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page&QuestionID=$QuestionID'>Next>></a> "; } ?> <a href="webboard2.php">Back to Webboard</a> <br> <br> <? include ('config.inc.php'); $strSQL = "SELECT * FROM register WHERE ID_User = '".$_SESSION['ID_User']."' "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); ?> <? while($objResult = mysql_fetch_array($objQuery)) { ?> <form action="viewwebboard2.php?QuestionID=<?=$_GET["QuestionID"];?>&Action=Save" method="post" name="frmMain" id="frmMain"> <table width="400" border="1" cellpadding="1" cellspacing="1"> <tr> <td width="80">Details</td> <td><textarea name="txtDetails" cols="50" rows="5" id="txtDetails"></textarea></td> </tr> <tr> <td >Name</td> <td ><input name="txtName" type="text" id="txtName" value="<?=$objResult["User"];?>" size="15"></td> </tr> </table> <input name="btnSave" type="submit" id="btnSave" value="Submit"> </form> <? } ?> <? mysql_close(); ?>
<? session_start(); if($_SESSION['ID_User'] == "") { echo "Please Login!"; exit(); } include ('config.inc.php'); $strSQL = "SELECT * FROM register WHERE ID_User = '".$_SESSION['ID_User']."' "; $objQuery = mysql_query($strSQL); $objResult = mysql_fetch_array($objQuery); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>ขายสินค้าการเกษตรออนไลน์</title> <link href="../css/css_style.css" rel="stylesheet" type="text/css" /> </head> <body> <table width="1024" border="1" align="center"> <tr> <td height="129" colspan="3"><div id="header"></div></td> </tr> <tr> <td height="36" colspan="3"> <div id="menu"> <table width="100%" border="1"> <tr> <td width="100" height="30"><a href="user_page.php?id=1">หน้าเเรก</a> </td> <td width="100" height="30"><a href="user_page.php?id=2">สินค้า</a> </td> <td width="100" height="30"><a href="user_page.php?id=3">ข่าว</a> </td> <td width="100" height="30"><a href="user_page.php?id=4">วิธีการสั่งซื้อ</a> </td> <td width="100" height="30"><a href="webboard2.php">เว็บบอร์ด</a> </td> <td width="100" height="30"><a href="user_page.php?id=6">เกี่ยวกับเรา</a> </td> </tr> </table> </div> </tr> <tr> <td width="191" height="585" valign="top"> <? include"show_user.php" ?> <a href="order.php?ID_Product=<?=$objResult["ID_Product"];?>&act=add"><img src="img/shopping.jpg" width="40" height="30" /> <font color="#000000" size="4">ตระกร้าสินค้า</font></a><br /><br /> <a href="user_page.php?id=13"><strong><font size="3">Edit Profile</font></strong></a><br /><br /> <a href="logout.php"><strong><font size="3" color="#FF0000">logout</font></strong></a> </p> <p><img src="img/f1.png" border="3" /><br /> <br /> <a href="user_page.php?id=9"><img src="img/f2.png" width="140" height="30" border="1" /></a><br /><br /> <a href="user_page.php?id=10"><img src="img/f3.png" width="140" height="30" border="1" /></a><br /><br /> <a href="user_page.php?id=11"><img src="img/f4.png" width="140" height="30" border="1" /></a><br /><br /> <a href="user_page.php?id=12"><img src="img/f5.png" width="140" height="30" border="1" /></a><br /><br /> <font color="#FF0000" size="4">ตรวจสอบสถานะการส่งสินค้า</font><br /><br /> <a href="http://track.thailandpost.co.th/trackinternet/Default.aspx" target="_blank"><img src="img/ems.jpg" width="180" height="100" /></a> </p> <img src="img/katay.jpg" width="160" height="100" /><br /><br /> <img src="img/paradon.jpg" width="160" height="100" /><br /><br /> </td> <td colspan="2" valign="top" bgcolor="#EAFFFF"> <?php $id=$_GET["id"]; if($id==""){include("../admin/show_edit_admin.php");} else if($id=="1"){include("../admin/show_edit_admin.php");} else if($id=="2"){include("show_product.php");} else if($id=="3"){include("news.php");} else if($id=="4"){include("how_buy.php");} else if($id=="5"){include("#");} else if($id=="6"){include("contact.php");} else if($id=="7"){include("register.php");} else if($id=="8"){include("order.php");} else if($id=="9"){include("show_tool_userlogin.php");} else if($id=="10"){include("show_medicine_userlogin.php");} else if($id=="11"){include("show_headfood_userlogin.php");} else if($id=="12"){include("show_fertilizer_userlogin.php");} else if($id=="13"){include("editprofile.php");} else if($id=="14"){include("show_id_buy.php");} else if($id=="15"){include("NewQuestion.php");} ?> <br><br> <a href="user_page.php?id=15"><font size="3"><strong>ตั้งกระทู้ใหม่</strong></font></a> <? include('config.inc.php'); $strSQL = "SELECT * FROM webboard "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $Num_Rows = mysql_num_rows($objQuery); $Per_Page = 10; // Per Page $Page = $_GET["Page"]; if(!$_GET["Page"]) { $Page=1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_Start = (($Per_Page*$Page)-$Per_Page); if($Num_Rows<=$Per_Page) { $Num_Pages =1; } else if(($Num_Rows % $Per_Page)==0) { $Num_Pages =($Num_Rows/$Per_Page) ; } else { $Num_Pages =($Num_Rows/$Per_Page)+1; $Num_Pages = (int)$Num_Pages; } $strSQL .=" order by QuestionID DESC LIMIT $Page_Start , $Per_Page"; $objQuery = mysql_query($strSQL); ?> <table width="820" border="1"> <tr> <th width="80"> <div align="center">QuestionID</div></th> <th width="428"> <div align="center">Question</div></th> <th width="90"> <div align="center">Name</div></th> <th width="130"> <div align="center">CreateDate</div></th> <th width="45"> <div align="center">View</div></th> <th width="47"> <div align="center">Reply</div></th> </tr> <? while($objResult = mysql_fetch_array($objQuery)) { ?> <tr> <td><div align="center"><?=$objResult["QuestionID"];?></div></td> <td><a href="viewwebboard2.php?QuestionID=<?=$objResult["QuestionID"];?>"><?=$objResult["Question"];?></a></td> <td><?=$objResult["Name"];?></td> <td><div align="center"><?=$objResult["CreateDate"];?></div></td> <td align="right"><?=$objResult["View"];?></td> <td align="right"><?=$objResult["Reply"];?></td> <? if($objResult["Name"] == $_SESSION['ID_User']){ echo "ปุ่มแก้ไข"; } } ?> </table> <br> Total <?= $Num_Rows;?> Record : <?=$Num_Pages;?> Page : <? if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a> "; } ?> </td> </tr> <tr> <td height="50" colspan="3" valign="top"><div id="fooster"></div></td> </tr> </table> </body> </html>
<td align="center"> <? if($objResult['ID_User'] == $_SESSION['ID_User']){ echo "<a href='editwebboard.php'>ปุ่มกด</a>"; } ?> </td>
<? if($objResult["Name"] == $objResult["User"]) { echo "<a href='editwebboard.php'>ปุ่มกด</a>"; } ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง