Completed
Push — v3.0 ( 23635d...e28df5 )
by Samir
23s
created
astpp/application/modules/accounts/views/view_reseller_details.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,13 +62,13 @@
 block discarded – undo
62 62
             <div class="col-md-12 no-padding color-three border_box"> 
63 63
                 <div class="pull-left">
64 64
                     <ul class="breadcrumb">
65
-                        <li><a href="<?= base_url() . "accounts/" . strtolower($entity_name) . "_list/";?>"><?= ucfirst($entity_name); ?>s</a></li>
66
-                        <li class="active"><a href="<?= base_url() . "accounts/" . strtolower($entity_name) . "_edit/" . $edit_id . "/";?>"> <?= ucfirst($entity_name); ?> Profile </a></li>
65
+                        <li><a href="<?= base_url()."accounts/".strtolower($entity_name)."_list/"; ?>"><?= ucfirst($entity_name); ?>s</a></li>
66
+                        <li class="active"><a href="<?= base_url()."accounts/".strtolower($entity_name)."_edit/".$edit_id."/"; ?>"> <?= ucfirst($entity_name); ?> Profile </a></li>
67 67
                     </ul>
68 68
                 </div>
69 69
                 <div class="pull-right">
70 70
                     <ul class="breadcrumb">
71
-		      <li class="active pull-right"><a href="<?= base_url() . "accounts/reseller_list/";?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
71
+		      <li class="active pull-right"><a href="<?= base_url()."accounts/reseller_list/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
72 72
                     </ul>
73 73
                 </div>
74 74
             </div>     
Please login to merge, or discard this patch.
astpp/application/modules/accounts/views/view_customer_details.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,14 +56,14 @@
 block discarded – undo
56 56
             <div class="col-md-12 no-padding color-three border_box"> 
57 57
                 <div class="pull-left">
58 58
                     <ul class="breadcrumb">
59
-                    <?php $entity= $entity_name == 'provider' ? 'customer':$entity_name; ?>
60
-                        <li><a href="<?= base_url() . "accounts/" . strtolower($entity) . "_list/";?>"><?= ucfirst($entity_name); ?>s</a></li>
61
-                        <li class="active"><a href="<?= base_url() . "accounts/" . strtolower($entity_name) . "_edit/" . $edit_id . "/";?>"> <?= ucfirst($accounttype); ?> Profile </a></li>
59
+                    <?php $entity = $entity_name == 'provider' ? 'customer' : $entity_name; ?>
60
+                        <li><a href="<?= base_url()."accounts/".strtolower($entity)."_list/"; ?>"><?= ucfirst($entity_name); ?>s</a></li>
61
+                        <li class="active"><a href="<?= base_url()."accounts/".strtolower($entity_name)."_edit/".$edit_id."/"; ?>"> <?= ucfirst($accounttype); ?> Profile </a></li>
62 62
                     </ul>
63 63
                 </div>
64 64
                 <div class="pull-right">
65 65
                     <ul class="breadcrumb">
66
-		      <li class="active pull-right"><a href="<?= base_url() . "accounts/customer_list/";?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
66
+		      <li class="active pull-right"><a href="<?= base_url()."accounts/customer_list/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
67 67
                     </ul>
68 68
                 </div>
69 69
             </div>     
Please login to merge, or discard this patch.
astpp/application/modules/accounts/views/view_reseller_edit_details_own.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 //         $(".invoice_day").hide();
27 27
 //         $('label[for="Billing Day"]').hide()
28 28
        
29
-document.getElementsByName("currency_id")[0].selectedIndex = <?=$currency_id-1?>;
30
-document.getElementsByName("timezone_id")[0].selectedIndex = <?=$timezone_id-1?>;
31
-document.getElementsByName("country_id")[0].selectedIndex = <?=$country_id-1?>;
29
+document.getElementsByName("currency_id")[0].selectedIndex = <?=$currency_id - 1?>;
30
+document.getElementsByName("timezone_id")[0].selectedIndex = <?=$timezone_id - 1?>;
31
+document.getElementsByName("country_id")[0].selectedIndex = <?=$country_id - 1?>;
32 32
 document.getElementsByName("sweep_id")[0].selectedIndex = <?=2?>;
