$Post_Data['UserID'] = 'TESTID';
$Post_Data['UserPW'] = 'TESTPW';
$Post_Data['Service'] = 'ATALK';
$Post_Data['Type'] = 'Send';
$Post_Data['Callback'] = '*** 개인정보보호를 위한 전화번호 노출방지 ***';
$Post_Data['Send_Date'] = '';
$Post_Data['Fail_To_Template'] = 1;
if( $w=="" && !$is_admin ) {
$Post_Data['Template_Seq'] = '250';
$Post_Data['Fail_To'] = 'LMS';
$Post_Data['Subject'] = '관리자에게';
$Post_Data['Main_Text'] = '관리자에게 보내는 내용';
$Dest[] = Array("Company" => "회사명", "Name" => "관리자", "Phone" => "관리자전화번호",
"Replace_Datas" => Array(
Array("Key" => "#{이름}", "Value" => ""),
Array("Key" => "#{내용}", "Value" => "")
)
);
$phpVersion = substr(phpversion(), 0, 3) * 1;
if ( $phpVersion >= 5.4 ) {
$Destination = json_encode($Dest, JSON_UNESCAPED_UNICODE);
} else {
function han($s) { return reset(json_decode('{"s":"'.$s.'"}')); }
function to_han($str) { return preg_replace('/(\\\u[a-f0-9]+)+/e','han("$0")',$str); }
$Destination = to_han(json_encode($Dest));
}
$Post_Data["Destination"] = $Destination;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://balsongking.com/Linkage/API/');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: multipart/form-data'));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $Post_Data);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ( $status != 200 ) {
die("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($ch) . ", curl_errno " . curl_errno($ch));
}
curl_close($ch);
$jsonDecodeArr = json_decode($response, true);
if ( $jsonDecodeArr['Result'] != 'OK' ) {
echo iconv("UTF-8", "EUC-KR", $jsonDecodeArr['Message']);
exit;
}
$resultTh = "접수번호";
$resultTd = $jsonDecodeArr['Job_No'];
$Post_Data['Template_Seq'] = '251';
$Post_Data['Fail_To'] = 'LMS';
$Post_Data['Subject'] = '작성자에게';
$Post_Data['Main_Text'] = '작성자에게 보내는 내용';
$Dest[] = Array("Company" => "회사명", "Name" => "작성자", "Phone" => "작성자전화번호",
"Replace_Datas" => Array(
Array("Key" => "#{이름}", "Value" => ""),
Array("Key" => "#{내용}", "Value" => "")
)
);
$phpVersion = substr(phpversion(), 0, 3) * 1;
if ( $phpVersion >= 5.4 ) {
$Destination = json_encode($Dest, JSON_UNESCAPED_UNICODE);
} else {
function han($s) { return reset(json_decode('{"s":"'.$s.'"}')); }
function to_han($str) { return preg_replace('/(\\\u[a-f0-9]+)+/e','han("$0")',$str); }
$Destination = to_han(json_encode($Dest));
}
$Post_Data["Destination"] = $Destination;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://balsongking.com/Linkage/API/');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: multipart/form-data'));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $Post_Data);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ( $status != 200 ) {
die("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($ch) . ", curl_errno " . curl_errno($ch));
}
curl_close($ch);
$jsonDecodeArr = json_decode($response, true);
if ( $jsonDecodeArr['Result'] != 'OK' ) {
echo iconv("UTF-8", "EUC-KR", $jsonDecodeArr['Message']);
exit;
}
$resultTh = "접수번호";
$resultTd = $jsonDecodeArr['Job_No'];
}