/home/banprang/domains/plai.go.th/public_html/coremain/module/help_s1/help_s1_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
<?php
// Status Package Module
$status_module=select_query("status_module","cms_status_module","id","25");
if(
$status_module[0]!=1)    {    
    
fieldset_no_module();
}

$navig['help_s1']="E-Service";
$navig['help_s1_add']="เพิ่มข้อมูล";
navigator($navig);
print
"<br>";
bar_header("เพิ่มข้อมูล"); // Bar_Header
fieldset_top("E-Service");

if(
$p_topic!="")                                    {  $topic=trim($p_topic);                        }
if(
$p_evar!="")                                        {  $fulltexts=trim($p_evar);                    }
if(
$p_name_help!="")                                {  $name_help=trim($p_name_help);                }
if(
$p_address_help!="")                                {  $address_help=trim($p_address_help);            }
if(
$p_tel_help!="")                                    {  $tel_help=trim($p_tel_help);                    }
if(
$p_email_help!="")                                {  $email_help=trim($p_email_help);                }

$userfile5_name=trim($_FILES['userfile5']['name']);

$date=date("d");
$month=date("m");
$year=date("Y");
$yearthai=$year+543;
$strf strftime("%H%M%S");
$date_time_help=$yearthai.$month.$date.$strf;
            
// เช็คไฟล์ว่าถูกต้องหรือไม่
if($userfile5_name!="")            {    check_file($userfile5_name,5);    }
    

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


//#########เพิ่มข้อมูลลงในฐาน    
$sql="INSERT INTO `cms_help_s1` (
`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`,`ip`
)
VALUES (
'', '
$topic', '$fulltexts', '$name_help', '$address_help', '$tel_help', '$email_help', '$date_time_help', '1', '$name5', '', '', '', '', '', '','$_SERVER[REMOTE_ADDR]')";
mysql_query($sql) or die(mysql_error());


echo 
"<br><center>";
    echo 
"<b>ข้อมูลข้างล่างนี้ ได้ถูกส่งไปยังเจ้าหน้าที่ที่เกี่ยวข้องแล้ว<b><br>";
    
    
$sql="SELECT * FROM cms_help_s1";
    
$re=mysql_query($sql);
    
$data=mysql_fetch_array($re);

// แสดงเนื้อหาข่าวประชาสัมพันธ์
echo"<table width='100%' border='0' cellspacing='1'  align='center' cellpadding='0'>";
$data=select_query("*","cms_help_s1","id_help",$data[0]);
{            
    echo
"  <tr height=40>";
        echo
"<td width='140'>";                                    
                    echo 
"&nbsp; &nbsp;&nbsp;<img src='core_main/images/marker.gif'>&nbsp;&nbsp;<b>หัวข้อ E-Service</b>";
        echo
"</td>";
        echo 
"<td>$data[topic]<br></td>";
    echo
"</tr>";

    echo
"  <tr height=40>";
        echo
"<td>";                                    
                    echo 
"&nbsp; &nbsp;&nbsp;<img src='core_main/images/marker.gif'>&nbsp;&nbsp;<b>รายละเอียด</b>";
        echo
"</td>";
        echo 
"<td>$data[fulltexts]<br></td>";
    echo
"</tr>";

    echo
"  <tr height=40>";
        echo
"<td>";                                    
                    echo 
"&nbsp; &nbsp;&nbsp;<img src='core_main/images/marker.gif'>&nbsp;&nbsp;<b>ชื่อ-สกุล</b>";
        echo
"</td>";
        echo 
"<td>$data[who_help]<br></td>";
    echo
"</tr>";

    echo
"  <tr height=40>";
        echo
"<td>";                                    
                    echo 
"&nbsp; &nbsp;&nbsp;<img src='core_main/images/marker.gif'>&nbsp;&nbsp;<b>ที่อยู่</b>";
        echo
"</td>";
        echo 
"<td>$data[address_help]<br></td>";
    echo
"</tr>";
    
    echo
"  <tr height=40>";
        echo
"<td>";                                    
                    echo 
"&nbsp; &nbsp;&nbsp;<img src='core_main/images/marker.gif'>&nbsp;&nbsp;<b>โทรศัพท์</b>";
        echo
"</td>";
        echo 
"<td>$data[tel]<br></td>";
    echo
"</tr>";

    echo
"  <tr height=40>";
        echo
"<td>";                                    
                    echo 
"&nbsp; &nbsp;&nbsp;<img src='core_main/images/marker.gif'>&nbsp;&nbsp;<b>อีเมล์</b>";
        echo
"</td>";
        echo 
"<td>$data[email]<br></td>";
    echo
"</tr>";    

    echo
"  <tr height=40>";
        echo
"<td>";                                    
                    echo 
"&nbsp; &nbsp;&nbsp;<img src='core_main/images/marker.gif'>&nbsp;&nbsp;<b>วัน/เวลา</b>";
        echo
"</td>";
        echo 
"<td>$data[date_help]<br></td>";
    echo
"</tr>";    
    if(
$data[files]!=""){
    echo
"  <tr height=40>";
        echo
"<td>";                                    
        echo 
"&nbsp; &nbsp;&nbsp;<img src='core_main/images/marker.gif'>&nbsp;&nbsp;<b>เอกสารประกอบ</b>";
        echo
"</td>";
        echo 
"<td><a href='$_SESSION[web_name]/mainfile/$data[files]' target=blank>ดาวน์โหลด</a><br></td>";
    echo
"</tr>";    
    }            
}
echo
"</table>";

    
    
    echo 
"<a href='index.php'>กลับหน้าหลัก</a>";
echo 
"</center>";
include(
'core_main/footer.php');
fieldset_down();
exit;



?>