1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
<?php $rowPerPage=20; if((!$_POST['page'])||($_POST['page']==1)){ $_POST['page']=1; $startRow=0; }else{ $startRow=($_POST['page']-1)*$rowPerPage; } #################################################### if($_POST['action']=='HistoryThis') { $query="DELETE FROM tbl_contactus_data WHERE id='".$_POST['ID']."' "; mysql_query($query); } #################################################### //------------------------------------ if($_GET['currID']){ $_POST['currID']=$_GET['currID'];} //-------------------------------------------------------------------------- $query="SELECT * FROM `tbl_contactus_data` ORDER BY `date_contact` DESC "; $queryLimit= $query." LIMIT $startRow , $rowPerPage " ; $result=mysql_query($queryLimit);
$resultBrowse2=mysql_query($query); $xrow=mysql_num_rows($resultBrowse2); $totalPage=ceil($xrow/$rowPerPage);
?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <link href="style.css" rel="stylesheet" type="text/css" /> <script language="javascript"> function historyThis(ids){ if(confirm('ต้องการลบ? ')){ document.form1.action.value='HistoryThis'; document.form1.ID.value=ids; document.form1.submit(); }else{ return false; } } </script> <form action="<?php $_SERVER['PHP_SELF']?>" method="post" name="form1" enctype="multipart/form-data"> <table width="99%" border="0" align="center" cellpadding="2" cellspacing="2"> <tr class="red"> <td width="4%" height="25" align="center" bgcolor="#D9D9B3"><img src="images/black_icon/16x16/app_window.png" width="16" height="16" /></td> <td width="96%" bgcolor="#D9D9B3">ข้อมูลจากหน้า ติดต่อเรา
<input type="hidden" name="action" id="action" /> <input type="hidden" name="currID" id="currID" value="<?php echo $_POST['currID']?>" /> <input type="hidden" name="RmPic" id="RmPic" /> <input type="hidden" name="ID" id="ID" /> <input type="hidden" name="page" id="page" /> </td> </tr> <tr> <td colspan="2"><table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td width="14%" height="30" align="center" bgcolor="#E2E2E2">ชื่อ</td> <td width="14%" align="center" bgcolor="#E2E2E2">อีเมล์</td> <td width="15%" align="center" bgcolor="#E2E2E2">ประเภท</td> <td width="16%" align="center" bgcolor="#E2E2E2">หัวข้อ</td> <td width="22%" align="center" bgcolor="#E2E2E2">ข้อความ</td> <td width="13%" align="center" bgcolor="#E2E2E2">วันที่ส่งข้อความ</td> <td width="6%" align="center" bgcolor="#E2E2E2">ลบ</td> </tr> <?php while($data=mysql_fetch_assoc($result)){ ?> <tr> <td height="30" align="left" bgcolor="#EBEBEB"><span class="txt10-black"><?php echo $data['name_smane']?></span></td> <td align="left" bgcolor="#EBEBEB"><span class="txt10-black"><?php echo $data['email']?></span></td> <td align="left" bgcolor="#EBEBEB"><span class="txt10-black"><?php echo $data['contact_type']?></span></td> <td align="left" bgcolor="#EBEBEB"><span class="txt10-black"><?php echo $data['topic']?></span></td> <td align="left" bgcolor="#EBEBEB"><span class="txt10-black"><?php echo $data['detail']?></span></td> <td align="left" bgcolor="#EBEBEB"><span class="txt10-black"> <?php GetThaiDateTime($data['date_contact'])?> </span></td> <td align="center" bgcolor="#EBEBEB"><span class="txt10-black"><a href="#" onclick="historyThis('<?php echo $data['id']?>')"> <img src="images/black_icon/16x16/round_delete.png" width="16" height="16" style="border:none"/></a></span></td> </tr> <?php }?> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table></td> </tr> <tr> <td colspan="2" class="txt10-black"><input type="hidden" name="hiddenField" id="hiddenField" /></td> </tr> <tr> <td colspan="2"><span class="txt10-black">หน้า : <?php for($i=1;$i<= $totalPage ; $i++){ ?> <?php if($_POST['page']==$i){ echo "<strong>[ ";} ?> <a href="#" onclick="document.form1.page.value='<?php echo $i?>';document.form1.submit()"> <?php echo $i;?> </a> <?php if($_POST['page']==$i){ echo " ] </strong>";}?> <?php }?> </span></td> </tr> <tr> <td colspan="2"> </td> </tr> </table> </form>
|