Completed
Push — v3.0 ( 3d1631...29f961 )
by Samir
22:25
created
web_interface/astpp/application/modules/login/controllers/login.php 1 patch
Braces   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -78,31 +78,31 @@  discard block
 block discarded – undo
78 78
 		$this->db->select("*");
79 79
 		if($result['type'] == '2' || $result['type'] == '-1'){
80 80
 			$this->db->where(array("accountid"=>$result["id"]));
81
-		}else if($result['type'] == '0'){
81
+		} else if($result['type'] == '0'){
82 82
 			if($result['reseller_id'] == 0){
83 83
 				$this->db->where(array("accountid"=>"1"));
84
-			}else{
84
+			} else{
85 85
 				$this->db->where(array("accountid"=>$result["reseller_id"]));
86 86
 			}
87
-		}else if($result['type'] == '1'){
87
+		} else if($result['type'] == '1'){
88 88
 			if($result['reseller_id'] == 0){
89 89
 				$result_invoice = $this->common->get_field_name('id','invoice_conf', array("accountid" => $result['id']));
90 90
 				
91 91
 				if($result_invoice){
92 92
 					$this->db->where(array("accountid"=>$result["id"]));
93
-				}else{
93
+				} else{
94 94
 					$this->db->where(array("accountid"=>"1"));
95 95
 				}
96 96
 				
97
-			}else{
97
+			} else{
98 98
 				$result_invoice = $this->common->get_field_name('id','invoice_conf', array("accountid" => $result['reseller_id']));
99 99
 				if($result_invoice){
100 100
 					$this->db->where(array("accountid"=>$result["reseller_id"]));
101
-				}else{
101
+				} else{
102 102
 					$this->db->where(array("accountid"=>"1"));
103 103
 				}
104 104
 			}
105
-		}else {
105
+		} else {
106 106
 			$this->db->where(array("accountid"=>"1"));
107 107
 		}
108 108
 		$res = $this->db->get("invoice_conf");
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
                         $this->session->set_userdata('mode_cur', 'user');
121 121
                         if($result['type'] == 1){
122 122
                             redirect(base_url() . 'dashboard/');
123
-                        }else{
123
+                        } else{
124 124
                             redirect(base_url() . 'user/user/');
125 125
                         }
