@@ -20,8 +20,9 @@ discard block |
||
| 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 Reports_form {
|
| 27 | 28 | function __construct() {
|
@@ -56,8 +57,7 @@ discard block |
||
| 56 | 57 | array('Call Type', 'calltype', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_calltype'),
|
| 57 | 58 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
|
| 58 | 59 | array('', 'HIDDEN', 'advance_search', '1', '', '', ''));
|
| 59 | - } |
|
| 60 | - else |
|
| 60 | + } else |
|
| 61 | 61 | {
|
| 62 | 62 | $form['forms'] = array("", array('id' => "cdr_customer_search"));
|
| 63 | 63 | $form['Search'] = array( |
@@ -190,8 +190,7 @@ discard block |
||
| 190 | 190 | $recording, |
| 191 | 191 | )); |
| 192 | 192 | |
| 193 | - } |
|
| 194 | - else{
|
|
| 193 | + } else{
|
|
| 195 | 194 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
|
| 196 | 195 | $currency_id=$account_info['currency_id']; |
| 197 | 196 | $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
|
@@ -348,7 +347,7 @@ discard block |
||
| 348 | 347 | $account_data = $this->CI->session->userdata("accountinfo");
|
| 349 | 348 | $loginid = $account_data['id']; |
| 350 | 349 | |
| 351 | - }else{
|
|
| 350 | + } else{
|
|
| 352 | 351 | $loginid = "0"; |
| 353 | 352 | } |
| 354 | 353 | if($logintype==0 || $logintype==3){
|
@@ -535,7 +534,7 @@ discard block |
||
| 535 | 534 | array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"),
|
| 536 | 535 | array(gettext("Description"), "300", "description", "", "", "","","true","center"),
|
| 537 | 536 | )); |
| 538 | - }else{
|
|
| 537 | + } else{
|
|
| 539 | 538 | $grid_field_arr = json_encode(array( |
| 540 | 539 | array("Created Date", "120", "created_date", "", "", "","","true","center"),
|
| 541 | 540 | array("Invoice Number", "120", "created_date", "", "", "","","true","center"),
|
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $this->opensips_db->limit($limit,$start); |
| 39 | 39 | if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
| 40 | 40 | $this->opensips_db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
| 41 | - }else{ |
|
| 41 | + } else{ |
|
| 42 | 42 | $this->opensips_db->order_by('username','asc'); |
| 43 | 43 | } |
| 44 | 44 | $query = $this->opensips_db->get("subscriber"); |
@@ -62,8 +62,9 @@ discard block |
||
| 62 | 62 | OR effective_caller_id_number like '%$instant_search%' |
| 63 | 63 | )" |
| 64 | 64 | :null; |
| 65 | - if(!empty($like_str)) |
|
| 66 | - $this->opensips_db->where($like_str); |
|
| 65 | + if(!empty($like_str)) { |
|
| 66 | + $this->opensips_db->where($like_str); |
|
| 67 | + } |
|
| 67 | 68 | $this->opensips_db->where($where); |
| 68 | 69 | if ($flag) { |
| 69 | 70 | $this->opensips_db->limit($limit,$start); |
@@ -72,15 +73,13 @@ discard block |
||
| 72 | 73 | if($result->num_rows() > 0){ |
| 73 | 74 | if($flag){ |
| 74 | 75 | return $result; |
| 75 | - } |
|
| 76 | - else{ |
|
| 76 | + } else{ |
|
| 77 | 77 | return $result->num_rows(); |
| 78 | 78 | } |
| 79 | - }else{ |
|
| 79 | + } else{ |
|
| 80 | 80 | if($flag){ |
| 81 | 81 | $result=(object)array('num_rows'=>0); |
| 82 | - } |
|
| 83 | - else{ |
|
| 82 | + } else{ |
|
| 84 | 83 | $result=0; |
| 85 | 84 | } |
| 86 | 85 | return $result; |
@@ -93,7 +92,7 @@ discard block |
||
| 93 | 92 | $this->opensips_db->limit( $limit,$start); |
| 94 | 93 | if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
| 95 | 94 | $this->opensips_db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
| 96 | - }else{ |
|
| 95 | + } else{ |
|
| 97 | 96 | $this->opensips_db->order_by('setid','asc'); |
| 98 | 97 | } |
| 99 | 98 | $query = $this->opensips_db->get("dispatcher"); |
@@ -33,8 +33,9 @@ discard block |
||
| 33 | 33 | $db_config = Common_model::$global_config['system_config']; |
| 34 | 34 | $opensipdsn = "mysql://" . $db_config['opensips_dbuser'] . ":" . $db_config['opensips_dbpass'] . "@" . $db_config['opensips_dbhost'] . "/" . $db_config['opensips_dbname'] . "?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir="; |
| 35 | 35 | $this->opensips_db = $this->load->database($opensipdsn, true); |
| 36 | - if ($this->session->userdata('user_login') == FALSE) |
|
| 37 | - redirect(base_url() . '/astpp/login'); |
|
| 36 | + if ($this->session->userdata('user_login') == FALSE) { |
|
| 37 | + redirect(base_url() . '/astpp/login'); |
|
| 38 | + } |
|
| 38 | 39 | } |
| 39 | 40 | |
| 40 | 41 | function opensips_add() { |
@@ -92,7 +93,7 @@ discard block |
||
| 92 | 93 | $this->opensips_model->edit_opensipsdevices($add_array, $add_array['id']); |
| 93 | 94 | echo json_encode(array("SUCCESS"=> " OpenSips updated successfully!")); |
| 94 | 95 | exit; |
| 95 | - }else{ |
|
| 96 | + } else{ |
|
| 96 | 97 | echo json_encode($auth_flag); |
| 97 | 98 | exit; |
| 98 | 99 | } |
@@ -109,7 +110,7 @@ discard block |
||
| 109 | 110 | $this->opensips_model->add_opensipsdevices($add_array); |
| 110 | 111 | echo json_encode(array("SUCCESS"=> "OpenSips added successfully!")); |
| 111 | 112 | exit; |
| 112 | - }else{ |
|
| 113 | + } else{ |
|
| 113 | 114 | echo json_encode($auth_flag); |
| 114 | 115 | exit; |
| 115 | 116 | } |
@@ -131,10 +132,10 @@ discard block |
||
| 131 | 132 | $auth_flag = $auth_flag->num_rows(); |
| 132 | 133 | if($auth_flag == 0){ |
| 133 | 134 | return "TRUE"; |
| 134 | - }else{ |
|
| 135 | + } else{ |
|
| 135 | 136 | return array("username_error"=>"Duplicate Email Address Found Email Must Be Unique."); |
| 136 | 137 | } |
| 137 | - }else{ |
|
| 138 | + } else{ |
|
| 138 | 139 | return array("username_error"=>"User name is required field."); |
| 139 | 140 | } |
| 140 | 141 | return "0"; |
@@ -155,13 +156,13 @@ discard block |
||
| 155 | 156 | echo json_encode(array("SUCCESS"=> "Opensips Updated Successfully!")); |
| 156 | 157 | exit; |
| 157 | 158 | } |
| 158 | - }else{ |
|
| 159 | + } else{ |
|
| 159 | 160 | $data['page_title'] = 'Add Opensips'; |
| 160 | 161 | if ($this->form_validation->run() == FALSE) { |
| 161 | 162 | $data['validation_errors'] = validation_errors(); |
| 162 | 163 | echo $data['validation_errors']; |
| 163 | 164 | exit; |
| 164 | - }else{ |
|
| 165 | + } else{ |
|
| 165 | 166 | $this->opensips_model->add_opensipsdevices($array_add); |
| 166 | 167 | echo json_encode(array("SUCCESS"=> "Opensips Added Successfully!")); |
| 167 | 168 | exit; |
@@ -184,13 +185,13 @@ discard block |
||
| 184 | 185 | echo json_encode(array("SUCCESS"=> "OpenSips Updated Successfully!")); |
| 185 | 186 | exit; |
| 186 | 187 | } |
| 187 | - }else{ |
|
| 188 | + } else{ |
|
| 188 | 189 | $data['page_title'] = 'Add Opensips'; |
| 189 | 190 | if ($this->form_validation->run() == FALSE) { |
| 190 | 191 | $data['validation_errors'] = validation_errors(); |
| 191 | 192 | echo $data['validation_errors']; |
| 192 | 193 | exit; |
| 193 | - }else{ |
|
| 194 | + } else{ |
|
| 194 | 195 | $this->opensips_model->add_opensipsdevices($add_array); |
| 195 | 196 | echo json_encode(array("SUCCESS"=> "OpenSips Added Successfully!")); |
| 196 | 197 | exit; |
@@ -35,8 +35,9 @@ discard block |
||
| 35 | 35 | $this->load->model('email_model'); |
| 36 | 36 | $this->load->library('csvreader'); |
| 37 | 37 | $this->load->library('astpp/email_lib'); |
| 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 email_edit($edit_id = '') { |
@@ -246,8 +247,9 @@ discard block |
||
| 246 | 247 | } |
| 247 | 248 | function email_mass() { |
| 248 | 249 | $account_data = $this->session->userdata("accountinfo"); |
| 249 | - if ($account_data['type'] == '1' || $account_data['type']== 0 || $account_data['type']==3) |
|
| 250 | - redirect(base_url() . '/astpp/dashboard/'); |
|
| 250 | + if ($account_data['type'] == '1' || $account_data['type']== 0 || $account_data['type']==3) { |
|
| 251 | + redirect(base_url() . '/astpp/dashboard/'); |
|
| 252 | + } |
|
| 251 | 253 | $data['username'] = $this->session->userdata('user_name'); |
| 252 | 254 | $data['page_title'] = 'Email Mass'; |
| 253 | 255 | $data['form'] = $this->form->build_form($this->email_form->build_list_for_email_client_area(), ''); |
@@ -291,8 +293,7 @@ discard block |
||
| 291 | 293 | $path =$dir_path.$actual_file_name; |
| 292 | 294 | if (move_uploaded_file($uploadedFile1,$path)) { |
| 293 | 295 | $this->session->set_flashdata('astpp_errormsg', 'files added successfully!'); |
| 294 | - } |
|
| 295 | - else{ |
|
| 296 | + } else{ |
|
| 296 | 297 | $this->session->set_flashdata('astpp_errormsg', 'Please try again !'); |
| 297 | 298 | } |
| 298 | 299 | } |
@@ -315,8 +316,7 @@ discard block |
||
| 315 | 316 | if($add_array['temp'] == ''){ |
| 316 | 317 | $subject = ''; |
| 317 | 318 | $body =''; |
| 318 | - } |
|
| 319 | - else{ |
|
| 319 | + } else{ |
|
| 320 | 320 | $where = array('id' => $add_array['temp']); |
| 321 | 321 | $account = $this->db_model->getSelect("subject,template", "default_templates", $where); |
| 322 | 322 | $account_data =$account->result_array(); |
@@ -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 Email_form {
|
| 29 | 30 | function __construct($library_name = '') {
|
@@ -153,7 +154,7 @@ discard block |
||
| 153 | 154 | $account_data = $this->CI->session->userdata("accountinfo");
|
| 154 | 155 | $loginid = $account_data['id']; |
| 155 | 156 | |
| 156 | - }else{
|
|
| 157 | + } else{
|
|
| 157 | 158 | $loginid = "0"; |
| 158 | 159 | } |
| 159 | 160 | $form['forms'] = array(base_url() . 'email/email_client_area/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
|
@@ -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(); |
@@ -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 | } |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | }*/ |
| 54 | 54 | if(isset($accountinfo['local_call'])){ |
| 55 | 55 | $accountinfo['local_call']=0; |
| 56 | - }else{ |
|
| 56 | + } else{ |
|
| 57 | 57 | $accountinfo['local_call']=1; |
| 58 | 58 | } |
| 59 | 59 | if ($accountinfo['type'] == 1){ |
| 60 | 60 | $invoice_config = $accountinfo['invoice_config_flag']; |
| 61 | - }else{ |
|
| 61 | + } else{ |
|
| 62 | 62 | $invoice_config = ""; |
| 63 | 63 | } |
| 64 | 64 | unset($accountinfo['invoice_config_flag']); |
@@ -300,17 +300,17 @@ discard block |
||
| 300 | 300 | ); |
| 301 | 301 | if(isset($add_array['is_recording']) && $add_array['is_recording'] != ''){ |
| 302 | 302 | $is_recording=1; |
| 303 | - }else{ |
|
| 303 | + } else{ |
|
| 304 | 304 | $is_recording=0; |
| 305 | 305 | } |
| 306 | 306 | if(isset($add_array['allow_ip_management']) && $add_array['allow_ip_management'] != ''){ |
| 307 | 307 | $allow_ip_management=1; |
| 308 | - }else{ |
|
| 308 | + } else{ |
|
| 309 | 309 | $allow_ip_management=0; |
| 310 | 310 | } |
| 311 | 311 | if(isset($add_array['local_call']) && $add_array['local_call'] != ''){ |
| 312 | 312 | $local_call=1; |
| 313 | - }else{ |
|
| 313 | + } else{ |
|
| 314 | 314 | $local_call=0; |
| 315 | 315 | } |
| 316 | 316 | if ($sip_flag) { |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | $current_id=$accountinfo['type'] ==1 ? $accountinfo['id'] : '0'; |
| 479 | 479 | if($accountdata['reseller_id'] == $current_id){ |
| 480 | 480 | $this->common->mail_to_users('voip_account_refilled', $accountdata); |
| 481 | - }else{ |
|
| 481 | + } else{ |
|
| 482 | 482 | $this->common->mail_to_users('voip_child_account_refilled', $accountdata); |
| 483 | 483 | } |
| 484 | 484 | } |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | } |
| 507 | 507 | if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
| 508 | 508 | $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
| 509 | - }else{ |
|
| 509 | + } else{ |
|
| 510 | 510 | $this->db->order_by('number','desc'); |
| 511 | 511 | } |
| 512 | 512 | $result = $this->db->get('accounts'); |
@@ -535,12 +535,13 @@ discard block |
||
| 535 | 535 | $this->db->where($type); |
| 536 | 536 | } |
| 537 | 537 | if ($flag) { |
| 538 | - if (!$export) |
|
| 539 | - $this->db->limit($limit, $start); |
|
| 538 | + if (!$export) { |
|
| 539 | + $this->db->limit($limit, $start); |
|
| 540 | + } |
|
| 540 | 541 | } |
| 541 | 542 | if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
| 542 | 543 | $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
| 543 | - }else{ |
|
| 544 | + } else{ |
|
| 544 | 545 | $this->db->order_by('number','desc'); |
| 545 | 546 | } |
| 546 | 547 | $result = $this->db->get('accounts'); |
@@ -614,10 +615,11 @@ discard block |
||
| 614 | 615 | |
| 615 | 616 | function get_account_number($accountid) { |
| 616 | 617 | $query = $this->db_model->getSelect("number", "accounts", array("id" => $accountid)); |
| 617 | - if ($query->num_rows() > 0) |
|
| 618 | - return $query->row_array(); |
|
| 619 | - else |
|
| 620 | - return false; |
|
| 618 | + if ($query->num_rows() > 0) { |
|
| 619 | + return $query->row_array(); |
|
| 620 | + } else { |
|
| 621 | + return false; |
|
| 622 | + } |
|
| 621 | 623 | } |
| 622 | 624 | |
| 623 | 625 | function add_callerid($data) { |
@@ -662,10 +664,11 @@ discard block |
||
| 662 | 664 | function get_accounttax_by_id($account_id) { |
| 663 | 665 | $this->db->where("accountid", trim($account_id)); |
| 664 | 666 | $query = $this->db->get("taxes_to_accounts"); |
| 665 | - if ($query->num_rows() > 0) |
|
| 666 | - return $query->result_array(); |
|
| 667 | - else |
|
| 668 | - return false; |
|
| 667 | + if ($query->num_rows() > 0) { |
|
| 668 | + return $query->result_array(); |
|
| 669 | + } else { |
|
| 670 | + return false; |
|
| 671 | + } |
|
| 669 | 672 | } |
| 670 | 673 | |
| 671 | 674 | /** |
@@ -678,29 +681,32 @@ discard block |
||
| 678 | 681 | $this->db->where("number", $acc_num); |
| 679 | 682 | $query = $this->db->get("accounts"); |
| 680 | 683 | |
| 681 | - if ($query->num_rows() > 0) |
|
| 682 | - return $query->row_array(); |
|
| 683 | - else |
|
| 684 | - return false; |
|
| 684 | + if ($query->num_rows() > 0) { |
|
| 685 | + return $query->row_array(); |
|
| 686 | + } else { |
|
| 687 | + return false; |
|
| 688 | + } |
|
| 685 | 689 | } |
| 686 | 690 | |
| 687 | 691 | function get_account_by_number($id) { |
| 688 | 692 | $this->db->where("id", $id); |
| 689 | 693 | $query = $this->db->get("accounts"); |
| 690 | 694 | |
| 691 | - if ($query->num_rows() > 0) |
|
| 692 | - return $query->row_array(); |
|
| 693 | - else |
|
| 694 | - return false; |
|
| 695 | + if ($query->num_rows() > 0) { |
|
| 696 | + return $query->row_array(); |
|
| 697 | + } else { |
|
| 698 | + return false; |
|
| 699 | + } |
|
| 695 | 700 | } |
| 696 | 701 | |
| 697 | 702 | function get_currency_by_id($currency_id) { |
| 698 | 703 | |
| 699 | 704 | $query = $this->db_model->getSelect("*", 'currency', array('id' => $currency_id)); |
| 700 | - if ($query->num_rows() > 0) |
|
| 701 | - return $query->row_array(); |
|
| 702 | - else |
|
| 703 | - return false; |
|
| 705 | + if ($query->num_rows() > 0) { |
|
| 706 | + return $query->row_array(); |
|
| 707 | + } else { |
|
| 708 | + return false; |
|
| 709 | + } |
|
| 704 | 710 | } |
| 705 | 711 | |
| 706 | 712 | |
@@ -37,8 +37,9 @@ discard block |
||
| 37 | 37 | $this->load->model('accounts_model'); |
| 38 | 38 | $this->load->model('Astpp_common'); |
| 39 | 39 | $this->protected_pages = array('account_list'); |
| 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 | } |
| 43 | 44 | |
| 44 | 45 | function customer_list() { |
@@ -377,13 +378,15 @@ discard block |
||
| 377 | 378 | $where = array("accountid" => $accountid); |
| 378 | 379 | $instant_search=$this->session->userdata('left_panel_search_'.$accounttype.'_ipmap'); |
| 379 | 380 | $like_str=!empty($instant_search) ? "(name like '%$instant_search%' OR ip like '%$instant_search%' OR prefix like '%$instant_search%' OR created_date like '%$instant_search%' )" :null; |
| 380 | - if(!empty($like_str)) |
|
| 381 | - $this->db->where($like_str); |
|
| 381 | + if(!empty($like_str)) { |
|
| 382 | + $this->db->where($like_str); |
|
| 383 | + } |
|
| 382 | 384 | $count_all = $this->db_model->countQuery("*", "ip_map", $where); |
| 383 | 385 | $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
| 384 | 386 | $json_data = $paging_data["json_paging"]; |
| 385 | - if(!empty($like_str)) |
|
| 386 | - $this->db->where($like_str); |
|
| 387 | + if(!empty($like_str)) { |
|
| 388 | + $this->db->where($like_str); |
|
| 389 | + } |
|
| 387 | 390 | $query = $this->db_model->select("*", "ip_map", $where, "id", "ASC", $paging_data["paging"]["page_no"], $paging_data["paging"]["start"]); |
| 388 | 391 | $grid_fields = json_decode($this->accounts_form->build_ip_list_for_customer($accountid, $accounttype)); |
| 389 | 392 | $json_data['rows'] = $this->form->build_grid($query, $grid_fields); |
@@ -472,15 +475,17 @@ discard block |
||
| 472 | 475 | $json_data = array(); |
| 473 | 476 | $instant_search=$this->session->userdata('left_panel_search_'.$accounttype.'_animap'); |
| 474 | 477 | $like_str=!empty($instant_search) ? "(number like '%$instant_search%' OR creation_date like '%$instant_search%' )" :null; |
| 475 | - if(!empty($like_str)) |
|
| 476 | - $this->db->where($like_str); |
|
| 478 | + if(!empty($like_str)) { |
|
| 479 | + $this->db->where($like_str); |
|
| 480 | + } |
|
| 477 | 481 | $where = array("accountid" => $accountid); |
| 478 | 482 | $count_all = $this->db_model->countQuery("*", "ani_map", $where); |
| 479 | 483 | |
| 480 | 484 | $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
| 481 | 485 | $json_data = $paging_data["json_paging"]; |
| 482 | - if(!empty($like_str)) |
|
| 483 | - $this->db->where($like_str); |
|
| 486 | + if(!empty($like_str)) { |
|
| 487 | + $this->db->where($like_str); |
|
| 488 | + } |
|
| 484 | 489 | $query = $this->db_model->select("*", "ani_map", $where, "id", "ASC", $paging_data["paging"]["page_no"], $paging_data["paging"]["start"]); |
| 485 | 490 | |
| 486 | 491 | $grid_fields = json_decode($this->accounts_form->build_animap_list_for_customer($accountid, $accounttype)); |
@@ -1043,7 +1048,7 @@ discard block |
||
| 1043 | 1048 | $data['edit_id'] = $edit_id; |
| 1044 | 1049 | $data['accounttype'] = $accounttype; |
| 1045 | 1050 | $this->load->view('view_reseller_package_list', $data); |
| 1046 | - }else { |
|
| 1051 | + } else { |
|
| 1047 | 1052 | redirect(base_url() . 'accounts/reseller_list/'); |
| 1048 | 1053 | exit; |
| 1049 | 1054 | } |
@@ -1321,14 +1326,14 @@ discard block |
||
| 1321 | 1326 | $accountinfo = $this->accounts_model->get_account_by_number($post_array['id']); |
| 1322 | 1327 | if($accountinfo['reseller_id'] == 0){ |
| 1323 | 1328 | $where = array("accountid"=> 1); |
| 1324 | - }else{ |
|
| 1329 | + } else{ |
|
| 1325 | 1330 | $where = array("accountid"=> $accountinfo['id']); |
| 1326 | 1331 | } |
| 1327 | 1332 | $query = $this->db_model->getSelect("*", "invoice_conf", $where); |
| 1328 | 1333 | if($query->num_rows >0){ |
| 1329 | 1334 | $invoice_conf = $query->result_array(); |
| 1330 | 1335 | $invoice_conf = $invoice_conf[0]; |
| 1331 | - }else{ |
|
| 1336 | + } else{ |
|
| 1332 | 1337 | $query = $this->db_model->getSelect("*", "invoice_conf",array("accountid"=> 1)); |
| 1333 | 1338 | $invoice_conf = $query->result_array(); |
| 1334 | 1339 | $invoice_conf = $invoice_conf[0]; |
@@ -1355,7 +1360,7 @@ discard block |
||
| 1355 | 1360 | 'after_balance'=>$account_balance, |
| 1356 | 1361 | ); |
| 1357 | 1362 | $this->db->insert("invoice_details", $insert_arr); |
| 1358 | - }else{ |
|
| 1363 | + } else{ |
|
| 1359 | 1364 | $this->load->module('invoices/invoices'); |
| 1360 | 1365 | $invoice_id=$this->invoices->invoices->generate_receipt($post_array['id'],$post_array['credit'],$accountinfo,$last_invoice_ID+1,$invoice_prefix,$due_date); |
| 1361 | 1366 | $account_balance = $this->common->get_field_name('balance', 'accounts', $post_array['id']); |
@@ -1788,8 +1793,9 @@ discard block |
||
| 1788 | 1793 | $json_data['total'] = $config['total_rows']; |
| 1789 | 1794 | $perpage = $config['per_page']; |
| 1790 | 1795 | $start = ($page_no - 1) * $perpage; |
| 1791 | - if ($start < 0) |
|
| 1792 | - $start = 0; |
|
| 1796 | + if ($start < 0) { |
|
| 1797 | + $start = 0; |
|
| 1798 | + } |
|
| 1793 | 1799 | |
| 1794 | 1800 | $account_charge_list = $this->db_model->getAllJionQuery($table, $select, $where, $jionTable, $jionCondition, $type, $perpage, $start, $order_by, $order_type, ""); |
| 1795 | 1801 | if ($account_charge_list->num_rows > 0) { |
@@ -2132,8 +2138,9 @@ discard block |
||
| 2132 | 2138 | $data['username'] = $this->session->userdata('user_name'); |
| 2133 | 2139 | $data['page_title'] = 'Account Taxes'; |
| 2134 | 2140 | |
| 2135 | - if ($action == false) |
|
| 2136 | - $action = "list"; |
|
| 2141 | + if ($action == false) { |
|
| 2142 | + $action = "list"; |
|
| 2143 | + } |
|
| 2137 | 2144 | |
| 2138 | 2145 | if ($action == 'list') { |
| 2139 | 2146 | $this->load->view('view_account_taxes_list', $data); |
@@ -2397,10 +2404,10 @@ discard block |
||
| 2397 | 2404 | $ip_map_result=(array)$this->db->get('ip_map')->first_row(); |
| 2398 | 2405 | if($ip_map_result['count'] > 0 ){ |
| 2399 | 2406 | echo 'FALSE'; |
| 2400 | - }else{ |
|
| 2407 | + } else{ |
|
| 2401 | 2408 | echo 'TRUE'; |
| 2402 | 2409 | } |
| 2403 | - }else{ |
|
| 2410 | + } else{ |
|
| 2404 | 2411 | echo 'FALSE'; |
| 2405 | 2412 | } |
| 2406 | 2413 | |