/home/banprang/domains/plai.go.th/public_html/coremain/module/help_s/help_s_add_output.php


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
<?php
session_start
();
include(
"../../../$_SESSION[web_name]/connect.php");
include (
"../../function_import_request.php");
include (
"../../function_msg.php");
//echo "<link href='../../ccs/style.css' rel='stylesheet' type='text/css'>";

import_request_variables('pG''p_');
// แสดงเนื้อหา
//#5.3#//if($p_type!="")                                            {         $type=trim($p_type);                                }
$type = isset($p_type) ? $p_type '';
//#5.3#//if($p_topic!="")                                            {  $topic=trim($p_topic);                                    }
$topic = isset($p_topic) ? $p_topic '';
//#5.3#//if($p_fulltexts!="")                                        {  $fulltexts=trim($p_fulltexts);                            }
$fulltexts = isset($p_fulltexts) ? $p_fulltexts '';
//#5.3#//if($p_name_help!="")                                {  $name_help=trim($p_name_help);            }
$name_help = isset($p_name_help) ? $p_name_help '';
//#5.3#//if($p_address_help!="")                            {  $address_help=trim($p_address_help);    }
$address_help = isset($p_address_help) ? $p_address_help '';
//#5.3#//if($p_tel_help!="")                                        {  $tel_help=trim($p_tel_help);                        }
$tel_help = isset($p_tel_help) ? $p_tel_help '';
//#5.3#//if($p_email_help!="")                                {  $email_help=trim($p_email_help);                }
$email_help = isset($p_email_help) ? $p_email_help '';
if (
$type == 1) {
  echo 
"<title>สายตรงถึงนายก ฯ</title>";
} elseif (
$type == 2) {
  echo 
"<title>สายตรงถึงปลัด ฯ</title>";
} elseif (
$type == 3) {
  echo 
"<title>ร้องเรียนการทุจริต</title>";
}elseif (
$type == 4) {
  echo 
"<title>การแสดงความคิดเห็น</title>";
}
//echo"<body background='../../../$_SESSION[web_name]/theme/$_SESSION[themes_]/$_SESSION[background]'  bgproperties='fixed'>";
if($type==1$type_boss="na";
if(
$type==2$type_boss="pa";

$date=date("d");
$month=date("m");
$year=date("Y");
$yearthai=$year+543;
$strf strftime("%H%M%S");
$date_time_help=$yearthai.$month.$date.$strf;

$userfile5_name trim($_FILES['userfile5']['name']);
$result '';
$chkF '';
// เช็คไฟล์ว่าถูกต้องหรือไม่
if ($userfile5_name != "") {
  
$chkF check_file($userfile5_name);
  if(
$chkF != 'OK'){
    
$result '<center><br>ไม่อนุญาตให้ Upload ไฟล์ชนิดนี้ <br>เนื่องจากชนิดไฟล์เสี่ยงต่อความเสียหายของระบบ <br>และขนาดไฟล์ต้องไม่เกิน 2 Mb.<br><br>';
  }
}

// Create_Filename
if ($userfile5_name != "" && $chkF == 'OK') {
  
$name5 create_filename($userfile5_name);
  
$dlink "../../../$_SESSION[web_name]/mainfile/" $name5;
  
upload_file_to_server($dlink$_FILES['userfile5']);
}

//#########เพิ่มข้อมูลลงในฐาน    
$sql="INSERT INTO `cms_help_group_detail` (
`id_help_detail` ,
`id_help` ,
`topic` ,
`fulltexts` ,
`who_help` ,
`address_help` ,
`tel` ,
`email` ,
`date_help` ,
`status` ,
`files` ,
`who_process` ,
`date_process` ,
`detail_process` ,
`who_aecept` ,
`date_aecept` ,
`detail_acept`
)
VALUES (
'','
$type', '$topic', '$fulltexts', '$name_help', '$address_help', '$tel_help', '$email_help', '$date_time_help', '1', '$name5', '', '', '', '$type_boss', '', '')";
mysql_query($sql) or die(mysql_error());

$result $result != '' $result : ($type == 'ข้อมูลร้องทุกข์ข้างล่างนี้ ได้ถูกส่งไปยังเจ้าหน้าที่แล้ว' 'ข้อมูลร้องทุกข์ข้างล่างนี้ ได้ถูกส่งไปยังเจ้าหน้าที่แล้ว');

?>
<table width='70%' height=100 border='0' align='center' cellpadding='1' cellspacing='1' bgcolor='dddddd'>
  <tr height='40' bgcolor='eeeeee'>
    <td align="center" valign="center">
      <h3><?php echo $result?></h3>
    </td>
  </tr>
</table>

<?php
$sql1 
"SELECT max(id_help_detail) FROM cms_help_group_detail WHERE id_help='$type'";
$re1 mysql_query($sql1);
$data1 mysql_fetch_array($re1);
    
// แสดงเนื้อหาข่าวประชาสัมพันธ์
$sql "SELECT * FROM cms_help_group_detail WHERE id_help_detail=$data1[0]";
$re mysql_query($sql);
$data mysql_fetch_array($re);
?>
<table width='70%' border='0' cellspacing='1'  align='center' cellpadding='0' bgcolor='dddddd'>
  <tr height=40 bgcolor='eeeeee'>
    <td width='140'>
      &nbsp; &nbsp;&nbsp;<img src='../../images/marker.gif'>&nbsp;&nbsp;<b>หัวข้อการทุจริต</b>
    </td>
    <td><?php echo $data['topic'?><br></td>
  </tr>
  <tr height=40 bgcolor='eeeeee'>
    <td>
      &nbsp; &nbsp;&nbsp;<img src='../../images/marker.gif'>&nbsp;&nbsp;<b>รายละเอียด</b>
    </td>
    <td><?php echo $data['fulltexts'?><br></td>
  </tr>
  <tr height=40 bgcolor='eeeeee'>
    <td>
      &nbsp; &nbsp;&nbsp;<img src='../../images/marker.gif'>&nbsp;&nbsp;<b>ชื่อ</b>
    </td>
    <td><?php echo $data['who_help'?><br></td>
  </tr>
  <tr height=40 bgcolor='eeeeee'>
    <td>
      &nbsp; &nbsp;&nbsp;<img src='../../images/marker.gif'>&nbsp;&nbsp;<b>ที่อยู่</b>
    </td>
    <td><?php echo $data['address_help'?><br></td>
  </tr>
  <tr height=40 bgcolor='eeeeee'>
    <td>
      &nbsp; &nbsp;&nbsp;<img src='../../images/marker.gif'>&nbsp;&nbsp;<b>โทรศัพท์</b>
    </td>
    <td><?php echo $data['tel'?><br></td>
  </tr>
  <tr height=40 bgcolor='eeeeee'>
    <td>
      &nbsp; &nbsp;&nbsp;<img src='../../images/marker.gif'>&nbsp;&nbsp;<b>อีเมล์</b>
    </td>
    <td><?php echo $data['email'?><br></td>
  </tr>
  <tr height=40 bgcolor='eeeeee'>
    <td>
      &nbsp; &nbsp;&nbsp;<img src='../../images/marker.gif'>&nbsp;&nbsp;<b>วัน/เวลา</b>
    </td>
    <td><?php echo $data['date_help'?><br></td>
  </tr>
<?php if($data['files']!=""){ ?>
  <tr height=40 bgcolor='eeeeee'>
    <td>
      &nbsp; &nbsp;&nbsp;<img src='../../images/marker.gif'>&nbsp;&nbsp;<b>เอกสารประกอบ</b>
    </td>
    <td><a href='../../../<?php echo $_SESSION['web_name'?>/mainfile/<?php echo $data['files'?>' target=blank>ดาวน์โหลด</a><br></td>
  </tr>
<?php ?>
</table>

<table width='70%' height=100 border='0' align='center' cellpadding='1' cellspacing='1' bgcolor='dddddd'>
  <tr height='40' bgcolor='dddddd'>
    <td align=center valign=center><a href='help_s.php?type=<?php echo $type ?>'>กลับหน้าหลัก</a></td>
  </tr>
  <tr height='127' bgcolor='eeeeee'>
    <td colspan=3></td>
  </tr>
</table>