Completed
Push — v3.0 ( 3d1631...29f961 )
by Samir
22:25
created
web_interface/astpp/application/modules/summary/controllers/summary.php 1 patch
Braces   +4 added lines, -3 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
     function customer() {
45 46
         $data['page_title'] = 'Customer Summary Report';
@@ -195,7 +196,7 @@  discard block
 block discarded – undo
195 196
                     $new_arr[] = $row1['notes'];
196 197
                 } elseif ($search_arr['groupby_3'] == 'trunk_id') {
197 198
                     $new_arr[] = $this->common->get_field_name('name', 'trunks', $row1['trunk_id']);
198
-                }  elseif($search_arr['groupby_3'] == 'package_id'){
199
+                } elseif($search_arr['groupby_3'] == 'package_id'){
199 200
 		    $new_arr[] = $this->common->get_field_name('package_name', 'packages', $row1['package_id']);
200 201
                 }
201 202
                 if (empty($new_arr)) {
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/summary/libraries/summary_form.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,8 +20,9 @@  discard block
 block discarded – undo
20 20
 # along with this program.  If not, see <http://www.gnu.org/licenses/>
21 21
 ############################################################################
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 Summary_form {
27 28
     function __construct() {
@@ -96,8 +97,9 @@  discard block
 block discarded – undo
96 97
                     }
97 98
                 }
98 99
 	}
