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"}';
    }
}