"; } ?>
"; echo""; // LOGIN echo""; } if(!isset($_GET['id']) && $_GET['action'] != 'login' && $_GET['action'] != 'post_webboard' && $_GET['action'] != 'member_manage'){ /*////////// //////////////////////////////////////////////////////// // // // แสดงกระทู้สำหรับบุคคลทั่วไป // // และสมาชิก // //////////////////////////////////////////////////////////////////*/ include"conf/config.inc.php"; if(!isset($start)){ $start = 0; } $limit = 10; /* หาจำนวน record ทั้งหมด ปล. อันนี้ต้องใช้กับตัวแบ่งนะ ห้ามเอาออก*/ if(!isset($_SESSION["user_log"])){ $Qtotal = mysql_query("select * from board where VIEW='enabled'"); //คิวรี่ คำสั่ง }else{ $Qtotal = mysql_query("select * from board"); //คิวรี่ คำสั่ง } $total = mysql_num_rows($Qtotal); // หาจำนวน record if(!isset($_SESSION["user_log"])){ $sql = "select * from board where view='enabled' order by ID desc limit $start,$limit"; }else{ $sql = "select * from board order by ID desc LIMIT $start,$limit "; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// } $dbquery = mysql_db_query($dbname, $sql); // หาจำนวนเรกคอร์ดข้อมูลในตาราง $num_rows = mysql_num_rows($dbquery); // เริ่มวนรอบแสดงข้อมูล $i=0; ?>

$date
 $topic
$poster
$status

"); }else{ echo("
$date
 $topic
$poster
$status

"); } $i++; } //ตัวแบ่งหน้า $page = ceil($total/$limit); ?>

"; echo "

"; echo "
หัวข้อ
"; echo "

ข้อความ
"; echo "

ผู้ตั้งกระทู้
"; echo "

"; echo "
"; echo "

"; echo ""; } if(isset($_SESSION["user_log"]) && ($_SESSION["supper_admin"]) == '1' && $_GET['action'] == 'member_manage'){ include"conf/config.inc.php"; if($_GET['todo'] == 'edit'){ $id = $_GET['uid']; $sql = "select * from member where ID = '$id'"; $query = mysql_query($sql) or die(mysql_error()); $rows = mysql_fetch_array($query); echo $rows['NAME']; }else{ $sql_mb = "select * from member order by ID ASC"; $query_mb = mysql_query($sql_mb) or die(mysql_error()); echo "
"; echo "
ข้อมูลสมาชิก

"; echo ""; echo ""; echo ""; echo ""; while($rows_mb = mysql_fetch_array($query_mb)){ echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
ชื่อ-นามสกุลตำแหน่งเบอร์โทรศัพท์
".$rows_mb['NAME']."".$rows_mb['POSITION']."".$rows_mb['PHONE']."
"; } mysql_close(); } /*//////////////////////////////////////////////////////////////////////////////////////////////////////// แสดงกระทู้สำหรับบุคคลทั่วไป //////////////////////////////////////////////////////////////////////////////////////////////////////////*/ if(isset($_GET[id]) && isset($_SESSION["user_log"]) && $_GET[action] != 'login'){ $topoic = "

 $topic

$message

$poster


"; if($reply != ''){ $comment = "

$reply

$rep_by
$rep_pos
$rep_date



"; }else{ /*////////////////////////////////////////////////////////////////////// แสดงกล่องสำหรับตอบคำถามสำหรับ admin /////////////////////////////////////////////////////////////////////////*/ $comment="

"; } if($view != 'enabled'){ $show = ""; } if($reply == ''){ $postReply =""; } echo "
".$topoic.$comment."
".$show."".$postReply."


"; }else if(isset($_GET[id]) && $_GET[action] != 'login'){ $topoic = "

$topic

$message

$poster


"; if($reply != ''){ $comment = "

$reply

$rep_by
$rep_pos
$rep_date



"; }else{ $comment="";} echo $topoic.$comment; } function errorMessage($code){ if($code == 1){ $code = "คุณไม่สามารถเข้าสู่ระบบได้กรุณาลองใหม่อีกครั้ง"; } if($code == 2){ $code = "คุณไม่สามารถตั้งกระทู้ใหม่ได้กรุณาลองใหม่อีกครั้ง"; } if($code == 3){ $code = "คุณไม่สามารถตอบคำถาม่ได้กรุณาลองใหม่อีกครั้ง"; } if($code == 4){ $code = "คุณไม่สามารถลบกระทู้ได้กรุณาลองใหม่อีกครั้ง"; } $alert= ""; return $alert; } if(isset($_GET[error])){ $msg = errorMessage($error); echo $msg; } ?>