99
-        if(empty($new_arr))
100
-            $new_arr[]=array("Account", "453", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string");
100
+        if(empty($new_arr)) {
101
+                    $new_arr[]=array("Account", "453", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string");
102
+        }
101 103
         $fixed_arr = array(
102 104
             array("Attempted Calls", "130", "attempted_calls", "", "", ""),
103 105
             array("Completed Calls", "130", "description", "", "", ""),
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/summary/models/summary_model.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,8 +39,9 @@  discard block
 block discarded – undo
39 39
             $where['callstart <=']=date('Y-m-d') . " 23:59:59";
40 40
         }
41 41
         $this->db->where($where);
42
-        if(!empty($group_by))
43
-            $this->db->group_by($group_by);
42
+        if(!empty($group_by)) {
43
+                    $this->db->group_by($group_by);
44
+        }
44 45
         if ($flag) {
45 46
             if ($export) {
46 47
                 $result = $this->db_model->select($select . ",COUNT(*) AS attempts, AVG(billseconds) AS acd,MAX(billseconds) AS mcd,SUM(billseconds) AS duration,SUM(CASE WHEN calltype !='free' THEN billseconds ELSE 0 END) as billable,SUM(CASE WHEN billseconds > 0 THEN 1 ELSE 0 END) as completed,SUM(debit) AS debit,SUM(cost) AS cost", "reseller_cdrs", '', $order, 'asc', '', '', '');
@@ -66,8 +67,9 @@  discard block
 block discarded – undo
66 67
             $where['callstart <=']=date('Y-m-d') . " 23:59:59";
67 68
         }
68 69
         $this->db->where($where);
69
-        if(!empty($group_by))
70
-            $this->db->group_by($group_by);
70
+        if(!empty($group_by)) {
71
+                    $this->db->group_by($group_by);
72
+        }
71 73
         if ($flag) {
72 74
             if ($export) {
73 75
                 $result = $this->db_model->select($select . ",COUNT(*) AS attempts, AVG(billseconds) AS acd,MAX(billseconds) AS mcd,SUM(billseconds) AS duration,SUM(CASE WHEN calltype !='free' THEN billseconds ELSE 0 END) as billable,SUM(CASE WHEN billseconds > 0 THEN 1 ELSE 0 END) as completed,SUM(cost) AS cost", "cdrs", '', $order, 'asc', '', '', '');
@@ -96,8 +98,9 @@  discard block
 block discarded – undo
96 98
             $where['callstart <=']=date('Y-m-d') . " 23:59:59";
97 99
         }
98 100
         $this->db->where($where);
99
-        if(!empty($group_by))
100
-            $this->db->group_by($group_by);
101
+        if(!empty($group_by)) {
102
+                    $this->db->group_by($group_by);
103
+        }
101 104
         if ($flag) {
102 105
             if ($export) {
103 106
                 $result = $this->db_model->select($select . ",COUNT(*) AS attempts, AVG(billseconds) AS acd,MAX(billseconds) AS mcd,SUM(billseconds) AS duration,SUM(CASE WHEN calltype !='free' THEN billseconds ELSE 0 END) as billable,SUM(CASE WHEN billseconds > 0 THEN 1 ELSE 0 END) as completed,SUM(debit) AS debit,SUM(cost) AS cost", "cdrs", '', $order, 'asc', '', '', '');
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/dashboard/controllers/dashboard.php 1 patch
Braces   +10 added lines, -12 removed lines patch added patch discarded remove patch
@@ -37,8 +37,9 @@  discard block
 block discarded – undo
37 37
 
38 38
     function index() 
39 39
     {
40
-        if ($this->session->userdata('user_login') == FALSE) 
41
-            redirect(base_url() . 'login/login');
40
+        if ($this->session->userdata('user_login') == FALSE) {
41
+                    redirect(base_url() . 'login/login');
42
+        }
42 43
             $data['page_title'] = 'Dashboard';
43 44
         if ($this->session->userdata('logintype') == 0) 
44 45
 	{
@@ -116,7 +117,7 @@  discard block
 block discarded – undo
116 117
             $acc_arr[$data['day']]['completed']= $data['completed']+$acc_arr[$data['day']]['completed'];
117 118
             $acc_arr[$data['day']]['duration'] = $data['duration']+$acc_arr[$data['day']]['duration'];
118 119
             $acc_arr[$data['day']]['mcd'] =$data['mcd'] > $acc_arr[$data['day']]['mcd'] ? $data['mcd']: $acc_arr[$data['day']]['mcd'];
119
-	  }else{
120
+	  } else{
120 121
 	    $acc_arr[$data['day']]=$data;
121 122
 	  }
122 123
 	}
@@ -134,7 +135,7 @@  discard block
 block discarded – undo
134 135
                   $json_data['acd'][]=array((string)$acc_arr[$day]['day'],(float)$acd);
135 136
                   $json_data['mcd'][]=array((string)$acc_arr[$day]['day'],(float)$acc_arr[$day]['mcd']);
136 137
                   $json_data['asr'][]=array((string)$acc_arr[$day]['day'],(float)$asr);
137
-		}else{
138
+		} else{
138 139
 		  $json_data['total'][]=  array($date->format("d"), 0);
139 140
 		  $json_data['answered'][]=  array($date->format("d"), 0);
140 141
 		  $json_data['failed'][]=  array($date->format("d"), 0);
@@ -145,8 +146,7 @@  discard block
 block discarded – undo
145 146
 		}
146 147
 		
147 148
 	    }
148
-	}
149
-	else{
149
+	} else{
150 150
 	foreach($daterange as $date){
151 151
 		$json_data['date'][]=$date->format("d");
152 152
 		$day = (int) $date->format("d");
@@ -196,8 +196,7 @@  discard block
 block discarded – undo
196 196
 	$reseller_id=$accountinfo['type']== -1 ? 0 : $accountinfo['id'];
197 197
 	if($this->session->userdata('userlevel_logintype')!= 0 && $this->session->userdata('userlevel_logintype')!= 3){
198 198
 	  $account_arr = $this->common->get_array('id,number,first_name,last_name', 'accounts',array('reseller_id'=>$reseller_id));
199
-	} 
200
-	else{
199
+	} else{
201 200
 	 $account_arr = $this->common->get_array('id,number,first_name,last_name', 'accounts',array('id'=>$reseller_id));
202 201
 	}
203 202
     	if($result->num_rows() > 0 )
@@ -208,7 +207,7 @@  discard block
 block discarded – undo
208 207
             $json_data[$i][]= round($data['billseconds']/60,0);
209 208
             $i++;
210 209
            } 
211
-    	}else{
210
+    	} else{
212 211
 	  $json_data[] = array();
213 212
       	}
214 213
      	echo json_encode($json_data);
@@ -233,8 +232,7 @@  discard block
 block discarded – undo
233 232
 	$reseller_id=$accountinfo['type']== -1 ? 0 : $accountinfo['id'];
234 233
 	if($this->session->userdata('userlevel_logintype')!= 0 && $this->session->userdata('userlevel_logintype')!= 3){
235 234
 	  $account_arr = $this->common->get_array('id,number,first_name,last_name', 'accounts',array('reseller_id'=>$reseller_id));
236
-	} 
237
-	else{
235
+	} else{
238 236
 	 $account_arr = $this->common->get_array('id,number,first_name,last_name', 'accounts',array('id'=>$reseller_id));
239 237
 	}
240 238
 	$i=0;
@@ -248,7 +246,7 @@  discard block
 block discarded – undo
248 246
 		        $i++;
249 247
             }
250 248
     	    
251
-        }else{
249
+        } else{
252 250
     	        $json_data[] = array();
253 251
      	     }
254 252
 	echo json_encode($json_data);
Please login to merge, or discard this patch.
astpp/application/modules/dashboard/models/dashboard_model.php 1 patch
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -62,8 +62,9 @@  discard block
 block discarded – undo
62 62
         $this->db->where('callstart >=',$start_date." 00:00:00");
63 63
         $this->db->where('callstart <=',$end_date." 23:59:59");
64 64
         $this->db->where('reseller_id',$parent_id);
65
-        if($group_flag)
66
-        $this->db->group_by("DAY(callstart)");
65
+        if($group_flag) {
66
+                $this->db->group_by("DAY(callstart)");
67
+        }
67 68
         $result=$this->db->get($table);
68 69
 	return $result;
69 70
     }
