function send_lms($phone, $gift, $nation) { global $_gl; global $my_db; $httpmethod = "POST"; $url = "http://api.openapi.io/ppurio/1/message/lms/minivertising"; $clientKey = "MTAyMC0xMzg3MzUwNzE3NTQ3LWNlMTU4OTRiLTc4MGItNDQ4MS05NTg5LTRiNzgwYjM0ODEyYw=="; $contentType = "Content-Type: application/x-www-form-urlencoded"; if ($gift == "1") { if ($nation == "1") { $gift_name = "브롬톤 자전거 1대"; $response = sendRequest($httpmethod, $url, $clientKey, $contentType, $phone, $gift_name); }else if ($nation == "2"){ $gift_name = "스타벅스 1년치 이용권(150만원 충전 카드)"; $response = sendRequest5($httpmethod, $url, $clientKey, $contentType, $phone, $gift_name); }else if ($nation == "3"){ $gift_name = "홍콩 왕복 항공권"; $response = sendRequest6($httpmethod, $url, $clientKey, $contentType, $phone, $gift_name); }else if ($nation == "4"){ $gift_name = "TWG 티 세트와 로얄 알버트 찻잔 세트"; $response = sendRequest7($httpmethod, $url, $clientKey, $contentType, $phone, $gift_name); } }else if ($gift == "2"){ $gift_name = "촉촉 여행 선물"; $response = sendRequest3($httpmethod, $url, $clientKey, $contentType, $phone, $gift_name); }else if ($gift == "3"){ $gift_name = "빌리프 여행 선물"; $response = sendRequest4($httpmethod, $url, $clientKey, $contentType, $phone, $gift_name); }else{ $gift_name = "촉촉 3종 체험 키트"; $response = sendRequest2($httpmethod, $url, $clientKey, $contentType, $phone, $gift_name); } $json_data = json_decode($response, true); /* 받아온 결과값을 DB에 저장 및 Variation */ $query3 = "INSERT INTO sms_info(send_phone, send_status, cmid, send_regdate) values('".$phone."','".$json_data['result_code']."','".$json_data['cmid']."','".date("Y-m-d H:i:s")."')"; $result3 = mysqli_query($my_db, $query3); $query2 = "UPDATE member_info SET mb_lms='Y' WHERE mb_phone='".$phone."'"; $result2 = mysqli_query($my_db, $query2); if ($json_data['result_code'] == "200") $flag = "Y"; else $flag = "N"; return $flag; }
} else { echo $flag = "N"; } break; case "all_send_sms": $query = "SELECT mb_phone FROM " . $_gl['member_info_table'] . " WHERE mb_use='N' ORDER BY idx DESC"; //$query = "SELECT mb_phone, mb_s_url, mb_nansu FROM ".$_gl['member_info_table']." WHERE mb_winner='Y' AND mb_use='N' AND mb_s_url<>''"; $result = mysqli_query($my_db, $query); $httpmethod = "POST"; $url = "http://api.openapi.io/ppurio/1/message/lms/minivertising"; $clientKey = "MTAyMC0xMzg3MzUwNzE3NTQ3LWNlMTU4OTRiLTc4MGItNDQ4MS05NTg5LTRiNzgwYjM0ODEyYw=="; $contentType = "Content-Type: application/x-www-form-urlencoded"; while ($data = @mysqli_fetch_array($result)) { $phone = $data['mb_phone']; $s_url = "http://www.belif-factory.com/MOBILE/coupon_page.belif?mid=" . $phone; $response = sendRequest2($httpmethod, $url, $clientKey, $contentType, $phone, $s_url); echo "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />"; $json_data = json_decode($response, true); //print_r($json_data); /* 받아온 결과값을 DB에 저장 및 Variation */ $query3 = "INSERT INTO " . $_gl['sms_info_table'] . "(send_phone, send_status, cmid, send_regdate) values('" . $phone . "','" . $json_data['result_code'] . "','" . $json_data['cmid'] . "','" . date("Y-m-d H:i:s") . "')"; $result3 = mysqli_query($my_db, $query3); $query2 = "UPDATE " . $_gl['member_info_table'] . " SET mb_use='Y' WHERE mb_phone='" . $phone . "'"; $result2 = mysqli_query($my_db, $query2); } $flag = "N"; if ($result) { echo $flag = "Y"; } else {
function send_lms2($phone, $serial) { global $_gl; global $my_db; $s_url = "http://grow.babience-event.com/MOBILE/coupon_page.php?serial=".$serial; $httpmethod = "POST"; $url = "http://api.openapi.io/ppurio/1/message/lms/minivertising"; $clientKey = "MTAyMC0xMzg3MzUwNzE3NTQ3LWNlMTU4OTRiLTc4MGItNDQ4MS05NTg5LTRiNzgwYjM0ODEyYw=="; $contentType = "Content-Type: application/x-www-form-urlencoded"; $response = sendRequest2($httpmethod, $url, $clientKey, $contentType, $phone, $s_url, $serial); $json_data = json_decode($response, true); /* 받아온 결과값을 DB에 저장 및 Variation */ $query3 = "INSERT INTO sms_info(send_phone, send_status, cmid, send_regdate) values('".$phone."','".$json_data['result_code']."','".$json_data['cmid']."','".date("Y-m-d H:i:s")."')"; $result3 = mysqli_query($my_db, $query3); $query2 = "UPDATE member_info SET mb_lms='Y' WHERE mb_phone='".$phone."'"; $result2 = mysqli_query($my_db, $query2); if ($json_data['result_code'] == "200") $flag = "Y"; else $flag = "N"; return $flag; }