include "config.inc.php"; $thai_month_arr=array( "0"=>"", "1"=>"มกราคม", "2"=>"กุมภาพันธ์", "3"=>"มีนาคม", "4"=>"เมษายน", "5"=>"พฤษภาคม", "6"=>"มิถุนายน", "7"=>"กรกฎาคม", "8"=>"สิงหาคม", "9"=>"กันยายน", "10"=>"ตุลาคม", "11"=>"พฤศจิกายน", "12"=>"ธันวาคม" ); function thai_date($time){ global $thai_day_arr,$thai_month_arr; //$thai_date_return="วัน".$thai_day_arr[date("w",$time)]; $thai_date_return.= date("j",$time); $thai_date_return.= " ".$thai_month_arr[date("n",$time)]; $thai_date_return.= " ".(date("Y",$time)+543); //$thai_date_return.= " ".date("H:i",$time)." น."; return $thai_date_return; } $order_id = $_GET['order_id']; $sql = "update news_th set view = view+1 where order_id = '$order_id'"; $sql_result = mysql_db_query($dbname,$sql); $sql_show = "SELECT * FROM news_th where order_id = '$order_id'"; $regist_result = mysql_db_query($dbname,$sql_show); $array = mysql_fetch_array($regist_result); //แปลงวันจาก d/m/Y เป็นไทย $re_date = split("/",$array['date_addnews']); $date_addnews = $re_date[2]."-".$re_date[1]."-".$re_date[0]; $eng_date = strtotime("$date_addnews"); $th_date = thai_date($eng_date); ?>