0byt3m1n1-V2
Path:
/
home
/
xncercjb
/
domains
/
quickspace.co.th
/
public_html
/
include
/
[
Home
]
File: function.ph1
<?php if( $_SERVER['HTTP_HOST'] == 'localhost' || strncmp($_SERVER['HTTP_HOST'], "192.168.", 8)==0 ) $backto = base64_encode("http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); else $backto = base64_encode("https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); if( $_SESSION['sess_lang'] == "EN" ){ include("lang.english.inc.php"); $class_curen = "active"; }else if( $_SESSION['sess_lang'] == "JP" ){ include("lang.japan.inc.php"); $class_curen = "active"; }else if( $_SESSION['sess_lang'] == "CH" ){ include("lang.china.inc.php"); $class_curen = "active"; }else{ include("lang.thai.inc.php"); $class_curth = "active"; } function displaydate($x) { $date_m = array("มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"); $time_array=explode(" ",$x); $date = $time_array[0]; $time = $time_array[1]; $date_array=explode("-",$date); $y = $date_array[0]+543; $m = $date_array[1]-1; $d = $date_array[2]; $m=$date_m[$m]; $displaydate= "$d $m $y "; return $displaydate; } function displaydateEN($x) { $date_m = array("January","February","March","April","May","June","July","August","September","October","November","December"); $time_array=explode(" ",$x); $date = $time_array[0]; $time = $time_array[1]; $date_array=explode("-",$date); $y = $date_array[0]; $m = $date_array[1]-1; $d = $date_array[2]; $m=$date_m[$m]; $displaydate= "$m $d, $y "; return $displaydate; } function displaydate_en2($x) { $date_m = array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); $time_array=explode(" ",$x); $date = $time_array[0]; $time = $time_array[1]; $date_array=explode("-",$date); $y = $date_array[0]; $m = $date_array[1]-1; $d = $date_array[2]; $m=$date_m[$m]; $displaydate= "$d $m $y"; return $displaydate; } function displaytime($x) { $time_array=explode(" ",$x); $date = $time_array[0]; $time = $time_array[1]; //$date_array=explode("-",$date); /*$y = $date_array[0]+543; $m = $date_array[1]-1; $d = $date_array[2]; $m=$date_m[$m];*/ $displaytime= "$time"; return $displaytime; } function getEmail($email,$sign=null){ $mail_contact = explode(',', $email); $count = 0 ; $total=count($mail_contact); if ($sign==null) {$sign = ", ";} while ($count < $total) { if ($count >=1) { $displayemail .= $sign; //", "; } $displayemail .= "<a href='mailto:".$mail_contact[$count]."'> ".$mail_contact[$count]." </a>" ; $count ++; } return $displayemail; } function getPhoneTop($phone){ $tel_b = explode(',', $phone); $count = 0 ; $total=count($tel_b); while ($count < $total) { $tel_b[$count] = trim($tel_b[$count]); $cut_tel = array(' ','+', "\n", "(", ")"); //"-", $tel_a[$count] = str_replace($cut_tel, '', $tel_b[$count] ); $rest = str_replace("-",'', $tel_a[$count] ); $rest = substr($rest, 0, 10); if ($count >=1) { $displayphone .= " | "; } preg_match("/[[:digit:]]+\.?[[:digit:]]*/", $rest , $phone_number ) ; $displayphone .= '<a href="tel:'.$phone_number[0].'">'.$tel_b[$count].'</a>'; $count ++; } return $displayphone; } function getPhone($phone){ $tel_b = explode(',', $phone); $count = 0 ; $total=count($tel_b); while ($count < $total) { $tel_b[$count] = trim($tel_b[$count]); $cut_tel = array(' ','+', "\n", "(", ")"); //"-", $tel_a[$count] = str_replace($cut_tel, '', $tel_b[$count] ); $rest = str_replace("-",'', $tel_a[$count] ); $rest = substr($rest, 0, 10); if ($count >=1) { $displayphone .= ", "; } preg_match("/[[:digit:]]+\.?[[:digit:]]*/", $rest , $phone_number ) ; $displayphone .= '<a href="tel:'.$phone_number[0].'">'.$tel_b[$count].'</a>'; $count ++; } return $displayphone; } function getPhone2($phone){ $tel_b = explode(',', $phone); $count = 0 ; $total=count($tel_b); while ($count < $total) { $tel_b[$count] = trim($tel_b[$count]); $cut_tel = array(' ','+', "\n", "(", ")"); //"-", $tel_a[$count] = str_replace($cut_tel, '', $tel_b[$count] ); $rest = str_replace("-",'', $tel_a[$count] ); $rest = substr($rest, 0, 10); if ($count >=1) { $displayphone .= ", "; } preg_match("/[[:digit:]]+\.?[[:digit:]]*/", $rest , $phone_number ) ; $displayphone .= $tel_b[$count]; $count ++; } return $displayphone; } function getPhoneTel($phone,$numsubstr){ $tel_b = explode(',', $phone); $count = 0 ; $total=count($tel_b); while ($count < $total) { $tel_b[$count] = trim($tel_b[$count]); $cut_tel = array(' ','+', "\n", "(", ")"); //"-", $tel_a[$count] = str_replace($cut_tel, '', $tel_b[$count] ); $rest = str_replace("-",'', $tel_a[$count] ); $rest = substr($rest, 0, $numsubstr); if ($count >=1) { $displayphone .= ", "; } preg_match("/[[:digit:]]+\.?[[:digit:]]*/", $rest , $phone_number ) ; $displayphone .= '<a href="tel:'.$phone_number[0].'">'.$tel_b[$count].'</a>'; $count ++; } return $displayphone; } function word_name_link($text) { $news_name_link = str_replace(" ", "-", trim($text)); //ถ้าเป็นช่องว่าง ให้เติม - $news_name_link = str_replace('"', '' , trim($news_name_link)); //ถ้าเป็น " ให้ตัดออก $cut_name_link = array(' ','+', '\n', '(", ")','/','-/-','"','"'); //"-", $news_name_link = str_replace($cut_name_link, '', $news_name_link ); $news_name_link = substr($news_name_link,0,200); //ตัดข้อความไม่ให้ยาวเกิน return $news_name_link; } function getLineID($phone,$sign=null){ $tel_b = explode(',', $phone); $count = 0 ; $total=count($tel_b); if($total > 1){ if($sign==null) {$sign = ",";} while ($count < $total) { $tel_b[$count] = trim($tel_b[$count]); $cut_tel = array(' ','+', "\n", "(", ")"); //"-", $tel_a[$count] = str_replace($cut_tel, '', $tel_b[$count] ); $rest = str_replace("-",'', $tel_a[$count] ); $rest = substr($rest, 0, 10); if($count >= 1) { $displayLineID .= $sign." "; } preg_match("/[[:digit:]]+\.?[[:digit:]]*/", $rest , $phone) ; $displayLineID .= '<a href="http://line.me/ti/p/~'.$tel_b[$count].'">'.$tel_b[$count].'</a> '; $count ++; } }else{ $displayLineID .= '<a href="http://line.me/ti/p/~'.$phone.'">'.$phone.'</a> '; } return $displayLineID; } function detailImg($text){ $detail = str_replace('<img src="../../', '<img src="../', trim($text)); //ถ้าเป็นช่องว่าง ให้เติม - return $detail; } function getBrand($value){ if($value!=""){ $category=explode(",",$value); $count_cate=count($category); for($x=0;$x<$count_cate;$x++){ if(!empty($category[$x])){ $sql="SELECT * FROM tb_product_brand WHERE bran_id=".$category[$x]; $result_cate=mysql_queryx($sql); $r_cate=mysql_fetch_arrayx($result_cate); if ($x >1) { $getBrandName .= ", "; } $getBrandName.= $r_cate['bran_name']; } } } return $getBrandName; } ?>
©
2018.