Completed
Push — v3.0 ( 3d1631...29f961 )
by Samir
22:25
created
web_interface/astpp/application/modules/charges/controllers/charges.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@  discard block
 block discarded – undo
34 34
         $this->load->library('astpp/form');
35 35
         $this->load->model('charges_model');
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
     function periodiccharges_add() {
@@ -182,13 +183,15 @@  discard block
 block discarded – undo
182 183
                                             OR  charges.charge like '%$instant_search%' 
183 184
                                                 )"
184 185
                                            :null;
185
-        if(!empty($like_str))
186
-        $this->db->where($like_str);
186
+        if(!empty($like_str)) {
187
+                $this->db->where($like_str);
188
+        }
187 189
         $count_all = $this->db_model->getCountWithJion($table, $select, $where, $jionTable, $jionCondition, $type);
188 190
         $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
189 191
         $json_data = $paging_data["json_paging"];
190
-        if(!empty($like_str))
191
-        $this->db->where($like_str);
192
+        if(!empty($like_str)) {
193
+                $this->db->where($like_str);
194
+        }
192 195
         $account_charge_list = $this->db_model->getAllJionQuery($table, $select, $where, $jionTable, $jionCondition, $type, $paging_data["paging"]["page_no"], $paging_data["paging"]["start"], $order_by, $order_type, "");
193 196
         $grid_fields = json_decode($this->charges_form->build_charges_list_for_customer($accountid, $accounttype));
