Completed
Push — v3.0 ( 23635d...e28df5 )
by Samir
23s
created
web_interface/astpp/application/third_party/MX/Router.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,15 +45,21 @@
 block discarded – undo
45 45
 	
46 46
 	public function _validate_request($segments) {
47 47
 
48
-		if (count($segments) == 0) return $segments;
48
+		if (count($segments) == 0) {
49
+			return $segments;
50
+		}
49 51
 		
50 52
 		/* locate module controller */
51
-		if ($located = $this->locate($segments)) return $located;
53
+		if ($located = $this->locate($segments)) {
54
+			return $located;
55
+		}
52 56
 		
53 57
 		/* use a default 404_override controller */
54 58
 		if (isset($this->routes['404_override']) AND $this->routes['404_override']) {
55 59
 			$segments = explode('/', $this->routes['404_override']);
56
-			if ($located = $this->locate($segments)) return $located;
60
+			if ($located = $this->locate($segments)) {
61
+				return $located;
62
+			}
57 63
 		}
58 64
 		
59 65
 		/* no controller found */
Please login to merge, or discard this patch.
web_interface/astpp/application/third_party/MX/Loader.php 1 patch
Braces   +78 added lines, -32 removed lines patch added patch discarded remove patch
@@ -71,7 +71,9 @@  discard block
 block discarded – undo
71 71
 	/** Add a module path loader variables **/
72 72
 	public function _add_module_paths($module = '') {
73 73
 		
74
-		if (empty($module)) return;
74
+		if (empty($module)) {
75
+			return;
76
+		}
75 77
 		
76 78
 		foreach (Modules::$locations as $location => $offset) {
77 79
 			
@@ -90,12 +92,15 @@  discard block
 block discarded – undo
90 92
 	/** Load the database drivers **/
91 93
 	public function database($params = '', $return = FALSE, $active_record = NULL) {
92 94
 		
93
-		if (class_exists('CI_DB', FALSE) AND $return == FALSE AND $active_record == NULL AND isset(CI::$APP->db) AND is_object(CI::$APP->db)) 
94
-			return;
95
+		if (class_exists('CI_DB', FALSE) AND $return == FALSE AND $active_record == NULL AND isset(CI::$APP->db) AND is_object(CI::$APP->db)) {
96
+					return;
97
+		}
95 98
 
96 99
 		require_once BASEPATH.'database/DB'.EXT;
97 100
 
98
-		if ($return === TRUE) return DB($params, $active_record);
101
+		if ($return === TRUE) {
102
+			return DB($params, $active_record);
103
+		}
99 104
 			
100 105
 		CI::$APP->db = DB($params, $active_record);
101 106
 		
@@ -105,13 +110,19 @@  discard block
 block discarded – undo
105 110
 	/** Load a module helper **/
106 111
 	public function helper($helper) {
107 112
 		
108
-		if (is_array($helper)) return $this->helpers($helper);
113
+		if (is_array($helper)) {
114
+			return $this->helpers($helper);
115
+		}
109 116
 		
110
-		if (isset($this->_ci_helpers[$helper]))	return;
117
+		if (isset($this->_ci_helpers[$helper])) {
118
+			return;
119
+		}
111 120
 
112 121
 		list($path, $_helper) = Modules::find($helper.'_helper', $this->_module, 'helpers/');
113 122
 
114
-		if ($path === FALSE) return parent::helper($helper);
123
+		if ($path === FALSE) {
124
+			return parent::helper($helper);
125
+		}
115 126
 
116 127
 		Modules::load_file($_helper, $path);
117 128
 		$this->_ci_helpers[$_helper] = TRUE;
@@ -119,7 +130,9 @@  discard block
 block discarded – undo
119 130
 
120 131
 	/** Load an array of helpers **/
121 132
 	public function helpers($helpers) {
122
-		foreach ($helpers as $_helper) $this->helper($_helper);	
133
+		foreach ($helpers as $_helper) {
134
+			$this->helper($_helper);
135
+		}
123 136
 	}
124 137
 
125 138
 	/** Load a module language file **/
@@ -128,18 +141,23 @@  discard block
 block discarded – undo
128 141
 	}
129 142
 	
130 143
 	public function languages($languages) {
131
-		foreach($languages as $_language) $this->language($_language);
144
+		foreach($languages as $_language) {
145
+			$this->language($_language);
146
+		}
132 147
 	}
133 148
 	
134 149
 	/** Load a module library **/
135 150
 	public function library($library = '', $params = NULL, $object_name = NULL) {
136 151
 		
137
-		if (is_array($library)) return $this->libraries($library);		
152
+		if (is_array($library)) {
153
+			return $this->libraries($library);
154
+		}
138 155
 		
139 156
 		$class = strtolower(basename($library));
140 157
 
141
-		if (isset($this->_ci_classes[$class]) AND $_alias = $this->_ci_classes[$class])
142
-			return CI::$APP->$_alias;
158
+		if (isset($this->_ci_classes[$class]) AND $_alias = $this->_ci_classes[$class]) {
159
+					return CI::$APP->$_alias;
160
+		}
143 161
 			
144 162
 		($_alias = strtolower($object_name)) OR $_alias = $class;
145 163
 		
@@ -171,18 +189,23 @@  discard block
 block discarded – undo
171 189
 
172 190
 	/** Load an array of libraries **/
173 191
 	public function libraries($libraries) {
174
-		foreach ($libraries as $_library) $this->library($_library);	
192
+		foreach ($libraries as $_library) {
193
+			$this->library($_library);
194
+		}
175 195
 	}
176 196
 
177 197
 	/** Load a module model **/
178 198
 	public function model($model, $object_name = NULL, $connect = FALSE) {
179 199
 		
180
-		if (is_array($model)) return $this->models($model);
200
+		if (is_array($model)) {
201
+			return $this->models($model);
202
+		}
181 203
 
182 204
 		($_alias = $object_name) OR $_alias = basename($model);
183 205
 
184
-		if (in_array($_alias, $this->_ci_models, TRUE)) 
185
-			return CI::$APP->$_alias;
206
+		if (in_array($_alias, $this->_ci_models, TRUE)) {
207
+					return CI::$APP->$_alias;
208
+		}
186 209
 			
187 210
 		/* check module */
188 211
 		list($path, $_model) = Modules::find(strtolower($model), $this->_module, 'models/');
@@ -197,7 +220,9 @@  discard block
 block discarded – undo
197 220
 			class_exists('CI_Model', FALSE) OR load_class('Model', 'core');
198 221
 			
199 222
 			if ($connect !== FALSE AND ! class_exists('CI_DB', FALSE)) {
200
-				if ($connect === TRUE) $connect = '';
223
+				if ($connect === TRUE) {
224
+					$connect = '';
225
+				}
201 226
 				$this->database($connect, FALSE, TRUE);
202 227
 			}
203 228
 			
@@ -214,13 +239,17 @@  discard block
 block discarded – undo
214 239
 
215 240
 	/** Load an array of models **/
216 241
 	public function models($models) {
217
-		foreach ($models as $_model) $this->model($_model);	
242
+		foreach ($models as $_model) {
243
+			$this->model($_model);
244
+		}
218 245
 	}
219 246
 
220 247
 	/** Load a module controller **/
221 248
 	public function module($module, $params = NULL)	{
222 249
 		
223
-		if (is_array($module)) return $this->modules($module);
250
+		if (is_array($module)) {
251
+			return $this->modules($module);
252
+		}
224 253
 
225 254
 		$_alias = strtolower(basename($module));
226 255
 		CI::$APP->$_alias = Modules::load(array($module => $params));
@@ -229,16 +258,21 @@  discard block
 block discarded – undo
229 258
 
230 259
 	/** Load an array of controllers **/
231 260
 	public function modules($modules) {
232
-		foreach ($modules as $_module) $this->module($_module);	
261
+		foreach ($modules as $_module) {
262
+			$this->module($_module);
263
+		}
233 264
 	}
234 265
 
235 266
 	/** Load a module plugin **/
236 267
 	public function plugin($plugin)	{
237 268
 		
238
-		if (is_array($plugin)) return $this->plugins($plugin);		
269
+		if (is_array($plugin)) {
270
+			return $this->plugins($plugin);
271
+		}
239 272
 		
240
-		if (isset($this->_ci_plugins[$plugin]))	
241
-			return;
273
+		if (isset($this->_ci_plugins[$plugin])) {
274
+					return;
275
+		}
242 276
 
243 277
 		list($path, $_plugin) = Modules::find($plugin.'_pi', $this->_module, 'plugins/');	
244 278
 		
@@ -252,7 +286,9 @@  discard block
 block discarded – undo
252 286
 
253 287
 	/** Load an array of plugins **/
254 288
 	public function plugins($plugins) {
255
-		foreach ($plugins as $_plugin) $this->plugin($_plugin);	
289
+		foreach ($plugins as $_plugin) {
290
+			$this->plugin($_plugin);
291
+		}
256 292
 	}
257 293
 
258 294
 	/** Load a module view **/
@@ -292,20 +328,26 @@  discard block
 block discarded – undo
292 328
 					break;
293 329
 				}
294 330
 				
295
-				if ( ! $cascade) break;
331
+				if ( ! $cascade) {
332
+					break;
333
+				}
296 334
 			}
297 335
 			
298 336
 		} elseif (isset($_ci_path)) {
299 337
 			
300 338
 			$_ci_file = basename($_ci_path);
301
-			if( ! file_exists($_ci_path)) $_ci_path = '';
339
+			if( ! file_exists($_ci_path)) {
340
+				$_ci_path = '';
341
+			}
302 342
 		}
303 343
 
304
-		if (empty($_ci_path)) 
305
-			show_error('Unable to load the requested file: '.$_ci_file);
344
+		if (empty($_ci_path)) {
345
+					show_error('Unable to load the requested file: '.$_ci_file);
346
+		}
306 347
 
307
-		if (isset($_ci_vars)) 
308
-			$this->_ci_cached_vars = array_merge($this->_ci_cached_vars, (array) $_ci_vars);
348
+		if (isset($_ci_vars)) {
349
+					$this->_ci_cached_vars = array_merge($this->_ci_cached_vars, (array) $_ci_vars);
350
+		}
309 351
 		
310 352
 		extract($this->_ci_cached_vars);
311 353
 
@@ -319,7 +361,9 @@  discard block
 block discarded – undo
319 361
 
320 362
 		log_message('debug', 'File loaded: '.$_ci_path);
321 363
 
322
-		if ($_ci_return == TRUE) return ob_get_clean();
364
+		if ($_ci_return == TRUE) {
365
+			return ob_get_clean();
366
+		}
323 367
 
324 368
 		if (ob_get_level() > $this->_ci_ob_level + 1) {
325 369
 			ob_end_flush();
@@ -359,7 +403,9 @@  discard block
 block discarded – undo
359 403
 		}
360 404
 		
361 405
 		/* nothing to do */
362
-		if (count($autoload) == 0) return;
406
+		if (count($autoload) == 0) {
407
+			return;
408
+		}
363 409
 		
364 410
 		/* autoload package paths */
365 411
 		if (isset($autoload['packages'])) {
Please login to merge, or discard this patch.
web_interface/astpp/application/models/system_model.php 1 patch
Braces   +15 added lines, -12 removed lines patch added patch discarded remove patch
@@ -51,10 +51,11 @@  discard block
 block discarded – undo
51 51
         $this->db->where("id", $id);
52 52
         $query = $this->db->get("system");
53 53
 
54
-        if ($query->num_rows() > 0)
55
-            return $query->row_array();
56
-        else
57
-            return false;
54
+        if ($query->num_rows() > 0) {
55
+                    return $query->row_array();
56
+        } else {
57
+                    return false;
58
+        }
58 59
     }
59 60
 
60 61
     function remove_config($data) {
@@ -89,10 +90,11 @@  discard block
 block discarded – undo
89 90
         $this->db->where("taxes_id", $id);
90 91
         $query = $this->db->get("taxes");
91 92
 
92
-        if ($query->num_rows() > 0)
93
-            return $query->row_array();
94
-        else
95
-            return false;
93
+        if ($query->num_rows() > 0) {
94
+                    return $query->row_array();
95
+        } else {
96
+                    return false;
97
+        }
96 98
     }
97 99
 
98 100
     function remove_tax($data) {
@@ -373,10 +375,11 @@  discard block
 block discarded – undo
373 375
     function get_template_by_id_all($id) {
374 376
         $this->db->where('id', $id);
375 377
         $query = $this->db->get('templates');
376
-        if ($query->num_rows() > 0)
377
-            return $query->row_array();
378
-        else
379
-            return false;
378
+        if ($query->num_rows() > 0) {
379
+                    return $query->row_array();
380
+        } else {
381
+                    return false;
382
+        }
380 383
     }
381 384
 
382 385
     function edit_template($edit_id, $data) {
Please login to merge, or discard this patch.
web_interface/astpp/application/models/db_model.php 1 patch
Braces   +55 added lines, -43 removed lines patch added patch discarded remove patch
@@ -48,10 +48,11 @@  discard block
 block discarded – undo
48 48
     function save($tableName, $arr, $val = 'false') {
49 49
         $str = $this->db->insert_string($tableName, $arr);
50 50
         $rs = $this->db->query($str);
51
-        if ($val == true)
52
-            return $this->db->insert_id();
53
-        else
54
-            return $rs;
51
+        if ($val == true) {
52
+                    return $this->db->insert_id();
53
+        } else {
54
+                    return $rs;
55
+        }
55 56
     }
56 57
 
57 58
     /*     * ********************************************************
@@ -134,15 +135,18 @@  discard block
 block discarded – undo
134 135
             $this->db->where($where);
135 136
         }
136 137
         
137
-        if ($paging_limit)
138
-            $this->db->limit($paging_limit, $start_limit);
139
-        if (!empty($groupby))
140
-            $this->db->group_by($groupby);
138
+        if ($paging_limit) {
139
+                    $this->db->limit($paging_limit, $start_limit);
140
+        }
141
+        if (!empty($groupby)) {
142
+                    $this->db->group_by($groupby);
143
+        }
141 144
         if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){
142 145
           $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']);
143
-        }else{
144
-           if($order_by)
145
-            $this->db->order_by($order_by, $order_type);
146
+        } else{
147
+           if($order_by) {
148
+                       $this->db->order_by($order_by, $order_type);
149
+           }
146 150
         }        
147 151
         $query = $this->db->get();
148 152
         return $query;
@@ -160,10 +164,12 @@  discard block
 block discarded – undo
160 164
         }
161 165
         $this->db->where_in($key, $where_in);
162 166
         $this->db->order_by($order_by, $order_type);
163
-        if ($paging_limit)
164
-            $this->db->limit($paging_limit, $start_limit);
165
-        if (!empty($groupby))
166
-            $this->db->groupby($groupby);
167
+        if ($paging_limit) {
168
+                    $this->db->limit($paging_limit, $start_limit);
169
+        }
170
+        if (!empty($groupby)) {
171
+                    $this->db->groupby($groupby);
172
+        }
167 173
         $query = $this->db->get();
168 174
 
169 175
         return $query;
@@ -254,9 +260,10 @@  discard block
 block discarded – undo
254 260
         }
255 261
         if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){
256 262
           $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']);
257
-        }else{
258
-           if($order_by)
259
-            $this->db->order_by($order_by, $order_type);
263
+        } else{
264
+           if($order_by) {
265
+                       $this->db->order_by($order_by, $order_type);
266
+           }
260 267
         }
261 268
 
262 269
         if ($group_by != '') {
@@ -306,9 +313,10 @@  discard block
 block discarded – undo
306 313
         }
307 314
         if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){
308 315
           $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']);
309
-        }else{
310
-           if($order_by)
311
-            $this->db->order_by($order_by, $order_type);
316
+        } else{
317
+           if($order_by) {
318
+                       $this->db->order_by($order_by, $order_type);
319
+           }
312 320
         }
313 321
 
314 322
         if ($group_by != '') {
@@ -466,7 +474,7 @@  discard block
 block discarded – undo
466 474
 	$logintype = $this->session->userdata('logintype');
467 475
 	if ($account_data['type'] == 1 && $id_where == 'where_arr') {
468 476
 	  $id_value['reseller_id'] = $account_data['id'];
469
-	}else{
477
+	} else{
470 478
 	  $this->db->or_where('type',3);
471 479
 	}
472 480
 	$where = $id_value;
@@ -572,7 +580,7 @@  discard block
 block discarded – undo
572 580
         $name=explode("as",$select);
573 581
         if(isset($name[3])){
574 582
             $name=trim($name[3]);
575
-        }else{
583
+        } else{
576 584
             $name=trim($name[1]);
577 585
         }
578 586
 
@@ -583,7 +591,7 @@  discard block
 block discarded – undo
583 591
             if(isset($dele[1]))
584 592
             {
585 593
                $drp_list['Deleted'][$drp_value->$select_params[0]] =  str_replace("^","",$drp_value->$name);
586
-            }else{
594
+            } else{
587 595
                $drp_list['Active'][$drp_value->$select_params[0]] = $drp_value->$name;
588 596
             }
589 597
         }
@@ -645,7 +653,7 @@  discard block
 block discarded – undo
645 653
 				if($field == 'invoice_date'){
646 654
 					$this->db->where($field . ' >= ', gmdate("Y-m-d", strtotime($value['0']))." 00:00:01");
647 655
 					$this->db->where($field . ' <= ', gmdate("Y-m-d", strtotime($value['0']))." 23:59:59");
648
-				}else{
656
+				} else{
649 657
                 $this->db->where($field . ' >= ', gmdate('Y-m-d H:i:s',strtotime($value[0])));
650 658
 				}
651 659
 			}
@@ -701,7 +709,7 @@  discard block
 block discarded – undo
701 709
 					if($field == "pattern"){
702 710
 							$str1 = $field . " LIKE '^".$search_array."%'";
703 711
 							$this->db->where($str1);
704
-					}else{
712
+					} else{
705 713
 							$str1 = $field . " LIKE '".$search_array."%'";
706 714
 							$this->db->where($str1);
707 715
 					}
@@ -711,7 +719,7 @@  discard block
 block discarded – undo
711 719
 					if($field == "pattern"){
712 720
 							$str1 = $field . " LIKE '%".$search_array.".*'";
713 721
 							$this->db->where($str1);
714
-					}else{
722
+					} else{
715 723
 							$str1 = $field . " LIKE '%".$search_array."'";
716 724
 							$this->db->where($str1);
717 725
 					}		
@@ -734,20 +742,23 @@  discard block
 block discarded – undo
734 742
                             if (array_key_exists($key . "-integer", $value)) {
735 743
 				$string=null;
736 744
                                 $string =$this->build_interger_where($key, $value[$key . "-integer"], $value[$key]);
737
-                                if($string)
738
-                                $where.= "$string AND ";
745
+                                if($string) {
746
+                                                                $where.= "$string AND ";
747
+                                }
739 748
                             }
740 749
                             if (array_key_exists($key . "-string", $value)) {
741 750
 				$string=null;
742 751
                                 $string=$this->build_string_where($key, $value[$key . "-string"], $value[$key]);
743
-                                if($string)
744
-                                $where.= "$string AND ";
752
+                                if($string) {
753
+                                                                $where.= "$string AND ";
754
+                                }
745 755
                             }
746 756
                             if ($key == 'callstart'|| $key == 'date'||$key== 'log_time') {
747 757
 				$string=null;
748 758
                                 $string=$this->build_date_where($key, $value);
749
-                                if($string)
750
-                                $where.= "$string AND ";
759
+                                if($string) {
760
+                                                                $where.= "$string AND ";
761
+                                }
751 762
                             }
752 763
                         } else {
753 764
 			      $where.="$key = '$value'AND ";
@@ -779,14 +790,14 @@  discard block
 block discarded – undo
779 790
                 case "5":
780 791
 		    if($field == "pattern"){
781 792
 		      $where = $field . " LIKE '^".$search_array."%'";
782
-		    }else{
793
+		    } else{
783 794
 		      $where = $field . " LIKE '".$search_array."%'";
784 795
 		    }
785 796
                     break;
786 797
                 case "6":
787 798
 		    if($field == "pattern"){
788 799
 		       $str1 = $field . " LIKE '%".$search_array.".*'";
789
-		    }else{
800
+		    } else{
790 801
 		       $str1 = $field . " LIKE '%".$search_array."'";
791 802
 		    }
792 803
 		    break;
@@ -820,8 +831,7 @@  discard block
 block discarded – undo
820 831
 			$where = "$field <= '$search_array'";
821 832
 			break;
822 833
 		}
823
-            }
824
-            else
834
+            } else
825 835
             {
826 836
 	      $this->db->where("$field IS NULL");
827 837
 	      $where= "$field IS NULL";
@@ -835,14 +845,16 @@  discard block
 block discarded – undo
835 845
             if (!empty($value[0])) {
836 846
 		$string=null;
837 847
                 $string="$field >= '$value[0]'";
838
-                if($string)
839
-                $where.=$string." AND ";
848
+                if($string) {
849
+                                $where.=$string." AND ";
850
+                }
840 851
             }
841 852
             if (!empty($value[1])) {
842 853
 		$string=null;
843 854
                 $string="$field <= '$value[1]'";
844
-                if($string)
845
-                $where.=$string." AND ";
855
+                if($string) {
856
+                                $where.=$string." AND ";
857
+                }
846 858
             }
847 859
         }
848 860
         if($where){
@@ -994,9 +1006,9 @@  discard block
 block discarded – undo
994 1006
             if($drp_value->type == 3)
995 1007
             {
996 1008
                $drp_list['Provider'][$drp_value->id] = $drp_value->first_name;
997
-            }elseif($drp_value->type == 1){
1009
+            } elseif($drp_value->type == 1){
998 1010
                $drp_list['Reseller'][$drp_value->id] = $drp_value->first_name;
999
-            }else{
1011
+            } else{
1000 1012
                $drp_list['Customer'][$drp_value->id] = $drp_value->first_name;
1001 1013
             }
1002 1014
         }
Please login to merge, or discard this patch.
web_interface/astpp/application/models/common_model.php 1 patch
Braces   +23 added lines, -16 removed lines patch added patch discarded remove patch
@@ -127,8 +127,9 @@  discard block
 block discarded – undo
127 127
         $to_cur_rate = (self::$global_config['currency_list'][$to_currency])?self::$global_config['currency_list'][$to_currency]:1;
128 128
         $amount = str_replace( ',', '', $amount );
129 129
         $cal_amount = ($amount * $to_cur_rate) / $from_cur_rate;
130
-        if ($format_currency)
131
-            $cal_amount = $this->format_currency($cal_amount);
130
+        if ($format_currency) {
131
+                    $cal_amount = $this->format_currency($cal_amount);
132
+        }
132 133
         if ($append_currency){
133 134
             $cal_amount = $cal_amount . " " . $to_currency;
134 135
         }
@@ -146,10 +147,12 @@  discard block
 block discarded – undo
146 147
         $to_cur_rate = (self::$global_config['currency_list'][$to_currency])?self::$global_config['currency_list'][$to_currency]:1;
147 148
         $amount = str_replace( ',', '', $amount );
148 149
         $cal_amount = ($amount * $to_cur_rate) / $from_cur_rate;
149
-        if ($format_currency)
150
-            $cal_amount = $this->format_currency($cal_amount);
151
-        if ($append_currency)
152
-            $cal_amount = $cal_amount ;
150
+        if ($format_currency) {
151
+                    $cal_amount = $this->format_currency($cal_amount);
152
+        }
153
+        if ($append_currency) {
154
+                    $cal_amount = $cal_amount ;
155
+        }
153 156
         $cal_amount = str_replace( ',', '', $cal_amount );
154 157
         return $cal_amount;
155 158
         }
@@ -163,13 +166,15 @@  discard block
 block discarded – undo
163 166
         $to_currency = ($to_currency == '') ? self::$global_config['system_config']['base_currency'] : $to_currency;
164 167
         if(self::$global_config['currency_list'][$from_currency] > 0){
165 168
 			$cal_amount = ($amount * self::$global_config['currency_list'][$to_currency]) / self::$global_config['currency_list'][$from_currency];
166
-		}else{
169
+		} else{
167 170
 			$cal_amount=$amount;
168 171
 		}
169
-        if ($format_currency)
170
-            $cal_amount = $this->format_currency($cal_amount);
171
-        if ($append_currency)
172
-            $cal_amount = $cal_amount . " " . $to_currency;
172
+        if ($format_currency) {
173
+                    $cal_amount = $this->format_currency($cal_amount);
174
+        }
175
+        if ($append_currency) {
176
+                    $cal_amount = $cal_amount . " " . $to_currency;
177
+        }
173 178
         $cal_amount = str_replace( ',', '', $cal_amount );
174 179
         return $cal_amount;
175 180
     }
@@ -185,10 +190,12 @@  discard block
 block discarded – undo
185 190
         $to_cur_rate = (self::$global_config['currency_list'][$to_currency])?self::$global_config['currency_list'][$to_currency]:1;
186 191
         $amount = str_replace( ',', '', $amount );
187 192
         $cal_amount = ($amount * $to_cur_rate) / $from_cur_rate;
188
-        if ($format_currency)
189
-            $cal_amount = $this->format_currency($cal_amount);
190
-        if ($append_currency)
191
-            $cal_amount = $cal_amount . " " . $to_currency;
193
+        if ($format_currency) {
194
+                    $cal_amount = $this->format_currency($cal_amount);
195
+        }
196
+        if ($append_currency) {
197
+                    $cal_amount = $cal_amount . " " . $to_currency;
198
+        }
192 199
         $cal_amount = str_replace( ',', '', $cal_amount );
193 200
         return $cal_amount;
194 201
     }
@@ -318,7 +325,7 @@  discard block
 block discarded – undo
318 325
         $account_result=(array)$account_result->first_row();
319 326
         if(isset($account_result['reseller_id']) && $account_result['reseller_id']> 0){
320 327
             return $account_result['reseller_id'];
321
-        }else{
328
+        } else{
322 329
             return '0';
323 330
         }
324 331
         
Please login to merge, or discard this patch.
web_interface/astpp/application/helpers/csv_helper.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 
3 5
 // ------------------------------------------------------------------------
4 6
 
@@ -59,8 +61,7 @@  discard block
 block discarded – undo
59 61
 		if ($download == "")
60 62
 		{
61 63
 			return $str;	
62
-		}
63
-		else
64
+		} else
64 65
 		{	
65 66
 			echo $str;
66 67
 		}		
Please login to merge, or discard this patch.
web_interface/astpp/application/helpers/email_csv_helper.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,8 +1,14 @@
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 
3 5
 function create_csv_string($data) {
4
-	if (!$fp = fopen('php://temp', 'w+')) return FALSE;
5
-	foreach ($data as $line) fputcsv($fp, $line);
6
+	if (!$fp = fopen('php://temp', 'w+')) {
7
+		return FALSE;
8
+	}
9
+	foreach ($data as $line) {
10
+		fputcsv($fp, $line);
11
+	}
6 12
 	rewind($fp);
7 13
 	return stream_get_contents($fp);
8 14
 }
Please login to merge, or discard this patch.
web_interface/astpp/application/helpers/MY_form_helper.php 1 patch
Braces   +14 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if (!defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 	
3 5
 // ------------------------------------------------------------------------
4 6
 
@@ -39,8 +41,7 @@  discard block
 block discarded – undo
39 41
                             
40 42
                             $form .= ' selected="selected" >';
41 43
                                 
42
-			}
43
-			else
44
+			} else
44 45
 			{
45 46
 				$form .= '>';
46 47
 			}
@@ -80,8 +81,7 @@  discard block
 block discarded – undo
80 81
 			if( $key == $selected )
81 82
 			{
82 83
 				$form .= '  selected="selected">';
83
-			}
84
-			else
84
+			} else
85 85
 			{
86 86
 				$form .= '>';
87 87
 			}
@@ -122,8 +122,7 @@  discard block
 block discarded – undo
122 122
 			if( strtolower($value) == strtolower($selected) )
123 123
 			{
124 124
 				$form .= '  selected="selected">';
125
-			}
126
-			else
125
+			} else
127 126
 			{
128 127
 				$form .= '>';
129 128
 			}
@@ -159,8 +158,7 @@  discard block
 block discarded – undo
159 158
 			if( $key == $selected )
160 159
 			{
161 160
 				$form .= ' selected>';
162
-			}
163
-			else
161
+			} else
164 162
 			{
165 163
 				$form .= '>';
166 164
 			}
@@ -199,8 +197,7 @@  discard block
 block discarded – undo
199 197
 			if( $key == $selected )
200 198
 			{
201 199
 				$form .= ' selected>';
202
-			}
203
-			else
200
+			} else
204 201
 			{
205 202
 				$form .= '>';
206 203
 			}
@@ -241,8 +238,7 @@  discard block
 block discarded – undo
241 238
 			if( $key == $selected )
242 239
 			{
243 240
 				$form .= '  selected="selected">';
244
-			}
245
-			else
241
+			} else
246 242
 			{
247 243
 				$form .= '>';
248 244
 			}
@@ -315,10 +311,11 @@  discard block
 block discarded – undo
315 311
 if( !function_exists( 'form_table_row_4' ) )
316 312
 {
317 313
 	function form_table_row_4($label,$field,$span,$wh='10',$wd=''){
318
-		if(wd == '')
319
-			echo '<th width="'.$wh.'%"><label>'.$label.'</label></th><td>';
320
-		else 
321
-			echo '<th width="'.$wh.'%"><label>'.$label.'</label></th><td width="'.$wd.'%">';
314
+		if(wd == '') {
315
+					echo '<th width="'.$wh.'%"><label>'.$label.'</label></th><td>';
316
+		} else {
317
+					echo '<th width="'.$wh.'%"><label>'.$label.'</label></th><td width="'.$wd.'%">';
318
+		}
322 319
 		echo $field;
323 320
 		echo '<br/><span class="helptext">'.$span.'</span>';
324 321
 		echo '</td></tr>';	
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/signup/controllers/signup.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -108,8 +108,9 @@  discard block
 block discarded – undo
108 108
     }
109 109
 
110 110
     function terms_check() {
111
-        if (isset($_POST['agreeCheck']))
112
-            return true;
111
+        if (isset($_POST['agreeCheck'])) {
112
+                    return true;
113
+        }
113 114
         $this->form_validation->set_message('terms_check', 'THIS IS SOOOOO REQUIRED, DUDE!');
114 115
         return false;
115 116
     }
@@ -228,7 +229,7 @@  discard block
 block discarded – undo
228 229
                     $sip_id = $query->result_array();
229 230
                     if($reseller_id > 0){
230 231
 						$reseller_id = $reseller_id;
231
-					}else{
232
+					} else{
232 233
 						$reseller_id = '0';
233 234
 					}
234 235
                     $free_switch_array = array('fs_username' => $user_data['number'],
Please login to merge, or discard this patch.