33 33
  
34 34
 	 $(".sweep_id").change(function(e){
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
  <div class="w-section inverse no-padding">
63 63
 				     <?php echo $form; ?>
64 64
 				     <?php
65
-					if(isset($validation_errors) && $validation_errors != ''){ ?>
65
+					if (isset($validation_errors) && $validation_errors != '') { ?>
66 66
 					    <script>
67 67
 						var ERR_STR = '<?php echo $validation_errors; ?>';
68 68
 						print_error(ERR_STR);
Please login to merge, or discard this patch.
astpp/application/modules/accounts/views/view_customer_invoices.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 <? startblock('extra_head') ?>
4 4
 <script type="text/javascript" language="javascript">
5 5
     $(document).ready(function() {
6
-        build_grid("invoices_list","<?php echo base_url() . "accounts/customer_details_json/invoices/$edit_id/"; ?>",<? echo $grid_fields; ?>,"");
6
+        build_grid("invoices_list","<?php echo base_url()."accounts/customer_details_json/invoices/$edit_id/"; ?>",<? echo $grid_fields; ?>,"");
7 7
         $("#left_panel_quick_search").keyup(function(){
8 8
             quick_search("accounts/customer_details_search/"+'<?php echo $accounttype?>'+"_invoices/");
9 9
         });
@@ -22,12 +22,12 @@  discard block
 block discarded – undo
22 22
             <div class="col-md-12 no-padding color-three border_box"> 
23 23
                 <div class="pull-left">
24 24
                     <ul class="breadcrumb">
25
-                        <li><a href="<?= base_url() . "accounts/" . strtolower($accounttype) . "_list/"; ?>"><?= ucfirst($accounttype); ?>s</a></li>
25
+                        <li><a href="<?= base_url()."accounts/".strtolower($accounttype)."_list/"; ?>"><?= ucfirst($accounttype); ?>s</a></li>
26 26
                         <li>
27
-                            <a href="<?= base_url() . "accounts/" . strtolower($accounttype) . "_edit/" . $edit_id . "/"; ?>"> Profile </a>
27
+                            <a href="<?= base_url()."accounts/".strtolower($accounttype)."_edit/".$edit_id."/"; ?>"> Profile </a>
28 28
                         </li>
29 29
                         <li class="active">
30
-                            <a href="<?= base_url() . "accounts/" . strtolower($accounttype) . "_invoices/" . $edit_id . "/"; ?>">
30
+                            <a href="<?= base_url()."accounts/".strtolower($accounttype)."_invoices/".$edit_id."/"; ?>">
31 31
                                 Invoices
32 32
                             </a>
33 33
                         </li>
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
                 <div class="pull-right">
37 37
                     <ul class="breadcrumb">
38 38
 		      <li class="active pull-right">
39
-		      <a href="<?= base_url() . "accounts/" . strtolower($accounttype) . "_edit/" . $edit_id . "/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
39
+		      <a href="<?= base_url()."accounts/".strtolower($accounttype)."_edit/".$edit_id."/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
40 40
                     </ul>
41 41
                 </div>
42 42
             </div>     
Please login to merge, or discard this patch.
astpp/application/modules/accounts/views/view_customer_speed_dial.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -62,19 +62,19 @@  discard block
 block discarded – undo
62 62
             <div class="col-md-12 no-padding color-three border_box"> 
63 63
                 <div class="pull-left">
64 64
                     <ul class="breadcrumb">
65
-                        <li><a href="<?= base_url() . "accounts/" . strtolower($accounttype) . "_list/";?>"><?= ucfirst($accounttype); ?>s </a></li>
65
+                        <li><a href="<?= base_url()."accounts/".strtolower($accounttype)."_list/"; ?>"><?= ucfirst($accounttype); ?>s </a></li>
66 66
                         <li>
67
-                            <a href="<?= base_url() . "accounts/" . strtolower($accounttype) . "_edit/" . $edit_id . "/"; ?>"> Profile </a>
67
+                            <a href="<?= base_url()."accounts/".strtolower($accounttype)."_edit/".$edit_id."/"; ?>"> Profile </a>
68 68
                         </li>
69 69
                        <li class="active">
70
-                            <a href="<?= base_url() . "accounts/" . strtolower($accounttype) . "_speeddial/" . $edit_id . "/"; ?>"> Speed Dial </a>
70
+                            <a href="<?= base_url()."accounts/".strtolower($accounttype)."_speeddial/".$edit_id."/"; ?>"> Speed Dial </a>
71 71
                         </li>
72 72
                     </ul>
73 73
                 </div>
74 74
                 <div class="pull-right">
75 75
                     <ul class="breadcrumb">
76 76
 		      <li class="active pull-right">
77
-		      <a href="<?= base_url() . "accounts/" . strtolower($accounttype) . "_edit/" . $edit_id . "/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
77
+		      <a href="<?= base_url()."accounts/".strtolower($accounttype)."_edit/".$edit_id."/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
78 78
                     </ul>
79 79
                 </div>                
80 80
             </div>     
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
                                             </label>
132 132
                                             </div>
133 133
                                                <div class="col-md-3">
134
-                                            <input class="col-md-2 form-control" name="speed_dial_<?php echo $i; ?>" id="speed_dial_<?php echo $i; ?>" size="16" type="text"  value="<?php if (isset($speeddial[$i]) && !empty($speeddial[$i])) {
134
+                                            <input class="col-md-2 form-control" name="speed_dial_<?php echo $i; ?>" id="speed_dial_<?php echo $i; ?>" size="16" type="text"  value="<?php if (isset($speeddial[$i]) && ! empty($speeddial[$i])) {
135 135
         echo $speeddial[$i];
136 136
     } ?>">
137 137
                                                </div>
Please login to merge, or discard this patch.
astpp/application/modules/accounts/views/view_customer_refill_report.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 <? startblock('extra_head') ?>
4 4
 <script type="text/javascript" language="javascript">
5 5
     $(document).ready(function() {
6
-        build_grid("refillreport_grid","<?php echo base_url() . "accounts/customer_details_json/refill/$edit_id/"; ?>",<? echo $grid_fields ?>,"");
6
+        build_grid("refillreport_grid","<?php echo base_url()."accounts/customer_details_json/refill/$edit_id/"; ?>",<? echo $grid_fields ?>,"");
7 7
         $("#left_panel_quick_search").keyup(function(){
8 8
             quick_search("accounts/customer_details_search/"+'<?php echo $accounttype?>'+"_refill/");
9 9
         });
@@ -20,12 +20,12 @@  discard block
 block discarded – undo
20 20
             <div class="col-md-12 no-padding color-three border_box"> 
21 21
                 <div class="pull-left">
22 22
                     <ul class="breadcrumb">
23
-                        <li><a href="<?= base_url() . "accounts/" . strtolower($accounttype) . "_list/";?>"><?= ucfirst($accounttype); ?>s</a></li>
23
+                        <li><a href="<?= base_url()."accounts/".strtolower($accounttype)."_list/"; ?>"><?= ucfirst($accounttype); ?>s</a></li>
24 24
                         <li>
25
-                            <a href="<?= base_url() . "accounts/" . strtolower($accounttype) . "_edit/" . $edit_id . "/"; ?>"> Profile </a>
25
+                            <a href="<?= base_url()."accounts/".strtolower($accounttype)."_edit/".$edit_id."/"; ?>"> Profile </a>
26 26
                         </li>
27 27
                         <li class="active">
28
-                            <a href="<?= base_url() . "accounts/" . strtolower($accounttype) . "_refillreport/" . $edit_id . "/"; ?>">
28
+                            <a href="<?= base_url()."accounts/".strtolower($accounttype)."_refillreport/".$edit_id."/"; ?>">
29 29
                                 Refill Report
30 30
                             </a>
31 31
                         </li>
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
                 <div class="pull-right">
35 35
                     <ul class="breadcrumb">
36 36
 		      <li class="active pull-right">
37
-		      <a href="<?= base_url() . "accounts/" . strtolower($accounttype) . "_edit/" . $edit_id . "/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
37
+		      <a href="<?= base_url()."accounts/".strtolower($accounttype)."_edit/".$edit_id."/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
38 38
                     </ul>
39 39
                 </div>
40 40
             </div>
Please login to merge, or discard this patch.
astpp/application/modules/accounts/views/view_accounts_add_callerid.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<script type="text/javascript" src="<?php echo base_url();?>assets/js/jquery-1.7.1.js"></script>
1
+<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/jquery-1.7.1.js"></script>
2 2
 <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/facebox.js"></script>
3 3
 <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/flexigrid.js"></script>
4 4
 <script type="text/javascript">
Please login to merge, or discard this patch.
astpp/application/modules/accounts/views/view_customer_dids.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@  discard block
 block discarded – undo
4 4
 <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/validate.js"></script>
5 5
 <script type="text/javascript" language="javascript">
6 6
     $(document).ready(function() {
7
-        build_grid("dids_list","<?php echo base_url() . "accounts/customer_details_json/did/$edit_id/"; ?>",<? echo $grid_fields; ?>,"");
7
+        build_grid("dids_list","<?php echo base_url()."accounts/customer_details_json/did/$edit_id/"; ?>",<? echo $grid_fields; ?>,"");
8 8
         $("#country_id" ).change(function() {
9 9
             var country_id= $('#country_id').val();
10
-            var url ='<?php echo base_url() . "accounts/customer_did_country/"; ?>';
10
+            var url ='<?php echo base_url()."accounts/customer_did_country/"; ?>';
11 11
             var accountid ='<?php echo $edit_id; ?>';
12 12
             $.ajax({
13 13
                 type: "POST",
@@ -64,19 +64,19 @@  discard block
 block discarded – undo
64 64
             <div class="col-md-12 no-padding color-three border_box"> 
65 65
                 <div class="pull-left">
66 66
                     <ul class="breadcrumb">
67
-                        <li><a href="<?= base_url() . "accounts/" . strtolower($accounttype) . "_list/";?>"><?= ucfirst($accounttype); ?>s</a></li>
67
+                        <li><a href="<?= base_url()."accounts/".strtolower($accounttype)."_list/"; ?>"><?= ucfirst($accounttype); ?>s</a></li>
68 68
                         <li>
69
-                            <a href="<?= base_url() . "accounts/" . strtolower($accounttype) . "_edit/" . $edit_id . "/"; ?>"> Profile </a>
69
+                            <a href="<?= base_url()."accounts/".strtolower($accounttype)."_edit/".$edit_id."/"; ?>"> Profile </a>
70 70
                         </li>
71 71
                         <li class="active">
72
-                            <a href="<?= base_url() . "accounts/" . strtolower($accounttype) . "_dids/" . $edit_id . "/"; ?>"><?= $page_title; ?></a>
72
+                            <a href="<?= base_url()."accounts/".strtolower($accounttype)."_dids/".$edit_id."/"; ?>"><?= $page_title; ?></a>
73 73
                         </li>
74 74
                     </ul>
75 75
                 </div>
76 76
                 <div class="pull-right">
77 77
                     <ul class="breadcrumb">
78 78
 		      <li class="active pull-right">
79
-		      <a href="<?= base_url() . "accounts/" . strtolower($accounttype) . "_edit/" . $edit_id . "/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
79
+		      <a href="<?= base_url()."accounts/".strtolower($accounttype)."_edit/".$edit_id."/"; ?>"> <i class="fa fa-fast-backward" aria-hidden="true"></i> Back</a></li>
80 80
                     </ul>
81 81
                 </div>
82 82
             </div>
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                      <fieldset class="margin-b-20">
100 100
                         <legend>Purchase DID</legend>
101 101
 
102
-                        <form method="post" id="did_purchase" name="did_purchase" action="<?= base_url() . "accounts/customer_dids_action/add/$edit_id/$accounttype/"; ?>" enctype="multipart/form-data">
102
+                        <form method="post" id="did_purchase" name="did_purchase" action="<?= base_url()."accounts/customer_dids_action/add/$edit_id/$accounttype/"; ?>" enctype="multipart/form-data">
103 103
                             <div class="col-md-4">
104 104
                                 <label for="Country" class="col-md-3 no-padding">Country : </label>
105 105
                                 <div class="col-md-8 no-padding sel_drop">
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/accounts/models/accounts_model.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
     function add_account($accountinfo) {
32 32
 	
33 33
         $account_data = $this->session->userdata("accountinfo");
34
-        $accountinfo['reseller_id'] = ($account_data['type'] == 1 ) ? $account_data['id'] : 0;
35
-        $accountinfo['maxchannels'] = ($accountinfo['type'] == 1 || $account_data['type'] == 2 || $account_data['type'] == -1 ) ? "0" : $accountinfo['maxchannels'];
34
+        $accountinfo['reseller_id'] = ($account_data['type'] == 1) ? $account_data['id'] : 0;
35
+        $accountinfo['maxchannels'] = ($accountinfo['type'] == 1 || $account_data['type'] == 2 || $account_data['type'] == -1) ? "0" : $accountinfo['maxchannels'];
36 36
         unset($accountinfo['action']);
37 37
         $sip_flag = isset($accountinfo['sip_device_flag']) ? 1 : 0;
38 38
         $opensip_flag = isset($accountinfo['opensips_device_flag']) ? 1 : 0;
39
-        unset($accountinfo['sip_device_flag'],$accountinfo['opensips_device_flag'],$accountinfo['tax_id']);
39
+        unset($accountinfo['sip_device_flag'], $accountinfo['opensips_device_flag'], $accountinfo['tax_id']);
40 40
 
41 41
         /*         * ******************************** */
42 42
         $accountinfo['creation'] = gmdate('Y-m-d H:i:s');
@@ -51,14 +51,14 @@  discard block
 block discarded – undo
51 51
         }else{
52 52
 	  $accountinfo['allow_ip_management']=1;
53 53
         }*/
54
-        if(isset($accountinfo['local_call'])){
55
-	  $accountinfo['local_call']=0;
56
-        }else{
57
-	  $accountinfo['local_call']=1;
54
+        if (isset($accountinfo['local_call'])) {
55
+	  $accountinfo['local_call'] = 0;
56
+        } else {
57
+	  $accountinfo['local_call'] = 1;
58 58
         }
59
-        if ($accountinfo['type'] == 1){
59
+        if ($accountinfo['type'] == 1) {
60 60
         $invoice_config = $accountinfo['invoice_config_flag'];
61
-		}else{
61
+		} else {
62 62
 		$invoice_config = "";		
63 63
 		}
64 64
 		unset($accountinfo['invoice_config_flag']);
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
             }
87 87
         if ($sip_flag == '1') {
88 88
             $this->db->select('id');
89
-            $this->db->where('name','default');
90
-            $sipprofile_result=(array)$this->db->get('sip_profiles')->first_row();
89
+            $this->db->where('name', 'default');
90
+            $sipprofile_result = (array)$this->db->get('sip_profiles')->first_row();
91 91
             $free_switch_array = array('fs_username' => $accountinfo['number'],
92 92
                 'fs_password' => $this->common->decode($accountinfo['password']),
93 93
                 'context' => 'default',
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
             $this->load->model('opensips/opensips_model');
110 110
             $this->opensips_model->add_opensipsdevices($opensips_array);
111 111
         }
112
-        $accountinfo['confirm'] =  base_url();
113
-        if($accountinfo['id'] == ""){
112
+        $accountinfo['confirm'] = base_url();
113
+        if ($accountinfo['id'] == "") {
114 114
         $accountinfo['id'] = $last_id;
115 115
 		}
116 116
         $accountinfo['password'] = $this->common->decode($accountinfo['password']);    
@@ -154,16 +154,16 @@  discard block
 block discarded – undo
154 154
                 if ($query_pricelist->num_rows > 0) {
155 155
                     $description = '';
156 156
                     if ($update_array['balance']['operator'] == '2') {
157
-                        $description .="Reseller update set balance by admin";
157
+                        $description .= "Reseller update set balance by admin";
158 158
                     }
159 159
                     if ($update_array['balance']['operator'] == '3') {
160
-                        $description .="Reseller update increase balance by admin";
160
+                        $description .= "Reseller update increase balance by admin";
161 161
                     }
162 162
                     if ($update_array['balance']['operator'] == '4') {
163
-                        $description .="Reseller update descrise balance by admin";
163
+                        $description .= "Reseller update descrise balance by admin";
164 164
                     }
165 165
                     foreach ($query_pricelist->result_array() as $key => $reseller_payment) {
166
-                        if (!empty($reseller_payment['reseller_id']) && $reseller_payment['reseller_id'] != '') {
166
+                        if ( ! empty($reseller_payment['reseller_id']) && $reseller_payment['reseller_id'] != '') {
167 167
                             $payment_by = $reseller_payment['reseller_id'];
168 168
                         } else {
169 169
                             $payment_by = '-1';
@@ -218,16 +218,16 @@  discard block
 block discarded – undo
218 218
             if ($query_pricelist->num_rows > 0) {
219 219
                 $description = '';
220 220
                 if ($update_array['balance']['operator'] == '2') {
221
-                    $description .="Customer update set balance by admin";
221
+                    $description .= "Customer update set balance by admin";
222 222
                 }
223 223
                 if ($update_array['balance']['operator'] == '3') {
224
-                    $description .="Customer update increase balance by admin";
224
+                    $description .= "Customer update increase balance by admin";
225 225
                 }
226 226
                 if ($update_array['balance']['operator'] == '4') {
227
-                    $description .="Customer update descrise balance by admin";
227
+                    $description .= "Customer update descrise balance by admin";
228 228
                 }
229 229
                 foreach ($query_pricelist->result_array() as $key => $customer_payment) {
230
-                    if (!empty($customer_payment['reseller_id']) && $customer_payment['reseller_id'] != '0') {
230
+                    if ( ! empty($customer_payment['reseller_id']) && $customer_payment['reseller_id'] != '0') {
231 231
                         $payment_by = $customer_payment['reseller_id'];
232 232
                     } else {
233 233
                         $payment_by = '-1';
@@ -283,11 +283,11 @@  discard block
 block discarded – undo
283 283
             $pin = $this->common->find_uniq_rendno_accno($number_length, 'pin', 'accounts', '', $count);
284 284
         }
285 285
         $sip_flag = false;
286
-        $opensip_flag=false;
287
-        if (isset($add_array['sip_device_flag']) && common_model::$global_config['system_config']['opensips']== 0) {
286
+        $opensip_flag = false;
287
+        if (isset($add_array['sip_device_flag']) && common_model::$global_config['system_config']['opensips'] == 0) {
288 288
             $sip_flag = true;
289 289
         }
290
-        if (isset($add_array['opensips_device_flag']) && common_model::$global_config['system_config']['opensips']== 1) {
290
+        if (isset($add_array['opensips_device_flag']) && common_model::$global_config['system_config']['opensips'] == 1) {
291 291
             $opensip_flag = true;
292 292
         }
293 293
         unset(
@@ -298,20 +298,20 @@  discard block
 block discarded – undo
298 298
                 $add_array['sip_device_flag'],
299 299
                 $add_array['opensips_device_flag']
300 300
         );
301
-        if(isset($add_array['is_recording']) &&  $add_array['is_recording'] != ''){
302
-        $is_recording=1;
303
-        }else{
304
-        $is_recording=0;
301
+        if (isset($add_array['is_recording']) && $add_array['is_recording'] != '') {
302
+        $is_recording = 1;
303
+        } else {
304
+        $is_recording = 0;
305 305
         }
306
-        if(isset($add_array['allow_ip_management']) &&  $add_array['allow_ip_management'] != ''){
307
-        $allow_ip_management=1;
308
-        }else{
309
-        $allow_ip_management=0;
306
+        if (isset($add_array['allow_ip_management']) && $add_array['allow_ip_management'] != '') {
307
+        $allow_ip_management = 1;
308
+        } else {
309
+        $allow_ip_management = 0;
310 310
         }
311
-        if(isset($add_array['local_call']) &&  $add_array['local_call'] != ''){
312
-        $local_call=1;
313
-        }else{
314
-        $local_call=0;
311
+        if (isset($add_array['local_call']) && $add_array['local_call'] != '') {
312
+        $local_call = 1;
313
+        } else {
314
+        $local_call = 0;
315 315
         }
316 316
         if ($sip_flag) {
317 317
             $query = $this->db_model->select("*", "sip_profiles", array('status' => "0"), "id", "ASC", '1', '0');
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
             $this->db->insert_batch('accounts', $insert_array);
420 420
             if ($opensip_flag == 1) {
421 421
                 $db_config = Common_model::$global_config['system_config'];
422
-                $opensipdsn = "mysql://" . $db_config['opensips_dbuser'] . ":" . $db_config['opensips_dbpass'] . "@" . $db_config['opensips_dbhost'] . "/" . $db_config['opensips_dbname'] . "?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir=";
422
+                $opensipdsn = "mysql://".$db_config['opensips_dbuser'].":".$db_config['opensips_dbpass']."@".$db_config['opensips_dbhost']."/".$db_config['opensips_dbname']."?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir=";
423 423
                 $this->opensips_db = $this->load->database($opensipdsn, true);
424 424
                 $this->opensips_db->insert_batch("subscriber", $opensips_array);
425 425
             }
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
     }
429 429
 
430 430
     function get_max_limit($add_array) {
431
-		$this->db->where('deleted','0');
431
+		$this->db->where('deleted', '0');
432 432
         $this->db->where("length(number)", $add_array['account_length']);
433 433
         $this->db->like('number', $add_array['prefix'], 'after');
434 434
         $this->db->select("count(id) as count");
@@ -444,16 +444,16 @@  discard block
 block discarded – undo
444 444
     }
445 445
     function account_process_payment($data) {
446 446
 	$data['accountid'] = $data['id'];
447
-        $accountdata=(array)$this->db->get_where('accounts',array("id"=>$data['accountid']))->first_row();
448
-        $accountinfo =$this->session->userdata('accountinfo');
447
+        $accountdata = (array)$this->db->get_where('accounts', array("id"=>$data['accountid']))->first_row();
448
+        $accountinfo = $this->session->userdata('accountinfo');
449 449
 	$data["payment_by"] = $accountdata['reseller_id'] > 0 ? $accountdata['reseller_id'] : '-1';
450 450
 	$data['payment_mode'] = $data['payment_type'];
451
-	unset($data['action'],$data['id'],$data['account_currency'],$data['payment_type']);
452
-	if (isset($data) && !empty($accountdata)) {
453
-		$data['credit']=$data['credit'] =='' ?  0 : $data['credit'];
451
+	unset($data['action'], $data['id'], $data['account_currency'], $data['payment_type']);
452
+	if (isset($data) && ! empty($accountdata)) {
453
+		$data['credit'] = $data['credit'] == '' ? 0 : $data['credit'];
454 454
 		$date = gmdate('Y-m-d H:i:s');
455
-		if($data['payment_mode']== 1){       
456
-		  $balance = $this->update_balance($data['credit'], $data['accountid'],$data['payment_mode']);
455
+		if ($data['payment_mode'] == 1) {       
456
+		  $balance = $this->update_balance($data['credit'], $data['accountid'], $data['payment_mode']);
457 457
 			  $insert_arr = array("accountid" => $data['accountid'],
458 458
 			  "credit" => "-".$data['credit'],
459 459
 			  'payment_mode'=>$data['payment_mode'],
@@ -463,8 +463,8 @@  discard block
 block discarded – undo
463 463
 			  'payment_by'=>$data['payment_by'],
464 464
 		  );
465 465
 		  $this->db->insert("payments", $insert_arr);
466
-		}else{ 
467
-		  $balance = $this->update_balance($data['credit'], $data['accountid'],$data['payment_mode']);
466
+		} else { 
467
+		  $balance = $this->update_balance($data['credit'], $data['accountid'], $data['payment_mode']);
468 468
 		  $insert_arr = array("accountid" => $data['accountid'],
469 469
 			  "credit" => $data['credit'],
470 470
 			  'payment_mode'=>$data['payment_mode'],
@@ -474,11 +474,11 @@  discard block
 block discarded – undo
474 474
 			  'payment_by'=>$data['payment_by'],
475 475
 		  );
476 476
 		  $this->db->insert("payments", $insert_arr);
477
-		  $accountdata['refill_amount']=$data['credit'];
478
-		  $current_id=$accountinfo['type'] ==1 ? $accountinfo['id'] : '0';
479
-		  if($accountdata['reseller_id'] == $current_id){
477
+		  $accountdata['refill_amount'] = $data['credit'];
478
+		  $current_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : '0';
479
+		  if ($accountdata['reseller_id'] == $current_id) {
480 480
 		    $this->common->mail_to_users('voip_account_refilled', $accountdata);
481
-		  }else{
481
+		  } else {
482 482
 		    $this->common->mail_to_users('voip_child_account_refilled', $accountdata);
483 483
 		  }
484 484
 		}
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 
489 489
     function get_admin_Account_list($flag, $start = 0, $limit = 0, $reseller_id = 0) {
490 490
         $this->db_model->build_search('admin_list_search');
491
-        $where = "reseller_id =" . $reseller_id . " AND deleted =0 AND type in (2,4,-1)";
491
+        $where = "reseller_id =".$reseller_id." AND deleted =0 AND type in (2,4,-1)";
492 492
         if ($this->session->userdata('advance_search') == 1) {
493 493
             $search = $this->session->userdata('admin_list_search');
494 494
             if ($search['type'] == '') {
@@ -504,10 +504,10 @@  discard block
 block discarded – undo
504 504
         if ($flag) {
505 505
             $this->db->limit($limit, $start);
506 506
         }
507
-        if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){
508
-          $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']);
509
-        }else{
510
-            $this->db->order_by('number','desc');
507
+        if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined') {
508
+          $this->db->order_by($_GET['sortname'], ($_GET['sortorder'] == 'undefined') ? 'desc' : $_GET['sortorder']);
509
+        } else {
510
+            $this->db->order_by('number', 'desc');
511 511
         }
512 512
         $result = $this->db->get('accounts');
513 513
 
@@ -535,13 +535,13 @@  discard block
 block discarded – undo
535 535
             $this->db->where($type);
536 536
         }
537 537
         if ($flag) {
538
-            if (!$export)
538
+            if ( ! $export)
539 539
                 $this->db->limit($limit, $start);
540 540
         }
541
-        if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){
542
-          $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']);
543
-        }else{
544
-            $this->db->order_by('number','desc');
541
+        if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined') {
542
+          $this->db->order_by($_GET['sortname'], ($_GET['sortorder'] == 'undefined') ? 'desc' : $_GET['sortorder']);
543
+        } else {
544
+            $this->db->order_by('number', 'desc');
545 545
         }
546 546
         $result = $this->db->get('accounts');
547 547
         if ($flag) {
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
     function insert_block($data, $accountid) {
591 591
         $data = explode(",", $data);
592 592
         $tmp = array();
593
-        if (!empty($data)) {
593
+        if ( ! empty($data)) {
594 594
             foreach ($data as $key => $data_value) {
595 595
                 $tmp[$key]["accountid"] = $accountid;
596 596
                 $result = $this->get_pattern_by_id($data_value);
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
     }
622 622
 
623 623
     function add_callerid($data) {
624
-        unset($data['action'],$data['flag']);
624
+        unset($data['action'], $data['flag']);
625 625
         $data['accountid'] = $this->common->get_field_name('id', 'accounts', array('number' => $data['accountid']));
626 626
         $this->db->insert('accounts_callerid', $data);
627 627
         return true;
@@ -706,10 +706,10 @@  discard block
 block discarded – undo
706 706
 
707 707
     function update_balance($amount, $accountid, $payment_type) {
708 708
         if ($payment_type == 0) {
709
-            $query = 'UPDATE `accounts` SET `balance` = (balance + ' . $amount . ') WHERE `id` = ' . $accountid;
709
+            $query = 'UPDATE `accounts` SET `balance` = (balance + '.$amount.') WHERE `id` = '.$accountid;
710 710
             return $this->db->query($query);
711 711
         }if ($payment_type == 1) {
712
-            $query = 'UPDATE `accounts` SET `balance` = (balance - ' . $amount . ') WHERE `id` = ' . $accountid;
712
+            $query = 'UPDATE `accounts` SET `balance` = (balance - '.$amount.') WHERE `id` = '.$accountid;
713 713
             return $this->db->query($query);
714 714
         }
715 715
     }
Please login to merge, or discard this patch.