194 197
         $json_data['rows'] = $this->form->build_grid($account_charge_list, $grid_fields);
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/charges/libraries/charges_form.php 1 patch
Braces   +4 added lines, -3 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 Charges_form {
29 30
       	function __construct($library_name = '') {
@@ -52,7 +53,7 @@  discard block
 block discarded – undo
52 53
             $account_data = $this->CI->session->userdata("accountinfo");
53 54
             $loginid = $account_data['id'];
54 55
 
55
-        }else{
56
+        } else{
56 57
             $loginid = "0";
57 58
         }
58 59
         $form['forms'] = array("", array('id' => "charges_search"));
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/did/controllers/did.php 1 patch
Braces   +26 added lines, -25 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@  discard block
 block discarded – undo
34 34
         $this->load->model('did_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
     function did_add() {
@@ -163,7 +164,7 @@  discard block
 block discarded – undo
163 164
 	    $this->db->where('note',$did_info['number']);
164 165
 	    $this->db->delete("reseller_pricing");
165 166
 	  }
166
-      }else{
167
+      } else{
167 168
 	  $reseller_ids=$this->common->get_subreseller_info($accountinfo['id']);
168 169
 	  $reseller_ids=rtrim($reseller_ids,",");
169 170
 	  $where="parent_id IN ($reseller_ids)";
@@ -172,7 +173,7 @@  discard block
 block discarded – undo
172 173
       }
173 174
       if($accountinfo['type']==1){
174 175
           $update_array = array('parent_id' => $accountinfo['id'], 'accountid' => 0, 'assign_date' => '0000-00-00 00:00:00', "charge_upto" => "0000-00-00 00:00:00","last_modified_date"=>gmdate("Y-m-d H:i:s"));
175
-      }else{
176
+      } else{
176 177
 	  $update_array = array('parent_id' => 0, 'accountid' => 0, 'assign_date' => '0000-00-00 00:00:00', "charge_upto" => "0000-00-00 00:00:00","last_modified_date"=>gmdate("Y-m-d H:i:s"));
177 178
       }
178 179
       $where = array('id' => $id);
@@ -181,7 +182,7 @@  discard block
 block discarded – undo
181 182
       $accountid=$did_info['accountid'] > 0 ? $did_info['accountid']:0;
182 183
       if($did_info['accountid'] > 0 ){
183 184
        $email_user_id=$did_info['accountid'];
184
-      }elseif($did_info['parent_id'] > 0){
185
+      } elseif($did_info['parent_id'] > 0){
185 186
 	$email_user_id=$did_info['parent_id'];
186 187
       }
187 188
       $accountinfo=(array)$this->db->get_where('accounts',array("id"=>$email_user_id))->first_row();
@@ -208,7 +209,7 @@  discard block
 block discarded – undo
208 209
 	    $accountinfo = $this->session->userdata('accountinfo');
209 210
 	    if($accountinfo['reseller_id'] > 0){
210 211
 	      $dids_array=$this->db->query("SELECT a.id AS id,a.number as number, b.monthlycost, b.setup FROM dids AS a, reseller_pricing AS b WHERE a.number = b.note AND b.reseller_id = ".$accountinfo['reseller_id']." AND a.parent_id =".$accountinfo['reseller_id'])->result_array();
211
-            }else{
212
+            } else{
212 213
               $this->db->select('id,monthlycost,setup,number');
213 214
               $this->db->where('accountid',0);
214 215
               $this->db->where('parent_id',0);
@@ -332,8 +333,9 @@  discard block
 block discarded – undo
332 333
 					OR  a.connectcost like '%$instant_search%'
333 334
 					    )" :null;
334 335
         if ($account_arr['reseller_id'] != 0) {
335
-	    if(!empty($like_str))
336
-            $this->db->where($like_str);
336
+	    if(!empty($like_str)) {
337
+	                $this->db->where($like_str);
338
+	    }
337 339
             if($accounttype=='reseller'){
338 340
 	      $this->db->where('a.note','b.number',false);
339 341
 	      $this->db->where('a.reseller_id',$account_arr['id']);
@@ -348,13 +350,13 @@  discard block
 block discarded – undo
348 350
 	      $this->db->select('a . * , b.id, a.reseller_id AS accountid,a.note as number,b.country_id as country_id');
349 351
 	      $this->db->limit($paging_data["paging"]["page_no"],$paging_data["paging"]["start"]);
350 352
 	      $query=$this->db->get('reseller_pricing as a,dids as b');
351
-          }else{
353
+          } else{
352 354
 	      $count_result=(array)$this->db->query('select count(id) as count from dids where accountid='.$accountid." AND parent_id =".$account_arr['reseller_id'])->first_row();
353 355
               $paging_data = $this->form->load_grid_config($count_result['count'], $_GET['rp'], $_GET['page']);
354 356
 	      $json_data = $paging_data["json_paging"];
355 357
               $query=$this->db->query("SELECT a . * ,a.note as number,b.country_id as country_id,b.id FROM reseller_pricing AS a, dids AS b WHERE b.accountid =".$account_arr['id']." AND a.note = b.number AND a.reseller_id =".$account_arr['reseller_id']);
356 358
           }
357
-        }else{
359
+        } else{
358 360
                         $like_str=!empty($instant_search) ? 
359 361
                                                 "(dids.number like '%$instant_search%'
360 362
                                                     OR dids.inc like '%$instant_search%'
@@ -364,14 +366,16 @@  discard block
 block discarded – undo
364 366
                                                     OR dids.monthlycost like '%$instant_search%'
365 367
                                                     OR dids.connectcost like '%$instant_search%'
366 368
                                                         )" :null;
367
-            if(!empty($like_str))
368
-            $this->db->where($like_str);
369
+            if(!empty($like_str)) {
370
+                        $this->db->where($like_str);
371
+            }
369 372
             $where = array($field_name => $accountid);
370 373
             $count_all = $this->db_model->countQuery("*", "dids", $where);
371 374
             $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
372 375
             $json_data = $paging_data["json_paging"];
373
-            if(!empty($like_str))
374
-            $this->db->where($like_str);
376
+            if(!empty($like_str)) {
377
+                        $this->db->where($like_str);
378
+            }
375 379
             $query = $this->db_model->select("*", "dids", $where, "id", "ASC", $paging_data["paging"]["page_no"], $paging_data["paging"]["start"]);
376 380
         }
377 381
         $did_grid_fields = json_decode($this->did_form->build_did_list_for_customer($accountid, $accounttype));
@@ -648,17 +652,14 @@  discard block
 block discarded – undo
