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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
<?php if ($_SESSION['dbname'] == "nversion_77") { $navig['blog'] = "$web_gbook[0]"; $navig['blog'] = "ช่องทางแสดงความคิดเห็น"; navigator($navig); echo "<br>"; bar_header("ช่องทางแสดงความคิดเห็น"); // Bar_Header fieldset_top("ช่องทางแสดงความคิดเห็น"); } else { $navig['blog'] = "$web_gbook[0]"; $navig['blog'] = "สมุดเยี่ยมชม"; navigator($navig); echo"<br>"; bar_header("สมุดเยี่ยมชม"); // Bar_Header fieldset_top("สมุดเยี่ยมชม"); }
$g_book="DELETE FROM cms_gbook WHERE IP='66.232.97.145' or IP='95.168.183.203' or IP='69.46.23.47' or IP='67.215.237.98' or IP='78.46.66.178' or IP='91.214.44.153' or IP='93.174.94.53' or IP='77.130.181.235' or IP='78.46.102.197' or IP='88.198.53.43' or Email='ugjjhkkgj@aol.com' or IP='200.107.15.58' or IP='93.174.93.233' or IP='78.46.93.230' or IP='189.76.210.2' or IP='84.109.105.132' or IP='94.27.77.4' or IP='202.188.222.2' or IP='202.57.11.42' or IP='124.195.4.17' or IP='123.233.248.3' or Message='Very nice site!'"; mysql_query($g_book);
import_request_variables('pG', 'p_'); if($p_Page!="") { $Page=trim($p_Page); } if($p_id_del!="") { $id_del=trim($p_id_del); }
if($_SESSION['admin_web']=="admin"){ if ($id_del != "") { $sql = "DELETE FROM cms_gbook WHERE No='$id_del'"; mysql_query($sql); } }
$sql = "DELETE FROM cms_gbook WHERE No>='0049'"; mysql_query($sql);
?> <table width="100%" border="0" cellspacing="0" align="center" height="100">
<tr> <td height="100"></td> <td valign="top">
<table width='100%' border='0' cellspacing='1' align='center' cellpadding='0'> <tr> <td height="100" valign="top"> <?php $sql = "select * From cms_gbook "; /* ตั้งค่า แสดงผลต่อหน้า $Per_Page */
$Per_Page = 10; if (!$Page) $Page = 1;
$Prev_Page = $Page - 1; $Next_Page = $Page + 1;
$result = mysql_query($sql); $Page_start = ($Per_Page * $Page) - $Per_Page; $Num_Rows = mysql_num_rows($result);
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)) echo "<center><b>จำนวน $Page มากกว่า $Num_Pages ยังไม่ผู้ใดเซนต์สมุด<b></center>"; $sql .= " Where 1 Order by No Desc LIMIT $Page_start , $Per_Page"; //ส่วนแสดงผล $result = mysql_query($sql); While ($row = mysql_fetch_array($result)) { $No = $row["No"]; $Message = check_word_sencor($row["Message"]); $Email = wordwrap($row["Email"], 30, "<br>\n", 1); $Name = $row["Name"]; $URL = $row["URL"]; $Date = $row["Date"]; $IP = $row["IP"]; ?> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td width="40%"> <?php if($_SESSION['admin_web']=="admin"){ ?> <a href='index.php?mod=gbook&path=gbook&id_del=<?php echo $No ?>' onclick='return goURL();'><img src='coremain/images/del1.gif' border='0' title='ลบข้อมูล'></a> <?php } ?> <img src='coremain/images/marker.gif'> ลำดับที่ : <?php echo $No; ?> </td> <td width="60%">เขียนเมื่อ : <?php echo $Date; ?> | <?php echo $URL; ?> | <?php echo $IP; ?></td> </tr> <tr> <td> เขียนโดย :</td> <td > <?= $Name; ?></td> </tr> <tr> <td height="20">Email :</td> <td height="20"> <?php if(strlen($Email)==0) { $Email ="<font color='#009900'>--ไม่ได้ระบุอีเมล์--<font>"; echo $Email; } else {echo "<a href='mailto:$Email'>$Email</a>";} ?> </td> </tr> <tr> <td>ข้อความ :</td> <td><?php echo $Message; ?></td> </tr> <tr> <td> </td> <td><div align="left"><b><font color='999999'>............................................................................................</b></div></td> </tr> </table> <br/> <?php } ?> <table width="90%" border="0" cellspacing="0" align="center"> <tr> <td>มีผู้ลงนาม <b> <?= $Num_Rows; ?> </b> คน ๛ รวมทั้งหมด <b> <?= $Num_Pages; ?> </b> หน้า : <?php /* สร้างปุ่มย้อนกลับ */ if($Prev_Page) echo "<a href='index.php?mod=gbook&Page=$Prev_Page&path=gbook'><< ย้อนกลับ</a> "; for($i=1; $i<$Num_Pages; $i++){ if($i != $Page) echo " <a href='index.php?mod=gbook&Page=$i&path=gbook'>$i</a> "; else echo "<font color='ff0000'><b>[</b></font><a href='index.php?mod=gbook&Page=$i&path=gbook'>$i</a><font color='ff0000'><b>]</b></font>"; }
/*สร้างปุ่มเดินหน้า */ if($Page!=$Num_Pages) echo " <a href ='index.php?mod=gbook&Page=$Next_Page&path=gbook'>หน้าถัดไป >></a>"; ?> </td> </tr> </table>
<form name="frm_cms_gbook" method="post" action="index.php?mod=commit&path=gbook" onsubmit= "return checkfrm();"> <table width="95%" border="0" cellspacing="1" cellpadding="1" align="center" bgcolor="<?php echo $datatm['heder_color'] ?>" height="201"> <tr> <td width="8" height="34"><img src='coremain/module/gbook/book.gif'></td> <td height="34"><a name='write'></a></td> <td height="34">สมุดเยี่ยมชม เชิญลงนาม</td> </tr> <?php text_editor(445, 250, 'ข้อความ', 3); ?> <tr> <td><img src='coremain/images/marker.gif'></td> <td> อีเมล์ : </td> <td> <input type="text" name="Email" value="<?php echo $_SESSION['name_email'] ?>"></td> </tr> <tr> <td><img src='coremain/images/marker.gif'></td> <td> ลงชื่อ : </td> <td> <input type="text" name="Name" value="<?php echo $_SESSION['name_user'] ?>"></td> </tr> <tr> <td><img src='coremain/images/marker.gif'></td> <td align=left> รหัสลับ : </td> <td><img src='coremain/module/webboard/login1_image.php' align='center' title='ป้อนตามที่เห็นในภาพ'></td> </tr> <tr> <td><img src='coremain/images/marker.gif'></td> <td align=left> ป้อนรหัส : </td> <td><input type=text name='from_pic'> <img src='coremain/images/bu.gif' title='ป้อนรหัสลับตามที่ปรากฏ' onmouseover=this.style.cursor='hand'></td> </tr> <?php button_text('บันทึกลงนาม', 'Submit', 3) ?> <!-- <tr> <td width="8" height="33"> </td> <td height="33"> </td> <td width="323" height="33"> <center><input type="submit" name="Submit" value="บันทึกลงนาม" onmouseover=this.style.cursor='hand'></center> </td> </tr>--> </table> </form>
</td> </tr> </table> </td> </tr> </table> <?php fieldset_down();?> <script language="JavaScript"> <!-- function checkfrm(){ if(document.frm_cms_gbook.Name.value=="") { alert("กรุณากรอกชื่อด้วยครับ") ; document.frm_cms_gbook.Name.focus() ; return false ; }else return true ; }
function goURL() { var blnLink blnLink = confirm("Click OK เพื่อยืนยันการลบข้อมูล?")
if (!blnLink) { return false; }
return true; } //--> </script>
|