Completed
Push — v3.0 ( 3d1631...29f961 )
by Samir
22:25
created
web_interface/astpp/application/modules/user/models/user_model.php 1 patch
Braces   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         if ($flag) {
94 94
            if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){
95 95
             $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']);
96
-           }else{
96
+           } else{
97 97
             $this->db->order_by('invoice_date', 'desc');
98 98
            }
99 99
         }
@@ -307,10 +307,11 @@  discard block
 block discarded – undo
307 307
         $this->db->where($where);
308 308
         $this->db->order_by("callstart desc");
309 309
         if ($flag) {
310
-            if (!$export)
311
-                $this->db->limit($limit, $start);
310
+            if (!$export) {
311
+                            $this->db->limit($limit, $start);
312
+            }
312 313
             $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype,is_recording,trunk_id,uniqueid');
313
-        }else {
314
+        } else {
314 315
             $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(debit) as total_debit,sum(cost) as total_cost,group_concat(distinct(pricelist_id)) as pricelist_ids,group_concat(distinct(trunk_id)) as trunk_ids');
315 316
         }
316 317
         $result = $this->db->get($table_name);
@@ -387,15 +388,13 @@  discard block
 block discarded – undo
387 388
         if($result->num_rows() > 0){
388 389
 	  if($flag){
389 390
 	    return $result;
390
-	  }
391
-	  else{
391
+	  } else{
392 392
 	    return $result->num_rows();
393 393
 	  }
394
-        }else{
394
+        } else{
395 395
          if($flag){
396 396
 	      $result=(object)array('num_rows'=>0);
397
-	  }
398
-	  else{
397
+	  } else{
399 398
 	      $result=0;
400 399
 	  }
401 400
 	  return $result;
@@ -452,7 +451,7 @@  discard block
 block discarded – undo
452 451
         if ($logintype == 1 || $logintype == 5) {
453 452
           
454 453
 		$where = array("accountid" => $this->session->userdata["accountinfo"]['id']);
455
-        }else{
454
+        } else{
456 455
        		 $where=array('id'=> $accountid);
457 456
 	}      
458 457
         $query = $this->db_model->getSelect("*","invoice_conf",$where);
@@ -475,10 +474,11 @@  discard block
 block discarded – undo
475 474
         $this->db->where($where);
476 475
         $this->db->order_by("callstart","desc");
477 476
         if ($flag) {
478
-            if (!$export)
479
-                $this->db->limit($limit, $start);
477
+            if (!$export) {
478
+                            $this->db->limit($limit, $start);
479
+            }
480 480
             $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,disposition,cost,accountid,pricelist_id,calltype,is_recording,trunk_id,uniqueid');
481
-        }else {
481
+        } else {
482 482
             $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(cost) as total_cost,group_concat(distinct(trunk_id)) as trunk_ids');
483 483
         }
484 484
         $result = $this->db->get('cdrs');
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/systems/controllers/systems.php 1 patch
Braces   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -33,8 +33,9 @@  discard block
 block discarded – undo
33 33
         $this->load->model('system_model');
34 34
         $this->load->dbutil();
35 35
 
36
-        if ($this->session->userdata('user_login') == FALSE)
37
-            redirect(base_url() . '/astpp/login');
36
+        if ($this->session->userdata('user_login') == FALSE) {
37
+                    redirect(base_url() . '/astpp/login');
38
+        }
38 39
     }
39 40
 
40 41
     function configuration_edit($edit_id = '') {
@@ -106,7 +107,7 @@  discard block
 block discarded – undo
106 107
 		}
107 108
             	$this->session->set_flashdata('astpp_errormsg', ucfirst($group_title).' Settings updated sucessfully!');
108 109
 	    	redirect(base_url() . 'systems/configuration/'.$group_title);
109
-        }else{
110
+        } else{
110 111
 	 	$this->load->view('view_systemconf', $data);
111 112
 	}
112 113
     }
@@ -167,8 +168,7 @@  discard block
 block discarded – undo
167 168
              $account_data = $this->session->userdata("accountinfo");
168 169
 			 $reseller = $account_data['id'];
169 170
              $this->resellertemplate_save($add_array,$reseller);
170
-        }
171
-        else
171
+        } else
172 172
         {
173 173
             $this->admintemplate_save($add_array);
174 174
         }