648 652
                 if(isset($csv_data['call_type'])){
649 653
 					if(strtolower($csv_data['call_type']) == 'sip-did'){
650 654
 						$call_type = '3';
651
-					}
652
-					else if(strtolower($csv_data['call_type']) == 'did-local'){
655
+					} else if(strtolower($csv_data['call_type']) == 'did-local'){
653 656
 						$call_type = '1';
654
-					}
655
-					else if(strtolower($csv_data['call_type']) == 'other'){
657
+					} else if(strtolower($csv_data['call_type']) == 'other'){
656 658
 						$call_type = '2';
657
-					}
658
-					else {
659
+					} else {
659 660
 						$call_type = '0';
660 661
 					}
661
-				}else{
662
+				} else{
662 663
 					$call_type = '0';
663 664
 				}
664 665
                 $csv_data['accountid'] = isset($csv_data['accountid']) ? $csv_data['accountid'] : 0;
@@ -717,21 +718,21 @@  discard block
 block discarded – undo
717 718
 				     unset($reseller_array['number'],$csv_data['accountid'],$reseller_array['accountid'],$reseller_array['country_id'],$reseller_array['init_inc']);
718 719
 				     $csv_data['accountid']=0;
719 720
 				     $final_reseller_array[$i]=$reseller_array;
720
-				    }else{
721
+				    } else{
721 722
 				      $csv_data['parent_id']=0;
722 723
 				    }
723 724
 				    $csv_data['assign_date']=gmdate("Y-m-d H:i:s");
724 725
 				    $new_final_arr[$i] = $csv_data;
725 726
 				    $this->common->mail_to_users('email_add_did', $account_info);
726
-			          }else{
727
+			          } else{
727 728
 				    $invalid_array[$i] = $csv_data;
728 729
 				    $invalid_array[$i]['error'] = 'Account have not sufficient amount to purchase this DID.';
729 730
 			          }
730
-			      }else{
731
+			      } else{
731 732
 				$invalid_array[$i] = $csv_data;
732 733
 				$invalid_array[$i]['error'] = 'Account not found or assign to invalid account';
733 734
 			      }
