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
205
|
<?php if (id_sub_permission($id_sub) != 1) { permission_fail(); } $navig['news_page'] = $data_name_menu_sub['name']; $navig['news_page_update'] = $msg_edit; navigator($navig); echo "<br>"; bar_header("แก้ไขข้อมูล"); // Bar_Header fieldset_top($data_name_menu_sub['name']);
$sql = "select * from cms_news_page WHERE id_sub='$_SESSION[id_sub]' and id_type='$_SESSION[id_type]'"; $result = mysql_query($sql); $data = mysql_fetch_array($result);
$date = substr($data['date_post'], 8, 2); $month = substr($data['date_post'], 5, 2); $year = substr($data['date_post'], 0, 4); $date1 = substr($data['date_line'], 8, 2); $month1 = substr($data['date_line'], 5, 2); $year1 = substr($data['date_line'], 0, 4); ?> <table width='100%' border='0' cellspacing='1' align='center' cellpadding='0'> <tr> <td height="100" valign="top"> <form action="index.php?mod=news_page_update_output&path=news_page" method="post" enctype="multipart/form-data" name="add" id="add" onSubmit="return checkadd()"> <table width="100%" border="0" align="center" cellpadding="1" cellspacing="3"> <tr height="40"> <td width="20%"><div align="left"><img src='coremain/images/marker.gif'> <strong>หัวข้อ</strong></div></td> <td widht="80%"><div align="left"><input name="topic" type="text" size="50" value="<?php echo $data['topic']?>"></td> </tr> <?php text_editor("445","260",$data['fulltexts'],"รายละเอียด"); // Text Editor $date=date("d"); $month=date("m"); $year=date("Y"); ?> <tr> <td><div align="left"><img src='coremain/images/marker.gif'> <strong>วันที่แก้ไขข้อมูล</strong></div></td> <td><div align="left"> <select name="date" id="date" disabled> <option value=01 <?php if ($date == "1") { echo "selected"; } ?>>1</option> <option value=02 <?php if ($date == "2") { echo "selected"; } ?>>2</option> <option value=03 <?php if ($date == "3") { echo "selected"; } ?>>3</option> <option value=04 <?php if ($date == "4") { echo "selected"; } ?>>4</option> <option value=05 <?php if ($date == "5") { echo "selected"; } ?>>5</option> <option value=06 <?php if ($date == "6") { echo "selected"; } ?>>6</option> <option value=07 <?php if ($date == "7") { echo "selected"; } ?> >7</option> <option value=08 <?php if ($date == "8") { echo "selected"; } ?>>8</option> <option value=09 <?php if ($date == "9") { echo "selected"; } ?>>9</option> <option value=10 <?php if ($date == "10") { echo "selected"; } ?> >10</option> <option value=11 <?php if ($date == "11") { echo "selected"; } ?>>11</option> <option value=12 <?php if ($date == "12") { echo "selected"; } ?>>12</option> <option value=13 <?php if ($date == "13") { echo "selected"; } ?>>13</option> <option value=14 <?php if ($date == "14") { echo "selected"; } ?> >14</option> <option value=15 <?php if ($date == "15") { echo "selected"; } ?>>15</option> <option value=16 <?php if ($date == "16") { echo "selected"; } ?>>16</option> <option value=17 <?php if ($date == "17") { echo "selected"; } ?>>17</option> <option value=18 <?php if ($date == "18") { echo "selected"; } ?>>18</option> <option value=19 <?php if ($date == "19") { echo "selected"; } ?>>19</option> <option value=20 <?php if ($date == "20") { echo "selected"; } ?>>20</option> <option value=21 <?php if ($date == "21") { echo "selected"; } ?>>21</option> <option value=22 <?php if ($date == "22") { echo "selected"; } ?>>22</option> <option value=23 <?php if ($date == "23") { echo "selected"; } ?>>23</option> <option value=24 <?php if ($date == "24") { echo "selected"; } ?>>24</option> <option value=25 <?php if ($date == "25") { echo "selected"; } ?>>25</option> <option value=26 <?php if ($date == "26") { echo "selected"; } ?>>26</option> <option value=27 <?php if ($date == "27") { echo "selected"; } ?>>27</option> <option value=28 <?php if ($date == "28") { echo "selected"; } ?>>28</option> <option value=29 <?php if ($date == "29") { echo "selected"; } ?>>29</option> <option value=30 <?php if ($date == "30") { echo "selected"; } ?>>30</option> <option value=31 <?php if ($date == "31") { echo "selected"; } ?>>31</option> </select> <b>เดือน</b> <select name="month" id="month" disabled> <option value="01" <?php if ($month == "1") { echo "selected"; } ?>>มกราคม</option> <option value=02 <?php if ($month == "2") { echo "selected"; } ?>>กุมภาพันธ์</option> <option value=03 <?php if ($month == "3") { echo "selected"; } ?>>มีนาคม</option> <option value=04 <?php if ($month == "4") { echo "selected"; } ?>>เมษายน</option> <option value=05 <?php if ($month == "5") { echo "selected"; } ?>>พฤษภาคม</option> <option value=06 <?php if ($month == "6") { echo "selected"; } ?>>มิถุนายน</option> <option value=07 <?php if ($month == "7") { echo "selected"; } ?> >กรกฎาคม</option> <option value=08 <?php if ($month == "8") { echo "selected"; } ?>>สิงหาคม</option> <option value=09 <?php if ($month == "9") { echo "selected"; } ?>>กันยายน</option> <option value=10 <?php if ($month == "10") { echo "selected"; } ?>>ตุลาคม</option> <option value=11 <?php if ($month == "11") { echo "selected"; } ?>>พฤศจิกายน</option> <option value=12 <?php if ($month == "12") { echo "selected"; } ?>>ธันวาคม</option> </select> <b>ค.ศ.</b> . <input name="year" type="text" disabled value="<?php echo $year; ?>" size="5" maxlength='4'> </div></td> </tr> <!-- pic 1 --> <tr height="40"> <td><div align="left"><img src='coremain/images/marker.gif'> <strong>Upload รูปที่1</strong></div></td> <td><div align="left"><input name="userfile1" type="file" size="35"><?php detail_pic();?></div> <?php if($data['pic1']!=""){ echo" <INPUT TYPE='checkbox' NAME='check_pic1' value='1'> เอารูปออก"; } ?> </td> </tr> <tr height="40"> <td><div align="left"><img src='coremain/images/marker.gif'> <strong>ตำแหน่งรูปที่1</strong></div></td> <td><div align="left"> <select name="position_pic1"> <option value="center" <?php if ($data['position_pic1'] == "center") { echo "selected"; } ?>>ตำแหน่งกลาง</option> <option value="left"<?php if ($data['position_pic1'] == "left") { echo "selected"; } ?>>ตำแหน่งซ้าย</option> <option value="right" <?php if ($data['position_pic1'] == "right") { echo "selected"; } ?>>ตำแหน่งขวา</option> </select> </div> <strong> คำอธิบายรูปที่1</strong> <input name="explain1" type="text" size="28" value="<?php echo $data['explain1']?>"> </td> </tr> <!-- pic 2 --> <tr height="40"> <td><div align="left"><img src='coremain/images/marker.gif'> <strong>Upload รูปที่2</strong></div></td> <td><div align="left"><input name="userfile2" type="file" size="35"><?php detail_pic();?></div> <?php if($data['pic2']!=""){ echo" <INPUT TYPE='checkbox' NAME='check_pic2' value='1'> เอารูปออก"; } ?> </td> </tr> <tr height="40"> <td><div align="left"><img src='coremain/images/marker.gif'> <strong>ตำแหน่งรูปที่2</strong></div></td> <td><div align="left"> <select name="position_pic2"> <option value="center" <?php if ($data['position_pic2'] == "center") { echo "selected"; } ?>>ตำแหน่งกลาง</option> <option value="left"<?php if ($data['position_pic2'] == "left") { echo "selected"; } ?>>ตำแหน่งซ้าย</option> <option value="right" <?php if ($data['position_pic2'] == "right") { echo "selected"; } ?>>ตำแหน่งขวา</option> </select></div> <strong>คำอธิบายรูปที่2</strong> <input name="explain2" type="text" size="28" value="<?php echo $data['explain2']?>"> </td> </tr>
<!-- pic 3 --> <tr height="40"> <td><div align="left"><img src='coremain/images/marker.gif'> <strong>Upload รูปที่3</strong></div></td> <td><div align="left"><input name="userfile3" type="file" size="35"><?php detail_pic();?> <?php if($data['pic3']!=""){ echo" <INPUT TYPE='checkbox' NAME='check_pic3' value='1'> เอารูปออก"; } ?> </td> </tr> <tr height="40"> <td><div align="left"><img src='coremain/images/marker.gif'> <strong>ตำแหน่งรูปที่3</strong></div></td> <td><div align="left"> <select name="position_pic3"> <option value="center" <?php if ($data['position_pic3'] == "center") { echo "selected"; } ?>>ตำแหน่งกลาง</option> <option value="left"<?php if ($data['position_pic3'] == "left") { echo "selected"; } ?>>ตำแหน่งซ้าย</option> <option value="right" <?php if ($data['position_pic3'] == "right") { echo "selected"; } ?>>ตำแหน่งขวา</option> </select></div> <strong>คำอธิบายรูปที่3</strong> <input name="explain3" type="text" size="28" value="<?php echo $data['explain3']?>"> </td> </tr> <!-- pic 4 --> <tr height="40"> <td><div align="left"><img src='coremain/images/marker.gif'> <strong>Upload รูปที่4</strong></div></td> <td><div align="left"><input name="userfile4" type="file" size="35"><?php detail_pic();?></div> <?php if($data['pic4']!=""){ echo" <INPUT TYPE='checkbox' NAME='check_pic4' value='1'> เอารูปออก"; } ?> </td> </tr> <tr height="40"> <td><div align="left"><img src='coremain/images/marker.gif'> <strong>ตำแหน่งรูปที่4</strong></div></td> <td><div align="left"> <select name="position_pic4"> <option value="center" <?php if ($data['position_pic4'] == "center") { echo "selected"; } ?>>ตำแหน่งกลาง</option> <option value="left"<?php if ($data['position_pic4'] == "left") { echo "selected"; } ?>>ตำแหน่งซ้าย</option> <option value="right" <?php if ($data['position_pic4'] == "right") { echo "selected"; } ?>>ตำแหน่งขวา</option> </select></div> <strong>คำอธิบายรูปที่4</strong> <input name="explain4" type="text" size="28" value="<?php echo $data['explain4']?>"> </td> </tr>
<!-- File --> <tr height="40"> <td><div align="left"><img src='coremain/images/marker.gif'> <strong>File ประกอบ</strong></div></td> <td><div align="left"><input name="userfile5" type="file" size="35"><?php detail_file();?></div> <?php if($data['files']!=""){ echo" <INPUT TYPE='checkbox' NAME='check_files' value='1'> เอาไฟล์ออก"; } ?> </td> </tr>
<?php text_button_update(); fieldset_down(); ?> </table> </form> </td> </tr> </table>
<script language="javascript"> function checkadd() { if (document.add.topic.value == "") { alert("กรุณากรอกหัวข้อข่าว !"); document.add.topic.focus(); return false; } else if (document.add.who.value == "") { alert("กรุณากรอกผู้ประกาศข่าว!"); document.add.who.focus(); return false; }
else return true; } </script>
|