Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
ltman.eemo.co.kr
/
public_html
/
www
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/ltman.eemo.co.kr/public_html/www/ltman_chulha_plan_ok_do_nonga.php
<? session_cache_limiter('no-cache, must-revalidate'); session_start(); header("Pragma: no-cache"); header("Cache-Control: no-cache,must-revalidate"); header("Content-Type: text/html; charset=utf-8"); include_once("dbconn.php"); include_once("lib.php"); foreach($_GET as $key => $value) { ${$key}=mysql_real_escape_string(trim($value)); } foreach($_POST as $key => $value) { ${$key}=mysql_real_escape_string(trim($value)); } $arr_rst=array(); $rs=RS("select * from farm_chulha_plan where parts_no='$parts_no' and jdate='$jdate' "); //mysql_query("update farm_chulha_plan set is_confirm='1', is_ltman_ok='1', is_ltman_ok_date=now() where parts_no='$parts_no' and jdate='$jdate' ") or die(); mysql_query("update farm_chulha_plan set is_confirm='1', is_confirm_date=now(), is_confirm_ltman='1' , is_confirm_ltman_date=now() where parts_no='$parts_no' and jdate='$jdate' ") or die(); $rs_condong=RS("select GROUP_CONCAT(farm_dong_info_no) as ak from farm_contract_dong where farm_contract_no='{$rs[contract_no]}' order by farm_dong_info_no asc "); $rs_plan_okdong=RS("select GROUP_CONCAT(dong_no) as ak from farm_chulha_plan where parts_no='{$rs[parts_no]}' and is_confirm='1' order by dong_no asc "); $exp1=explode(",",$rs_condong[ak]); $exp2=explode(",",$rs_plan_okdong[ak]); $arr_diff = array_diff($exp1,$exp2); if(sizeof($arr_diff)==0) { //mysql_query("update farm_contract set chulha_status='3' where no='{$rs[contract_no]}' ") or die(mysql_error()); } $arr_log_nos=array(); $result_log=mysql_query("select * from farm_chulha_plan where parts_no='$parts_no' and jdate='$jdate' ") or die(); while($rs_log=mysql_fetch_array($result_log)) { $arr_log_nos[]=$rs_log[no]; } asort($arr_log_nos); $str_log_nos=implode(",",$arr_log_nos); mysql_query("update farm_msg_alarm set is_confirm='1', is_chk='1', chk_date=now() where str_chulha_plan_nos='$str_log_nos' and is_confirm='0' and is_confirm_msg='1' ") or die(); function send_notification($tokens, $message) { $url = 'https://fcm.googleapis.com/fcm/send'; $fields = array( 'registration_ids' => $tokens, 'data' => $message ); $key = "AIzaSyCG6QsJex8nT-CVCMaDQL7vKxclJl3_XwI"; $headers = array( 'Authorization:key =' . $key, 'Content-Type: application/json' ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields)); $response = curl_exec($ch); curl_close($ch); $json=json_decode($response,true); //NotRegistered = 앱삭제 if($json["success"]) { return "success"; } else { return $response; } } $arr_rst['rst']='1'; echo urldecode(json_encode($arr_rst)); ?>