Esempio n. 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"}';
    }
}
Esempio n. 2
0
File: index.php Progetto: arh922/ain
     break;
 case "dlr":
     $par = $_GET['par'];
     $par = explode("_", $par);
     $del = $par[0];
     $type = $par[1];
     $uid = $par[2];
     $op_id = $par[3];
     $phone = $par[4];
     if (!isset($par[5])) {
         $callback = "callback";
     } else {
         $callback = $par[5];
     }
     $db_fuctions_obj = new DbFunctions();
     $ope_details = $db_fuctions_obj->get_operator_details($op_id);
     //pr($par);
     //  pr($ope_details);
     $period = $ope_details[0]['period'] * 24 * 60 * 60;
     //check if ver code is correct
     if ($par[1] == 1) {
         echo dlr($uid, $del, $op_id);
     } else {
         if ($par[1] == 2) {
             //$ope_details = get_operator_details($op_id);
             $log_obj = new Payment();
             $log_obj->update_log_del_status($uid, $del);
             $success_array = array(1);
             //sucuss
             if ($op_id == 1) {
                 //jawwal