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
|
<?php session_start(); include ("../../function_sql_query.php"); include ("../../function_form.php"); include ("../../function_import_request.php"); echo"<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>"; echo"<link href='coremain/ccs/style.css' rel='stylesheet' type='text/css'>"; echo "<title>แก้ไขแบบสำรวจ</title>"; import_request_variables('pG', 'p_'); //#5.3#//if($p_date!="") { $date=trim($p_date); } $date = isset($p_date) ? $p_date : ''; //#5.3#//if($p_id_poll!="") { $id_poll=trim($p_id_poll); } $id_poll = isset($p_id_poll) ? $p_id_poll : ''; //#5.3#//if($p_startrow!="") { $startrow=trim($p_startrow); } $startrow = isset($p_startrow) ? $p_startrow : ''; //#5.3#//if($p_topic!="") { $topic=trim($p_topic); } $topic = isset($p_topic) ? $p_topic : ''; //#5.3#//if($p_id!="") { $id=trim($p_id); } $id = isset($p_id) ? $p_id : ''; for($i = 1; $i <= 9; $i++){ ${'c'.$i} = isset(${'p_c'.$i}) ? ${'p_c'.$i} : ''; }
if ($_SESSION['web_name'] == "") $_SESSION['web_name'] = $web_name; include("../../../$_SESSION[web_name]/connect.php"); ?>
<table width='60%' border='0' cellpadding='0' cellspacing='0' align=center> <tr> <td> <fieldset> <legend align=left><font color='<?= $datatm['color1'] ?>'>แบบสำรวจความคิดเห็น</font></legend> <br> <?php if($c1==""){ $sql = "select * from cms_poll where id='$id_poll'"; $result = mysql_query($sql); $data = mysql_fetch_array($result); ?> <center> <FORM id="formupdate" NAME='formupdate' METHOD=POST> <table width='98%' border='0' cellpadding='0' cellspacing='1' bgcolor=#f0e8d0> <tr> <td width='98%' height='25'> <center><img src='coremain/images/left.gif'> <a href='javascript:void(0);' class="poll_back"><b>Back</b></a> แก้ไขแบบสำรวจ </center> </td> </tr> </table> <table width='98%' border='0' cellpadding='0' cellspacing='1' bgcolor='#eff3f7'> <tr> <td width='20%' height='25' bgcolor='ffffff'> <img src='coremain/images/bullet2.gif'> <b>คำถาม</b></td> <td width='70%' height='25' bgcolor='ffffff'><INPUT TYPE='text' NAME='topic' size='60' value='<?= $data['topic'] ?>'></td> </tr> <?php for($j = 1; $j <= 9; $j++){ ?> <tr> <td width='20%' height='25' bgcolor='ffffff'> <img src='coremain/images/marker.gif'> ตัวเลือกที่ <?= $j ?></td> <td width='70%' height='25' bgcolor='ffffff'><INPUT TYPE='text' NAME='c<?= $j ?>' size='60' value='<?= $data['choose'.$j] ?>'></td> </tr> <?php } ?> </table> <br/><br/> <button type='button' class="bt-close ui-button ui-widget ui-corner-all btn_edit" id="<?= $id_poll ?>" style="padding: 5px 10px;">แก้ไขข้อมูล</button> </FORM> </center> <br> <?php }else{ $sql="update cms_poll set topic='$topic',choose1='$c1',choose2='$c2',choose3='$c3',choose4='$c4',choose5='$c5',choose6='$c6',choose7='$c7',choose8='$c8',choose9='$c9' where id='$id_poll'"; $result=mysql_query($sql); ?> <table width='60%' border='0' cellspacing='0' bgcolor='<?php echo $datatm['color1'];?>' align='center' cellpadding='0'> <tr> <td bgcolor="#FFFFFF" height="140" valign="top"> <div align='center'> <br><br><center>ข้อมูลได้ถูกแก้ไขแล้ว<br><br></center> <script> setTimeout(function(){ poll_back(); }, 1000); </script> </div> </td> </tr> </table> <?php } ?> </fieldset> </td> </tr> </table>
<Script LANGUAGE="VBscript"> var arrData = [ { name: 'folder_name', value: '<?php echo $_SESSION['folder_name']?>' }, { name: 'admin_web', value: '<?php echo $_SESSION['admin_web'];?>' }, { name: 'startrow', value: '<?php echo $startrow; ?>' } ]; $('.btn_edit').click(function(){ var data = $('#formupdate').serializeArray(); var value = $(this).attr('id'); arrData.push({ name: 'id_poll', value: value }); arrData = arrData.concat(data); $('#dialog-popup').dialog({ dialogClass: 'no-close' }); $.ajax({ type: 'post', url: 'coremain/module/poll/update.php', data: arrData, success: function(result){ $('#dialog-popup').html(result); } }); });
$('.poll_back').click(function(){ poll_back(); }); function poll_back(){ var dialog = 'dialog-popup'; var popup = $('#'+dialog); $.ajax({ type: 'post', url: 'coremain/module/poll/result.php', data: arrData, success: function(result){ popup.html(result); } }); } $('.manage_poll').click(function(){ });
</Script>
|