734
-                            }else{
735
+                            } else{
735 736
 			      $csv_data['setup'] = $this->common_model->add_calculate_currency($csv_data['setup'], '', '', false, false);
736 737
 			      $csv_data['monthlycost'] = $this->common_model->add_calculate_currency($csv_data['monthlycost'], '', '', false, false);
737 738
 			      $csv_data['cost'] = $this->common_model->add_calculate_currency($csv_data['cost'], '', '', false, false);
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/did/libraries/did_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 did_form {
29 30
 
@@ -35,11 +36,10 @@  discard block
 block discarded – undo
35 36
     if ($id != 0){
36 37
       if($parent_id > 0){
37 38
 	  $account_dropdown =  array('Reseller',  array('name' => 'parent_id', 'disabled' => 'disabled','class' => 'accountid', 'id' => 'accountid'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0","type"=>"1", "deleted" => "0","status" => "0"));                
38
-      }else{
39
+      } else{
39 40
 	  if($account_id > 0){
40 41
 	    $account_dropdown =  array('Account ',  array('name' => 'accountid', 'disabled' => 'disabled','class' => 'accountid', 'id' => 'accountid'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0","type"=>"0,3", "deleted" => "0","status" => "0"));
41
-	  }
42
-	  else{
42
+	  } else{
43 43
 	    $account_dropdown = array('Account', 'accountid', 'SELECT', '',array("name"=>"accountid","rules"=>"did_account_checking"), 'tOOL TIP', 'Please Enter account number', 'id',  'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0", "type" => "0,3","deleted" => "0","status" => "0" ));
44 44
 	  }
45 45
       }
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/did/views/view_import_did.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
                                 if($csv_key == 0){
102 102
 				    $cnt++;
103 103
                                     echo "<th>".ucfirst($field_name)."</th>";
104
-                                }else{
104
+                                } else{
105 105
                                     echo "<td class='portlet-content'>".$field_val."</td>";   
106 106
                                 }
107 107
                             }
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/did/models/did_model.php 1 patch
Braces   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -113,8 +113,7 @@  discard block
 block discarded – undo
113 113
 		      }
114 114
 		      $this->db->limit($limit, $start);
115 115
 		      $query=$this->db->query("SELECT a.note AS number,a.*,IF((SELECT COUNT( id ) AS count FROM reseller_pricing AS b WHERE b.parent_id =".$accountinfo['id']." AND a.note = b.note ) >0,(SELECT reseller_id AS accountid FROM reseller_pricing AS c WHERE c.note = a.note AND c.parent_id =".$accountinfo['id']."), (SELECT accountid from dids as d where d.parent_id = ".$accountinfo['id']." AND d.number=a.note)) AS accountid FROM reseller_pricing AS a where a.reseller_id=".$accountinfo['id']." AND a.parent_id =".$accountinfo['reseller_id'].$search_string);
116
-		  }
117
-		  else{
116
+		  } else{
118 117
 		    $this->db_model->build_search('did_list_search');
119 118
 		    $query = $this->db_model->select("*,note as number,IF((SELECT COUNT( id ) AS count FROM reseller_pricing AS b WHERE b.parent_id =".$accountinfo['id']." AND reseller_pricing.note = b.note ) >0,(SELECT reseller_id AS accountid FROM reseller_pricing AS c WHERE c.note = reseller_pricing.note AND c.parent_id =".$accountinfo['id']."), (SELECT accountid from dids as d where d.parent_id = ".$accountinfo['id']." AND d.number=reseller_pricing.note)) AS accountid", "reseller_pricing", $where, "note", "desc", $limit, $start);
120 119
 		  }
@@ -123,8 +122,7 @@  discard block
 block discarded – undo
123 122
 		  $query = $this->db_model->countQuery("*", "reseller_pricing", $where);
124 123
 		}
125 124
 
126
-	    }
127
-	    else
125
+	    } else
128 126
 	    {	
129 127
 	      $this->db_model->build_search('did_list_search');
130 128
 	      if ($flag) {
@@ -163,7 +161,7 @@  discard block
 block discarded – undo
163 161
 	  $accountinfo=(array)$this->db->get_where('accounts',array("id"=>$did_info['parent_id']))->first_row();
164 162
 	  $accountinfo['did_number'] = $accountinfo['number'];
165 163
 	  $this->common->mail_to_users('email_remove_did', $accountinfo);
166
-	}elseif($did_info['accountid'] > 0 ){
164
+	} elseif($did_info['accountid'] > 0 ){
167 165
 	  $accountinfo=(array)$this->db->get_where('accounts',array("id"=>$did_info['accountid']))->first_row();
168 166
 	  $accountinfo['did_number'] = $did_info['number'];
169 167
 	  $this->common->mail_to_users('email_remove_did', $accountinfo);
@@ -175,10 +173,11 @@  discard block
 block discarded – undo
175 173
         $this->db->where("country", ucfirst($field_value));
176 174
         $query = $this->db->get('countrycode');
177 175
         $data = $query->result();
178
-        if ($query->num_rows > 0)
179
-            return $data[0]->id;
180
-        else
181
-            return '';
176
+        if ($query->num_rows > 0) {
177
+                    return $data[0]->id;
178
+        } else {
179
+                    return '';
180
+        }
182 181
     }
183 182
 
184 183
     function bulk_insert_dids($field_value) {
@@ -250,10 +249,11 @@  discard block
 block discarded – undo
250 249
         $this->db->where("id", $number);
251 250
         $this->db->or_where("number", $number);
252 251
         $query = $this->db->get("dids");
253
-        if ($query->num_rows() > 0)
254
-            return $query->row_array();
255
-        else
256
-            return false;
252
+        if ($query->num_rows() > 0) {
253
+                    return $query->row_array();
254
+        } else {
255
+                    return false;
256
+        }
257 257
     }
258 258
    function edit_did_reseller($did_id,$post) {
259 259
         $accountinfo = $this->session->userdata('accountinfo');
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/did/language/english/did_lang.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 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
 //DID list
4 6
 $lang['DID.MANAGE_DIDs']='Manage DIDs';
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.