Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
ltms.eemo.co.kr
/
public_html
/
super
/
Or
Select Your Path :
Upload File :
New :
File
Dir
//home/ltms.eemo.co.kr/public_html/super/farm_contract_auth_do.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_contract=RS("select * from farm_contract where no='$no' "); $contractor_company=RS("select * from contractor_company where no='{$rs_contract[contractor_company_no]}' "); $rs_farm_ju=RS("select * from member where farm_no='{$rs_contract[farm_no]}' and mtype='1' "); if($auth==1) { $contract_code=recall_id($contractor_company[prefix_code]); mysql_query("update farm_contract set contract_status='1', is_auth='$auth', is_auth_date=now(), contract_code='$contract_code', re_auth='0', re_auth_chk_date=null where no='$no' ") or die(); $data = array( 'msg' => $contractor_company[name]." ".$rs_contract[breed_type]." 계약승인요청이 승인되었습니다", 'tel' => $rs_farm_ju[cel] ); $url = "http://ltms.eemo.co.kr/super/sms_send_msg.php"; $ch = curl_init(); //curl 초기화 curl_setopt($ch, CURLOPT_URL, $url); //URL 지정하기 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //요청 결과를 문자열로 반환 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); //connection timeout 10초 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //원격 서버의 인증서가 유효한지 검사 안함 curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); //POST data curl_setopt($ch, CURLOPT_POST, true); //true시 post 전송 $response = curl_exec($ch); curl_close($ch); } else if($auth==-1) { mysql_query("update farm_contract set contract_status='-2', is_auth='$auth', is_auth_date=now(), re_auth='0', re_auth_chk_date=null where no='$no' ") or die(); mysql_query("insert into farm_contract_reject_log set farm_no='{$rs_contract[farm_no]}', farm_contract_no='$no', reject_msg='$msg', regdate=now() ") or die(); $data = array( 'msg' => $contractor_company[name]." ".$rs_contract[breed_type]." 계약승인요청이 ".$msg." 사유로 반려되었습니다", 'tel' => $rs_farm_ju[cel] ); $url = "http://ltms.eemo.co.kr/super/sms_send_msg.php"; $ch = curl_init(); //curl 초기화 curl_setopt($ch, CURLOPT_URL, $url); //URL 지정하기 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //요청 결과를 문자열로 반환 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); //connection timeout 10초 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //원격 서버의 인증서가 유효한지 검사 안함 curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); //POST data curl_setopt($ch, CURLOPT_POST, true); //true시 post 전송 $response = curl_exec($ch); curl_close($ch); } function recall_id($prefix) { $bb=$prefix.strtoupper(gen_uuid()); $rs=RS("select * from farm_contract where contract_code='$bb' "); if($rs[no]) { recall_id($prefix); } else { return $bb; } } function gen_uuid() { return sprintf('%04x', mt_rand( 0, 0xffff ) ); } $arr_rst['rst']='1'; echo json_encode($arr_rst); ?>