Passed
Push — v3.0 ( ee545b...afe0c2 )
by Samir
152:57 queued 117:51
created
astpp/application/modules/refill_coupon/models/refill_coupon_model.php 1 patch
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,10 +33,11 @@
 block discarded – undo
33 33
 		$reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0;
34 34
 		$where=array('reseller_id'=>$reseller_id);
35 35
 		if ($flag) {
36
-		if($export)
37
-		  $query = $this->db_model->select("*", "refill_coupon",$where, "id", "ASC",'','');
38
-		else
39
-		$query = $this->db_model->select("*", "refill_coupon",$where, "id", "ASC", $limit, $start);
36
+		if($export) {
37
+				  $query = $this->db_model->select("*", "refill_coupon",$where, "id", "ASC",'','');
38
+		} else {
39
+				$query = $this->db_model->select("*", "refill_coupon",$where, "id", "ASC", $limit, $start);
40
+		}
40 41
 		} else {
41 42
 			$query = $this->db_model->countQuery("*", "refill_coupon",$where);
42 43
 		}
Please login to merge, or discard this patch.
astpp/application/modules/refill_coupon/controllers/refill_coupon.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,8 +32,9 @@  discard block
 block discarded – undo
32 32
 		  $this->load->library("refill_coupon_form");
33 33
 		  $this->load->library("astpp/form");
34 34
 		  $this->load->library("session");
35
-		  if ($this->session->userdata('user_login') == FALSE)
36
-			redirect(base_url() . 'login/login');
35
+		  if ($this->session->userdata('user_login') == FALSE) {
36
+		  			redirect(base_url() . 'login/login');
37
+		  }
37 38
 	  }
38 39
 	function refill_coupon_list(){
39 40
 	if($this->session->userdata('logintype') == 0 || $this->session->userdata('logintype') == 3){
@@ -120,8 +121,7 @@  discard block
 block discarded – undo
120 121
 				$data['validation_errors'] = validation_errors();
121 122
 				echo $data['validation_errors'];
122 123
 				exit;
123
-		}
124
-		else {    
124
+		} else {    
125 125
 		  if($account_length<=strlen($add_array['prefix'])){
126 126
 			  echo json_encode(array("count_error"=>"You Can Not Create ".$add_array['count']." Accounts with ".$add_array['prefix']." prefix."));
127 127
 			  exit;      
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 		  if($currentlength > 0 && $add_array['count'] > $currentlength){
134 134
 			echo json_encode(array("count_error"=>"You Can Create Maximum ".$currentlength." accounts with ".$add_array['prefix']." prefix"));
135 135
 			exit;      
136
-		  }else{
136
+		  } else{
137 137
 			$this->refill_coupon_model->add_refill_coupon($add_array);
138 138
 			echo json_encode(array("SUCCESS"=> "Refill coupon created successfully!"));
139 139
 			exit;
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/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.