function renew_payment($user) { $this->update_payment_tries($user->uid); $db_functions_obj = new DbFunctions(); $payment_obj = new Payment(); $helper_obj = new Helper(); //pr($user); //exit; //exit; $operator_details = $db_functions_obj->get_operator_by_id($user->operator_id); //pr($operator_details); exit; /* if ($operator_details['type'] == "MO") { $from = $operator_details['paid_shortcode']; // $msg = $operator_details['verification_code']; ///شو لازم تكون المسج $smsc = $operator_details['paid_smsc']; } else{*/ $from = $operator_details['paid_shortcode']; // $msg = $operator_details['verification_code']; $smsc = $operator_details['paid_smsc']; /* } */ /* $log_id = $payment_obj->insert($user->uid, $operator_details['country_id'], $user->cid, $user->operator_id, "تم تفعيل الاشتراك بنجاح", $operator_details['paid_shortcode'], $user->phone, 1); */ // $date = time(); // $next_time = $date + $operator_details['period'] /*7 days*/; // $payment_obj->update_payment($user->uid, $date, $next_time); $db_functions_obj->update_repayment_count($user->uid); //$root = "http://arh:8080/appstreamig/streaming/"; $root = "http://www.jeelplus.com/appstreamig/streaming/api/"; $dlr_url = $root . 'index.php?action=dlr' . ('&par=%d_2_' . $user->uid . "_" . $user->operator_id . "_" . $user->phone); //echo($dlr_url); if ($user->uid) { $number = $user->phone; $port = $operator_details['port']; $helper_obj->send_sms($from, $number, "سيتم تفعيل اشتراكك", $smsc, $dlr_url, $port); } // return $uid; }
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"}'; } }