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
|
<?php
//if($_GET['CurrID']) { $_POST['CurrID']=$_GET['CurrID'];} else {$_POST['CurrID']=$_POST['CurrID'];} //------------------------------------------------------------------------------------------------------------------------------- if($_POST['option']=='ANSWER_NOW'){ $query="UPDATE consult SET answer='".$_POST['textAns']."' , topic_status='2' , ans_date=now() WHERE cons_id='".$_GET['CurrID']."' "; mysql_query($query); //include('mailto_consult.php'); ?> <script language="javascript">window.location.href='mailto_consult.php?currID=<?php echo $_GET['CurrID']?>'</script> <?php } //------------------------------------------------------------------------------------------------------------------------------- $thisFile= basename($PHP_SELF); $rowPerPage=20; if((!$_GET['page'])||($_GET['page']==1)){ $_GET['page']=1; $startRow=0; }else{ $startRow=($_GET['page']-1)*$rowPerPage; } //------------------------------------------------------------------------------------------------------------------------------- $query="SELECT * FROM consult WHERE cons_id= '".$_GET['CurrID']."' "; $result=mysql_query($query); $data=mysql_fetch_assoc($result);
?> <!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> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <title>Untitled Document</title> <link href="style.css" rel="stylesheet" type="text/css" />
<style> #username{ padding:2px; font-size:18px; border:2px #CCC solid; }
#tick{display:none} #cross{display:none} </style>
<style type="text/css"> <!-- #cross {display:none} #tick {display:none} #username { padding:2px; font-size:18px; border:2px #CCC solid; } --> </style> <script language="javascript"> function toDelete(id){ if(confirm('ต้องการลบหัวข้อนี้ ?')){ document.form1.action.value='delete'; document.form1.KEY.value=id; document.form1.submit(); }else{ return false(); } } //------------------------- function CheckForm(){ if(document.form1.textAns.value==''){ alert('กรุณาใส่ข้อความตอบกลับ '); return false; }else{ document.form1.option.value='ANSWER_NOW'; document.form1.submit(); } } </script>
</head>
<body><form action="<?php $_SERVER['PHP_SELF']?>" method="post" name="form1" onSubmit="return CheckForm()"> <table width="100%" border="0" cellspacing="3" cellpadding="3"> <tr> <td class="txt10-black"><table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td width="30%" align="right" class="txt10-black">หัวข้อคำถาม</td> <td width="70%"> <?php echo $data['cons_topic']?></td> </tr> <tr> <td align="right" valign="top" class="txt10-black">รายละเอียด</td> <td> <?php echo $data['cons_detail']?></td> </tr> <tr> <td align="right" class="txt10-black">ชื่อผู้ตั้ง</td> <td> <?php echo $data['cons_name']?></td> </tr> <tr> <td align="right" class="txt10-black">อีเมล์</td> <td> <?php echo $data['cons_email']?></td> </tr> <tr> <td align="right" class="txt10-black">เบอร์โทรติดต่อกลับ</td> <td> <?php echo $data['cons_phone']?></td> </tr> <tr> <td align="right" class="txt10-black">ip</td> <td> <?php echo $data['cons_ip']?></td> </tr> <tr> <td align="right" class="txt10-black">วันที่ตังคำถาม</td> <td> <?php echo $data['cons_date']?></td> </tr> <tr> <td align="right" bgcolor="#F8F8F8" class="txt10-black">ข้อความตอบกลับ</td> <td bgcolor="#F8F8F8"><textarea name="textAns" cols="50" rows="8" id="textAns"><?php echo $data['answer']?></textarea></td> </tr> <tr> <td> </td> <td><input type="submit" name="button" id="button" value="ตอบคำถาม" /> <input type="reset" name="button2" id="button2" value="ยกเลิก" onClick="window.location.href='main.php?work=Consult';" /> <input name="option" type="hidden" id="option" value="ANSWER" /> <input name="userEmail" type="hidden" id="userEmail" value="<?php echo $data['cons_email']?>" /> <input name="userName" type="hidden" value="<?php echo $data['cons_name']?>" /> <input name="userTopic" type="hidden" value="<?php echo $data['cons_topic']?>" /> <input name="userDetail" type="hidden" value="<?php echo $data['cons_detail']?>" /> <input name="consultID" type="hidden" value="<?php echo $_GET['CurrID']?>" /> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table> <p> </p></td> </tr> </table> </form> </body> </html>
|