126 126
                     } else {
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
             $this->session->set_userdata('user_login', FALSE);
152 152
             $data['app_name'] = 'ASTPP - Open Source Billing Solution';
153 153
             $this->load->view('view_login', $data);
154
-        }else {
154
+        } else {
155 155
 	/*
156 156
 	*
157 157
 	* Purpose : Display logo based on domain name
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/login/views/view_login.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
                         <div class="col-md-4 col-md-offset-4">&nbsp;<span class="login_error">
39 39
                         <?php if (isset($astpp_notification)){ ?>
40 40
                         Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active.
41
-                    <?php }else{
41
+                    <?php } else{
42 42
                          echo "&nbsp;";
43 43
                     } ?>
44 44
                     </span></div> <br/>
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/animap/controllers/animap.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,9 @@
 block discarded – undo
32 32
         $this->load->library('astpp/form');
33 33
         $this->load->model('animap_model');
34 34
 
35
-        if ($this->session->userdata('user_login') == FALSE)
36
-            redirect(base_url() . '/astpp/login');
35
+        if ($this->session->userdata('user_login') == FALSE) {
36
+                    redirect(base_url() . '/astpp/login');
37
+        }
37 38
     }
38 39
 
39 40
     function animap_add() {
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/accounts/controllers/accounts.php 1 patch
Braces   +27 added lines, -20 removed lines patch added patch discarded remove patch
@@ -37,8 +37,9 @@  discard block
 block discarded – undo
37 37
         $this->load->model('accounts_model');
38 38
         $this->load->model('Astpp_common');
39 39
         $this->protected_pages = array('account_list');
40
-        if ($this->session->userdata('user_login') == FALSE)
41
-            redirect(base_url() . '/login/login');
40
+        if ($this->session->userdata('user_login') == FALSE) {
41
+                    redirect(base_url() . '/login/login');
42
+        }
42 43
     }
43 44
 
44 45
     function customer_list() {
@@ -377,13 +378,15 @@  discard block
 block discarded – undo
377 378
         $where = array("accountid" => $accountid);
378 379
         $instant_search=$this->session->userdata('left_panel_search_'.$accounttype.'_ipmap');
379 380
         $like_str=!empty($instant_search) ? "(name like '%$instant_search%'  OR ip like '%$instant_search%' OR prefix like '%$instant_search%' OR created_date like '%$instant_search%' )" :null;
380
-        if(!empty($like_str))
381
-        $this->db->where($like_str);
381
+        if(!empty($like_str)) {
382
+                $this->db->where($like_str);
383
+        }
382 384
         $count_all = $this->db_model->countQuery("*", "ip_map", $where);
383 385
         $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
384 386
         $json_data = $paging_data["json_paging"];
385
-        if(!empty($like_str))
386
-        $this->db->where($like_str);
387
+        if(!empty($like_str)) {
388
+                $this->db->where($like_str);
389
+        }
387 390
         $query = $this->db_model->select("*", "ip_map", $where, "id", "ASC", $paging_data["paging"]["page_no"], $paging_data["paging"]["start"]);
388 391
         $grid_fields = json_decode($this->accounts_form->build_ip_list_for_customer($accountid, $accounttype));
389 392
         $json_data['rows'] = $this->form->build_grid($query, $grid_fields);
@@ -472,15 +475,17 @@  discard block
 block discarded – undo
472 475
         $json_data = array();
473 476
         $instant_search=$this->session->userdata('left_panel_search_'.$accounttype.'_animap'); 
474 477
         $like_str=!empty($instant_search) ? "(number like '%$instant_search%'  OR  creation_date like '%$instant_search%' )" :null;
475
-        if(!empty($like_str))
476
-        $this->db->where($like_str);
478
+        if(!empty($like_str)) {
479
+                $this->db->where($like_str);
480
+        }
477 481
         $where = array("accountid" => $accountid);
478 482
         $count_all = $this->db_model->countQuery("*", "ani_map", $where);
479 483
 
480 484
         $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
481 485
         $json_data = $paging_data["json_paging"];
482
-        if(!empty($like_str))
483
-        $this->db->where($like_str);
486
+        if(!empty($like_str)) {
487
+                $this->db->where($like_str);
488
+        }
484 489
         $query = $this->db_model->select("*", "ani_map", $where, "id", "ASC", $paging_data["paging"]["page_no"], $paging_data["paging"]["start"]);
485 490
 
486 491
         $grid_fields = json_decode($this->accounts_form->build_animap_list_for_customer($accountid, $accounttype));
@@ -1043,7 +1048,7 @@  discard block
 block discarded – undo
1043 1048
             $data['edit_id'] = $edit_id;
1044 1049
             $data['accounttype'] = $accounttype;
1045 1050
             $this->load->view('view_reseller_package_list', $data);
1046
-       }else {
1051
+       } else {
1047 1052
             redirect(base_url() . 'accounts/reseller_list/');
1048 1053
             exit;
1049 1054
        }
@@ -1321,14 +1326,14 @@  discard block
 block discarded – undo
1321 1326
             $accountinfo = $this->accounts_model->get_account_by_number($post_array['id']);
1322 1327
             if($accountinfo['reseller_id'] == 0){
1323 1328
                $where = array("accountid"=> 1);
1324
-		}else{
1329
+		} else{
1325 1330
 		    $where = array("accountid"=> $accountinfo['id']);    
1326 1331
 		}
1327 1332
 		$query = $this->db_model->getSelect("*", "invoice_conf", $where);
1328 1333
 		if($query->num_rows >0){
1329 1334
 		    $invoice_conf = $query->result_array();
1330 1335
 		    $invoice_conf = $invoice_conf[0];
1331
-		}else{
1336
+		} else{
1332 1337
 		    $query = $this->db_model->getSelect("*", "invoice_conf",array("accountid"=> 1));
1333 1338
 		    $invoice_conf = $query->result_array();
1334 1339
 		    $invoice_conf = $invoice_conf[0];            
@@ -1355,7 +1360,7 @@  discard block
 block discarded – undo
1355 1360
 				      'after_balance'=>$account_balance,
1356 1361
 				    );
1357 1362
 		    $this->db->insert("invoice_details", $insert_arr);
1358
-                }else{
1363
+                } else{
1359 1364
 		    $this->load->module('invoices/invoices');
1360 1365
 		    $invoice_id=$this->invoices->invoices->generate_receipt($post_array['id'],$post_array['credit'],$accountinfo,$last_invoice_ID+1,$invoice_prefix,$due_date);
1361 1366
 		    $account_balance = $this->common->get_field_name('balance', 'accounts', $post_array['id']);
@@ -1784,8 +1789,9 @@  discard block
 block discarded – undo
1784 1789
         $json_data['total'] = $config['total_rows'];
1785 1790
         $perpage = $config['per_page'];
1786 1791
         $start = ($page_no - 1) * $perpage;
1787
-        if ($start < 0)
1788
-            $start = 0;
1792
+        if ($start < 0) {
1793
+                    $start = 0;
1794
+        }
1789 1795
 
1790 1796
         $account_charge_list = $this->db_model->getAllJionQuery($table, $select, $where, $jionTable, $jionCondition, $type, $perpage, $start, $order_by, $order_type, "");
1791 1797
         if ($account_charge_list->num_rows > 0) {
@@ -2128,8 +2134,9 @@  discard block
 block discarded – undo
2128 2134
         $data['username'] = $this->session->userdata('user_name');
2129 2135
         $data['page_title'] = 'Account Taxes';
2130 2136
 
2131
-        if ($action == false)
2132
-            $action = "list";
2137
+        if ($action == false) {
2138
+                    $action = "list";
2139
+        }
2133 2140
 
2134 2141
         if ($action == 'list') {
2135 2142
             $this->load->view('view_account_taxes_list', $data);
@@ -2393,10 +2400,10 @@  discard block
 block discarded – undo
2393 2400
        $ip_map_result=(array)$this->db->get('ip_map')->first_row();
2394 2401
        if($ip_map_result['count'] > 0 ){
2395 2402
          echo 'FALSE';
2396
-       }else{
2403
+       } else{
2397 2404
          echo 'TRUE';
2398 2405
        }
2399
-     }else{
2406
+     } else{
2400 2407
       echo 'FALSE';
2401 2408
      }
2402 2409
     
Please login to merge, or discard this patch.
astpp/application/modules/accounts/libraries/accounts_form.php 1 patch
Braces   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,8 +21,9 @@  discard block
 block discarded – undo
21 21
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 22
 ###############################################################################
23 23
 
24
-if (!defined('BASEPATH'))
24
+if (!defined('BASEPATH')) {
25 25
     exit('No direct script access allowed');
26
+}
26 27
 
27 28
 class Accounts_form {
28 29
     function __construct($library_name = '') {
@@ -279,8 +280,7 @@  discard block
 block discarded – undo
279 280
             array(gettext('Tax'), 'tax_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'taxes_description', 'taxes', 'build_dropdown', 'where_arr', array('status' => 0, 'reseller_id' => $loginid), 'multi'),
280 281
         );
281 282
 
282
-}
283
-else{
283
+} else{
284 284
 	        $form[gettext('Billing Information')] = array(
285 285
             array(gettext('Rate Group'), 'pricelist_id', 'SELECT', '', array("name" => "pricelist_id", 'rules' => 'required'), 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array("status" => "0", "reseller_id" => "0")),
286 286
             
@@ -442,8 +442,7 @@  discard block
 block discarded – undo
442 442
             array('', 'HIDDEN', 'advance_search', '1', '', '', '')
443 443
         );
444 444
         
445
-        }
446
-		else
445
+        } else
447 446
 		{
448 447
 		
449 448
 		$form['forms'] = array("", array('id' => "account_search"));
@@ -603,8 +602,9 @@  discard block
 block discarded – undo
603 602
     function build_grid_buttons_customer() {
604 603
         $logintype = $this->CI->session->userdata('userlevel_logintype');
605 604
         $provider = null;
606
-        if ($logintype != 1)
607
-            $provider = array(gettext("Create Provider"), "btn btn-line-blue btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/provider_add/");
605
+        if ($logintype != 1) {
606
+                    $provider = array(gettext("Create Provider"), "btn btn-line-blue btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/provider_add/");
607
+        }
608 608
              // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name);
609 609
         $buttons_json = json_encode(array(
610 610
             array(gettext("Create Customer"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/accounts/customer_add/"),
Please login to merge, or discard this patch.
astpp/application/modules/accounts/views/view_accounting_taxes_add.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,8 +59,9 @@
 block discarded – undo
59 59
                             if (isset($taxesList) && is_array($taxesList) && count($taxesList) > 0) {
60 60
                                 echo "<table>";
61 61
                                 foreach ($taxesList as $values) {
62
-                                    if ($i == 1)
63
-                                        echo"<tr>";
62
+                                    if ($i == 1) {
63
+                                                                            echo"<tr>";
64
+                                    }
64 65
                                     ?>
65 66
                                 <td style="padding-left: 10px;">
66 67
                                     <input type="checkbox" id="tax_<?= $values->id; ?>"name="tax_<?= $values->id; ?>" value="<?= $values->id; ?>" <? if (in_array($values->id, $tax_ids)) {
Please login to merge, or discard this patch.
astpp/application/modules/accounts/views/view_reseller_invoices_config.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@
 block discarded – undo
208 208
 <?php
209 209
 	if($account_data['logo']  != ''){
210 210
 	     $logo=$account_data['file'];
211
-	}else{
211
+	} else{
212 212
 	     $logo=$account_data['logo'];
213 213
 	}
214 214
           if($logo != ''){        
Please login to merge, or discard this patch.
astpp/application/modules/accounts/views/view_bulk_account_creation.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -60,11 +60,12 @@
 block discarded – undo
60 60
                            $validation_array=json_decode($validation_errors);
61 61
                            if(is_object($validation_array)){
62 62
                            $validation_array = get_object_vars($validation_array);
63
-                           foreach($validation_array as $key=>$value)
64
-		              echo $value."<br/>";
63
+                           foreach($validation_array as $key=>$value) {
64
+                           		              echo $value."<br/>";
65
+                           }
66
+                           } else {
67
+                           		              echo $validation_errors;
65 68
                            }
66
-                           else
67
-		              echo $validation_errors;
68 69
                            
69 70
                         }
70 71
                         ?>
Please login to merge, or discard this patch.
astpp/application/modules/accounts/views/view_accounts_add_callerid.php 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,10 @@
 block discarded – undo
24 24
     <section class="slice color-three no-margin">
25 25
 	<div class="w-section inverse no-padding">
26 26
             <div style="color:red;margin-left: 60px;">
27
-                <?php if (isset($validation_errors)) echo $validation_errors; ?> 
27
+                <?php if (isset($validation_errors)) {
28
+	echo $validation_errors;
29
+}
30
+?> 
28 31
             </div>
29 32
             <?php echo $form; ?>
30 33
         </div>      
Please login to merge, or discard this patch.