@@ -494,12 +494,12 @@  discard block
 block discarded – undo
494 494
       $data['page_title'] = 'Database Backup';
495 495
       if($add_array['id'] != ''){
496 496
       
497
-      }else{
497
+      } else{
498 498
            if($this->form_validation->run() == FALSE) {
499 499
                 $data['validation_errors'] = validation_errors();
500 500
                 echo $data['validation_errors'];
501 501
                 exit;
502
-          }else{
502
+          } else{
503 503
              $db_name     = $this->db->database;
504 504
              $db_username = $this->db->username;
505 505
              $db_password = $this->db->password;
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
               $this->system_model->backup_insert($add_array);
525 525
               echo json_encode(array("SUCCESS"=> $add_array['backup_name']." backup exported successfully!"));
526 526
               exit;
527
-           }else{
527
+           } else{
528 528
                 echo 'An error occur when the system tried to backup of the database. Please check yours system settings for the backup section';
529 529
                 exit;
530 530
            }
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
               exec($run_restore);
573 573
               $this->session->set_flashdata('astpp_errormsg', 'Database Restore successfully.');
574 574
               redirect(base_url() . 'systems/database_restore/');
575
-            }else{
575
+            } else{
576 576
               $this->session->set_flashdata('astpp_notification', 'File not exists!');
577 577
               redirect(base_url() . 'systems/database_restore/');
578 578
             }
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
             $query = $this->system_model->import_database($filename,$_FILES['userfile']['name']);
624 624
             $this->session->set_flashdata('astpp_errormsg',"The file ".  basename( $_FILES['userfile']['name'])." has been uploaded");
625 625
             redirect(base_url()."systems/database_restore/");            
626
-        }else{
626
+        } else{
627 627
             $this->session->set_flashdata('astpp_notification',"There is a some issue or invalid file format.");
628 628
             redirect(base_url()."systems/database_restore/");            
629 629
         }
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/systems/models/system_model.php 1 patch
Braces   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -71,8 +71,7 @@  discard block
 block discarded – undo
71 71
 		$this->db->where('reseller_id',$reseller);
72 72
 		$this->db->or_where('reseller_id',0);
73 73
 		$this->db->where($where);
74
-            }
75
-            else
74
+            } else
76 75
             {
77 76
                $this->db->where('reseller_id',0);
78 77
             }
@@ -80,13 +79,12 @@  discard block
 block discarded – undo
80 79
             if($flag) {
81 80
 
82 81
 		$query = $this->db_model->select("*", "default_templates","", "id", "ASC", $limit, $start);
83
-	     }else {
82
+	     } else {
84 83
 
85 84
 		$query = $this->db_model->countQuery("*", "default_templates","");
86 85
 		
87 86
 	     }
88
-	  } 
89
-	  else {
87
+	  } else {
90 88
           
91 89
             $where = array('reseller_id' => 0);
92 90
             $this->db->where($where);
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/taxes/models/taxes_model.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         $this->db_model->build_search('taxes_list_search');
31 31
         if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
32 32
             $where = array("reseller_id"=>$this->session->userdata["accountinfo"]['id']);
33
-        }else{
33
+        } else{
34 34
 	    $where =array("reseller_id"=>0);
35 35
         }
36 36
         if ($flag) {
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         $data["creation_date"] = date("Y-m-d H:i:s");
47 47
          if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) {
48 48
 	  $data['reseller_id'] = $this->session->userdata["accountinfo"]['id'];
49
-         }else{
49
+         } else{
50 50
 	  $data['reseller_id'] =0;
51 51
          }
52 52
         $this->db->insert("taxes", $data);
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/email/controllers/email.php 1 patch
Braces   +10 added lines, -11 removed lines patch added patch discarded remove patch
@@ -35,8 +35,9 @@  discard block
 block discarded – undo
35 35
         $this->load->model('email_model');
36 36
         $this->load->library('csvreader');
37 37
 	$this->load->library('astpp/email_lib');
38
-        if ($this->session->userdata('user_login') == FALSE)
39
-            redirect(base_url() . '/astpp/login');
38
+        if ($this->session->userdata('user_login') == FALSE) {
39
+                    redirect(base_url() . '/astpp/login');
40
+        }
40 41
     }
41 42
 
42 43
     function email_edit($edit_id = '') {
@@ -203,7 +204,7 @@  discard block
 block discarded – undo
203 204
             }  