@@ -73,10 +74,11 @@  discard block
 block discarded – undo
73 74
 	$end_date=$end_date." 23:59:59";
74 75
 	$accountinfo=$this->session->userdata('accountinfo');
75 76
 	$parent_id= ($accountinfo['type'] == 1) ? $accountinfo['id']:0;
76
-	if($this->session->userdata('userlevel_logintype')!= 0 && $this->session->userdata('userlevel_logintype')!= 3)
77
-	 $where ="reseller_id ='$parent_id'";
78
-	else
79
-	 $where ="accountid ='$parent_id'";
77
+	if($this->session->userdata('userlevel_logintype')!= 0 && $this->session->userdata('userlevel_logintype')!= 3) {
78
+		 $where ="reseller_id ='$parent_id'";
79
+	} else {
80
+		 $where ="accountid ='$parent_id'";
81
+	}
80 82
 	$where= $where." AND callstart >= '".$start_date."' AND  callstart <= '".$end_date."'";
81 83
 	$select_query= "(SELECT sum( billseconds ) AS billseconds,accountid FROM (cdrs) WHERE $where group by accountid order by sum(billseconds) desc limit 10)
82 84
 			union
@@ -91,10 +93,11 @@  discard block
 block discarded – undo
91 93
 	$end_date=$end_date." 23:59:59";
92 94
 	$accountinfo=$this->session->userdata('accountinfo');
93 95
 	$parent_id= ($accountinfo['type'] == 1) ? $accountinfo['id']:0;
94
-	  if($this->session->userdata('userlevel_logintype')!= 0 && $this->session->userdata('userlevel_logintype')!= 3)
95
-	  $where ="reseller_id ='$parent_id'";
96
-	else
97
-	  $where ="accountid ='$parent_id'";
96
+	  if($this->session->userdata('userlevel_logintype')!= 0 && $this->session->userdata('userlevel_logintype')!= 3) {
97
+	  	  $where ="reseller_id ='$parent_id'";
98
+	  } else {
99
+		  $where ="accountid ='$parent_id'";
100
+	}
98 101
 	  $where= $where." AND callstart >= '".$start_date."' AND  callstart <= '".$end_date."'";
99 102
 	  $select_query="(SELECT count(uniqueid) as call_count, `accountid` FROM (`cdrs`) WHERE $where GROUP BY `accountid` ORDER BY `call_count` desc LIMIT 10)
100 103
 	  UNION
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/rates/controllers/rates.php 1 patch
Braces   +21 added lines, -25 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@  discard block
 block discarded – undo
