@@ -50,11 +50,12 @@ discard block |
||
50 | 50 | $this->db->select('pricelist_id'); |
51 | 51 | $account_info=(array)$this->db->get('accounts')->first_row(); |
52 | 52 | $where=array('pricelist_id'=>$account_info['pricelist_id']); |
53 | - if(!empty($like_str)) |
|
54 | - $this->db->where($like_str); |
|
53 | + if(!empty($like_str)) { |
|
54 | + $this->db->where($like_str); |
|
55 | + } |
|
55 | 56 | if ($flag) { |
56 | 57 | $query = $this->db_model->select("*", "packages", $where, "id", "ASC", $limit, $start); |
57 | - }else { |
|
58 | + } else { |
|
58 | 59 | $query = $this->db_model->countQuery("*", "packages", $where); |
59 | 60 | } |
60 | 61 | return $query; |
@@ -120,8 +121,7 @@ discard block |
||
120 | 121 | $this->db->where_in('accountid',$acc_arr); |
121 | 122 | if($flag){ |
122 | 123 | $this->db->select('*'); |
123 | - } |
|
124 | - else{ |
|
124 | + } else{ |
|
125 | 125 | $this->db->select('count(id) as count'); |
126 | 126 | } |
127 | 127 | if($flag){ |
@@ -129,27 +129,26 @@ discard block |
||
129 | 129 | } |
130 | 130 | if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
131 | 131 | $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
132 | - }else{ |
|
132 | + } else{ |
|
133 | 133 | $this->db->order_by('seconds','desc'); |
134 | 134 | } |
135 | 135 | $result=$this->db->get('counters'); |
136 | 136 | // echo $this->db->last_query();exit; |
137 | 137 | if($flag){ |
138 | 138 | return $result; |
139 | - }else{ |
|
139 | + } else{ |
|
140 | 140 | $result=$result->result_array(); |
141 | 141 | return $result[0]['count']; |
142 | 142 | } |
143 | - }else{ |
|
143 | + } else{ |
|
144 | 144 | if($flag){ |
145 | 145 | $query=(object)array('num_rows'=>0); |
146 | - } |
|
147 | - else{ |
|
146 | + } else{ |
|
148 | 147 | $query=0; |
149 | 148 | } |
150 | 149 | return $query; |
151 | 150 | } |
152 | - }else{ |
|
151 | + } else{ |
|
153 | 152 | |
154 | 153 | if($result->num_rows() >0){ |
155 | 154 | $acc_arr=array(); |
@@ -162,8 +161,7 @@ discard block |
||
162 | 161 | |
163 | 162 | if($flag){ |
164 | 163 | $this->db->select('*'); |
165 | - } |
|
166 | - else{ |
|
164 | + } else{ |
|
167 | 165 | $this->db->select('count(id) as count'); |
168 | 166 | } |
169 | 167 | if($flag){ |
@@ -176,17 +174,16 @@ discard block |
||
176 | 174 | if($flag){ |
177 | 175 | |
178 | 176 | return $result; |
179 | - }else{ |
|
177 | + } else{ |
|
180 | 178 | $result=$result->result_array(); |
181 | 179 | |
182 | 180 | return $result[0]['count']; |
183 | 181 | } |
184 | - }else{ |
|
182 | + } else{ |
|
185 | 183 | if($flag){ |
186 | 184 | |
187 | 185 | $query=(object)array('num_rows'=>0); |
188 | - } |
|
189 | - else{ |
|
186 | + } else{ |
|
190 | 187 | $query=0; |
191 | 188 | } |
192 | 189 | // echo $this->db->last_query();exit; |
@@ -32,8 +32,9 @@ discard block |
||
32 | 32 | $this->load->library("refill_coupon_form"); |
33 | 33 | $this->load->library("astpp/form"); |
34 | 34 | $this->load->library("session"); |
35 | - if ($this->session->userdata('user_login') == FALSE) |
|
36 | - redirect(base_url() . 'login/login'); |
|
35 | + if ($this->session->userdata('user_login') == FALSE) { |
|
36 | + redirect(base_url() . 'login/login'); |
|
37 | + } |
|
37 | 38 | } |
38 | 39 | function refill_coupon_list(){ |
39 | 40 | if($this->session->userdata('logintype') == 0 || $this->session->userdata('logintype') == 3){ |
@@ -120,8 +121,7 @@ discard block |
||
120 | 121 | $data['validation_errors'] = validation_errors(); |
121 | 122 | echo $data['validation_errors']; |
122 | 123 | exit; |
123 | - } |
|
124 | - else { |
|
124 | + } else { |
|
125 | 125 | if($account_length<=strlen($add_array['prefix'])){ |
126 | 126 | echo json_encode(array("count_error"=>"You Can Not Create ".$add_array['count']." Accounts with ".$add_array['prefix']." prefix.")); |
127 | 127 | exit; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | if($currentlength > 0 && $add_array['count'] > $currentlength){ |
134 | 134 | echo json_encode(array("count_error"=>"You Can Create Maximum ".$currentlength." accounts with ".$add_array['prefix']." prefix")); |
135 | 135 | exit; |
136 | - }else{ |
|
136 | + } else{ |
|
137 | 137 | $this->refill_coupon_model->add_refill_coupon($add_array); |
138 | 138 | echo json_encode(array("SUCCESS"=> "Refill coupon created successfully!")); |
139 | 139 | exit; |
@@ -20,8 +20,9 @@ |
||
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')) |
|
23 | +if (!defined('BASEPATH')) { |
|
24 | 24 | exit('No direct script access allowed'); |
25 | +} |
|
25 | 26 | |
26 | 27 | class Refill_coupon_form { |
27 | 28 | function __construct($library_name = '') { |
@@ -34,7 +34,7 @@ |
||
34 | 34 | <th>Expiry Date</th><td><?=$refill_coupon_details['expiry_date']?></td> |
35 | 35 | <th>Callingcard</th><td><?=$refill_coupon_details['callingcard']?></td> |
36 | 36 | </tr> |
37 | - <th>Status</th><td><?php if($refill_coupon_details['status'] == 0){ echo "Inactive";} elseif($refill_coupon_details['status'] == 1){ echo "Active"; } elseif($refill_coupon_details['status'] == 2){ echo "Inuse"; }else{ echo "Expired";}?></td> |
|
37 | + <th>Status</th><td><?php if($refill_coupon_details['status'] == 0){ echo "Inactive";} elseif($refill_coupon_details['status'] == 1){ echo "Active"; } elseif($refill_coupon_details['status'] == 2){ echo "Inuse"; } else{ echo "Expired";}?></td> |
|
38 | 38 | </tr> |
39 | 39 | </table> |
40 | 40 |
@@ -33,10 +33,11 @@ discard block |
||
33 | 33 | $reseller_id=$accountinfo['type']==1 ? $accountinfo['id'] : 0; |
34 | 34 | $where=array('reseller_id'=>$reseller_id); |
35 | 35 | if ($flag) { |
36 | - if($export) |
|
37 | - $query = $this->db_model->select("*", "refill_coupon",$where, "id", "ASC",'',''); |
|
38 | - else |
|
39 | - $query = $this->db_model->select("*", "refill_coupon",$where, "id", "ASC", $limit, $start); |
|
36 | + if($export) { |
|
37 | + $query = $this->db_model->select("*", "refill_coupon",$where, "id", "ASC",'',''); |
|
38 | + } else { |
|
39 | + $query = $this->db_model->select("*", "refill_coupon",$where, "id", "ASC", $limit, $start); |
|
40 | + } |
|
40 | 41 | } else { |
41 | 42 | $query = $this->db_model->countQuery("*", "refill_coupon",$where); |
42 | 43 | } |
@@ -67,8 +68,7 @@ discard block |
||
67 | 68 | $length=strlen($prefix); |
68 | 69 | if($length !=0){ |
69 | 70 | $number_length=$account_length-$length; |
70 | - } |
|
71 | - else{ |
|
71 | + } else{ |
|
72 | 72 | $number_length=$account_length; |
73 | 73 | } |
74 | 74 | $add_array['amount'] = $this->common_model->add_calculate_currency($add_array['amount'], '', '', false, false); |
@@ -35,8 +35,9 @@ discard block |
||
35 | 35 | $this->load->library('freeswitch_lib'); |
36 | 36 | $this->load->model('freeswitch_model'); |
37 | 37 | |
38 | - if ($this->session->userdata('user_login') == FALSE) |
|
39 | - redirect(base_url() . '/astpp/login'); |
|
38 | + if ($this->session->userdata('user_login') == FALSE) { |
|
39 | + redirect(base_url() . '/astpp/login'); |
|
40 | + } |
|
40 | 41 | } |
41 | 42 | |
42 | 43 | function fssipdevices_add($type = "") { |
@@ -61,7 +62,7 @@ discard block |
||
61 | 62 | if($account_data['type'] == '-1' || $account_data['type'] == '1') |
62 | 63 | { |
63 | 64 | $this->load->view('view_freeswitch_add_edit', $data); |
64 | - }else{ |
|
65 | + } else{ |
|
65 | 66 | $this->load->view('view_freeswitch_customer_add_edit', $data); |
66 | 67 | } |
67 | 68 | } |
@@ -75,7 +76,7 @@ discard block |
||
75 | 76 | { |
76 | 77 | $data['form'] = $this->form->build_form($this->freeswitch_form->get_freeswith_form_fields($edit_id), $account); |
77 | 78 | $this->load->view('view_freeswitch_add_edit', $data); |
78 | - }else{ |
|
79 | + } else{ |
|
79 | 80 | $data['form'] = $this->form->build_form($this->freeswitch_form->get_freeswith_form_fields($edit_id), $account); |
80 | 81 | $this->load->view('view_freeswitch_customer_add_edit', $data); |
81 | 82 | } |
@@ -91,7 +92,7 @@ discard block |
||
91 | 92 | { |
92 | 93 | $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($accountid,$edit_id), $account); |
93 | 94 | $this->load->view('view_freeswitch_add_edit', $data); |
94 | - }else{ |
|
95 | + } else{ |
|
95 | 96 | |
96 | 97 | $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($accountid,$edit_id), $account); |
97 | 98 | $this->load->view('view_freeswitch_customer_add_edit', $data); |
@@ -214,7 +215,7 @@ discard block |
||
214 | 215 | echo json_encode(array("SUCCESS"=> "SIP Device Updated Successfully!")); |
215 | 216 | exit; |
216 | 217 | } |
217 | - }else{ |
|
218 | + } else{ |
|
218 | 219 | $data['page_title'] = 'Create Freeswitch SIP Devices'; |
219 | 220 | if ($this->form_validation->run() == FALSE) { |
220 | 221 | $data['validation_errors'] = validation_errors(); |
@@ -269,7 +270,7 @@ discard block |
||
269 | 270 | $path_false = base_url().'/assets/images/false.png'; |
270 | 271 | if($value['voicemail_enabled'] == 'true'){ |
271 | 272 | $voicemail_enabled ='<img src='.$path_true.' style="height:20px;width:20px;" title="Enable">'; |
272 | - }else{ |
|
273 | + } else{ |
|
273 | 274 | $voicemail_enabled ='<img src='.$path_false.' style="height:20px;width:20px;" title="Disable">'; |
274 | 275 | } |
275 | 276 | $json_data['rows'][] = array('cell' => array( |
@@ -489,7 +490,7 @@ discard block |
||
489 | 490 | $gateway_data["status"] = isset($query_value["status"])?$query_value["status"]:""; |
490 | 491 | if ($gateway_key != "gateway_data") { |
491 | 492 | $gateway_data[$gateway_key] = $gatewau_val; |
492 | - }else if($gateway_key == "status") { |
|
493 | + } else if($gateway_key == "status") { |
|
493 | 494 | $gateway_data[$gateway_key] = $gatewau_val; |
494 | 495 | } |
495 | 496 | /** |
@@ -512,7 +513,7 @@ discard block |
||
512 | 513 | **/ |
513 | 514 | if(!empty($gateway_data['dialplan_variable']) && $gateway_data['dialplan_variable'] != ''){ |
514 | 515 | $gateway_result['dialplan_variable'] = $gateway_data['dialplan_variable']; |
515 | - }else{ |
|
516 | + } else{ |
|
516 | 517 | $gateway_result['dialplan_variable'] = ''; |
517 | 518 | } |
518 | 519 | /**********************************************************************************************/ |
@@ -545,7 +546,7 @@ discard block |
||
545 | 546 | /*********************************************************************/ |
546 | 547 | else if($key == "status") { |
547 | 548 | $insert_arr[$key] = $gateway_data["status"]; |
548 | - } else { |
|
549 | + } else { |
|
549 | 550 | if ($key != "id") { |
550 | 551 | $gateway_arr[$key] = $gateway_value; |
551 | 552 | } |
@@ -707,16 +708,13 @@ discard block |
||
707 | 708 | if($button_name == "start") |
708 | 709 | { |
709 | 710 | $cmd = "api sofia profile " . trim($query[0]['name']) ." start"; |
710 | - } |
|
711 | - elseif($button_name == "stop") |
|
711 | + } elseif($button_name == "stop") |
|
712 | 712 | { |
713 | 713 | $cmd= "api sofia profile stop"; |
714 | - } |
|
715 | - elseif($button_name == "reload") |
|
714 | + } elseif($button_name == "reload") |
|
716 | 715 | { |
717 | 716 | $cmd = "api reloadxml"; |
718 | - } |
|
719 | - elseif($button_name == "rescan") |
|
717 | + } elseif($button_name == "rescan") |
|
720 | 718 | { |
721 | 719 | $cmd = "api sofia profile " . trim($query[0]['name']) . " rescan"; |
722 | 720 | } |
@@ -769,8 +767,7 @@ discard block |
||
769 | 767 | /**====================================================================*/ |
770 | 768 | $insert = $this->db->insert("sip_profiles", $sipprofile_data); |
771 | 769 | |
772 | - } |
|
773 | - else { |
|
770 | + } else { |
|
774 | 771 | $this->session->set_flashdata('astpp_notification', 'Duplicate SIP IP OR Port found it must be unique!'); |
775 | 772 | redirect(base_url() . 'freeswitch/fssipprofile_add/'); |
776 | 773 | } |
@@ -850,7 +847,7 @@ discard block |
||
850 | 847 | $update = $this->db->update("sip_profiles", $insert_arr, array('id' => $edit_id)); |
851 | 848 | if($sipprofile_data['type_settings']=="add_setting"){ |
852 | 849 | $this->session->set_flashdata('astpp_errormsg',$data['sip_name']. " SIP Setting Added Successfully!"); |
853 | - }else{ |
|
850 | + } else{ |
|
854 | 851 | $this->session->set_flashdata('astpp_errormsg',$data['sip_name']. " SIP Setting Updated Successfully!"); |
855 | 852 | |
856 | 853 | } |
@@ -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 Freeswitch_form { |
29 | 30 | |
@@ -35,8 +36,7 @@ discard block |
||
35 | 36 | $log_type = $this->CI->session->userdata("logintype"); |
36 | 37 | if($log_type == 0 || $log_type == 3 || $log_type == 1){ |
37 | 38 | $sip_pro=null; |
38 | - } |
|
39 | - else{ |
|
39 | + } else{ |
|
40 | 40 | $sip_pro=array('SIP Profile', 'sip_profile_id', 'SELECT', '', 'trim|dropdown|xss_clean', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'sip_profiles', 'build_dropdown', '', ''); |
41 | 41 | |
42 | 42 | } |
@@ -512,13 +512,13 @@ discard block |
||
512 | 512 | } else { |
513 | 513 | if($accountid){ |
514 | 514 | $account_Arr=null; |
515 | - }else{ |
|
515 | + } else{ |
|
516 | 516 | $account_Arr=array('Account', 'accountcode', 'SELECT', '','trim|dropdown|xss_clean', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0","type"=>"0", "deleted" => "0")); |
517 | 517 | } |
518 | 518 | if ($this->CI->session->userdata("logintype") == '1') { |
519 | 519 | $sip_pro =null; |
520 | 520 | $link = base_url() . 'freeswitch/customer_fssipdevices_save/true'; |
521 | - }else{ |
|
521 | + } else{ |
|
522 | 522 | $sip_pro =array('SIP Profile', 'sip_profile_id', 'SELECT', '','trim|dropdown|xss_clean', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'sip_profiles', 'build_dropdown', '', ''); |
523 | 523 | $link = base_url() . 'freeswitch/fssipdevices_save/true'; |
524 | 524 | } |
@@ -97,7 +97,10 @@ discard block |
||
97 | 97 | <div class="row"> |
98 | 98 | <div class="col-md-12 spacer" style='margin-top:15px;' align=center > |
99 | 99 | <div style="color:red;margin-left: 60px;"> |
100 | - <?php if (isset($validation_errors)) echo $validation_errors; ?> |
|
100 | + <?php if (isset($validation_errors)) { |
|
101 | + echo $validation_errors; |
|
102 | +} |
|
103 | +?> |
|
101 | 104 | </div> |
102 | 105 | <form method="post" action="<?= base_url() ?>freeswitch/fssipprofile_add/edit/" enctype="multipart/form-data" name='form1' id ="myForm1"> |
103 | 106 | <input type='hidden' name='id' value="<?=$id?>" /> |
@@ -116,7 +119,8 @@ discard block |
||
116 | 119 | <div style="width:550px;"><label style="text-align:right;" class="col-md-3">Status </label> |
117 | 120 | <select name="sipstatus" class="col-md-5 form-control selectpicker" data-live-search='true'> |
118 | 121 | |
119 | - <option value="0" <?if($status==0)echo 'selected=selected;'?>>Active</option> |
|
122 | + <option value="0" <?if($status==0) { |
|
123 | + echo 'selected=selected;'?>>Active</option> |
|
120 | 124 | <option value="1" <?if($status==1)echo 'selected=selected;'?>>Inactive</option> |
121 | 125 | </select> |
122 | 126 | </div> |
@@ -143,7 +147,9 @@ discard block |
||
143 | 147 | <div class="container"> |
144 | 148 | <div class="row"> |
145 | 149 | <div class="portlet-content" id="search_bar" style="cursor:pointer; display:none"> |
146 | - <?php echo $form_search; ?> |
|
150 | + <?php echo $form_search; |
|
151 | +} |
|
152 | +?> |
|
147 | 153 | </div> |
148 | 154 | </div> |
149 | 155 | </div> |
@@ -158,7 +164,10 @@ discard block |
||
158 | 164 | |
159 | 165 | |
160 | 166 | <div style="color:red;margin-left: 60px;"> |
161 | - <?php if (isset($validation_errors)) echo $validation_errors; ?> |
|
167 | + <?php if (isset($validation_errors)) { |
|
168 | + echo $validation_errors; |
|
169 | +} |
|
170 | +?> |
|
162 | 171 | </div> |
163 | 172 | <form method="post" name="form2" id="form2" action="<?= base_url() ?>freeswitch/fssipprofile_edit" enctype="multipart/form-data"> |
164 | 173 | <input type='hidden' name='id' value=<?=$id?> /> |
@@ -186,7 +195,7 @@ discard block |
||
186 | 195 | if($params_name!='') |
187 | 196 | { |
188 | 197 | $type="edit_setting"; |
189 | - }else{ |
|
198 | + } else{ |
|
190 | 199 | $type="add_setting"; |
191 | 200 | } |
192 | 201 | ?> |
@@ -40,7 +40,10 @@ |
||
40 | 40 | <select class="form-control" name="host_id" id="host_id"> |
41 | 41 | <?php |
42 | 42 | foreach($fs_data as $name) { ?> |
43 | - <option value="<?= $name['id'] ?>"<?php if(isset($host_id) && ($name['id'] == $host_id))echo 'selected';?>><?= $name['freeswitch_host'] ?></option> |
|
43 | + <option value="<?= $name['id'] ?>"<?php if(isset($host_id) && ($name['id'] == $host_id)) { |
|
44 | + echo 'selected'; |
|
45 | +} |
|
46 | +?>><?= $name['freeswitch_host'] ?></option> |
|
44 | 47 | <?php |
45 | 48 | } ?> |
46 | 49 | </select> |