Completed
Push — v3.0 ( e28df5...5be1a9 )
by Samir
13:00
created
web_interface/astpp/application/modules/animap/libraries/animap_form.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@
 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 Animap_form {
29 30
 	  	function __construct($library_name = '') {
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/taxes/controllers/taxes.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('taxes_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 taxes_add() {
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/taxes/libraries/taxes_form.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,9 @@
 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 Taxes_form {
27 28
 	function __construct() {
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/package/models/package_model.php 1 patch
Braces   +14 added lines, -17 removed lines patch added patch discarded remove patch
@@ -50,11 +50,12 @@  discard block
 block discarded – undo
50 50
 	 $this->db->select('pricelist_id');
51 51
 	 $account_info=(array)$this->db->get('accounts')->first_row();     
52 52
 	 $where=array('pricelist_id'=>$account_info['pricelist_id']);
53
-	  if(!empty($like_str))
54
-	  $this->db->where($like_str); 
53
+	  if(!empty($like_str)) {
54
+	  	  $this->db->where($like_str);
55
+	  }
55 56
 	 if ($flag) {
56 57
 	   $query = $this->db_model->select("*", "packages", $where, "id", "ASC", $limit, $start);
57
-	 }else {
58
+	 } else {
58 59
 	   $query = $this->db_model->countQuery("*", "packages", $where);
59 60
 	 }
60 61
 	  return $query;
@@ -120,8 +121,7 @@  discard block
 block discarded – undo
120 121
 		$this->db->where_in('accountid',$acc_arr);
121 122
 		if($flag){
122 123
 		  $this->db->select('*');
123
-		}
124
-		else{
124
+		} else{
125 125
 		  $this->db->select('count(id) as count');
126 126
 		}
127 127
 		if($flag){
@@ -129,27 +129,26 @@  discard block
 block discarded – undo
129 129
 		}
130 130
 			if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){
131 131
 				$this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']);
132
-			}else{
132
+			} else{
133 133
 				$this->db->order_by('seconds','desc');
134 134
 			}
135 135
 		$result=$this->db->get('counters');
136 136
 // 	    echo $this->db->last_query();exit;    
137 137
 		if($flag){
138 138
 		  return $result;
139
-		}else{
139
+		} else{
140 140
 		  $result=$result->result_array();
141 141
 		  return $result[0]['count'];
142 142
 		}
143
-	  }else{
143
+	  } else{
144 144
 			if($flag){
145 145
 				$query=(object)array('num_rows'=>0);
146
-			}
147
-			else{
146
+			} else{
148 147
 				$query=0;
149 148
 			}
150 149
 	  return $query;
151 150
 		}
152
-	}else{
151
+	} else{
153 152
           
154 153
 		 if($result->num_rows() >0){
155 154
 		$acc_arr=array();
@@ -162,8 +161,7 @@  discard block
 block discarded – undo
162 161
          
163 162
 		 if($flag){
164 163
 	  $this->db->select('*');
165
-		 }
166
-		 else{
164
+		 } else{
167 165
 		  $this->db->select('count(id) as count');
168 166
 		 }
169 167
 		 if($flag){
@@ -176,17 +174,16 @@  discard block
 block discarded – undo
176 174
 		  if($flag){
177 175
 	        
178 176
 		return $result;
179
-		  }else{
177
+		  } else{
180 178
 		$result=$result->result_array();
181 179
 		
182 180
 		return $result[0]['count'];
183 181
 		  }
184
-		 }else{
182
+		 } else{
185 183
 		  if($flag){
186 184
 	          
187 185
 		  $query=(object)array('num_rows'=>0);
188
-		  }
189
-		  else{
186
+		  } else{
190 187
 		  $query=0;
191 188
 		  }
192 189
 // 	echo $this->db->last_query();exit;    
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/package/controllers/package.php 1 patch
Braces   +19 added lines, -21 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@  discard block
 block discarded – undo
34 34
 		$this->load->model('package_model');
35 35
 		$this->load->library('csvreader');
36 36
 
37
-		if ($this->session->userdata('user_login') == FALSE)
38
-			redirect(base_url() . '/astpp/login');
37
+		if ($this->session->userdata('user_login') == FALSE) {
38
+					redirect(base_url() . '/astpp/login');
39
+		}
39 40
 	}
40 41
 
41 42
    
@@ -190,7 +191,7 @@  discard block
 block discarded – undo
190 191
 			$data['grid_buttons'] = $this->package_form->set_pattern_grid_buttons($package_id);
191 192
 			$data["edit_id"] = $package_id;
192 193
 			$this->load->view("view_package_pattern_list",$data);
193
-		}else{
194
+		} else{
194 195
 			redirect(base_url()."package/package_list/");
195 196
 		}    
196 197
 	}
@@ -198,14 +199,16 @@  discard block
 block discarded – undo
198 199
 		$json_data = array();
199 200
 		$instant_search=$this->session->userdata('left_panel_search_package_pattern');
200 201
 		$like_str=!empty($instant_search) ? "(patterns like '%$instant_search%'  OR destination like '%$instant_search%' )" :null;
201
-		if(!empty($like_str))
202
-		$this->db->where($like_str);
202
+		if(!empty($like_str)) {
203
+				$this->db->where($like_str);
204
+		}
203 205
 		$where = array('package_id' => $package_id);
204 206
 		$count_all = $this->db_model->countQuery("*", "package_patterns", $where);
205 207
 		$paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
206 208
 		$json_data = $paging_data["json_paging"];
207
-		if(!empty($like_str))
208
-		$this->db->where($like_str);
209
+		if(!empty($like_str)) {
210
+				$this->db->where($like_str);
211
+		}
209 212
 		$pattern_data = $this->db_model->select("*", "package_patterns", $where, "id", "ASC", $paging_data["paging"]["page_no"], $paging_data["paging"]["start"]);
210 213
         
211 214
 		$grid_fields = json_decode($this->package_form->build_pattern_list_for_customer($package_id));
@@ -383,19 +386,17 @@  discard block
 block discarded – undo
383 386
 						$data['page_title'] = "Package Patterns Preview";
384 387
 						$data['check_header']=$check_header;
385 388
 						$this->session->set_userdata('import_package_code_csv',$actual_file_name);
386
-					}else{
389
+					} else{
387 390
 						$data['error'] = "File Uploading Fail Please Try Again";
388 391
 					}
389 392
 				}
