Path : /var/www/html/smart_kpp2_bk17 มีค 69/modules/la/
File Upload :
Current File : /var/www/html/smart_kpp2_bk17 มีค 69/modules/la/linenotify.php

<?php
		
//ส่งไลน์ notify
define('LINE_API',"https://line.myschool.in.th/notiapi");

//$token = "d9A54fK8lqsnm7gpu6psewhTd51Snu08LxUv5dsqRJh"; //ใส่Token ที่copy เอาไว้ ส่วนตัว
$token = "PfI0S6X65myRO8ml3nUaMVAIcqIeRMA6SILYn4BbIlC"; //กลุ่ม
//$message = "devbanban Test Line Notify API "; //ข้อความที่ต้องการส่ง สูงสุด 1000 ตัวอักษร
$url = "http://office.yst1.go.th/";
$message2 = "$message"."$subject"." $url";


$res = notify_message($message2,$token);
//print_r($res);
function notify_message($message2,$token){
 $queryData = array('message' => $message2, 'token' => $token);
 $queryData = http_build_query($queryData,'','&');
 $headerOptions = array(
		 'http'=>array(
			'method'=>'POST',
			'header'=> "Content-Type: application/x-www-form-urlencoded\r\n"
					  ."Authorization: Bearer ".$token."\r\n"
					  ."Content-Length: ".strlen($queryData)."\r\n",
			'content' => $queryData
		 ),
 );
 $context = stream_context_create($headerOptions);
 $result = file_get_contents(LINE_API,FALSE,$context);
 $res = json_decode($result);
 return $res;
}

//ค้นหา user
//echo $person_id1 = $_POST[person_id];  //รับค่าเลข ปชช.เจ้าของรายการ
$sql3="select * from system_user where person_id='$person_id'";
$dbquery3 = mysqli_query($connect,$sql3);
$ref_result3 = mysqli_fetch_array($dbquery3);
$token_line = $ref_result3['token_line'];
//$token = "$token_line";
//$token = "PfI0S6X65myRO8ml3nUaMVAIcqIeRMA6SILYn4BbIlC";
//ส่วนตัว $token = "d9A54fK8lqsnm7gpu6psewhTd51Snu08LxUv5dsqRJh";

		send_line_notify($message2, $token);

		//จบส่ง line
?>