/home/banprang/domains/plai.go.th/public_html/coremain/module/e_service1/e_service1_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
<?php
$navig
['send_mail']="E-Services";
navigator($navig);
echo
"<br>";
bar_header("E-Services"); // Bar_Header
fieldset_top("ส่งข้อมูลสำเร็จ");

$message strip_tags($p_evar);
$file_name '';
if(
$_FILES['file_send']['name'] != ''){
  
$path_dir $_SESSION['web_name'].'/module_eservice1/';
  
  
$file_upload trim($_FILES['file_send']['name']);
  
$file_name create_filename($file_upload);
  
$dlink $path_dir.$file_name;
  
//upload_file_to_server($dlink, $_FILES['file_send']);
  
move_uploaded_file($_FILES['file_send']['tmp_name'], $dlink);
}

if(
$p_topic != ''){
  
$send_date date('d/m/Y H:i:s');
  
$_id select_max_query0('id''cms_eservice1');
  
$id $_id[0] == '' $_id[0];
  
$user_ip get_client_ip();
  
$insert "insert into cms_eservice1 (id, type_id, topic, detail, sender_name, sender_tel, sender_mail, send_date, sender_ip, file_attach) values ('$id', '$p_service_title', '$p_topic', '$message', '$p_sender_name', '$p_sender_tel', '$p_sender_mail', '$send_date', '$user_ip', '$file_name')";
  
mysql_query($insert);
}

function 
get_client_ip() {
  
$ipaddress '';
  if (
getenv('HTTP_CLIENT_IP'))
      
$ipaddress getenv('HTTP_CLIENT_IP');
  else if(
getenv('HTTP_X_FORWARDED_FOR'))
      
$ipaddress getenv('HTTP_X_FORWARDED_FOR');
  else if(
getenv('HTTP_X_FORWARDED'))
      
$ipaddress getenv('HTTP_X_FORWARDED');
  else if(
getenv('HTTP_FORWARDED_FOR'))
      
$ipaddress getenv('HTTP_FORWARDED_FOR');
  else if(
getenv('HTTP_FORWARDED'))
     
$ipaddress getenv('HTTP_FORWARDED');
  else if(
getenv('REMOTE_ADDR'))
      
$ipaddress getenv('REMOTE_ADDR');
  else
      
$ipaddress 'UNKNOWN';
  return 
$ipaddress;
}

echo
"<br/><b><center>ส่งข้อมูลเรียบร้อยแล้ว</center><br/></b>";
refresh_data('index.php?mod=e_service1&path=e_service1'2);    // กลับหน้าหลัก

echo fieldset_down();
?>