390
-			 }   
391
-			else{
393
+			 } else{
392 394
 					$data['error']=="File Uploading Fail Please Try Again";
393 395
 				}
394
-		   }
395
-		   else {
396
+		   } else {
396 397
 				$data['error'] = "Invalid file format : Only CSV file allows to import records(Can't import empty file)";
397 398
 			}
398
-			}else{
399
+			} else{
399 400
 		$invalid_flag=true;
400 401
 			}
401 402
 		if ($invalid_flag) {
@@ -443,18 +444,17 @@  discard block
 block discarded – undo
443 444
 			if($str != ""){
444 445
 			$invalid_array[$i]=$csv_data;
445 446
 			$invalid_array[$i]['error'] = $str;
446
-		}
447
-		else{
447
+		} else{
448 448
 		  $csv_data['patterns'] = "^" . $csv_data['patterns'] . ".*";
449 449
 		  $csv_data['package_id'] = $edit_id;
450 450
 		  $new_final_arr[$i]=$csv_data;
451 451
 		  $pattern_arr[$csv_data['patterns']]=$csv_data['patterns'];
452 452
 		}
453
-		}else{
453
+		} else{
454 454
 			$invalid_array[$i]=$csv_data;
455 455
 			$invalid_array[$i]['error'] = "Duplicate pattern found from  database.";
456 456
 		 }
457
-	  }else{
457
+	  } else{
458 458
 		  $invalid_array[$i]=$csv_data;
459 459
 		  $invalid_array[$i]['error'] = "Duplicate pattern found from import file";
460 460
 		  }
@@ -514,12 +514,10 @@  discard block
 block discarded – undo
514 514
 		$count = count($error_field);
515 515
 		$str.= $count > 1 ? ' are not valid' : ' is not Valid';
516 516
 		return $str;
517
-		  }
518
-		  else{
517
+		  } else{
519 518
 		  return false;
520 519
 		  }
521
-	  }
522
-	  else{
520
+	  } else{
523 521
 	  $str=rtrim($str,',');
524 522
 		$error_field=explode(',',$str);
525 523
 		$count = count($error_field);
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/package/libraries/package_form.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,9 @@
 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 Package_form {
29 30
 
Please login to merge, or discard this patch.
astpp/application/modules/package/views/view_import_package_code.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
 							foreach($csv_value as $field_name => $field_val){
114 114
 								if($csv_key == 0){
115 115
 									echo "<th>".ucfirst($field_name)."</th>";
116
-								}else{
116
+								} else{
117 117
 									echo "<td class='portlet-content'>".$field_val."</td>";   
118 118
 								}
119 119
 							}
Please login to merge, or discard this patch.
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.