34 34
         $this->load->library('csvreader');
35 35
 	ini_set("memory_limit","2048M");
36 36
 	ini_set("max_execution_time","259200");
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 termination_rates_list() {
@@ -109,18 +110,17 @@  discard block
 block discarded – undo
109 110
 			  $data['check_header']=$check_header;
110 111
 			  $data['page_title'] = 'Termination Rates Preview';
111 112
 			  $this->session->set_userdata('import_termination_rate_csv',$actual_file_name);
112
-			}else{
113
+			} else{
113 114
 			  $data['error'] = "File Uploading Fail Please Try Again";
114 115
 			}
115 116
                     }
116
-                }
117
-                else{
117
+                } else{
118 118
                     $data['error']=="File Uploading Fail Please Try Again";
119 119
                 }
120
-            }else {
120
+            } else {
121 121
                 $data['error'] = "Invalid file format : Only CSV file allows to import records(Can't import empty file)";
122 122
             }
123
-        }else{
123
+        } else{
124 124
 		$invalid_flag=true;
125 125
         }
126 126
         if ($invalid_flag) {
@@ -163,8 +163,7 @@  discard block
 block discarded – undo
163 163
 	    if($str != ""){
164 164
 	      $invalid_array[$i]=$csv_data;
165 165
 	      $invalid_array[$i]['error'] = $str;
166
-	    }
167
-	    else{
166
+	    } else{
168 167
 	      $csv_data['trunk_id']=$trunkID;
169 168
 	      $csv_data['pattern'] = "^" . $csv_data['pattern'] . ".*";
170 169
 	      $new_final_arr[$i]=$csv_data;
@@ -252,19 +251,17 @@  discard block
 block discarded – undo
252 251
                         $data['page_title'] = "Origination Rates Preview";
253 252
                         $data['check_header']=$check_header;
254 253
                         $this->session->set_userdata('import_origination_rate_csv',$actual_file_name);
255
-                    }else{
254
+                    } else{
256 255
                         $data['error'] = "File Uploading Fail Please Try Again";
257 256
                     }
258 257
                 }
259
-             }   
260
-            else{
258
+             } else{
261 259
                     $data['error']=="File Uploading Fail Please Try Again";
262 260
                 }
263
-           }
264
-           else {
261
+           } else {
265 262
                 $data['error'] = "Invalid file format : Only CSV file allows to import records(Can't import empty file)";
266 263
             }
267
-            }else{
264
+            } else{
268 265
 		$invalid_flag=true;
269 266
             }