204 205
 			if($edit_data['status'] == 1){
205 206
 				$edit_data['status']='Not Sent';
206
-			}else{
207
+			} else{
207 208
 				$edit_data['status']='Sent';
208 209
 			}
209 210
             $data['form'] = $this->form->build_form($this->email_form->get_form_fields_email_view(), $edit_data);
@@ -246,8 +247,9 @@  discard block
 block discarded – undo
246 247
     }
247 248
     function email_mass() {
248 249
         $account_data = $this->session->userdata("accountinfo");
249
-        if ($account_data['type'] == '1' || $account_data['type']== 0 || $account_data['type']==3)
250
-            redirect(base_url() . '/astpp/dashboard/');
250
+        if ($account_data['type'] == '1' || $account_data['type']== 0 || $account_data['type']==3) {
251
+                    redirect(base_url() . '/astpp/dashboard/');
252
+        }
251 253
 	$data['username'] = $this->session->userdata('user_name');	
252 254
         $data['page_title'] = 'Email Mass';
253 255
         $data['form'] = $this->form->build_form($this->email_form->build_list_for_email_client_area(), '');
@@ -264,8 +266,7 @@  discard block
 block discarded – undo
264 266
 			$str.="<a href='".$link."' title='".$val."' class='btn btn-royelblue btn-sm'><i class='fa fa-paperclip fa-fw'></i></a>&nbsp;&nbsp;";
265 267
 		}
266 268
 		return $str;
267
-	}
268
-	else{
269
+	} else{
269 270
 		return "";
270 271
 	}
271 272
     }
@@ -292,8 +293,7 @@  discard block
 block discarded – undo
292 293
 			       $path =$dir_path.$actual_file_name;
293 294
 			       if (move_uploaded_file($uploadedFile1,$path)) {
294 295
 				   $this->session->set_flashdata('astpp_errormsg', 'files added successfully!');
295
-			       }
296
-			       else{
296
+			       } else{
297 297
 				    $this->session->set_flashdata('astpp_errormsg', 'Please try again   !');
298 298
 			       }
299 299
 		       }
@@ -316,8 +316,7 @@  discard block
 block discarded – undo
