Changeset 2718275
- Timestamp:
- 05/04/2022 07:16:43 PM (4 years ago)
- Location:
- inax-ir/trunk
- Files:
-
- 9 edited
-
assets/js/inax.check_bill_ajax.js (modified) (3 diffs)
-
bill.php (modified) (1 diff)
-
inc/ajax_check_bill.php (modified) (3 diffs)
-
inc/buy.php (modified) (1 diff)
-
inc/inax-functions.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
templates/client/default/bill.tpl (modified) (2 diffs)
-
templates/client/default/topup.tpl (modified) (2 diffs)
-
topup.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
inax-ir/trunk/assets/js/inax.check_bill_ajax.js
r2696688 r2718275 14 14 url: ajax_object.ajaxurl, // this is the object instantiated in wp_localize_script function 15 15 type: 'POST', 16 data:{ 16 data:{ 17 17 action: 'check_bill', // this is the function in your functions.php that will be triggered 18 18 bill_id: bill_id, … … 27 27 //const obj = JSON.parse(JSON.stringify(response)); 28 28 //console.log( "salam" ); 29 console.log( obj );29 //console.log( obj ); 30 30 if( obj.error_msg =='no'){ 31 31 $('.display_bill_type').html( obj.type ); … … 34 34 //check if not empty 35 35 if( obj.pay_type_fa ) { 36 console.log('ffff');37 36 $('.display_pay_type').html( obj.pay_type_fa ); 38 37 $("#tr5").show(); -
inax-ir/trunk/bill.php
r2713603 r2718275 106 106 $amount_rial = $amount*10; // تبدیل به ریال 107 107 $bill_type_name = inax_bill_type_fa($type_en); 108 109 //echo $payment_type;exit; 108 110 109 111 $pay_type_fa = ''; -
inax-ir/trunk/inc/ajax_check_bill.php
r2713603 r2718275 69 69 $type_en = $data['type_en']; 70 70 $amount = $data['amount']; 71 //$payment_type = $result['pay_type'];//تشخیص نوع پرداخت از پارامتر آینکس71 $payment_type = $data['pay_type'];//تشخیص نوع پرداخت از پارامتر آینکس 72 72 $amount_rial = $amount*10; // تبدیل به ریال 73 73 $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 } 74 92 75 93 //تشخیص نوع پرداخت برجسب موجودی کاربر … … 87 105 } 88 106 }*/ 89 $pay_type_fa = '';90 $payment_type = '';//payment_type define in buy.php107 //$pay_type_fa = ''; 108 //$payment_type = '';//payment_type define in buy.php 91 109 92 110 /* … … 124 142 $payment_type = !empty($payment_type) ? "'$payment_type'" : "NULL"; 125 143 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 )"); 127 145 if( !$sql ){ 128 146 $error_msg = 'خطا در ذخیره اطلاعات در دیتابیس ...<br/>' . $wpdb->last_error; -
inax-ir/trunk/inc/buy.php
r2713603 r2718275 86 86 'operator' => $operator, 87 87 'charge_type' => $charge_type, 88 'mnp' => $mnp, 88 89 'order_id' => $tr_id . rand(100, 999), 89 90 'callback' => $callback, -
inax-ir/trunk/inc/inax-functions.php
r2713603 r2718275 35 35 'MTN' => array('0901','0902','0903','0904','0905','0930','0933','0935','0936','0937','0938','0939','0941','0900'), 36 36 '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'), 38 38 'SHT' => array('0998'), 39 39 'TAL' => array('09329'), -
inax-ir/trunk/readme.txt
r2713603 r2718275 43 43 44 44 == Changelog == 45 = 2.9 (1401/02/14) = 46 * افزودن شماره 0923 به اپراتور رایتل 47 * افزودن گزینه انتخاب سیم کارت ترابرد شده برای خرید شارژ مستقیم 48 45 49 = 2.8 (1401/02/03) = 46 50 * انتخاب روش پرداخت از اعتبار کیف پول یا آنلاین توسط خریدار -
inax-ir/trunk/templates/client/default/bill.tpl
r2696688 r2718275 129 129 <table id="modal_result" class="table table-bordered " style="display:none;"> 130 130 <tr id="tr1" style="display:none"> 131 <th class="text-right" style="width:1 00px;" >نوع قبض</th>131 <th class="text-right" style="width:120px;" >نوع قبض</th> 132 132 <td><span class="display_bill_type" ></span> 133 133 </td> … … 151 151 {$wordpress_csrf} 152 152 <input type="hidden" class='bill_dbid' name="bill_dbid" value=""> 153 154 153 <button class="btn btn-success btn-sm" name="pay_submit" type="submit"><i class="fa fa-check"></i> پرداخت</button> 155 154 </form> -
inax-ir/trunk/templates/client/default/topup.tpl
r2713603 r2718275 139 139 <tr> 140 140 <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"> 141 146 <select name="charge_type" class="form-control form-control-lg text-center" style="cursor:pointer;" required> 142 147 <option value="">- - - - انتخاب نوع شارژ - - - -</option> … … 144 149 {if isset($mtn_active) || isset($rtl_active)} 145 150 <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>--> 147 152 {if isset($mtn_active) } 148 153 <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 20 20 $smarty->assign('title', 'خرید شارژ مستقیم'); 21 21 22 $operator =''; 22 23 if( isset($_GET['MTN']) ){ 23 24 $operator = 'MTN'; … … 36 37 $smarty->assign('sht_active', true); 37 38 } 39 $smarty->assign('operator',$operator); 38 40 39 41 if( ( isset($_POST['submit']) || isset($_POST['submit_credit']) ) && (isset($_GET['MTN']) || isset($_GET['MCI']) || isset($_GET['RTL']) || isset($_GET['SHT'])) ){ … … 48 50 $amount = (isset($_POST['amount']) && $_POST['amount'] != '') ? sanitize_text_field(trim($_POST['amount'])) : ''; 49 51 $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 : ''; 50 54 51 55 $mobile = inax_convert_fa_to_en($mobile); … … 90 94 $error_msg = 'لطفا نوع شارژ را انتخاب کنید'; 91 95 } 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" ){ 93 97 $error_msg = 'نوع شارژ صحیح نیست'; 94 98 } 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']; 97 101 } 98 102 elseif( isset($_POST['submit_credit']) && $user_credit<$amount ){ … … 102 106 $date = date('Y-m-d H:i:s'); 103 107 104 $mnp='';108 //$mnp=''; 105 109 $sim_type = 'credit'; 106 110 if($charge_type=='permanent'){ 107 111 $sim_type='permanent'; 108 }elseif($charge_type=='mnp'){ 112 } 113 /*elseif($charge_type=='mnp'){ 109 114 $mnp=1; 110 } 115 }*/ 111 116 112 117 $mnp = !empty($mnp) ? "'$mnp'" : "NULL";
Note: See TracChangeset
for help on using the changeset viewer.