<?php 
error_reporting(0);
date_default_timezone_set("Asia/Bangkok");


$hostname_conn = "127.0.0.1"; 	
$user_conn = "root"; 		
$passwords_conn= "";  
$dbname_conn = "work_request"; 	

//$ip=getenv(REMOTE_ADDR);
$date=date('Y-m-d');
$time=date('H:i:s');
$IP_SERVER="http://".$_SERVER["SERVER_ADDR"]."/Request/";
//$IP_SERVER="http://egat.servehttp.com/Request/";

$conn=mysqli_connect($hostname_conn, $user_conn, $passwords_conn,$dbname_conn) or die("ติดต่อฐานขู้อมูลไม่ได้");
mysqli_set_charset($conn,"utf8");

function date_time_work($data){
	//substr($data,9,2);
	$text_m = "";
	switch (substr($data,5,2)) {
	    case "01":$text_m = 'ม.ค.';break;
	    case "02":$text_m = 'ก.พ.';break;
	    case "03":$text_m = 'มี.ค.';break;
	    case "04":$text_m = 'เม.ย.';break;
	    case "05":$text_m = 'พ.ค.';break;
	    case "06":$text_m = 'มิ.ย.';break;
	    case "07":$text_m = 'ก.ค.';break;
	    case "08":$text_m = 'ส.ค.';break;
	    case "09":$text_m = 'ก.ย.';break;
	    case "10":$text_m = 'ต.ค.';break;
	    case "11":$text_m = 'พ.ย.';break;
	    case "12":$text_m = 'ธ.ค.';break;
	    default: $text_m = substr($data,6,2);
	}
	return substr($data,8,2)." ".$text_m." ".(substr($data,0,4)+543);
}

?>