@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | ? unserialize(CUSTOMEREDIT_ARRAY) :($uri_arr[0]=="accounts"&& $entity_name =='provider' |
77 | 77 | ? unserialize(PROVIDEREDIT_ARRAY) :($uri_arr[0]=="accounts"&& $entity_name =='reseller' |
78 | 78 | ? unserialize(RESELLEREDIT_ARRAY) : ($uri_arr[0] =="package" ? unserialize(PACKAGEEDIT_ARRAY):false) )))); |
79 | - }else{ |
|
79 | + } else{ |
|
80 | 80 | $menu_info=null; |
81 | 81 | $current_menu_url=$uri_arr[0]."/".$uri_arr[1]."/"; |
82 | 82 | $new_menu_info=array(); |
@@ -113,23 +113,23 @@ discard block |
||
113 | 113 | if($acc_info['type'] == '3' || $acc_info['type'] == '0'){ |
114 | 114 | if($value == "user/user_ipmap/" && $acc_info['allow_ip_management'] == '1'){ |
115 | 115 | $value_flag=false; |
116 | - }elseif(in_array('user/user_sipdevices/',$menu_info) && $value == "user/user_sipdevices/" && common_model::$global_config['system_config']['opensips']== 0){ |
|
116 | + } elseif(in_array('user/user_sipdevices/',$menu_info) && $value == "user/user_sipdevices/" && common_model::$global_config['system_config']['opensips']== 0){ |
|
117 | 117 | $value_flag=false; |
118 | - }else{ |
|
118 | + } else{ |
|
119 | 119 | $value_flag=true; |
120 | 120 | } |
121 | - }else{ |
|
121 | + } else{ |
|
122 | 122 | if(common_model::$global_config['system_config']['opensips'] == 1 ){ |
123 | 123 | if($value != "accounts/".$entity_name."_opensips/"){ |
124 | 124 | $value_flag=true; |
125 | - }else{ |
|
125 | + } else{ |
|
126 | 126 | $value_flag=false; |
127 | 127 | } |
128 | 128 | } |
129 | 129 | if(common_model::$global_config['system_config']['opensips']== 0 ){ |
130 | 130 | if($value != "accounts/".$entity_name."_sipdevices/"){ |
131 | 131 | $value_flag=true; |
132 | - }else{ |
|
132 | + } else{ |
|
133 | 133 | $value_flag=false; |
134 | 134 | } |
135 | 135 | } |
@@ -137,8 +137,9 @@ discard block |
||
137 | 137 | |
138 | 138 | if($value_flag){ |
139 | 139 | $class = ($value == $uri_arr[0]."/".$uri_arr[1]."/" ) ? 'active' : ''; |
140 | - if($i==0) |
|
141 | - $class=($uri_arr[1]== $entity_name."_save") ? 'active': $class; |
|
140 | + if($i==0) { |
|
141 | + $class=($uri_arr[1]== $entity_name."_save") ? 'active': $class; |
|
142 | + } |
|
142 | 143 | |
143 | 144 | echo "<li class='$class'><a href ='$url'>$key</a></li>"; |
144 | 145 | } |
@@ -1,4 +1,6 @@ discard block |
||
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 | |
@@ -309,10 +311,11 @@ discard block |
||
309 | 311 | if ( ! function_exists('form_table_row_4')) |
310 | 312 | { |
311 | 313 | function form_table_row_4($label, $field, $span, $wh = '10', $wd = '') { |
312 | - if (wd == '') |
|
313 | - echo '<th width="'.$wh.'%"><label>'.$label.'</label></th><td>'; |
|
314 | - else |
|
315 | - 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 | + } |
|
316 | 319 | echo $field; |
317 | 320 | echo '<br/><span class="helptext">'.$span.'</span>'; |
318 | 321 | echo '</td></tr>'; |
@@ -34,8 +34,9 @@ discard block |
||
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 |
||
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); |
@@ -22,8 +22,9 @@ discard block |
||
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 |
||
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")); |
@@ -39,8 +39,9 @@ discard block |
||
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 |
||
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 |
||
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', '', '', ''); |
@@ -38,8 +38,9 @@ discard block |
||
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'; |
@@ -202,7 +203,7 @@ discard block |
||
202 | 203 | $new_arr[] = $row1['notes']; |
203 | 204 | } elseif ($search_arr['groupby_3'] == 'trunk_id') { |
204 | 205 | $new_arr[] = $this->common->get_field_name('name', 'trunks', $row1['trunk_id']); |
205 | - } elseif ($search_arr['groupby_3'] == 'package_id') { |
|
206 | + } elseif ($search_arr['groupby_3'] == 'package_id') { |
|
206 | 207 | $new_arr[] = $this->common->get_field_name('package_name', 'packages', $row1['package_id']); |
207 | 208 | } |
208 | 209 | if (empty($new_arr)) { |
@@ -20,8 +20,9 @@ discard block |
||
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 |
||
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", "", "", ""), |
@@ -64,7 +64,7 @@ |
||
64 | 64 | *******/ |
65 | 65 | if( $accountinfo['type'] == '0'){ |
66 | 66 | $where=array('accountid'=>$accountinfo['id']); |
67 | - }else{ |
|
67 | + } else{ |
|
68 | 68 | $where=''; |
69 | 69 | } |
70 | 70 | /**************************************************************************************************************/ |
@@ -31,8 +31,9 @@ discard block |
||
31 | 31 | $this->load->library("ipmap_form"); |
32 | 32 | $this->load->library('astpp/form'); |
33 | 33 | $this->load->model('ipmap_model'); |
34 | - if ($this->session->userdata('user_login') == FALSE) |
|
35 | - redirect(base_url() . '/astpp/login'); |
|
34 | + if ($this->session->userdata('user_login') == FALSE) { |
|
35 | + redirect(base_url() . '/astpp/login'); |
|
36 | + } |
|
36 | 37 | } |
37 | 38 | function ipmap_add() { |
38 | 39 | $data['username'] = $this->session->userdata('user_name'); |
@@ -66,8 +67,7 @@ discard block |
||
66 | 67 | $ip = $add_array['ip']; |
67 | 68 | if (strpos($ip,'/') !== false) { |
68 | 69 | $add_array['ip']=$add_array['ip']; |
69 | - } |
|
70 | - else{ |
|
70 | + } else{ |
|
71 | 71 | $add_array['ip']=$add_array['ip'].'/32'; |
72 | 72 | } |
73 | 73 | $data['form'] = $this->form->build_form($this->ipmap_form->get_ipmap_form_fields(), $add_array); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $accountdata=$this->session->userdata['accountinfo']; |
127 | 127 | if($accountdata['type'] == '0'){ |
128 | 128 | redirect(base_url() . 'user/user_ipmap_detail/'); |
129 | - }else{ |
|
129 | + } else{ |
|
130 | 130 | redirect(base_url() . 'ipmap/ipmap_detail/'); |
131 | 131 | } |
132 | 132 | /*********************************************************************/ |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $ret_url, |
191 | 191 | |
192 | 192 | )); |
193 | - }else{ |
|
193 | + } else{ |
|
194 | 194 | $ret_url = '<a href="'. base_url() .'ipmap/ipmap_edit/'.$value['id'].'" class="btn btn-royelblue btn-sm" rel="facebox" title="Edit"> <i class="fa fa-pencil-square-o fa-fw"></i></a> <a href="'. base_url() .'ipmap/ipmap_delete/' . $value['id'].'" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();"> <i class="fa fa-trash fa-fw"></i></a>'; |
195 | 195 | $account_name =$this->common->build_concat_string("first_name,last_name,number", "accounts",$value['accountid']); |
196 | 196 | $json_data['rows'][] = array('cell' => array( |