316 316
         if($add_array['temp'] == ''){
317 317
 	 	$subject = '';
318 318
 		$body ='';	
319
-             }
320
-		else{
319
+             } else{
321 320
                 $where = array('id' => $add_array['temp']);
322 321
 		$account = $this->db_model->getSelect("subject,template", "default_templates", $where);
323 322
 		$account_data =$account->result_array();
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/email/libraries/email_form.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@  discard block
 block discarded – undo
22 22
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
23 23
 ###############################################################################
24 24
 
25
-if (!defined('BASEPATH'))
26
-    exit('No direct script access allowed');
25
+if (!defined('BASEPATH')) {
26
+    exit('No direct script access allowed');
27
+}
27 28
 
28 29
 class Email_form {
29 30
     function __construct($library_name = '') {
@@ -153,7 +154,7 @@  discard block
 block discarded – undo
153 154
             $account_data = $this->CI->session->userdata("accountinfo");
154 155
             $loginid = $account_data['id'];
155 156
 
156
-        }else{
157
+        } else{
157 158
             $loginid = "0";
158 159
         }
159 160
          $form['forms'] = array(base_url() . 'email/email_client_area/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
@@ -176,8 +177,7 @@  discard block
 block discarded – undo
176 177
     function get_form_fields_email_view_client($add_arr) {
177 178
 	if($add_arr['type'] == ''){
178 179
 	   $email_add = array('To','email', 'SELECT', '', '', 'tOOL TIP', 'Please Enter receipent Email', 'email', 'email', 'accounts', 'build_dropdown', 'where_arr',array('status'=>$add_arr['status'],'posttoexternal'=>$add_arr['posttoexternal'],'pricelist_id'=>$add_arr['pricelist_id']), 'multi');
179
-	}
180
-	else{
180
+	} else{
181 181
 	 $email_add = array('To','email', 'SELECT', '', '', 'tOOL TIP', 'Please Enter receipent Email', 'email', 'email', 'accounts', 'build_dropdown', 'where_arr',array('status'=>$add_arr['status'],'posttoexternal'=>$add_arr['posttoexternal'],'pricelist_id'=>$add_arr['pricelist_id'],'type'=>$add_arr['type']), 'multi');
182 182
 	}
183 183
 
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/email/models/email_model.php 1 patch
Braces   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
 	  if(empty($email_address)){
52 52
 		$this->db->or_where('accountid',0);
53
-	  }else{
53
+	  } else{
54 54
 		$this->db->where('reseller_id',$account_id);
55 55
 	  }
56 56
 	  }
@@ -93,8 +93,7 @@  discard block
 block discarded – undo
93 93
     function get_email_client_data($data, $start = 0, $limit = 0){
94 94
 	if($data['type'] == ''){
95 95
 		$where = array('pricelist_id'=>$data['pricelist_id'],'posttoexternal'=>$data['posttoexternal'],'status'=>$data['status'],'deleted'=>'0');
96
-	}
97
-	else{
96
+	} else{
98 97
 		$where = array('pricelist_id'=>$data['pricelist_id'],'posttoexternal'=>$data['posttoexternal'],'status'=>$data['status'],'type'=>$data['type'],'deleted'=>'0');
99 98
 	}
100 99
 	
@@ -118,8 +117,7 @@  discard block
 block discarded – undo
118 117
 			{
119 118
 				$account_info['email']=$val;
120 119
 				$account_info['accountid']='0';
121
-			}
122
-			else{
120
+			} else{
123 121
 				$res_data = $act_details->result_array();
124 122
 				$account_info=$res_data[0];
125 123
 				$account_info['accountid']=$account_info['id'];
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/reports/controllers/reports.php 1 patch
Braces   +33 added lines, -26 removed lines patch added patch discarded remove patch
@@ -38,8 +38,9 @@  discard block
 block discarded – undo
38 38
         $this->fpdf = new PDF('P', 'pt');
39 39
         $this->fpdf->initialize('P', 'mm', 'A4');
40 40
 
41
-        if ($this->session->userdata('user_login') == FALSE)
42
-            redirect(base_url() . '/astpp/login');
41
+        if ($this->session->userdata('user_login') == FALSE) {
42
+                    redirect(base_url() . '/astpp/login');
43
+        }
43 44
     }
44 45
 
45 46
     function customerReport() {
@@ -272,7 +273,7 @@  discard block
 block discarded – undo
272 273
                 "",
273 274
                 "",
274 275
             );
275
-            }else{
276
+            } else{
276 277
                             $customer_array[] = array("Date", "CallerID", "Called Number", "Code", "Destination", "Duration", "Debit($currency)", "Cost($currency)", "Disposition", "Account","Rate Group", "Call Type");
277 278
                foreach ($query->result_array() as $value) {
278 279
                    $duration = ($show_seconds == 'minutes') ? ($value['billseconds'] > 0 ) ?
@@ -316,7 +317,7 @@  discard block
 block discarded – undo
316 317
         $this->load->helper('csv');
317 318
         if(isset($customer_array)){
318 319
 		array_to_csv($customer_array, 'Customer_CDR_' . date("Y-m-d") . '.csv');
319
-	}else{
320
+	} else{
320 321
 		$customer_array[] = array("Date", "CallerID", "Called Number", "Code", "Destination", "Duration", "Debit($currency)", "Cost($currency)", "Disposition", "Account","Rate Group", "Call Type");
321 322
 		array_to_csv($customer_array, 'Customer_CDR_' . date("Y-m-d") . '.csv');
322 323
 	}
@@ -642,13 +643,15 @@  discard block
 block discarded – undo
642 643
                                            :null;
643 644
         
644 645
         $json_data = array();
645
-        if(!empty($like_str))
646
-        $this->db->where($like_str);
646
+        if(!empty($like_str)) {
647
+                $this->db->where($like_str);
648
+        }
647 649
         $count_all = $this->reports_model->users_cdrs_list(false, $accountid, $accounttype, "", "");
648 650
         $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
649 651
         $json_data = $paging_data["json_paging"];
650
-        if(!empty($like_str))
651
-        $this->db->where($like_str);
652
+        if(!empty($like_str)) {
653
+                $this->db->where($like_str);
654
+        }
652 655
         $query = $this->reports_model->users_cdrs_list(true, $accountid, $accounttype, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
653 656
         $grid_fields = json_decode($this->reports_form->build_report_list_for_user($accounttype));
654 657
         $json_data['rows'] = $this->form->build_grid($query, $grid_fields);
@@ -774,12 +777,12 @@  discard block
 block discarded – undo
774 777
 		$item_type=$value['item_type'];
775 778
 		if($value['before_balance'] == '-'){
776 779
 			$before_balance='-';
777
-		}else{		
780
+		} else{		
778 781
 			$before_balance=$this->common->convert_to_currency('','',$value['before_balance']);
779 782
 		}
780 783
 		if($value['debit'] == '-'){
781 784
 			$debit='-';
782
-		}else{		
785
+		} else{		
783 786
 			$debit=$this->common->convert_to_currency('','',$value['debit']);
784 787
 		}
785 788
 		$credit=$this->common->convert_to_currency('','',$value['credit']);
@@ -788,7 +791,7 @@  discard block
 block discarded – undo
788 791
 	     }
789 792
 		if($value['after_balance'] == '-'){
790 793
 			$after_balance='-';
791
-		}else{		
794
+		} else{		
792 795
 			$after_balance=$this->common->convert_to_currency('','',$value['after_balance']);
793 796
 		}
794 797
 		$description=$value['description'];
@@ -806,7 +809,7 @@  discard block
 block discarded – undo
806 809
 							$after_balance,
807 810
 							$description,
808 811
 				                    ));
809
-	}else{
812
+	} else{
810 813
             $json_data['rows'][] = array('cell' => array(
811 814
 							$date,
812 815
 							$invoice_num,
@@ -833,7 +836,7 @@  discard block
 block discarded – undo
833 836
 	}
834 837
         if ($this->session->userdata('logintype') == 1) {
835 838
 	        $json_data['rows'][$count_all]['cell']=array('<b>Total</b>','-','-','-','-','<b>'.$this->common->convert_to_currency('','',$debit_sum).'</b>','<b>'.$this->common->convert_to_currency('','',$credit_sum).'</b>','-','-');
836
-	}else{
839
+	} else{
837 840
 	        $json_data['rows'][$count_all]['cell']=array('<b>Total</b>','-','-','-','-','<b>'.$this->common->convert_to_currency('','',$debit_sum).'</b>','<b>'.$this->common->convert_to_currency('','',$credit_sum).'</b>','-','-');
838 841
 
839 842
 	}
@@ -870,14 +873,16 @@  discard block
 block discarded – undo
870 873
                                             OR 'credit' like '%$instant_search%'
871 874
                                             OR  'description' like '%$instant_search%')"
872 875
                                             :null;
873
-        if(!empty($like_str))
874
-        $this->db->where($like_str);
876
+        if(!empty($like_str)) {
877
+                $this->db->where($like_str);
878
+        }
875 879
         $count_all = $this->reports_model->get_customer_charge_list(false,$accountid);
876 880
 
877 881
         $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
878 882
         $json_data = $paging_data["json_paging"];
879
-        if(!empty($like_str))
880
-        $this->db->where($like_str);
883
+        if(!empty($like_str)) {
884
+                $this->db->where($like_str);
885
+        }
881 886
         $query = $this->reports_model->get_customer_charge_list(true,$accountid,$paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
882 887
 	$result= $query->result_array();
883 888
         $query1 = $this->reports_model->get_customer_charge_list(true,$accountid,'','');
@@ -899,12 +904,12 @@  discard block
 block discarded – undo
899 904
 		$item_type=$value['item_type'];
900 905
 		if($value['before_balance'] == '-'){
901 906
 			$before_balance='-';
902
-		}else{		
907
+		} else{		
903 908
 			$before_balance=$this->common->convert_to_currency('','',$value['before_balance']);
904 909
 		}
905 910
 		if($value['debit'] == '-'){
906 911
 			$debit='-';
907
-		}else{		
912
+		} else{		
908 913
 			$debit=$this->common->convert_to_currency('','',$value['debit']);
909 914
 		}
910 915
 		$credit=$this->common->convert_to_currency('','',$value['credit']);
@@ -913,7 +918,7 @@  discard block
 block discarded – undo
913 918
 	     }
914 919
 		if($value['after_balance'] == '-'){
915 920
 			$after_balance='-';
916
-		}else{		
921
+		} else{		
917 922
 			$after_balance=$this->common->convert_to_currency('','',$value['after_balance']);
918 923
 		}
919 924
 		$description=$value['description'];
@@ -929,7 +934,7 @@  discard block
 block discarded – undo
929 934
 							$after_balance,
930 935
 							$description,
931 936
 				                    ));
932
-	}else{
937
+	} else{
933 938
             $json_data['rows'][] = array('cell' => array(
934 939
 							$date,
935 940
 							$invoice_num,
@@ -955,7 +960,7 @@  discard block
 block discarded – undo
955 960
 	}
956 961
         if ($this->session->userdata('logintype') == 1) {
957 962
 	        $json_data['rows'][$count_all]['cell']=array('<b>Total</b>','-','-','-','<b>'.$this->common->convert_to_currency('','',$debit_sum).'</b>','<b>'.$this->common->convert_to_currency('','',$credit_sum).'</b>','-','-');
958
-	}else{
963
+	} else{
959 964
 	        $json_data['rows'][$count_all]['cell']=array('<b>Total</b>','-','-','-','<b>'.$this->common->convert_to_currency('','',$debit_sum).'</b>','<b>'.$this->common->convert_to_currency('','',$credit_sum).'</b>','-','-');
960 965
 
961 966
 	}
@@ -971,13 +976,15 @@  discard block
 block discarded – undo
971 976
                                             OR  notes like '%$instant_search%'
972 977
                                                 )"
973 978
                                            :null;
974
-        if(!empty($like_str))
975
-        $this->db->where($like_str);
979
+        if(!empty($like_str)) {
980
+                $this->db->where($like_str);
981
+        }
976 982
         $count_all = $this->reports_model->get_customer_refillreport(false,$accountid);
977 983
         $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
978 984
         $json_data = $paging_data["json_paging"];
979
-        if(!empty($like_str))
980
-        $this->db->where($like_str);
985
+        if(!empty($like_str)) {
986
+                $this->db->where($like_str);
987
+        }
981 988
         $query = $this->reports_model->get_customer_refillreport(true,$accountid,$paging_data["paging"]["start"], $paging_data["paging"]["page_no"]);
982 989
         $grid_fields = json_decode($this->reports_form->build_refillreport_for_customer());
983 990
         $json_data['rows'] = $this->form->build_grid($query, $grid_fields);
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/reports/libraries/reports_form.php 1 patch
Braces   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,8 +20,9 @@  discard block
 block discarded – undo
20 20
 # You should have received a copy of the GNU Affero General Public License
21 21
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
22 22
 ###############################################################################
23
-if (!defined('BASEPATH'))
24
-    exit('No direct script access allowed');
23
+if (!defined('BASEPATH')) {
24
+    exit('No direct script access allowed');
25
+}
25 26
 
26 27
 class Reports_form {
27 28
     function __construct() {
@@ -56,8 +57,7 @@  discard block
 block discarded – undo
56 57
             array('Call Type', 'calltype', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_calltype'),
57 58
             array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
58 59
             array('', 'HIDDEN', 'advance_search', '1', '', '', ''));
59
-             }
60
-		else
60
+             } else
61 61
 		{
62 62
 		$form['forms'] = array("", array('id' => "cdr_customer_search"));
63 63
         $form['Search'] = array(
@@ -190,8 +190,7 @@  discard block
 block discarded – undo
190 190
                 $recording,
191 191
                 ));
192 192
                 
193
-                }
194
-                else{
193
+                } else{
195 194
 		$account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
196 195
 		$currency_id=$account_info['currency_id'];
197 196
 		$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
@@ -348,7 +347,7 @@  discard block
 block discarded – undo
348 347
             $account_data = $this->CI->session->userdata("accountinfo");
349 348
             $loginid = $account_data['id'];
350 349
 
351
-        }else{
350
+        } else{
352 351
             $loginid = "0";
353 352
         }
354 353
         if($logintype==0 || $logintype==3){
@@ -535,7 +534,7 @@  discard block
 block discarded – undo
535 534
 	    array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"),	
536 535
             array(gettext("Description"), "300", "description", "", "", "","","true","center"),
537 536
                 ));
538
-	}else{
537
+	} else{
539 538
         $grid_field_arr = json_encode(array(
540 539
             array("Created Date", "120", "created_date", "", "", "","","true","center"),
541 540
             array("Invoice Number", "120", "created_date", "", "", "","","true","center"),
Please login to merge, or discard this patch.