Example #1
0
function repayment($phone, $country_id, $operator_id, $email, $callback = "", $cid = "")
{
    $db_fuctions_obj = new DbFunctions();
    $ope_details = $db_fuctions_obj->get_operator_details($operator_id);
    $phone_details = $db_fuctions_obj->get_phone_details($phone, $cid);
    if (count($phone_details) > 0) {
        //$root = "http://arh:8080/appstreamig/streaming/";
        $root = "http://www.jeelplus.com/appstreamig/streaming/api/";
        $dlr_url = $root . 'index.php?action=dlr' . ('&par=%d_2_' . $phone_details[0]['uid'] . "_" . $operator_id . "_" . $phone . "_" . $callback);
        $status = send_sms($ope_details[0]['paid_shortcode'], $phone, "لقد تم تفعيل اشتراكك بنجاح", $ope_details[0]['paid_smsc'], $dlr_url, $ope_details[0]['port']);
        $uid = $db_fuctions_obj->get_uid_by_phone($phone, $cid);
        $db_fuctions_obj->update_repayment_count('', $uid);
        /*if($status == '0: Accepted for delivery') {
                return '{"status":"1","message":"success","PersonID":"' . $email . '"}'; 
          }
          else{
                return ('{"success":"0","message":"failed"}'); 
          } */
    } else {
        return '{"success":"0","message":"phone_not_found"}';
    }
}
Example #2
0
File: index.php Project: arh922/ain
                 //call bashar service
                 //exec_curl("http://cp.m-diet.com/payments.ashx/insertpaymenttbl?PersonEmail=$email&OperatorID=$op_id&Status=1");
             }
         }
     }
     break;
 case "dlr_mo":
     $db_fuctions_obj = new DbFunctions();
     $phone = urlencode($_GET['from']);
     $shortcode = $_GET['to'];
     $sms_body = $_GET['message'];
     //email
     $smsc = $_GET['smsc'];
     //send to bashar phone and email:success
     echo '{"status":"1","email": "' . $sms_body . '", "phone":"' . $phone . '"}';
     $phone_details = $db_fuctions_obj->get_phone_details($phone);
     $email = $phone_details[0]['email'];
     $op_id = $phone_details[0]['operator_id'];
     $uid = $phone_details[0]['uid'];
     echo dlr($uid, 1, $op_id);
     break;
 case "verify_code":
     $number = $_REQUEST['phone'];
     $code = $_REQUEST['code'];
     $cid = $_REQUEST['client_id'];
     $callback = @$_REQUEST['callback'];
     echo verify_code($number, $code, $callback, $cid);
     break;
 case "cron_payment":
     //every 8 hours for 3 days
     renew_payment(@$_REQUEST['cid']);