270 267
         if ($invalid_flag) {
@@ -308,8 +305,7 @@  discard block
 block discarded – undo
308 305
 	    if($str != ""){
309 306
 	      $invalid_array[$i]=$csv_data;
310 307
 	      $invalid_array[$i]['error'] = $str;
311
-	    }
312
-	    else{
308
+	    } else{
313 309
 	      $csv_data['pricelist_id']=$pricelistID;
314 310
 	      $csv_data['trunk_id']=$trunkid;
315 311
 	      $csv_data['pattern'] = "^" . $csv_data['pattern'] . ".*";
@@ -371,12 +367,10 @@  discard block
 block discarded – undo
371 367
 		$count = count($error_field);
372 368
 		$str.= $count > 1 ? ' are not valid' : ' is not Valid';
373 369
 		return $str;
374
-	      }
375
-	      else{
370
+	      } else{
376 371
 	      return false;
377 372
 	      }
378
-	  }
379
-	  else{
373
+	  } else{
380 374
 	  $str=rtrim($str,',');
381 375
 	    $error_field=explode(',',$str);
382 376
 	    $count = count($error_field);
@@ -617,13 +611,15 @@  discard block
 block discarded – undo
617 611
         $where = array('accountid' => $accountid);
618 612
         $instant_search=$this->session->userdata('left_panel_search_'.$accounttype.'_pattern'); 
619 613
         $like_str=!empty($instant_search) ? "(blocked_patterns like '%$instant_search%'  OR  destination like '%$instant_search%' )" :null;
620
-        if(!empty($like_str))
621
-        $this->db->where($like_str);
614
+        if(!empty($like_str)) {
615
+                $this->db->where($like_str);
616
+        }
622 617
         $count_all = $this->db_model->countQuery("*", "block_patterns", $where);
623 618
         $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']);
624 619
         $json_data = $paging_data["json_paging"];
625
-        if(!empty($like_str))
626
-        $this->db->where($like_str);
620
+        if(!empty($like_str)) {
621
+                $this->db->where($like_str);
622
+        }
627 623
         $pattern_data = $this->db_model->getSelect("*", "block_patterns", $where, "id", "ASC", $paging_data["paging"]["page_no"], $paging_data["paging"]["start"]);
628 624
         $grid_fields = json_decode($this->rates_form->build_pattern_list_for_customer($accountid,$accounttype));
629 625
         $json_data['rows'] = $this->form->build_grid($pattern_data, $grid_fields);
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/rates/libraries/rates_form.php 1 patch
Braces   +9 added lines, -6 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 rates_form {
27 28
     function __construct($library_name = '') {
@@ -62,8 +63,9 @@  discard block
 block discarded – undo
62 63
     function get_origination_rate_form_fields() {
63 64
 	 $logintype=$this->CI->session->userdata('userlevel_logintype');
64 65
         $trunk=null;
65
-        if($logintype !=1)
66
-	  $trunk = array('Force Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0"));
66
+        if($logintype !=1) {
67
+        	  $trunk = array('Force Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0"));
68
+        }
67 69
         $form['forms'] = array(base_url() . 'rates/origination_rate_save/', array('id' => 'origination_rate_form', 'method' => 'POST', 'name' => 'origination_rate_form'));
68 70
         $form['Rate Information'] = array(
69 71
             array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
@@ -165,8 +167,9 @@  discard block
 block discarded – undo
165 167
     function origination_rate_batch_update_form() {
166 168
     $logintype=$this->CI->session->userdata('userlevel_logintype');
167 169
             $trunk=null;
168
-        if($logintype !=1)
169
-	  $trunk = array('Force Trunk', array('name'=> 'trunk_id[trunk_id]','id'=>'trunk_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0"),array('name'=>'trunk_id[operator]','class'=>'update_drp'), 'update_drp_type');
170
+        if($logintype !=1) {
171
+        	  $trunk = array('Force Trunk', array('name'=> 'trunk_id[trunk_id]','id'=>'trunk_id'), 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'trunks', 'build_dropdown', 'where_arr', array("status" => "0"),array('name'=>'trunk_id[operator]','class'=>'update_drp'), 'update_drp_type');
172
+        }
170 173
         $form['forms'] = array("rates/origination_rate_batch_update/",array('id' => "origination_rate_batch_update"));        
171 174
         $form['Batch Update'] = array(
172 175
             array('Connect Cost', 'INPUT', array('name' => 'connectcost[connectcost]','id'=>'connectcost', 'value' => '', 'size' => '20',  'class' => "text field "), '', 'Tool tips info', '1', array('name'=>'connectcost[operator]','class'=>'update_drp'), '', '', '', 'update_int_type', ''),
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/rates/models/rates_model.php 1 patch
Braces   +27 added lines, -21 removed lines patch added patch discarded remove patch
@@ -50,10 +50,11 @@  discard block
 block discarded – undo
50 50
         $this->db_model->build_search('termination_rates_list_search');
51 51
         $this->db->from('outbound_routes');
52 52
         if ($flag) {
53
-            if ($export)
54
-                $this->db->limit($limit, $start);
53
+            if ($export) {
54
+                            $this->db->limit($limit, $start);
55
+            }
55 56
             $result = $this->db->get();
56
-        }else {
57
+        } else {
57 58
             $result = $this->db->count_all_results();
58 59
         }
59 60
         return $result;
@@ -71,10 +72,11 @@  discard block
 block discarded – undo
71 72
        
72 73
 	    $this->db_model->build_search('origination_rate_list_search');
73 74
         if ($flag) {
74
-            if ($export)
75
-                $this->db->limit($limit, $start);
75
+            if ($export) {
76
+                            $this->db->limit($limit, $start);
77
+            }
76 78
             $result = $this->db_model->select("*", "routes", $where, "id", "ASC", $limit, $start);
77
-        }else {
79
+        } else {
78 80
             $result = $this->db_model->countQuery("*", "routes", $where);
79 81
         }
80 82
 // 	echo "<pre>";print_r($result->result());exit;
@@ -90,10 +92,11 @@  discard block
 block discarded – undo
90 92
 
91 93
         $this->db_model->build_search('origination_rate_list_search');
92 94
         if ($flag) {
93
-            if ($export)
94
-                $this->db->limit($limit, $start);
95
+            if ($export) {
96
+                            $this->db->limit($limit, $start);
97
+            }
95 98
             $result = $this->db_model->select("*", "routes", $where, "id", "ASC", $limit, $start);
96
-        }else {
99
+        } else {
97 100
             $result = $this->db_model->countQuery("*", "routes", $where);
98 101
         }
99 102
         return $result;
@@ -273,10 +276,11 @@  discard block
 block discarded – undo
273 276
         $this->db->where("name", $field_value);
274 277
         $query = $this->db->get('trunks');
275 278
         $data = $query->result();
276
-        if ($query->num_rows > 0)
277
-            return $data[0]->id;
278
-        else
279
-            return '';
279
+        if ($query->num_rows > 0) {
280
+                    return $data[0]->id;
281
+        } else {
282
+                    return '';
283
+        }
280 284
     }
281 285
 
282 286
     function bulk_insert_termination_rate($field_value) {
@@ -300,10 +304,11 @@  discard block
 block discarded – undo
300 304
         }
301 305
         
302 306
         $updateflg = $this->db_model->build_batch_update_array($update_array);
303
-        if($updateflg)
304
-            return $this->db->update("outbound_routes");
305
-        else
306
-            return false;
307
+        if($updateflg) {
308
+                    return $this->db->update("outbound_routes");
309
+        } else {
310
+                    return false;
311
+        }
307 312
     }
308 313
     function origination_rate_batch_update($update_array){
309 314
         $this->db_model->build_search('origination_rate_list_search');
@@ -312,10 +317,11 @@  discard block
 block discarded – undo
312 317
             $this->db->where("reseller_id",$account_data['id']);
313 318
         }
314 319
         $updateflg = $this->db_model->build_batch_update_array($update_array);
315
-        if($updateflg)
316
-            return $this->db->update("routes");
317
-        else
318
-            return false;
320
+        if($updateflg) {
321
+                    return $this->db->update("routes");
322
+        } else {
323
+                    return false;
324
+        }
319 325
     }
320 326
     function getreseller_rates_list($flag, $start = 0, $limit = 0,$export=false) {
321 327
         $this->db_model->build_search('resellerrates_list_search');
Please login to merge, or discard this patch.
web_interface/astpp/application/modules/pricing/controllers/pricing.php 1 patch
Braces   +7 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('astpp/form');
33 33
         $this->load->model('pricing_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 price_add($type = "") {
@@ -84,15 +85,16 @@  discard block
 block discarded – undo
84 85
                 exit;
85 86
             }
86 87
             $this->load->view('view_price_add_edit', $data);
87
-       }else {
88
+       } else {
88 89
             $data['page_title'] = 'Create Price Details';
89 90
             if ($this->form_validation->run() == FALSE) {
90 91
                 $data['validation_errors'] = validation_errors();
91 92
                 echo $data['validation_errors'];
92 93
                 exit;
93 94
             } else {
94
-		if(isset($add_array['trunk_id']) && !empty($add_array['trunk_id']))
95
-                $trunk_id=$add_array['trunk_id'];
95
+		if(isset($add_array['trunk_id']) && !empty($add_array['trunk_id'])) {
96
+		                $trunk_id=$add_array['trunk_id'];
97
+		}
96 98
                 unset($add_array['trunk_id']);
97 99
                 $priceid=$this->pricing_model->add_price($add_array);
98 100
 		if(isset($trunk_id) && $trunk_id != ''){
Please login to merge, or discard this patch.