Plugin Directory

Changeset 2718275


Ignore:
Timestamp:
05/04/2022 07:16:43 PM (4 years ago)
Author:
mohammad50
Message:

update to 2.9

Location:
inax-ir/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • inax-ir/trunk/assets/js/inax.check_bill_ajax.js

    r2696688 r2718275  
    1414        url: ajax_object.ajaxurl, // this is the object instantiated in wp_localize_script function
    1515        type: 'POST',
    16         data:{ 
     16        data:{
    1717            action: 'check_bill', // this is the function in your functions.php that will be triggered
    1818            bill_id: bill_id,
     
    2727            //const obj = JSON.parse(JSON.stringify(response));
    2828            //console.log( "salam" );
    29             console.log( obj );
     29            //console.log( obj );
    3030            if( obj.error_msg =='no'){
    3131                $('.display_bill_type').html( obj.type );
     
    3434                //check if not empty
    3535                if( obj.pay_type_fa ) {
    36                     console.log('ffff');
    3736                    $('.display_pay_type').html( obj.pay_type_fa );
    3837                    $("#tr5").show();
  • inax-ir/trunk/bill.php

    r2713603 r2718275  
    106106                    $amount_rial    = $amount*10; // تبدیل به ریال
    107107                    $bill_type_name = inax_bill_type_fa($type_en);
     108
     109                    //echo $payment_type;exit;
    108110
    109111                    $pay_type_fa = '';
  • inax-ir/trunk/inc/ajax_check_bill.php

    r2713603 r2718275  
    6969                $type_en        = $data['type_en'];
    7070                $amount         = $data['amount'];
    71                 //$payment_type     = $result['pay_type'];//تشخیص نوع پرداخت از پارامتر آینکس
     71                $payment_type   = $data['pay_type'];//تشخیص نوع پرداخت از پارامتر آینکس
    7272                $amount_rial    = $amount*10; // تبدیل به ریال
    7373                $bill_type_name = inax_bill_type_fa($type_en);
     74
     75                //error_log( print_r($data, true) );
     76
     77                $pay_type_fa = '';
     78                if( $payment_type=='credit' ){//اگر نوع پرداخت از سمت آینکس اعتباری برگشت داده شود نماینده اعتبار کافی جهت پرداخت دارد
     79                    $pay_type_fa = 'پرداخت اعتباری';
     80                    //بررسی لاگین بودن و داشتن اعتبار خریدار برای اجازه پرداخت اعتباری
     81                    if( get_current_user_id()==0){
     82                        $payment_type = 'online';
     83                        $pay_type_fa = 'پرداخت آنلاین(کاربر مهمان)';
     84                    }else{//بررسی اعتبار خریدار
     85                        $credit = inax_check_user_credit();//return as toman
     86                        if( $credit < $amount ){//تغییر روش پرداخت به آنلاین به علت کافی نبودن اعتبار
     87                            $payment_type='online';
     88                            $pay_type_fa = 'پرداخت آنلاین(به علت کافی نبودن موجودی کیف پول خریدار)';
     89                        }
     90                    }
     91                }
    7492
    7593                //تشخیص نوع پرداخت برجسب موجودی کاربر
     
    87105                    }
    88106                }*/
    89                 $pay_type_fa = '';
    90                 $payment_type = '';//payment_type define in buy.php
     107                //$pay_type_fa = '';
     108                //$payment_type = '';//payment_type define in buy.php
    91109
    92110                /*
     
    124142                $payment_type   = !empty($payment_type) ? "'$payment_type'" : "NULL";
    125143
    126                 $sql = $wpdb->query( "INSERT INTO $inax_charge_db (type, client_id, bill_id, pay_id,bill_type, amount,mobile,check_bill_result,payment_type, date, mode ) VALUES ('bill', '$client_id', '$bill_id', '$pay_id', '$type_en', '$amount', '$mobile', '$check_bill_result','$payment_type', '$date', $mode )");
     144                $sql = $wpdb->query( "INSERT INTO $inax_charge_db (type, client_id, bill_id, pay_id,bill_type, amount,mobile,check_bill_result,payment_type, date, mode ) VALUES ('bill', '$client_id', '$bill_id', '$pay_id', '$type_en', '$amount', '$mobile', '$check_bill_result', $payment_type, '$date', $mode )");
    127145                if( !$sql ){
    128146                    $error_msg = 'خطا در ذخیره اطلاعات در دیتابیس ...<br/>' . $wpdb->last_error;
  • inax-ir/trunk/inc/buy.php

    r2713603 r2718275  
    8686                        'operator'      => $operator,
    8787                        'charge_type'   => $charge_type,
     88                        'mnp'           => $mnp,
    8889                        'order_id'      => $tr_id . rand(100, 999),
    8990                        'callback'      => $callback,
  • inax-ir/trunk/inc/inax-functions.php

    r2713603 r2718275  
    3535            'MTN'   => array('0901','0902','0903','0904','0905','0930','0933','0935','0936','0937','0938','0939','0941','0900'),
    3636            'MCI'   => array('0910','0911','0912','0913','0914','0915','0916','0917','0918','0919','0990','0991','0994','0992','0993'),
    37             'RTL'   => array('0920','0921','0922'),
     37            'RTL'   => array('0920','0921','0922','0923'),
    3838            'SHT'   => array('0998'),
    3939            'TAL'   => array('09329'),
  • inax-ir/trunk/readme.txt

    r2713603 r2718275  
    4343
    4444== Changelog ==
     45= 2.9 (1401/02/14) =
     46* افزودن شماره 0923 به اپراتور رایتل
     47* افزودن گزینه انتخاب سیم کارت ترابرد شده برای خرید شارژ مستقیم
     48
    4549= 2.8 (1401/02/03) =
    4650* انتخاب روش پرداخت از اعتبار کیف پول یا آنلاین توسط خریدار
  • inax-ir/trunk/templates/client/default/bill.tpl

    r2696688 r2718275  
    129129                                    <table id="modal_result" class="table table-bordered " style="display:none;">
    130130                                        <tr id="tr1" style="display:none">
    131                                             <th class="text-right" style="width:100px;" >نوع قبض</th>
     131                                            <th class="text-right" style="width:120px;" >نوع قبض</th>
    132132                                            <td><span class="display_bill_type" ></span>
    133133                                            </td>
     
    151151                                                    {$wordpress_csrf}
    152152                                                    <input type="hidden" class='bill_dbid' name="bill_dbid" value="">
    153 
    154153                                                    <button class="btn btn-success btn-sm" name="pay_submit" type="submit"><i class="fa fa-check"></i> پرداخت</button>
    155154                                                </form>
  • inax-ir/trunk/templates/client/default/topup.tpl

    r2713603 r2718275  
    139139                            <tr>
    140140                                <td colspan="3">
     141                                    <input type="checkbox" name="mnp" class="text-center" value="1" {if isset($smarty.post.mnp) && $smarty.post.mnp eq 1 }checked{/if} id="mnp_label"> <label for="mnp_label"> در صورتی که شماره فوق به {$operator|operator_fa} ترابرد شده است این گزینه را فعال نمائید.</label>
     142                                </td>
     143                            </tr>
     144                            <tr>
     145                                <td colspan="3">
    141146                                    <select name="charge_type" class="form-control form-control-lg text-center" style="cursor:pointer;" required>
    142147                                        <option value="">- - - - انتخاب نوع شارژ - - - -</option>
     
    144149                                        {if isset($mtn_active) || isset($rtl_active)}
    145150                                        <option value="amazing" {if isset($smarty.post.charge_type) && $smarty.post.charge_type eq "amazing" }selected{/if} >{if isset($mtn_active) }شارژ شگفت انگیز{elseif isset($rtl_active)}شارژ شور انگیز{/if}</option>{/if}
    146                                         <option value="mnp" {if isset($smarty.post.charge_type) && $smarty.post.charge_type eq "mnp" }selected{/if} >شارژ سیم کارت ترابرد شده</option>
     151                                        <!--<option value="mnp" {if isset($smarty.post.charge_type) && $smarty.post.charge_type eq "mnp" }selected{/if} >شارژ سیم کارت ترابرد شده</option>-->
    147152                                        {if isset($mtn_active) }
    148153                                        <option value="permanent" {if isset($smarty.post.charge_type) && $smarty.post.charge_type eq "permanent" }selected{/if} >شارژ سیم کارت دایمی</option>{/if}
  • inax-ir/trunk/topup.php

    r2713603 r2718275  
    2020    $smarty->assign('title', 'خرید شارژ مستقیم');
    2121
     22    $operator ='';
    2223    if( isset($_GET['MTN']) ){
    2324        $operator = 'MTN';
     
    3637        $smarty->assign('sht_active', true);
    3738    }
     39    $smarty->assign('operator',$operator);
    3840
    3941    if( ( isset($_POST['submit']) || isset($_POST['submit_credit']) ) && (isset($_GET['MTN']) || isset($_GET['MCI']) || isset($_GET['RTL']) || isset($_GET['SHT'])) ){
     
    4850        $amount         = (isset($_POST['amount']) && $_POST['amount'] != '') ? sanitize_text_field(trim($_POST['amount'])) : '';
    4951        $charge_type    = (isset($_POST['charge_type']) && $_POST['charge_type'] != '') ? sanitize_text_field($_POST['charge_type']) : '';
     52
     53        $mnp        = (isset($_POST['mnp']) && $_POST['mnp']==1) ? 1 : '';
    5054
    5155        $mobile = inax_convert_fa_to_en($mobile);
     
    9094            $error_msg = 'لطفا نوع شارژ را انتخاب کنید';
    9195        }
    92         elseif( $charge_type != "normal" && $charge_type != "amazing" && $charge_type != "mnp" && $charge_type != "permanent" ){
     96        elseif( $charge_type != "normal" && $charge_type != "amazing" && $charge_type != "permanent" ){
    9397            $error_msg = 'نوع شارژ صحیح نیست';
    9498        }
    95         elseif( op_number_check($operator,$mobile,$charge_type)['result']==false ){
    96             $error_msg = "خطا : " . op_number_check($operator,$mobile,$charge_type)['msg'];
     99        elseif( op_number_check($operator,$mobile,$mnp)['result']==false ){
     100            $error_msg = "خطا : " . op_number_check($operator,$mobile,$mnp)['msg'];
    97101        }
    98102        elseif( isset($_POST['submit_credit']) && $user_credit<$amount ){
     
    102106            $date = date('Y-m-d H:i:s');
    103107
    104             $mnp='';
     108            //$mnp='';
    105109            $sim_type   = 'credit';
    106110            if($charge_type=='permanent'){
    107111                $sim_type='permanent';
    108             }elseif($charge_type=='mnp'){
     112            }
     113            /*elseif($charge_type=='mnp'){
    109114                $mnp=1;
    110             }
     115            }*/
    111116
    112117            $mnp    = !empty($mnp) ? "'$mnp'" : "NULL";
Note: See TracChangeset for help on using the changeset viewer.