@@ -22,180 +22,180 @@ discard block |
||
| 22 | 22 | ############################################################################### |
| 23 | 23 | |
| 24 | 24 | if ( ! defined('BASEPATH')) |
| 25 | - exit('No direct script access allowed'); |
|
| 25 | + exit('No direct script access allowed'); |
|
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * Dynamically build forms for display |
| 29 | 29 | */ |
| 30 | 30 | class Form { |
| 31 | 31 | |
| 32 | - protected $CI; // codeigniter |
|
| 33 | - protected $fields = array(); // array of fields |
|
| 34 | - protected $form_title = 'Form'; |
|
| 35 | - protected $form_id = 'form'; |
|
| 36 | - protected $form_action = ''; |
|
| 37 | - protected $form_class = ''; |
|
| 38 | - protected $hidden = array(); |
|
| 39 | - protected $multipart = FALSE; // default to standard form |
|
| 40 | - protected $submit_button = 'Submit'; |
|
| 41 | - protected $after_button = ''; |
|
| 42 | - protected $rules = array(); // storage for validation rules |
|
| 43 | - |
|
| 44 | - function __construct() { |
|
| 45 | - $this->CI = & get_instance(); |
|
| 46 | - $this->CI->load->library('form_validation'); |
|
| 47 | - $this->CI->load->library('astpp/common'); |
|
| 48 | - $this->CI->load->model('db_model'); |
|
| 49 | - $this->check_permissions(); |
|
| 50 | - } |
|
| 32 | + protected $CI; // codeigniter |
|
| 33 | + protected $fields = array(); // array of fields |
|
| 34 | + protected $form_title = 'Form'; |
|
| 35 | + protected $form_id = 'form'; |
|
| 36 | + protected $form_action = ''; |
|
| 37 | + protected $form_class = ''; |
|
| 38 | + protected $hidden = array(); |
|
| 39 | + protected $multipart = FALSE; // default to standard form |
|
| 40 | + protected $submit_button = 'Submit'; |
|
| 41 | + protected $after_button = ''; |
|
| 42 | + protected $rules = array(); // storage for validation rules |
|
| 43 | + |
|
| 44 | + function __construct() { |
|
| 45 | + $this->CI = & get_instance(); |
|
| 46 | + $this->CI->load->library('form_validation'); |
|
| 47 | + $this->CI->load->library('astpp/common'); |
|
| 48 | + $this->CI->load->model('db_model'); |
|
| 49 | + $this->check_permissions(); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | 52 | // __construct |
| 53 | - /** |
|
| 54 | - * adds raw html to the field array |
|
| 55 | - */ |
|
| 56 | - function check_permissions() { |
|
| 57 | - if ($this->CI->session->userdata('user_login') == TRUE) { |
|
| 58 | - $module_info = unserialize($this->CI->session->userdata("permited_modules")); |
|
| 59 | - if ($this->CI->session->userdata('userlevel_logintype') != 0 && $this->CI->session->userdata('userlevel_logintype') != 3) { |
|
| 60 | - $module_info[] = 'dashboard'; |
|
| 61 | - } |
|
| 62 | - $url = $this->CI->uri->uri_string; |
|
| 63 | - $file_name = explode("/", $url); |
|
| 64 | - if (isset($file_name['1'])) { |
|
| 65 | - $module = explode('_', $file_name['1']); |
|
| 66 | - } else { |
|
| 67 | - $module = $file_name; |
|
| 68 | - } |
|
| 69 | - if ($this->CI->session->userdata('userlevel_logintype') == 1) { |
|
| 53 | + /** |
|
| 54 | + * adds raw html to the field array |
|
| 55 | + */ |
|
| 56 | + function check_permissions() { |
|
| 57 | + if ($this->CI->session->userdata('user_login') == TRUE) { |
|
| 58 | + $module_info = unserialize($this->CI->session->userdata("permited_modules")); |
|
| 59 | + if ($this->CI->session->userdata('userlevel_logintype') != 0 && $this->CI->session->userdata('userlevel_logintype') != 3) { |
|
| 60 | + $module_info[] = 'dashboard'; |
|
| 61 | + } |
|
| 62 | + $url = $this->CI->uri->uri_string; |
|
| 63 | + $file_name = explode("/", $url); |
|
| 64 | + if (isset($file_name['1'])) { |
|
| 65 | + $module = explode('_', $file_name['1']); |
|
| 66 | + } else { |
|
| 67 | + $module = $file_name; |
|
| 68 | + } |
|
| 69 | + if ($this->CI->session->userdata('userlevel_logintype') == 1) { |
|
| 70 | 70 | $module_info[] = 'user'; |
| 71 | 71 | } |
| 72 | - if (in_array($module[0], $module_info)) { |
|
| 73 | - if ($this->CI->session->userdata('userlevel_logintype') == 0 && $module[0] == 'customer' && isset($file_name[1]) && $file_name[1] != 'customer_transfer') { |
|
| 74 | - redirect(base_url().'user/user/'); |
|
| 75 | - } else { |
|
| 76 | - return true; |
|
| 77 | - } |
|
| 78 | - } else { |
|
| 79 | - $this->CI->session->set_userdata('astpp_errormsg', 'You do not have permission to access this module..!'); |
|
| 80 | - if ($this->CI->session->userdata('userlevel_logintype') == '-1' || $this->CI->session->userdata('logintype') == '1') { |
|
| 81 | - redirect(base_url().'dashboard/'); |
|
| 82 | - } else { |
|
| 83 | - redirect(base_url().'user/user/'); |
|
| 84 | - } |
|
| 85 | - } |
|
| 86 | - } else { |
|
| 87 | - redirect(base_url()); |
|
| 88 | - } |
|
| 89 | - } |
|
| 90 | - |
|
| 91 | - function build_form($fields_array, $values) { |
|
| 92 | - $form_contents = ''; |
|
| 93 | - $form_contents .= '<div class="pop_md col-md-12 margin-t-10 padding-x-8">'; |
|
| 94 | - if (isset($fields_array['breadcrumb'])) { |
|
| 95 | - $form_contents .= form_breadcrumb($fields_array['breadcrumb']); |
|
| 96 | - unset($fields_array['breadcrumb']); |
|
| 97 | - } |
|
| 98 | - $form_contents .= form_open($fields_array['forms'][0], $fields_array['forms'][1]); |
|
| 99 | - unset($fields_array['forms']); |
|
| 100 | - $button_array = array(); |
|
| 101 | - if (isset($fields_array['button_save']) || isset($fields_array['button_cancel']) || isset($fields_array['additional_button'])) { |
|
| 102 | - $save = $fields_array['button_save']; |
|
| 103 | - unset($fields_array['button_save']); |
|
| 104 | - if (isset($fields_array['button_cancel'])) { |
|
| 105 | - $cancel = $fields_array['button_cancel']; |
|
| 106 | - unset($fields_array['button_cancel']); |
|
| 107 | - } |
|
| 108 | - if (isset($fields_array['additional_button'])) { |
|
| 109 | - $additiopnal_button = $fields_array['additional_button']; |
|
| 110 | - unset($fields_array['additional_button']); |
|
| 111 | - } |
|
| 112 | - } |
|
| 113 | - if (isset($additiopnal_button)) { |
|
| 114 | - $form_contents .= form_button(gettext($additiopnal_button)); |
|
| 115 | - } |
|
| 116 | - $i = 0; |
|
| 117 | - foreach ($fields_array as $fieldset_key => $form_fileds) { |
|
| 118 | - if (count($fields_array) > 1) { |
|
| 119 | - if ($i == 1 || $i == 3) { |
|
| 120 | - $form_contents .= '<div class="col-md-6 no-padding pull-right">'; |
|
| 121 | - $form_contents .= '<div class="col-md-12 padding-x-4">'; |
|
| 122 | - } else { |
|
| 123 | - $form_contents .= '<div class="col-md-6 no-padding">'; |
|
| 124 | - $form_contents .= '<div class="col-md-12 padding-x-4">'; |
|
| 125 | - } |
|
| 126 | - } else { |
|
| 127 | - $form_contents .= '<div class="col-md-12 no-padding">'; |
|
| 128 | - $form_contents .= '<div class="col-md-12 no-padding">'; |
|
| 129 | - } |
|
| 130 | - $form_contents .= '<ul class="no-padding">'; |
|
| 131 | - $form_contents .= '<div class="col-md-12 no-padding">'; |
|
| 132 | - if ($i == 1 || $i == 3) { |
|
| 133 | - $form_contents .= form_fieldset(gettext($fieldset_key)); |
|
| 134 | - } else { |
|
| 135 | - $form_contents .= form_fieldset(gettext($fieldset_key)); |
|
| 136 | - } |
|
| 137 | - foreach ($form_fileds as $fieldkey => $fieldvalue) { |
|
| 138 | - $form_contents .= '<li class="col-md-12">'; |
|
| 139 | - if ($fieldvalue[1] == 'HIDDEN') { |
|
| 140 | - if (isset($this->CI->input->post)) |
|
| 141 | - $fieldvalue[2]['value'] = ( ! $this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 142 | - else |
|
| 143 | - $fieldvalue[2]['value'] = ($values) ? (isset($values[$fieldvalue[2]['name']]) ? $values[$fieldvalue[2]['name']] : '') : (isset($fieldvalue[2]['value']) ? $fieldvalue[2]['value'] : ''); |
|
| 144 | - $form_contents .= form_hidden($fieldvalue[2]['name'], $fieldvalue[2]['value']); |
|
| 145 | - } else { |
|
| 146 | - $validation_arr = array(); |
|
| 147 | - if ($fieldvalue[1] == 'INPUT') { |
|
| 148 | - if ( ! empty($fieldvalue[3])) { |
|
| 149 | - $validation_arr = explode("|", $fieldvalue[3]); |
|
| 150 | - } |
|
| 151 | - } |
|
| 152 | - elseif ($fieldvalue[2] == 'SELECT') { |
|
| 153 | - |
|
| 154 | - if (is_array($fieldvalue[4])) { |
|
| 155 | - $validation_arr = explode("|", $fieldvalue[4]['rules']); |
|
| 156 | - } else { |
|
| 157 | - $validation_arr = explode("|", $fieldvalue[4]); |
|
| 158 | - } |
|
| 159 | - } |
|
| 160 | - if ( ! empty($validation_arr)) { |
|
| 161 | - $fieldvalue[0] = in_array('required', $validation_arr) ? $fieldvalue[0]."<span style='color:black;'> *</span>" : $fieldvalue[0]; |
|
| 162 | - $fieldvalue[0] = in_array('dropdown', $validation_arr) ? $fieldvalue[0]."<span style='color:black;'> *</span>" : $fieldvalue[0]; |
|
| 163 | - } |
|
| 72 | + if (in_array($module[0], $module_info)) { |
|
| 73 | + if ($this->CI->session->userdata('userlevel_logintype') == 0 && $module[0] == 'customer' && isset($file_name[1]) && $file_name[1] != 'customer_transfer') { |
|
| 74 | + redirect(base_url().'user/user/'); |
|
| 75 | + } else { |
|
| 76 | + return true; |
|
| 77 | + } |
|
| 78 | + } else { |
|
| 79 | + $this->CI->session->set_userdata('astpp_errormsg', 'You do not have permission to access this module..!'); |
|
| 80 | + if ($this->CI->session->userdata('userlevel_logintype') == '-1' || $this->CI->session->userdata('logintype') == '1') { |
|
| 81 | + redirect(base_url().'dashboard/'); |
|
| 82 | + } else { |
|
| 83 | + redirect(base_url().'user/user/'); |
|
| 84 | + } |
|
| 85 | + } |
|
| 86 | + } else { |
|
| 87 | + redirect(base_url()); |
|
| 88 | + } |
|
| 89 | + } |
|
| 90 | + |
|
| 91 | + function build_form($fields_array, $values) { |
|
| 92 | + $form_contents = ''; |
|
| 93 | + $form_contents .= '<div class="pop_md col-md-12 margin-t-10 padding-x-8">'; |
|
| 94 | + if (isset($fields_array['breadcrumb'])) { |
|
| 95 | + $form_contents .= form_breadcrumb($fields_array['breadcrumb']); |
|
| 96 | + unset($fields_array['breadcrumb']); |
|
| 97 | + } |
|
| 98 | + $form_contents .= form_open($fields_array['forms'][0], $fields_array['forms'][1]); |
|
| 99 | + unset($fields_array['forms']); |
|
| 100 | + $button_array = array(); |
|
| 101 | + if (isset($fields_array['button_save']) || isset($fields_array['button_cancel']) || isset($fields_array['additional_button'])) { |
|
| 102 | + $save = $fields_array['button_save']; |
|
| 103 | + unset($fields_array['button_save']); |
|
| 104 | + if (isset($fields_array['button_cancel'])) { |
|
| 105 | + $cancel = $fields_array['button_cancel']; |
|
| 106 | + unset($fields_array['button_cancel']); |
|
| 107 | + } |
|
| 108 | + if (isset($fields_array['additional_button'])) { |
|
| 109 | + $additiopnal_button = $fields_array['additional_button']; |
|
| 110 | + unset($fields_array['additional_button']); |
|
| 111 | + } |
|
| 112 | + } |
|
| 113 | + if (isset($additiopnal_button)) { |
|
| 114 | + $form_contents .= form_button(gettext($additiopnal_button)); |
|
| 115 | + } |
|
| 116 | + $i = 0; |
|
| 117 | + foreach ($fields_array as $fieldset_key => $form_fileds) { |
|
| 118 | + if (count($fields_array) > 1) { |
|
| 119 | + if ($i == 1 || $i == 3) { |
|
| 120 | + $form_contents .= '<div class="col-md-6 no-padding pull-right">'; |
|
| 121 | + $form_contents .= '<div class="col-md-12 padding-x-4">'; |
|
| 122 | + } else { |
|
| 123 | + $form_contents .= '<div class="col-md-6 no-padding">'; |
|
| 124 | + $form_contents .= '<div class="col-md-12 padding-x-4">'; |
|
| 125 | + } |
|
| 126 | + } else { |
|
| 127 | + $form_contents .= '<div class="col-md-12 no-padding">'; |
|
| 128 | + $form_contents .= '<div class="col-md-12 no-padding">'; |
|
| 129 | + } |
|
| 130 | + $form_contents .= '<ul class="no-padding">'; |
|
| 131 | + $form_contents .= '<div class="col-md-12 no-padding">'; |
|
| 132 | + if ($i == 1 || $i == 3) { |
|
| 133 | + $form_contents .= form_fieldset(gettext($fieldset_key)); |
|
| 134 | + } else { |
|
| 135 | + $form_contents .= form_fieldset(gettext($fieldset_key)); |
|
| 136 | + } |
|
| 137 | + foreach ($form_fileds as $fieldkey => $fieldvalue) { |
|
| 138 | + $form_contents .= '<li class="col-md-12">'; |
|
| 139 | + if ($fieldvalue[1] == 'HIDDEN') { |
|
| 140 | + if (isset($this->CI->input->post)) |
|
| 141 | + $fieldvalue[2]['value'] = ( ! $this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 142 | + else |
|
| 143 | + $fieldvalue[2]['value'] = ($values) ? (isset($values[$fieldvalue[2]['name']]) ? $values[$fieldvalue[2]['name']] : '') : (isset($fieldvalue[2]['value']) ? $fieldvalue[2]['value'] : ''); |
|
| 144 | + $form_contents .= form_hidden($fieldvalue[2]['name'], $fieldvalue[2]['value']); |
|
| 145 | + } else { |
|
| 146 | + $validation_arr = array(); |
|
| 147 | + if ($fieldvalue[1] == 'INPUT') { |
|
| 148 | + if ( ! empty($fieldvalue[3])) { |
|
| 149 | + $validation_arr = explode("|", $fieldvalue[3]); |
|
| 150 | + } |
|
| 151 | + } |
|
| 152 | + elseif ($fieldvalue[2] == 'SELECT') { |
|
| 153 | + |
|
| 154 | + if (is_array($fieldvalue[4])) { |
|
| 155 | + $validation_arr = explode("|", $fieldvalue[4]['rules']); |
|
| 156 | + } else { |
|
| 157 | + $validation_arr = explode("|", $fieldvalue[4]); |
|
| 158 | + } |
|
| 159 | + } |
|
| 160 | + if ( ! empty($validation_arr)) { |
|
| 161 | + $fieldvalue[0] = in_array('required', $validation_arr) ? $fieldvalue[0]."<span style='color:black;'> *</span>" : $fieldvalue[0]; |
|
| 162 | + $fieldvalue[0] = in_array('dropdown', $validation_arr) ? $fieldvalue[0]."<span style='color:black;'> *</span>" : $fieldvalue[0]; |
|
| 163 | + } |
|
| 164 | 164 | |
| 165 | - if (is_array($fieldvalue[1]) || (is_array($fieldvalue[2]) && isset($fieldvalue[2]['hidden']))) { |
|
| 166 | - $form_contents .= form_label(gettext($fieldvalue[0]), $fieldvalue[0], array('class' => 'col-md-3 no-padding add_settings')); |
|
| 167 | - } else { |
|
| 168 | - $form_contents .= form_label(gettext($fieldvalue[0]), "", array("class" => "col-md-3 no-padding")); |
|
| 169 | - } |
|
| 170 | - } |
|
| 171 | - if ($fieldvalue[2] == 'SELECT' && ! isset($fieldvalue[13])) { |
|
| 172 | - |
|
| 173 | - /* |
|
| 165 | + if (is_array($fieldvalue[1]) || (is_array($fieldvalue[2]) && isset($fieldvalue[2]['hidden']))) { |
|
| 166 | + $form_contents .= form_label(gettext($fieldvalue[0]), $fieldvalue[0], array('class' => 'col-md-3 no-padding add_settings')); |
|
| 167 | + } else { |
|
| 168 | + $form_contents .= form_label(gettext($fieldvalue[0]), "", array("class" => "col-md-3 no-padding")); |
|
| 169 | + } |
|
| 170 | + } |
|
| 171 | + if ($fieldvalue[2] == 'SELECT' && ! isset($fieldvalue[13])) { |
|
| 172 | + |
|
| 173 | + /* |
|
| 174 | 174 | To make Drop down enabled disabled |
| 175 | 175 | */ |
| 176 | - $extra = isset($fieldvalue[1]['extra']) ? $fieldvalue[1]['extra'] : ''; |
|
| 177 | - /***************************/ |
|
| 178 | - if ($fieldvalue[7] != '' && $fieldvalue[8] != '') { |
|
| 179 | - $str = $fieldvalue[7].",".$fieldvalue[8]; |
|
| 180 | - |
|
| 181 | - if (isset($this->CI->input->post)) { |
|
| 182 | - $fieldvalue['value'] = ( ! $this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[1] : $this->CI->input->post($fieldvalue[1]); |
|
| 183 | - } else { |
|
| 184 | - if (is_array($fieldvalue[1])) { |
|
| 185 | - $fieldvalue['value'] = ($values) ? @$values[$fieldvalue[1]['name']] : @$fieldvalue[1]; |
|
| 186 | - } else { |
|
| 187 | - $fieldvalue['value'] = ($values) ? @$values[$fieldvalue[1]] : @$fieldvalue[1]; |
|
| 188 | - } |
|
| 189 | - } |
|
| 190 | - $drp_array = call_user_func_array(array($this->CI->db_model, $fieldvalue[10]), array($str, $fieldvalue[9], $fieldvalue[11], $fieldvalue[12])); |
|
| 191 | - |
|
| 192 | - if ($fieldset_key == gettext('System Configuration Information') || ($fieldset_key == 'Billing Information' && $fieldvalue[0] == 'Force Trunk') || ($fieldset_key == 'Card Information' && $fieldvalue[0] == 'Rate Group') || ($fieldset_key == 'Billing Information' && $fieldvalue[0] == 'Account') || $fieldset_key == 'Freeswitch Devices' && $fieldvalue[0] == 'Rate Group' || ($fieldset_key== 'Origination Rate Add/Edit' && $fieldvalue[0] == 'Trunks' )||$fieldset_key== 'Billing Information' && $fieldvalue[0] == 'Rate Group' || ($fieldset_key== 'Information' && $fieldvalue[0] == 'Failover GW Name #1') || ($fieldset_key== 'Information' && $fieldvalue[0] == 'Failover GW Name #2') || ($fieldset_key== 'Information' && $fieldvalue[0] == 'Rate Group') || ($fieldset_key== 'Sip Devices' && $fieldvalue[0] == 'Sip Profile') || ($fieldset_key== 'Sip Devices' && $fieldvalue[0] == 'Account')) { |
|
| 193 | - $form_contents.=form_dropdown_all($fieldvalue[1], $drp_array, $fieldvalue['value'],$extra); |
|
| 194 | - } else { |
|
| 195 | - $form_contents.=form_dropdown($fieldvalue[1], $drp_array, $fieldvalue['value'], $extra); |
|
| 196 | - } |
|
| 197 | - if(isset($fieldvalue[4]) && $fieldvalue[4] != ''){ |
|
| 198 | - if(is_array($fieldvalue[4])){ |
|
| 176 | + $extra = isset($fieldvalue[1]['extra']) ? $fieldvalue[1]['extra'] : ''; |
|
| 177 | + /***************************/ |
|
| 178 | + if ($fieldvalue[7] != '' && $fieldvalue[8] != '') { |
|
| 179 | + $str = $fieldvalue[7].",".$fieldvalue[8]; |
|
| 180 | + |
|
| 181 | + if (isset($this->CI->input->post)) { |
|
| 182 | + $fieldvalue['value'] = ( ! $this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[1] : $this->CI->input->post($fieldvalue[1]); |
|
| 183 | + } else { |
|
| 184 | + if (is_array($fieldvalue[1])) { |
|
| 185 | + $fieldvalue['value'] = ($values) ? @$values[$fieldvalue[1]['name']] : @$fieldvalue[1]; |
|
| 186 | + } else { |
|
| 187 | + $fieldvalue['value'] = ($values) ? @$values[$fieldvalue[1]] : @$fieldvalue[1]; |
|
| 188 | + } |
|
| 189 | + } |
|
| 190 | + $drp_array = call_user_func_array(array($this->CI->db_model, $fieldvalue[10]), array($str, $fieldvalue[9], $fieldvalue[11], $fieldvalue[12])); |
|
| 191 | + |
|
| 192 | + if ($fieldset_key == gettext('System Configuration Information') || ($fieldset_key == 'Billing Information' && $fieldvalue[0] == 'Force Trunk') || ($fieldset_key == 'Card Information' && $fieldvalue[0] == 'Rate Group') || ($fieldset_key == 'Billing Information' && $fieldvalue[0] == 'Account') || $fieldset_key == 'Freeswitch Devices' && $fieldvalue[0] == 'Rate Group' || ($fieldset_key== 'Origination Rate Add/Edit' && $fieldvalue[0] == 'Trunks' )||$fieldset_key== 'Billing Information' && $fieldvalue[0] == 'Rate Group' || ($fieldset_key== 'Information' && $fieldvalue[0] == 'Failover GW Name #1') || ($fieldset_key== 'Information' && $fieldvalue[0] == 'Failover GW Name #2') || ($fieldset_key== 'Information' && $fieldvalue[0] == 'Rate Group') || ($fieldset_key== 'Sip Devices' && $fieldvalue[0] == 'Sip Profile') || ($fieldset_key== 'Sip Devices' && $fieldvalue[0] == 'Account')) { |
|
| 193 | + $form_contents.=form_dropdown_all($fieldvalue[1], $drp_array, $fieldvalue['value'],$extra); |
|
| 194 | + } else { |
|
| 195 | + $form_contents.=form_dropdown($fieldvalue[1], $drp_array, $fieldvalue['value'], $extra); |
|
| 196 | + } |
|
| 197 | + if(isset($fieldvalue[4]) && $fieldvalue[4] != ''){ |
|
| 198 | + if(is_array($fieldvalue[4])){ |
|
| 199 | 199 | |
| 200 | 200 | if(isset($fieldvalue[1]['name'])){ |
| 201 | 201 | $fieldvalue_pass=$fieldvalue[1]['name']; |
@@ -203,8 +203,8 @@ discard block |
||
| 203 | 203 | $fieldvalue_pass=$fieldvalue[1]; |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | - $this->CI->form_validation->set_rules($fieldvalue_pass, $fieldvalue[0], $fieldvalue[4]['rules']); |
|
| 207 | - }else{ |
|
| 206 | + $this->CI->form_validation->set_rules($fieldvalue_pass, $fieldvalue[0], $fieldvalue[4]['rules']); |
|
| 207 | + }else{ |
|
| 208 | 208 | |
| 209 | 209 | if(isset($fieldvalue[1]['name'])){ |
| 210 | 210 | $fieldvalue_pass=$fieldvalue[1]['name']; |
@@ -212,11 +212,11 @@ discard block |
||
| 212 | 212 | $fieldvalue_pass=$fieldvalue[1]; |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | - $this->CI->form_validation->set_rules($fieldvalue_pass, $fieldvalue[0], $fieldvalue[4]); |
|
| 216 | - } |
|
| 217 | - } |
|
| 218 | - $form_contents.= '<div class="tooltips error_div pull-left no-padding" id="'.(is_array($fieldvalue[1])?$fieldvalue[1]['name']:$fieldvalue[1]).'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
|
| 219 | - $form_contents.= '<span class="popup_error error no-padding" id="'.(gettext(is_array($fieldvalue[1])?$fieldvalue[1]['name']:$fieldvalue[1])).'_error"> |
|
| 215 | + $this->CI->form_validation->set_rules($fieldvalue_pass, $fieldvalue[0], $fieldvalue[4]); |
|
| 216 | + } |
|
| 217 | + } |
|
| 218 | + $form_contents.= '<div class="tooltips error_div pull-left no-padding" id="'.(is_array($fieldvalue[1])?$fieldvalue[1]['name']:$fieldvalue[1]).'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
|
| 219 | + $form_contents.= '<span class="popup_error error no-padding" id="'.(gettext(is_array($fieldvalue[1])?$fieldvalue[1]['name']:$fieldvalue[1])).'_error"> |
|
| 220 | 220 | |
| 221 | 221 | </span></div>'; |
| 222 | 222 | } else { |
@@ -189,39 +189,39 @@ discard block |
||
| 189 | 189 | } |
| 190 | 190 | $drp_array = call_user_func_array(array($this->CI->db_model, $fieldvalue[10]), array($str, $fieldvalue[9], $fieldvalue[11], $fieldvalue[12])); |
| 191 | 191 | |
| 192 | - if ($fieldset_key == gettext('System Configuration Information') || ($fieldset_key == 'Billing Information' && $fieldvalue[0] == 'Force Trunk') || ($fieldset_key == 'Card Information' && $fieldvalue[0] == 'Rate Group') || ($fieldset_key == 'Billing Information' && $fieldvalue[0] == 'Account') || $fieldset_key == 'Freeswitch Devices' && $fieldvalue[0] == 'Rate Group' || ($fieldset_key== 'Origination Rate Add/Edit' && $fieldvalue[0] == 'Trunks' )||$fieldset_key== 'Billing Information' && $fieldvalue[0] == 'Rate Group' || ($fieldset_key== 'Information' && $fieldvalue[0] == 'Failover GW Name #1') || ($fieldset_key== 'Information' && $fieldvalue[0] == 'Failover GW Name #2') || ($fieldset_key== 'Information' && $fieldvalue[0] == 'Rate Group') || ($fieldset_key== 'Sip Devices' && $fieldvalue[0] == 'Sip Profile') || ($fieldset_key== 'Sip Devices' && $fieldvalue[0] == 'Account')) { |
|
| 193 | - $form_contents.=form_dropdown_all($fieldvalue[1], $drp_array, $fieldvalue['value'],$extra); |
|
| 192 | + if ($fieldset_key == gettext('System Configuration Information') || ($fieldset_key == 'Billing Information' && $fieldvalue[0] == 'Force Trunk') || ($fieldset_key == 'Card Information' && $fieldvalue[0] == 'Rate Group') || ($fieldset_key == 'Billing Information' && $fieldvalue[0] == 'Account') || $fieldset_key == 'Freeswitch Devices' && $fieldvalue[0] == 'Rate Group' || ($fieldset_key == 'Origination Rate Add/Edit' && $fieldvalue[0] == 'Trunks') || $fieldset_key == 'Billing Information' && $fieldvalue[0] == 'Rate Group' || ($fieldset_key == 'Information' && $fieldvalue[0] == 'Failover GW Name #1') || ($fieldset_key == 'Information' && $fieldvalue[0] == 'Failover GW Name #2') || ($fieldset_key == 'Information' && $fieldvalue[0] == 'Rate Group') || ($fieldset_key == 'Sip Devices' && $fieldvalue[0] == 'Sip Profile') || ($fieldset_key == 'Sip Devices' && $fieldvalue[0] == 'Account')) { |
|
| 193 | + $form_contents .= form_dropdown_all($fieldvalue[1], $drp_array, $fieldvalue['value'], $extra); |
|
| 194 | 194 | } else { |
| 195 | - $form_contents.=form_dropdown($fieldvalue[1], $drp_array, $fieldvalue['value'], $extra); |
|
| 195 | + $form_contents .= form_dropdown($fieldvalue[1], $drp_array, $fieldvalue['value'], $extra); |
|
| 196 | 196 | } |
| 197 | - if(isset($fieldvalue[4]) && $fieldvalue[4] != ''){ |
|
| 198 | - if(is_array($fieldvalue[4])){ |
|
| 197 | + if (isset($fieldvalue[4]) && $fieldvalue[4] != '') { |
|
| 198 | + if (is_array($fieldvalue[4])) { |
|
| 199 | 199 | |
| 200 | - if(isset($fieldvalue[1]['name'])){ |
|
| 201 | - $fieldvalue_pass=$fieldvalue[1]['name']; |
|
| 202 | - }else{ |
|
| 203 | - $fieldvalue_pass=$fieldvalue[1]; |
|
| 200 | + if (isset($fieldvalue[1]['name'])) { |
|
| 201 | + $fieldvalue_pass = $fieldvalue[1]['name']; |
|
| 202 | + } else { |
|
| 203 | + $fieldvalue_pass = $fieldvalue[1]; |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | $this->CI->form_validation->set_rules($fieldvalue_pass, $fieldvalue[0], $fieldvalue[4]['rules']); |
| 207 | - }else{ |
|
| 207 | + } else { |
|
| 208 | 208 | |
| 209 | - if(isset($fieldvalue[1]['name'])){ |
|
| 210 | - $fieldvalue_pass=$fieldvalue[1]['name']; |
|
| 211 | - }else{ |
|
| 212 | - $fieldvalue_pass=$fieldvalue[1]; |
|
| 209 | + if (isset($fieldvalue[1]['name'])) { |
|
| 210 | + $fieldvalue_pass = $fieldvalue[1]['name']; |
|
| 211 | + } else { |
|
| 212 | + $fieldvalue_pass = $fieldvalue[1]; |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | $this->CI->form_validation->set_rules($fieldvalue_pass, $fieldvalue[0], $fieldvalue[4]); |
| 216 | 216 | } |
| 217 | 217 | } |
| 218 | - $form_contents.= '<div class="tooltips error_div pull-left no-padding" id="'.(is_array($fieldvalue[1])?$fieldvalue[1]['name']:$fieldvalue[1]).'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
|
| 219 | - $form_contents.= '<span class="popup_error error no-padding" id="'.(gettext(is_array($fieldvalue[1])?$fieldvalue[1]['name']:$fieldvalue[1])).'_error"> |
|
| 218 | + $form_contents .= '<div class="tooltips error_div pull-left no-padding" id="'.(is_array($fieldvalue[1]) ? $fieldvalue[1]['name'] : $fieldvalue[1]).'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
|
| 219 | + $form_contents .= '<span class="popup_error error no-padding" id="'.(gettext(is_array($fieldvalue[1]) ? $fieldvalue[1]['name'] : $fieldvalue[1])).'_error"> |
|
| 220 | 220 | |
| 221 | 221 | </span></div>'; |
| 222 | 222 | } else { |
| 223 | 223 | if (isset($this->CI->input->post)) { |
| 224 | - $fieldvalue['value'] = (!$this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[1] : $this->CI->input->post($fieldvalue[1]); |
|
| 224 | + $fieldvalue['value'] = ( ! $this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[1] : $this->CI->input->post($fieldvalue[1]); |
|
| 225 | 225 | } else { |
| 226 | 226 | if (is_array($fieldvalue[1])) { |
| 227 | 227 | $fieldvalue['value'] = ($values) ? @$values[$fieldvalue[1]['name']] : @$fieldvalue[1]; |
@@ -230,53 +230,53 @@ discard block |
||
| 230 | 230 | } |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - $str = $fieldvalue[7] . "," . $fieldvalue[8]; |
|
| 233 | + $str = $fieldvalue[7].",".$fieldvalue[8]; |
|
| 234 | 234 | $drp_array = call_user_func_array(array($this->CI->common, $fieldvalue[10]), array($fieldvalue[9])); |
| 235 | - $form_contents.=form_dropdown($fieldvalue[1], $drp_array, $fieldvalue['value'],$extra); |
|
| 236 | - if(isset($fieldvalue[4]) && $fieldvalue[4] != ''){ |
|
| 235 | + $form_contents .= form_dropdown($fieldvalue[1], $drp_array, $fieldvalue['value'], $extra); |
|
| 236 | + if (isset($fieldvalue[4]) && $fieldvalue[4] != '') { |
|
| 237 | 237 | $this->CI->form_validation->set_rules($fieldvalue[1], $fieldvalue[0], $fieldvalue[4]); |
| 238 | 238 | } |
| 239 | - $form_contents.= '<div class="tooltips error_div pull-left no-padding" id="'.(is_array($fieldvalue[1])?$fieldvalue[1]['name']:$fieldvalue[1]).'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
|
| 240 | - $form_contents.= '<span class="popup_error error no-padding" id="'.(is_array($fieldvalue[1])?$fieldvalue[1]['name']:$fieldvalue[1]).'_error"> |
|
| 239 | + $form_contents .= '<div class="tooltips error_div pull-left no-padding" id="'.(is_array($fieldvalue[1]) ? $fieldvalue[1]['name'] : $fieldvalue[1]).'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
|
| 240 | + $form_contents .= '<span class="popup_error error no-padding" id="'.(is_array($fieldvalue[1]) ? $fieldvalue[1]['name'] : $fieldvalue[1]).'_error"> |
|
| 241 | 241 | </span></div>'; |
| 242 | 242 | } |
| 243 | 243 | } else if (isset($fieldvalue[13]) && $fieldvalue[13] != '') { |
| 244 | 244 | |
| 245 | 245 | /* For multi select code */ |
| 246 | - $str = $fieldvalue[7] . "," . $fieldvalue[8]; |
|
| 246 | + $str = $fieldvalue[7].",".$fieldvalue[8]; |
|
| 247 | 247 | |
| 248 | 248 | if (isset($this->CI->input->post)) |
| 249 | - $fieldvalue['value'] = (!$this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[1] : $this->CI->input->post($fieldvalue[1]); |
|
| 249 | + $fieldvalue['value'] = ( ! $this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[1] : $this->CI->input->post($fieldvalue[1]); |
|
| 250 | 250 | else |
| 251 | 251 | $fieldvalue['value'] = ($values) ? @$values[$fieldvalue[1]] : @$fieldvalue[1]; |
| 252 | 252 | |
| 253 | 253 | $drp_array = call_user_func_array(array($this->CI->db_model, $fieldvalue[10]), array($str, $fieldvalue[9], $fieldvalue[11], $fieldvalue[12])); |
| 254 | 254 | if ($fieldset_key === 'System Configuration Information') { |
| 255 | - $form_contents.=form_dropdown_multiselect($fieldvalue[1], $drp_array, ''); |
|
| 255 | + $form_contents .= form_dropdown_multiselect($fieldvalue[1], $drp_array, ''); |
|
| 256 | 256 | } else { |
| 257 | - $form_contents.=form_dropdown_multiselect($fieldvalue[1] . "[]", $drp_array, $fieldvalue['value']); |
|
| 257 | + $form_contents .= form_dropdown_multiselect($fieldvalue[1]."[]", $drp_array, $fieldvalue['value']); |
|
| 258 | 258 | } |
| 259 | - if(isset($fieldvalue[4]) && $fieldvalue[4] != ''){ |
|
| 259 | + if (isset($fieldvalue[4]) && $fieldvalue[4] != '') { |
|
| 260 | 260 | $this->CI->form_validation->set_rules($fieldvalue[1], $fieldvalue[0], $fieldvalue[4]); |
| 261 | 261 | } |
| 262 | - $form_contents.= '<div class="tooltips error_div pull-left no-padding" id="'.$fieldvalue[1].'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
|
| 263 | - $form_contents.= '<span class="popup_error error no-padding" id="'.$fieldvalue[1].'_error"></span></div>'; |
|
| 262 | + $form_contents .= '<div class="tooltips error_div pull-left no-padding" id="'.$fieldvalue[1].'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
|
| 263 | + $form_contents .= '<span class="popup_error error no-padding" id="'.$fieldvalue[1].'_error"></span></div>'; |
|
| 264 | 264 | /* End--------------------- For multi select code */ |
| 265 | 265 | } else if ($fieldvalue[1] == 'INPUT') { |
| 266 | 266 | |
| 267 | 267 | |
| 268 | 268 | if (isset($this->CI->input->post)) |
| 269 | - $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? $fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 270 | - else{ |
|
| 271 | - $fieldvalue[2]['value'] = ($values) ? (isset($values[$fieldvalue[2]['name']]) ? $values[$fieldvalue[2]['name']] : ''):(isset($fieldvalue[2]['value']) ? $fieldvalue[2]['value'] :''); |
|
| 269 | + $fieldvalue[2]['value'] = ( ! $this->CI->input->post($fieldvalue[2]['name'])) ? $fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 270 | + else { |
|
| 271 | + $fieldvalue[2]['value'] = ($values) ? (isset($values[$fieldvalue[2]['name']]) ? $values[$fieldvalue[2]['name']] : '') : (isset($fieldvalue[2]['value']) ? $fieldvalue[2]['value'] : ''); |
|
| 272 | 272 | } |
| 273 | - $form_contents.= form_input($fieldvalue[2], 'readonly'); |
|
| 274 | - if(isset($fieldvalue[6]) && !empty($fieldvalue[6])){ |
|
| 275 | - $form_contents.=$fieldvalue[6]; |
|
| 273 | + $form_contents .= form_input($fieldvalue[2], 'readonly'); |
|
| 274 | + if (isset($fieldvalue[6]) && ! empty($fieldvalue[6])) { |
|
| 275 | + $form_contents .= $fieldvalue[6]; |
|
| 276 | 276 | } |
| 277 | 277 | $this->CI->form_validation->set_rules($fieldvalue[2]['name'], $fieldvalue[0], $fieldvalue[3]); |
| 278 | - $form_contents.= '<div class="tooltips error_div pull-left no-padding" id="'.$fieldvalue[2]['name'].'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
|
| 279 | - $form_contents.= '<span class="popup_error error no-padding" id="'.$fieldvalue[2]['name'].'_error"> |
|
| 278 | + $form_contents .= '<div class="tooltips error_div pull-left no-padding" id="'.$fieldvalue[2]['name'].'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
|
| 279 | + $form_contents .= '<span class="popup_error error no-padding" id="'.$fieldvalue[2]['name'].'_error"> |
|
| 280 | 280 | </span></div>'; |
| 281 | 281 | } |
| 282 | 282 | /* |
@@ -284,98 +284,98 @@ discard block |
||
| 284 | 284 | */ |
| 285 | 285 | else if ($fieldvalue[1] == 'IMAGE') { |
| 286 | 286 | if (isset($this->CI->input->post)) |
| 287 | - $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 287 | + $fieldvalue[2]['value'] = ( ! $this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 288 | 288 | |
| 289 | 289 | else |
| 290 | 290 | $fieldvalue[2]['value'] = ($values) ? @$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
| 291 | 291 | $fieldvalue[2]['style'] = isset($fieldvalue[2]['style']) ? $fieldvalue[2]['style'] : ""; |
| 292 | - $form_contents.= form_image($fieldvalue[2], 'readonly',$fieldvalue[2]['style']); |
|
| 293 | - $form_contents.=@$fieldvalue[6]; |
|
| 292 | + $form_contents .= form_image($fieldvalue[2], 'readonly', $fieldvalue[2]['style']); |
|
| 293 | + $form_contents .= @$fieldvalue[6]; |
|
| 294 | 294 | $this->CI->form_validation->set_rules($fieldvalue[2]['name'], $fieldvalue[0], $fieldvalue[3]); |
| 295 | - $form_contents.= '<div class="tooltips error_div pull-left no-padding" id="'.$fieldvalue[2]['name'].'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
|
| 296 | - $form_contents.= '<span class="popup_error error no-padding" id="'.$fieldvalue[2]['name'].'_error"> |
|
| 295 | + $form_contents .= '<div class="tooltips error_div pull-left no-padding" id="'.$fieldvalue[2]['name'].'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
|
| 296 | + $form_contents .= '<span class="popup_error error no-padding" id="'.$fieldvalue[2]['name'].'_error"> |
|
| 297 | 297 | </span></div>'; |
| 298 | 298 | } |
| 299 | 299 | else if ($fieldvalue[1] == 'DEL_BUTTON') { |
| 300 | 300 | if (isset($this->CI->input->post)) |
| 301 | - $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 301 | + $fieldvalue[2]['value'] = ( ! $this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 302 | 302 | |
| 303 | 303 | else |
| 304 | 304 | $fieldvalue[2]['value'] = ($values) ? @$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
| 305 | 305 | $fieldvalue[2]['style'] = isset($fieldvalue[2]['style']) ? $fieldvalue[2]['style'] : ""; |
| 306 | - $form_contents.= form_img_delete($fieldvalue[2], 'readonly',$fieldvalue[2]['style']); |
|
| 307 | - $form_contents.=@$fieldvalue[6]; |
|
| 306 | + $form_contents .= form_img_delete($fieldvalue[2], 'readonly', $fieldvalue[2]['style']); |
|
| 307 | + $form_contents .= @$fieldvalue[6]; |
|
| 308 | 308 | $this->CI->form_validation->set_rules($fieldvalue[2]['name'], $fieldvalue[0], $fieldvalue[3]); |
| 309 | - $form_contents.= '<div class="tooltips error_div pull-left no-padding" id="'.$fieldvalue[2]['name'].'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
|
| 310 | - $form_contents.= '<span class="popup_error error no-padding" id="'.$fieldvalue[2]['name'].'_error"> |
|
| 309 | + $form_contents .= '<div class="tooltips error_div pull-left no-padding" id="'.$fieldvalue[2]['name'].'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
|
| 310 | + $form_contents .= '<span class="popup_error error no-padding" id="'.$fieldvalue[2]['name'].'_error"> |
|
| 311 | 311 | </span></div>'; |
| 312 | 312 | } |
| 313 | 313 | /**********************************************************************************/ |
| 314 | 314 | else if ($fieldvalue[1] == 'PASSWORD') { |
| 315 | 315 | if (isset($this->CI->input->post)) |
| 316 | - $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 316 | + $fieldvalue[2]['value'] = ( ! $this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 317 | 317 | else |
| 318 | - $fieldvalue[2]['value'] = ($values) ?@$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
| 319 | - $form_contents.= form_password($fieldvalue[2]); |
|
| 318 | + $fieldvalue[2]['value'] = ($values) ? @$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
| 319 | + $form_contents .= form_password($fieldvalue[2]); |
|
| 320 | 320 | $this->CI->form_validation->set_rules($fieldvalue[2]['name'], $fieldvalue[0], $fieldvalue[3]); |
| 321 | - $form_contents.= '<div class="tooltips error_div pull-left no-padding" id="'.$fieldvalue[2]['name'].'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
|
| 322 | - $form_contents.= '<span class="popup_error error no-padding" id="'.$fieldvalue[2]['name'].'_error"> |
|
| 321 | + $form_contents .= '<div class="tooltips error_div pull-left no-padding" id="'.$fieldvalue[2]['name'].'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
|
| 322 | + $form_contents .= '<span class="popup_error error no-padding" id="'.$fieldvalue[2]['name'].'_error"> |
|
| 323 | 323 | </span></div>'; |
| 324 | 324 | } else if ($fieldvalue[2] == 'CHECKBOX') { |
| 325 | 325 | $OptionArray = array(); |
| 326 | 326 | |
| 327 | - if(isset($fieldvalue[7]) && $fieldvalue[7] != '') |
|
| 327 | + if (isset($fieldvalue[7]) && $fieldvalue[7] != '') |
|
| 328 | 328 | $OptionArray = call_user_func_array(array($this->CI->common, $fieldvalue[7]), array($fieldvalue[6])); |
| 329 | - if (isset($this->CI->input->post)){ |
|
| 330 | - $fieldvalue[3]['value'] = (!$this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[3]['value'] : $this->CI->input->post($fieldvalue[1]); |
|
| 329 | + if (isset($this->CI->input->post)) { |
|
| 330 | + $fieldvalue[3]['value'] = ( ! $this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[3]['value'] : $this->CI->input->post($fieldvalue[1]); |
|
| 331 | 331 | } |
| 332 | 332 | else |
| 333 | 333 | { |
| 334 | - $fieldvalue[3]['value'] = ($values) ? (isset($values[$fieldvalue[1]]) && $values[$fieldvalue[1]] ? 1: 0) : @$fieldvalue[3]['value']; |
|
| 334 | + $fieldvalue[3]['value'] = ($values) ? (isset($values[$fieldvalue[1]]) && $values[$fieldvalue[1]] ? 1 : 0) : @$fieldvalue[3]['value']; |
|
| 335 | 335 | } |
| 336 | 336 | if ($fieldvalue[3]['value'] == "1") { |
| 337 | 337 | $checked = true; |
| 338 | 338 | } else { |
| 339 | 339 | $checked = false; |
| 340 | 340 | }; |
| 341 | - if(isset($fieldvalue[3]['table_name']) && $fieldvalue[3]['table_name'] != ""){ |
|
| 341 | + if (isset($fieldvalue[3]['table_name']) && $fieldvalue[3]['table_name'] != "") { |
|
| 342 | 342 | |
| 343 | - $form_contents.= form_checkbox($fieldvalue[1], $fieldvalue[3]['value'],$checked , $OptionArray); |
|
| 344 | - }else{ |
|
| 345 | - $form_contents.= form_checkbox($fieldvalue[1], $fieldvalue[3]['value'],$checked ,$OptionArray); |
|
| 343 | + $form_contents .= form_checkbox($fieldvalue[1], $fieldvalue[3]['value'], $checked, $OptionArray); |
|
| 344 | + } else { |
|
| 345 | + $form_contents .= form_checkbox($fieldvalue[1], $fieldvalue[3]['value'], $checked, $OptionArray); |
|
| 346 | 346 | } |
| 347 | 347 | } else if ($fieldvalue[1] == 'TEXTAREA') { |
| 348 | 348 | |
| 349 | 349 | if (isset($this->CI->input->post)) |
| 350 | - $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 350 | + $fieldvalue[2]['value'] = ( ! $this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 351 | 351 | else |
| 352 | 352 | $fieldvalue[2]['value'] = ($values) ? $values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
| 353 | - $form_contents.= form_textarea($fieldvalue[2]); |
|
| 353 | + $form_contents .= form_textarea($fieldvalue[2]); |
|
| 354 | 354 | } |
| 355 | 355 | else if ($fieldvalue[2] == 'RADIO') { |
| 356 | 356 | |
| 357 | - $form_contents.= form_radio($fieldvalue[1], $fieldvalue[3]['value'], $fieldvalue[3]['checked']); |
|
| 357 | + $form_contents .= form_radio($fieldvalue[1], $fieldvalue[3]['value'], $fieldvalue[3]['checked']); |
|
| 358 | 358 | } |
| 359 | - $form_contents.= '</li>'; |
|
| 359 | + $form_contents .= '</li>'; |
|
| 360 | 360 | } |
| 361 | 361 | |
| 362 | - $form_contents.= '</ul>'; |
|
| 363 | - $form_contents.= '</div>'; |
|
| 364 | - $form_contents.= '</div>'; |
|
| 362 | + $form_contents .= '</ul>'; |
|
| 363 | + $form_contents .= '</div>'; |
|
| 364 | + $form_contents .= '</div>'; |
|
| 365 | 365 | $i++; |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | - $form_contents.= '<center><div class="col-md-12 margin-t-20 margin-b-20">'; |
|
| 368 | + $form_contents .= '<center><div class="col-md-12 margin-t-20 margin-b-20">'; |
|
| 369 | 369 | |
| 370 | - $form_contents.= form_button($save); |
|
| 370 | + $form_contents .= form_button($save); |
|
| 371 | 371 | |
| 372 | 372 | if (isset($cancel)) { |
| 373 | - $form_contents.= form_button($cancel); |
|
| 373 | + $form_contents .= form_button($cancel); |
|
| 374 | 374 | } |
| 375 | - $form_contents.= '</center></div>'; |
|
| 376 | - $form_contents.= form_fieldset_close(); |
|
| 377 | - $form_contents.= form_close(); |
|
| 378 | - $form_contents.= '</div>'; |
|
| 375 | + $form_contents .= '</center></div>'; |
|
| 376 | + $form_contents .= form_fieldset_close(); |
|
| 377 | + $form_contents .= form_close(); |
|
| 378 | + $form_contents .= '</div>'; |
|
| 379 | 379 | |
| 380 | 380 | |
| 381 | 381 | return $form_contents; |
@@ -383,8 +383,8 @@ discard block |
||
| 383 | 383 | |
| 384 | 384 | function build_serach_form($fields_array) { |
| 385 | 385 | $form_contents = ''; |
| 386 | - $form_contents.= '<div>'; |
|
| 387 | - $form_contents.= form_open($fields_array['forms'][0], $fields_array['forms'][1]); |
|
| 386 | + $form_contents .= '<div>'; |
|
| 387 | + $form_contents .= form_open($fields_array['forms'][0], $fields_array['forms'][1]); |
|
| 388 | 388 | unset($fields_array['forms']); |
| 389 | 389 | $button_array = array(); |
| 390 | 390 | /******* |
@@ -397,13 +397,13 @@ discard block |
||
| 397 | 397 | $cancel = $fields_array['button_reset']; |
| 398 | 398 | unset($fields_array['button_reset']); |
| 399 | 399 | } |
| 400 | - $button_search_delete=''; |
|
| 400 | + $button_search_delete = ''; |
|
| 401 | 401 | if (isset($fields_array['button_search_delete'])) { |
| 402 | 402 | $button_search_delete = $fields_array['button_search_delete']; |
| 403 | 403 | unset($fields_array['button_search_delete']); |
| 404 | 404 | } |
| 405 | - if(isset($fields_array['display_in'])){ |
|
| 406 | - $display_in=$fields_array['display_in']; |
|
| 405 | + if (isset($fields_array['display_in'])) { |
|
| 406 | + $display_in = $fields_array['display_in']; |
|
| 407 | 407 | unset($fields_array['display_in']); |
| 408 | 408 | } |
| 409 | 409 | } |
@@ -411,31 +411,31 @@ discard block |
||
| 411 | 411 | $i = 1; |
| 412 | 412 | foreach ($fields_array as $fieldset_key => $form_fileds) { |
| 413 | 413 | |
| 414 | - $form_contents.= '<ul class="padding-15">'; |
|
| 415 | - $form_contents.= form_fieldset(gettext($fieldset_key),array('style' => 'font-weight:bold;'),"search"); |
|
| 414 | + $form_contents .= '<ul class="padding-15">'; |
|
| 415 | + $form_contents .= form_fieldset(gettext($fieldset_key), array('style' => 'font-weight:bold;'), "search"); |
|
| 416 | 416 | |
| 417 | 417 | foreach ($form_fileds as $fieldkey => $fieldvalue) { |
| 418 | 418 | if ($i == 0) { |
| 419 | - $form_contents.= '<li class="col-md-12">'; |
|
| 419 | + $form_contents .= '<li class="col-md-12">'; |
|
| 420 | 420 | } |
| 421 | - $form_contents.= '<div class="col-md-3 no-padding">'; |
|
| 421 | + $form_contents .= '<div class="col-md-3 no-padding">'; |
|
| 422 | 422 | if ($fieldvalue[1] == 'HIDDEN') { |
| 423 | - $form_contents.= form_hidden($fieldvalue[2], $fieldvalue[3]); |
|
| 423 | + $form_contents .= form_hidden($fieldvalue[2], $fieldvalue[3]); |
|
| 424 | 424 | } else { |
| 425 | - $form_contents.= form_label(gettext($fieldvalue[0]), "", array("class" => "search_label col-md-12 no-padding")); |
|
| 425 | + $form_contents .= form_label(gettext($fieldvalue[0]), "", array("class" => "search_label col-md-12 no-padding")); |
|
| 426 | 426 | } |
| 427 | 427 | if ($fieldvalue[1] == 'INPUT') { |
| 428 | - $form_contents.= form_input($fieldvalue[2]); |
|
| 428 | + $form_contents .= form_input($fieldvalue[2]); |
|
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | |
| 432 | 432 | if ($fieldvalue[2] == 'SELECT' || $fieldvalue[5] == '1') { |
| 433 | 433 | |
| 434 | 434 | if ($fieldvalue[7] != '' && $fieldvalue[8] != '') { |
| 435 | - $str = $fieldvalue[7] . "," . $fieldvalue[8]; |
|
| 435 | + $str = $fieldvalue[7].",".$fieldvalue[8]; |
|
| 436 | 436 | |
| 437 | 437 | $drp_array = call_user_func_array(array($this->CI->db_model, $fieldvalue[10]), array($str, $fieldvalue[9], $fieldvalue[11], $fieldvalue[12])); |
| 438 | - $form_contents.=form_dropdown_all(gettext($fieldvalue[1]), $drp_array, ''); |
|
| 438 | + $form_contents .= form_dropdown_all(gettext($fieldvalue[1]), $drp_array, ''); |
|
| 439 | 439 | } else { |
| 440 | 440 | |
| 441 | 441 | if ($fieldvalue[1] == 'INPUT') { |
@@ -443,54 +443,54 @@ discard block |
||
| 443 | 443 | } |
| 444 | 444 | |
| 445 | 445 | $drp_array = call_user_func_array(array($this->CI->common, $fieldvalue[10]), array($fieldvalue[9])); |
| 446 | - $form_contents.=form_dropdown_all_search(gettext($fieldvalue[1]), $drp_array, ''); |
|
| 446 | + $form_contents .= form_dropdown_all_search(gettext($fieldvalue[1]), $drp_array, ''); |
|
| 447 | 447 | } |
| 448 | 448 | } else if ($fieldvalue[1] == 'PASSWORD') { |
| 449 | - $form_contents.= form_password($fieldvalue[2]); |
|
| 449 | + $form_contents .= form_password($fieldvalue[2]); |
|
| 450 | 450 | } else if ($fieldvalue[2] == 'CHECKBOX') { |
| 451 | - $form_contents.= form_checkbox(gettext($fieldvalue[1]), $fieldvalue[3]['value'], $fieldvalue[3]['checked']); |
|
| 451 | + $form_contents .= form_checkbox(gettext($fieldvalue[1]), $fieldvalue[3]['value'], $fieldvalue[3]['checked']); |
|
| 452 | 452 | } |
| 453 | - $form_contents.= '</div>'; |
|
| 453 | + $form_contents .= '</div>'; |
|
| 454 | 454 | if ($i % 5 == 0) { |
| 455 | - $form_contents.= '</li>'; |
|
| 455 | + $form_contents .= '</li>'; |
|
| 456 | 456 | $i = 0; |
| 457 | 457 | } |
| 458 | 458 | $i++; |
| 459 | 459 | } |
| 460 | 460 | } |
| 461 | - $form_contents.= '<div class="col-md-12 margin-t-20 margin-b-20">'; |
|
| 462 | - $form_contents.= form_button($cancel); |
|
| 463 | - $form_contents.= form_button($save); |
|
| 464 | - if(!empty($display_in)){ |
|
| 465 | - $form_contents.="<div class='col-md-5 pull-right'>"; |
|
| 466 | - $form_contents.="<div class='col-md-3'></div>"; |
|
| 467 | - $extra_parameters['class']=$display_in['label_class']; |
|
| 468 | - $extra_parameters['style']=$display_in['label_style']; |
|
| 469 | - $form_contents.=form_label($display_in['content'], "",$extra_parameters); |
|
| 470 | - $drp_array = call_user_func_array(array($this->CI->common,$display_in['function']),array()); |
|
| 471 | - $extra_parameters['class']=$display_in['dropdown_class']; |
|
| 472 | - $extra_parameters['style']=$display_in['dropdown_style']; |
|
| 473 | - $form_contents.=form_dropdown_all_search($display_in, $drp_array, '',$extra_parameters); |
|
| 474 | - $form_contents.="</div>"; |
|
| 461 | + $form_contents .= '<div class="col-md-12 margin-t-20 margin-b-20">'; |
|
| 462 | + $form_contents .= form_button($cancel); |
|
| 463 | + $form_contents .= form_button($save); |
|
| 464 | + if ( ! empty($display_in)) { |
|
| 465 | + $form_contents .= "<div class='col-md-5 pull-right'>"; |
|
| 466 | + $form_contents .= "<div class='col-md-3'></div>"; |
|
| 467 | + $extra_parameters['class'] = $display_in['label_class']; |
|
| 468 | + $extra_parameters['style'] = $display_in['label_style']; |
|
| 469 | + $form_contents .= form_label($display_in['content'], "", $extra_parameters); |
|
| 470 | + $drp_array = call_user_func_array(array($this->CI->common, $display_in['function']), array()); |
|
| 471 | + $extra_parameters['class'] = $display_in['dropdown_class']; |
|
| 472 | + $extra_parameters['style'] = $display_in['dropdown_style']; |
|
| 473 | + $form_contents .= form_dropdown_all_search($display_in, $drp_array, '', $extra_parameters); |
|
| 474 | + $form_contents .= "</div>"; |
|
| 475 | 475 | } |
| 476 | - if(isset($button_search_delete) && $button_search_delete != ''){ |
|
| 477 | - $form_contents.= form_button($button_search_delete); |
|
| 476 | + if (isset($button_search_delete) && $button_search_delete != '') { |
|
| 477 | + $form_contents .= form_button($button_search_delete); |
|
| 478 | 478 | } |
| 479 | - $form_contents.='<div class="col-md-12 no-padding margin-t-15" style=""> |
|
| 479 | + $form_contents .= '<div class="col-md-12 no-padding margin-t-15" style=""> |
|
| 480 | 480 | <div class="pull-right btn-close" id="global_clearsearch_filter">Close</div> |
| 481 | 481 | </div>'; |
| 482 | - $form_contents.= '</ul>'; |
|
| 483 | - $form_contents.= '</div>'; |
|
| 484 | - $form_contents.= form_fieldset_close(); |
|
| 485 | - $form_contents.= form_close(); |
|
| 486 | - $form_contents.= '</div>'; |
|
| 482 | + $form_contents .= '</ul>'; |
|
| 483 | + $form_contents .= '</div>'; |
|
| 484 | + $form_contents .= form_fieldset_close(); |
|
| 485 | + $form_contents .= form_close(); |
|
| 486 | + $form_contents .= '</div>'; |
|
| 487 | 487 | |
| 488 | 488 | return $form_contents; |
| 489 | 489 | } |
| 490 | 490 | function build_batchupdate_form($fields_array) { |
| 491 | 491 | $form_contents = ''; |
| 492 | - $form_contents.= '<div >'; |
|
| 493 | - $form_contents.= form_open($fields_array['forms'][0], $fields_array['forms'][1]); |
|
| 492 | + $form_contents .= '<div >'; |
|
| 493 | + $form_contents .= form_open($fields_array['forms'][0], $fields_array['forms'][1]); |
|
| 494 | 494 | unset($fields_array['forms']); |
| 495 | 495 | $button_array = array(); |
| 496 | 496 | if (isset($fields_array['button_search']) || isset($fields_array['button_reset'])) { |
@@ -504,69 +504,69 @@ discard block |
||
| 504 | 504 | $i = 1; |
| 505 | 505 | foreach ($fields_array as $fieldset_key => $form_fileds) { |
| 506 | 506 | |
| 507 | - $form_contents.= '<ul>'; |
|
| 508 | - $form_contents.= form_fieldset(gettext($fieldset_key), array('style' => 'margin-left:-22px;font-weight:bold;')); |
|
| 507 | + $form_contents .= '<ul>'; |
|
| 508 | + $form_contents .= form_fieldset(gettext($fieldset_key), array('style' => 'margin-left:-22px;font-weight:bold;')); |
|
| 509 | 509 | foreach ($form_fileds as $fieldkey => $fieldvalue) { |
| 510 | 510 | if ($i == 0) { |
| 511 | - $form_contents.= '<li>'; |
|
| 511 | + $form_contents .= '<li>'; |
|
| 512 | 512 | } |
| 513 | - $form_contents.= '<div class="col-md-4 no-padding">'; |
|
| 513 | + $form_contents .= '<div class="col-md-4 no-padding">'; |
|
| 514 | 514 | if ($fieldvalue[1] == 'HIDDEN') { |
| 515 | - $form_contents.= form_hidden($fieldvalue[2], $fieldvalue[3]); |
|
| 515 | + $form_contents .= form_hidden($fieldvalue[2], $fieldvalue[3]); |
|
| 516 | 516 | } else { |
| 517 | - $form_contents.= form_label(gettext($fieldvalue[0]), "", array("class" => "search_label col-md-12 no-padding")); |
|
| 517 | + $form_contents .= form_label(gettext($fieldvalue[0]), "", array("class" => "search_label col-md-12 no-padding")); |
|
| 518 | 518 | } |
| 519 | 519 | if ($fieldvalue[2] == 'SELECT' || $fieldvalue[5] == '1') { |
| 520 | 520 | if ($fieldvalue[7] != '' && $fieldvalue[8] != '') { |
| 521 | - $str = $fieldvalue[7] . "," . $fieldvalue[8]; |
|
| 522 | - if(is_array($fieldvalue[13])){ |
|
| 521 | + $str = $fieldvalue[7].",".$fieldvalue[8]; |
|
| 522 | + if (is_array($fieldvalue[13])) { |
|
| 523 | 523 | $drp_array = call_user_func_array(array($this->CI->common, $fieldvalue[14]), array($fieldvalue[13])); |
| 524 | - $form_contents.=form_dropdown($fieldvalue[13], $drp_array, ''); |
|
| 524 | + $form_contents .= form_dropdown($fieldvalue[13], $drp_array, ''); |
|
| 525 | 525 | } |
| 526 | 526 | /** |
| 527 | 527 | ASTPP 3.0 |
| 528 | 528 | Reseller Batch Update |
| 529 | 529 | **/ |
| 530 | - if($fieldvalue[10] == 'set_status'){ |
|
| 531 | - $drp_array =array('0'=>'Active','1'=>'Inactive'); |
|
| 530 | + if ($fieldvalue[10] == 'set_status') { |
|
| 531 | + $drp_array = array('0'=>'Active', '1'=>'Inactive'); |
|
| 532 | 532 | } |
| 533 | 533 | /************************************************************/ |
| 534 | - else{ |
|
| 535 | - $drp_array = call_user_func_array(array($this->CI->db_model, $fieldvalue[10]), array($str, $fieldvalue[9], $fieldvalue[11], $fieldvalue[12]));} |
|
| 536 | - $form_contents.=form_dropdown_all($fieldvalue[1], $drp_array, ''); |
|
| 534 | + else { |
|
| 535 | + $drp_array = call_user_func_array(array($this->CI->db_model, $fieldvalue[10]), array($str, $fieldvalue[9], $fieldvalue[11], $fieldvalue[12])); } |
|
| 536 | + $form_contents .= form_dropdown_all($fieldvalue[1], $drp_array, ''); |
|
| 537 | 537 | } else { |
| 538 | 538 | if ($fieldvalue[1] == 'INPUT') { |
| 539 | 539 | $drp_name = $fieldvalue[6]; |
| 540 | 540 | } |
| 541 | 541 | $drp_array = call_user_func_array(array($this->CI->common, $fieldvalue[10]), array($fieldvalue[9])); |
| 542 | - $form_contents.=form_dropdown($drp_name, $drp_array, ''); |
|
| 542 | + $form_contents .= form_dropdown($drp_name, $drp_array, ''); |
|
| 543 | 543 | } |
| 544 | 544 | } |
| 545 | 545 | if ($fieldvalue[1] == 'INPUT') { |
| 546 | - $form_contents.= form_input($fieldvalue[2]); |
|
| 546 | + $form_contents .= form_input($fieldvalue[2]); |
|
| 547 | 547 | } else if ($fieldvalue[2] == 'CHECKBOX') { |
| 548 | - $form_contents.= form_checkbox($fieldvalue[1], $fieldvalue[3]['value'], $fieldvalue[3]['checked']); |
|
| 548 | + $form_contents .= form_checkbox($fieldvalue[1], $fieldvalue[3]['value'], $fieldvalue[3]['checked']); |
|
| 549 | 549 | } |
| 550 | - $form_contents.= '</div>'; |
|
| 550 | + $form_contents .= '</div>'; |
|
| 551 | 551 | if ($i % 5 == 0) { |
| 552 | - $form_contents.= '</li>'; |
|
| 552 | + $form_contents .= '</li>'; |
|
| 553 | 553 | $i = 0; |
| 554 | 554 | } |
| 555 | 555 | $i++; |
| 556 | 556 | } |
| 557 | 557 | } |
| 558 | 558 | |
| 559 | - $form_contents.= '</ul>'; |
|
| 560 | - $form_contents.= '<div class="col-md-12 margin-t-20 margin-b-20">'; |
|
| 559 | + $form_contents .= '</ul>'; |
|
| 560 | + $form_contents .= '<div class="col-md-12 margin-t-20 margin-b-20">'; |
|
| 561 | 561 | |
| 562 | - $form_contents.= form_button($cancel); |
|
| 563 | - $form_contents.= form_button($save); |
|
| 564 | - $form_contents.='<div class="col-md-12 no-padding margin-t-15" style="margin-bottom:10px; !important"> |
|
| 562 | + $form_contents .= form_button($cancel); |
|
| 563 | + $form_contents .= form_button($save); |
|
| 564 | + $form_contents .= '<div class="col-md-12 no-padding margin-t-15" style="margin-bottom:10px; !important"> |
|
| 565 | 565 | <div class="pull-right btn-close" id="global_clearbatchupdate_filter">Close</div></div>'; |
| 566 | - $form_contents.= form_fieldset_close(); |
|
| 567 | - $form_contents.= form_close(); |
|
| 568 | - $form_contents.= '</div>'; |
|
| 569 | - $form_contents.= '</div>'; |
|
| 566 | + $form_contents .= form_fieldset_close(); |
|
| 567 | + $form_contents .= form_close(); |
|
| 568 | + $form_contents .= '</div>'; |
|
| 569 | + $form_contents .= '</div>'; |
|
| 570 | 570 | |
| 571 | 571 | return $form_contents; |
| 572 | 572 | } |
@@ -598,21 +598,21 @@ discard block |
||
| 598 | 598 | ASTPP 3.0 |
| 599 | 599 | For Edit on Account number or name |
| 600 | 600 | */ |
| 601 | - $row_id = isset($row['id']) ? $row["id"]: ''; |
|
| 601 | + $row_id = isset($row['id']) ? $row["id"] : ''; |
|
| 602 | 602 | /*****************************/ |
| 603 | 603 | foreach ($grid_fields as $field_key => $field_arr) { |
| 604 | 604 | /** |
| 605 | 605 | ASTPP 3.0 |
| 606 | 606 | For Edit on Account number or name |
| 607 | 607 | **/ |
| 608 | - $Actionkey = array_search(gettext('Action'), $this->CI->common->array_column($grid_fields,0)); |
|
| 608 | + $Actionkey = array_search(gettext('Action'), $this->CI->common->array_column($grid_fields, 0)); |
|
| 609 | 609 | /*********************************/ |
| 610 | 610 | if ($field_arr[2] != "") { |
| 611 | 611 | if ($field_arr[3] != "") { |
| 612 | - if($field_arr[2]=="status"){ |
|
| 612 | + if ($field_arr[2] == "status") { |
|
| 613 | 613 | $row['id'] = $row_id; |
| 614 | 614 | $jsn_tmp[$field_key] = call_user_func_array(array($this->CI->common, $field_arr[5]), array($field_arr[3], $field_arr[4], $row)); |
| 615 | - }else{ |
|
| 615 | + } else { |
|
| 616 | 616 | $jsn_tmp[$field_key] = call_user_func_array(array($this->CI->common, $field_arr[5]), array($field_arr[3], $field_arr[4], $row[$field_arr[2]])); |
| 617 | 617 | } |
| 618 | 618 | |
@@ -621,53 +621,53 @@ discard block |
||
| 621 | 621 | For Edit on Account number or name |
| 622 | 622 | **/ |
| 623 | 623 | $row[$field_arr[2]] = $jsn_tmp[$field_key]; |
| 624 | - } if(array_search("EDITABLE", $field_arr)){ |
|
| 624 | + } if (array_search("EDITABLE", $field_arr)) { |
|
| 625 | 625 | $ActionArr = $grid_fields[$Actionkey]; |
| 626 | - if($ActionArr[5]->EDIT->url =="accounts/customer_edit/" || $ActionArr[5]->EDIT->url =="accounts/provider_edit/"){ |
|
| 627 | - $ActionArr[5]->EDIT->url=$row['type']==0 ? "accounts/customer_edit/" : "accounts/provider_edit/"; |
|
| 626 | + if ($ActionArr[5]->EDIT->url == "accounts/customer_edit/" || $ActionArr[5]->EDIT->url == "accounts/provider_edit/") { |
|
| 627 | + $ActionArr[5]->EDIT->url = $row['type'] == 0 ? "accounts/customer_edit/" : "accounts/provider_edit/"; |
|
| 628 | 628 | } |
| 629 | - if($ActionArr[5]->EDIT->url =="accounts/admin_edit/" || $ActionArr[5]->EDIT->url =="accounts/subadmin_edit/"){ |
|
| 630 | - $ActionArr[5]->EDIT->url=$row['type']==4 ? "accounts/subadmin_edit/" : "accounts/admin_edit/"; |
|
| 629 | + if ($ActionArr[5]->EDIT->url == "accounts/admin_edit/" || $ActionArr[5]->EDIT->url == "accounts/subadmin_edit/") { |
|
| 630 | + $ActionArr[5]->EDIT->url = $row['type'] == 4 ? "accounts/subadmin_edit/" : "accounts/admin_edit/"; |
|
| 631 | 631 | } |
| 632 | 632 | $acctype = ""; |
| 633 | - if(isset($row["type"]) && ($row["type"] == '0' || $row["type"] == '1' || $row["type"] == '3')){ |
|
| 634 | - $acctype = (isset($row["posttoexternal"]) && $row["posttoexternal"] != '')? "<span class='label label-default pull-right'>".$this->CI->common->get_account_type("","",$row["posttoexternal"])."</span>":""; |
|
| 633 | + if (isset($row["type"]) && ($row["type"] == '0' || $row["type"] == '1' || $row["type"] == '3')) { |
|
| 634 | + $acctype = (isset($row["posttoexternal"]) && $row["posttoexternal"] != '') ? "<span class='label label-default pull-right'>".$this->CI->common->get_account_type("", "", $row["posttoexternal"])."</span>" : ""; |
|
| 635 | 635 | } |
| 636 | 636 | |
| 637 | - $fieldstr = $this->CI->common->build_custome_edit_button($ActionArr[5]->EDIT,$row[$field_arr[2]],$row["id"]); |
|
| 638 | - if($acctype != ''){ |
|
| 637 | + $fieldstr = $this->CI->common->build_custome_edit_button($ActionArr[5]->EDIT, $row[$field_arr[2]], $row["id"]); |
|
| 638 | + if ($acctype != '') { |
|
| 639 | 639 | $jsn_tmp[$field_key] = $fieldstr."<br/>".$acctype; |
| 640 | - }else{ |
|
| 640 | + } else { |
|
| 641 | 641 | $jsn_tmp[$field_key] = $fieldstr; |
| 642 | 642 | } |
| 643 | 643 | |
| 644 | 644 | |
| 645 | 645 | /*********************************/ |
| 646 | - }else { |
|
| 646 | + } else { |
|
| 647 | 647 | $jsn_tmp[$field_key] = $row[$field_arr[2]]; |
| 648 | 648 | } |
| 649 | 649 | } else { |
| 650 | 650 | if ($field_arr[0] == gettext("Action")) { |
| 651 | - if(isset($field_arr[5]) && isset($field_arr[5]->EDIT) && isset($field_arr[5]->DELETE)){ |
|
| 651 | + if (isset($field_arr[5]) && isset($field_arr[5]->EDIT) && isset($field_arr[5]->DELETE)) { |
|
| 652 | 652 | |
| 653 | - if($field_arr[5]->EDIT->url == 'accounts/customer_edit/' || $field_arr[5]->EDIT->url == 'accounts/provider_edit/' || $field_arr[5]->DELETE->url == 'accounts/provider_delete/' ||$field_arr[5]->DELETE->url == 'accounts/customer_delete/'){ |
|
| 654 | - if( $row['type'] == '0'|| strtolower($row['type']) == 'customer'){ |
|
| 655 | - $field_arr[5]->EDIT->url ='accounts/customer_edit/'; |
|
| 656 | - $field_arr[5]->DELETE->url ='accounts/customer_delete/'; |
|
| 653 | + if ($field_arr[5]->EDIT->url == 'accounts/customer_edit/' || $field_arr[5]->EDIT->url == 'accounts/provider_edit/' || $field_arr[5]->DELETE->url == 'accounts/provider_delete/' || $field_arr[5]->DELETE->url == 'accounts/customer_delete/') { |
|
| 654 | + if ($row['type'] == '0' || strtolower($row['type']) == 'customer') { |
|
| 655 | + $field_arr[5]->EDIT->url = 'accounts/customer_edit/'; |
|
| 656 | + $field_arr[5]->DELETE->url = 'accounts/customer_delete/'; |
|
| 657 | 657 | } |
| 658 | - if($row['type'] == 3 || strtolower($row['type']) == 'provider'){ |
|
| 659 | - $field_arr[5]->EDIT->url ='accounts/provider_edit/'; |
|
| 660 | - $field_arr[5]->DELETE->url ='accounts/provider_delete/'; |
|
| 658 | + if ($row['type'] == 3 || strtolower($row['type']) == 'provider') { |
|
| 659 | + $field_arr[5]->EDIT->url = 'accounts/provider_edit/'; |
|
| 660 | + $field_arr[5]->DELETE->url = 'accounts/provider_delete/'; |
|
| 661 | 661 | } |
| 662 | 662 | } |
| 663 | - if($field_arr[5]->EDIT->url == 'accounts/admin_edit/' || $field_arr[5]->EDIT->url == 'accounts/subadmin_edit/' || $field_arr[5]->DELETE->url == 'accounts/admin_delete/' ||$field_arr[5]->DELETE->url == 'accounts/subadmin_delete/'){ |
|
| 664 | - if($row['type'] == 2 || strtolower($row['type']) == 'administrator'){ |
|
| 665 | - $field_arr[5]->EDIT->url ='accounts/admin_edit/'; |
|
| 666 | - $field_arr[5]->DELETE->url ='accounts/admin_delete/'; |
|
| 663 | + if ($field_arr[5]->EDIT->url == 'accounts/admin_edit/' || $field_arr[5]->EDIT->url == 'accounts/subadmin_edit/' || $field_arr[5]->DELETE->url == 'accounts/admin_delete/' || $field_arr[5]->DELETE->url == 'accounts/subadmin_delete/') { |
|
| 664 | + if ($row['type'] == 2 || strtolower($row['type']) == 'administrator') { |
|
| 665 | + $field_arr[5]->EDIT->url = 'accounts/admin_edit/'; |
|
| 666 | + $field_arr[5]->DELETE->url = 'accounts/admin_delete/'; |
|
| 667 | 667 | } |
| 668 | - if($row['type'] == 4 || strtolower($row['type']) == 'sub admin'){ |
|
| 669 | - $field_arr[5]->EDIT->url ='accounts/subadmin_edit/'; |
|
| 670 | - $field_arr[5]->DELETE->url ='accounts/subadmin_delete/'; |
|
| 668 | + if ($row['type'] == 4 || strtolower($row['type']) == 'sub admin') { |
|
| 669 | + $field_arr[5]->EDIT->url = 'accounts/subadmin_edit/'; |
|
| 670 | + $field_arr[5]->DELETE->url = 'accounts/subadmin_delete/'; |
|
| 671 | 671 | } |
| 672 | 672 | } |
| 673 | 673 | } |
@@ -678,16 +678,16 @@ discard block |
||
| 678 | 678 | $jsn_tmp[$field_key] = $this->CI->common->get_action_buttons($field_arr[5], $row_id); |
| 679 | 679 | /****************************************************************************/ |
| 680 | 680 | } |
| 681 | - elseif($field_arr[0] == gettext("Profile Action")) |
|
| 681 | + elseif ($field_arr[0] == gettext("Profile Action")) |
|
| 682 | 682 | { |
| 683 | - if(isset($field_arr[5]) && isset($field_arr[5]->START) && isset($field_arr[5]->STOP) && isset($field_arr[5]->RELOAD) && isset($field_arr[5]->RESCAN)){ |
|
| 683 | + if (isset($field_arr[5]) && isset($field_arr[5]->START) && isset($field_arr[5]->STOP) && isset($field_arr[5]->RELOAD) && isset($field_arr[5]->RESCAN)) { |
|
| 684 | 684 | } |
| 685 | 685 | $jsn_tmp[$field_key] = $this->CI->common->get_action_buttons($field_arr[5], $row["id"]); |
| 686 | 686 | |
| 687 | 687 | } |
| 688 | 688 | else { |
| 689 | - $className = (isset($field_arr['9']) && $field_arr['9'] != '')?$field_arr['9']:"chkRefNos"; |
|
| 690 | - $jsn_tmp[$field_key] = '<input type="checkbox" name="chkAll" id=' . $row['id'] . ' class="ace '.$className.'" onclick="clickchkbox(' . $row['id'] . ')" value=' . $row['id'] . '><lable class="lbl"></lable>'; } |
|
| 689 | + $className = (isset($field_arr['9']) && $field_arr['9'] != '') ? $field_arr['9'] : "chkRefNos"; |
|
| 690 | + $jsn_tmp[$field_key] = '<input type="checkbox" name="chkAll" id='.$row['id'].' class="ace '.$className.'" onclick="clickchkbox('.$row['id'].')" value='.$row['id'].'><lable class="lbl"></lable>'; } |
|
| 691 | 691 | } |
| 692 | 692 | } |
| 693 | 693 | $json_data[] = array('cell' => $jsn_tmp); |
@@ -701,20 +701,20 @@ discard block |
||
| 701 | 701 | $json_data = array(); |
| 702 | 702 | foreach ($query as $row) { |
| 703 | 703 | foreach ($grid_fields as $field_key => $field_arr) { |
| 704 | - $row_id = isset($row['id']) ? $row["id"]: ''; |
|
| 704 | + $row_id = isset($row['id']) ? $row["id"] : ''; |
|
| 705 | 705 | /** |
| 706 | 706 | ASTPP 3.0 |
| 707 | 707 | For Edit on Account number or name |
| 708 | 708 | **/ |
| 709 | - $Actionkey = array_search('Action',$this->CI->common->array_column($grid_fields,0)); |
|
| 709 | + $Actionkey = array_search('Action', $this->CI->common->array_column($grid_fields, 0)); |
|
| 710 | 710 | /*******************************/ |
| 711 | 711 | |
| 712 | 712 | if ($field_arr[2] != "") { |
| 713 | 713 | if ($field_arr[3] != "") { |
| 714 | - if($field_arr[2]=="status"){ |
|
| 714 | + if ($field_arr[2] == "status") { |
|
| 715 | 715 | $row['id'] = $row_id; |
| 716 | 716 | $jsn_tmp[$field_key] = call_user_func_array(array($this->CI->common, $field_arr[5]), array($field_arr[3], $field_arr[4], $row)); |
| 717 | - }else{ |
|
| 717 | + } else { |
|
| 718 | 718 | $jsn_tmp[$field_key] = call_user_func_array(array($this->CI->common, $field_arr[5]), array($field_arr[3], $field_arr[4], $row[$field_arr[2]])); |
| 719 | 719 | } |
| 720 | 720 | /** |
@@ -722,17 +722,17 @@ discard block |
||
| 722 | 722 | For Edit on Account number or name |
| 723 | 723 | **/ |
| 724 | 724 | $row[$field_arr[2]] = $jsn_tmp[$field_key]; |
| 725 | - } if(array_search("EDITABLE", $field_arr)){ |
|
| 725 | + } if (array_search("EDITABLE", $field_arr)) { |
|
| 726 | 726 | $ActionArr = $grid_fields[$Actionkey]; |
| 727 | - if($ActionArr[5]->EDIT->url =="accounts/customer_edit/" || $ActionArr[5]->EDIT->url =="accounts/provider_edit/"){ |
|
| 728 | - $ActionArr[5]->EDIT->url=$row['type']==0 ? "accounts/customer_edit/" : "accounts/provider_edit/"; |
|
| 727 | + if ($ActionArr[5]->EDIT->url == "accounts/customer_edit/" || $ActionArr[5]->EDIT->url == "accounts/provider_edit/") { |
|
| 728 | + $ActionArr[5]->EDIT->url = $row['type'] == 0 ? "accounts/customer_edit/" : "accounts/provider_edit/"; |
|
| 729 | 729 | } |
| 730 | - if($ActionArr[5]->EDIT->url =="accounts/admin_edit/" || $ActionArr[5]->EDIT->url =="accounts/subadmin_edit/"){ |
|
| 731 | - $ActionArr[5]->EDIT->url=$row['type']==4 ? "accounts/subadmin_edit/" : "accounts/admin_edit/"; |
|
| 730 | + if ($ActionArr[5]->EDIT->url == "accounts/admin_edit/" || $ActionArr[5]->EDIT->url == "accounts/subadmin_edit/") { |
|
| 731 | + $ActionArr[5]->EDIT->url = $row['type'] == 4 ? "accounts/subadmin_edit/" : "accounts/admin_edit/"; |
|
| 732 | 732 | } |
| 733 | - $jsn_tmp[$field_key] = $this->CI->common->build_custome_edit_button($ActionArr[5]->EDIT,$row[$field_arr[2]],$row["id"]); |
|
| 733 | + $jsn_tmp[$field_key] = $this->CI->common->build_custome_edit_button($ActionArr[5]->EDIT, $row[$field_arr[2]], $row["id"]); |
|
| 734 | 734 | /*******************************/ |
| 735 | - }else { |
|
| 735 | + } else { |
|
| 736 | 736 | $jsn_tmp[$field_key] = isset($row[$field_arr[2]]) ? $row[$field_arr[2]] : ""; |
| 737 | 737 | } |
| 738 | 738 | } else { |
@@ -740,7 +740,7 @@ discard block |
||
| 740 | 740 | $jsn_tmp[$field_key] = $this->CI->common->get_action_buttons($field_arr[5], $row["id"]); |
| 741 | 741 | } |
| 742 | 742 | else { |
| 743 | - $jsn_tmp[$field_key] = '<input type="checkbox" name="chkAll" id=' . $row['id'] . ' class="ace chkRefNos" onclick="clickchkbox(' . $row['id'] . ')" value=' . $row['id'] . '><lable class="lbl"></lable>'; |
|
| 743 | + $jsn_tmp[$field_key] = '<input type="checkbox" name="chkAll" id='.$row['id'].' class="ace chkRefNos" onclick="clickchkbox('.$row['id'].')" value='.$row['id'].'><lable class="lbl"></lable>'; |
|
| 744 | 744 | } |
| 745 | 745 | } |
| 746 | 746 | } |
@@ -21,8 +21,9 @@ discard block |
||
| 21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | 22 | ############################################################################### |
| 23 | 23 | |
| 24 | -if ( ! defined('BASEPATH')) |
|
| 24 | +if ( ! defined('BASEPATH')) { |
|
| 25 | 25 | exit('No direct script access allowed'); |
| 26 | +} |
|
| 26 | 27 | |
| 27 | 28 | /** |
| 28 | 29 | * Dynamically build forms for display |
@@ -137,10 +138,11 @@ discard block |
||
| 137 | 138 | foreach ($form_fileds as $fieldkey => $fieldvalue) { |
| 138 | 139 | $form_contents .= '<li class="col-md-12">'; |
| 139 | 140 | if ($fieldvalue[1] == 'HIDDEN') { |
| 140 | - if (isset($this->CI->input->post)) |
|
| 141 | - $fieldvalue[2]['value'] = ( ! $this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 142 | - else |
|
| 143 | - $fieldvalue[2]['value'] = ($values) ? (isset($values[$fieldvalue[2]['name']]) ? $values[$fieldvalue[2]['name']] : '') : (isset($fieldvalue[2]['value']) ? $fieldvalue[2]['value'] : ''); |
|
| 141 | + if (isset($this->CI->input->post)) { |
|
| 142 | + $fieldvalue[2]['value'] = ( ! $this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 143 | + } else { |
|
| 144 | + $fieldvalue[2]['value'] = ($values) ? (isset($values[$fieldvalue[2]['name']]) ? $values[$fieldvalue[2]['name']] : '') : (isset($fieldvalue[2]['value']) ? $fieldvalue[2]['value'] : ''); |
|
| 145 | + } |
|
| 144 | 146 | $form_contents .= form_hidden($fieldvalue[2]['name'], $fieldvalue[2]['value']); |
| 145 | 147 | } else { |
| 146 | 148 | $validation_arr = array(); |
@@ -148,8 +150,7 @@ discard block |
||
| 148 | 150 | if ( ! empty($fieldvalue[3])) { |
| 149 | 151 | $validation_arr = explode("|", $fieldvalue[3]); |
| 150 | 152 | } |
| 151 | - } |
|
| 152 | - elseif ($fieldvalue[2] == 'SELECT') { |
|
| 153 | + } elseif ($fieldvalue[2] == 'SELECT') { |
|
| 153 | 154 | |
| 154 | 155 | if (is_array($fieldvalue[4])) { |
| 155 | 156 | $validation_arr = explode("|", $fieldvalue[4]['rules']); |
@@ -199,16 +200,16 @@ discard block |
||
| 199 | 200 | |
| 200 | 201 | if(isset($fieldvalue[1]['name'])){ |
| 201 | 202 | $fieldvalue_pass=$fieldvalue[1]['name']; |
| 202 | - }else{ |
|
| 203 | + } else{ |
|
| 203 | 204 | $fieldvalue_pass=$fieldvalue[1]; |
| 204 | 205 | } |
| 205 | 206 | |
| 206 | 207 | $this->CI->form_validation->set_rules($fieldvalue_pass, $fieldvalue[0], $fieldvalue[4]['rules']); |
| 207 | - }else{ |
|
| 208 | + } else{ |
|
| 208 | 209 | |
| 209 | 210 | if(isset($fieldvalue[1]['name'])){ |
| 210 | 211 | $fieldvalue_pass=$fieldvalue[1]['name']; |
| 211 | - }else{ |
|
| 212 | + } else{ |
|
| 212 | 213 | $fieldvalue_pass=$fieldvalue[1]; |
| 213 | 214 | } |
| 214 | 215 | |
@@ -245,10 +246,11 @@ discard block |
||
| 245 | 246 | /* For multi select code */ |
| 246 | 247 | $str = $fieldvalue[7] . "," . $fieldvalue[8]; |
| 247 | 248 | |
| 248 | - if (isset($this->CI->input->post)) |
|
| 249 | - $fieldvalue['value'] = (!$this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[1] : $this->CI->input->post($fieldvalue[1]); |
|
| 250 | - else |
|
| 251 | - $fieldvalue['value'] = ($values) ? @$values[$fieldvalue[1]] : @$fieldvalue[1]; |
|
| 249 | + if (isset($this->CI->input->post)) { |
|
| 250 | + $fieldvalue['value'] = (!$this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[1] : $this->CI->input->post($fieldvalue[1]); |
|
| 251 | + } else { |
|
| 252 | + $fieldvalue['value'] = ($values) ? @$values[$fieldvalue[1]] : @$fieldvalue[1]; |
|
| 253 | + } |
|
| 252 | 254 | |
| 253 | 255 | $drp_array = call_user_func_array(array($this->CI->db_model, $fieldvalue[10]), array($str, $fieldvalue[9], $fieldvalue[11], $fieldvalue[12])); |
| 254 | 256 | if ($fieldset_key === 'System Configuration Information') { |
@@ -265,9 +267,9 @@ discard block |
||
| 265 | 267 | } else if ($fieldvalue[1] == 'INPUT') { |
| 266 | 268 | |
| 267 | 269 | |
| 268 | - if (isset($this->CI->input->post)) |
|
| 269 | - $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? $fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 270 | - else{ |
|
| 270 | + if (isset($this->CI->input->post)) { |
|
| 271 | + $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? $fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 272 | + } else{ |
|
| 271 | 273 | $fieldvalue[2]['value'] = ($values) ? (isset($values[$fieldvalue[2]['name']]) ? $values[$fieldvalue[2]['name']] : ''):(isset($fieldvalue[2]['value']) ? $fieldvalue[2]['value'] :''); |
| 272 | 274 | } |
| 273 | 275 | $form_contents.= form_input($fieldvalue[2], 'readonly'); |
@@ -283,11 +285,11 @@ discard block |
||
| 283 | 285 | * Image upload from invoice configuration code. |
| 284 | 286 | */ |
| 285 | 287 | else if ($fieldvalue[1] == 'IMAGE') { |
| 286 | - if (isset($this->CI->input->post)) |
|
| 287 | - $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 288 | - |
|
| 289 | - else |
|
| 290 | - $fieldvalue[2]['value'] = ($values) ? @$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
| 288 | + if (isset($this->CI->input->post)) { |
|
| 289 | + $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 290 | + } else { |
|
| 291 | + $fieldvalue[2]['value'] = ($values) ? @$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
| 292 | + } |
|
| 291 | 293 | $fieldvalue[2]['style'] = isset($fieldvalue[2]['style']) ? $fieldvalue[2]['style'] : ""; |
| 292 | 294 | $form_contents.= form_image($fieldvalue[2], 'readonly',$fieldvalue[2]['style']); |
| 293 | 295 | $form_contents.=@$fieldvalue[6]; |
@@ -295,13 +297,12 @@ discard block |
||
| 295 | 297 | $form_contents.= '<div class="tooltips error_div pull-left no-padding" id="'.$fieldvalue[2]['name'].'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
| 296 | 298 | $form_contents.= '<span class="popup_error error no-padding" id="'.$fieldvalue[2]['name'].'_error"> |
| 297 | 299 | </span></div>'; |
| 298 | - } |
|
| 299 | - else if ($fieldvalue[1] == 'DEL_BUTTON') { |
|
| 300 | - if (isset($this->CI->input->post)) |
|
| 301 | - $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 302 | - |
|
| 303 | - else |
|
| 304 | - $fieldvalue[2]['value'] = ($values) ? @$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
| 300 | + } else if ($fieldvalue[1] == 'DEL_BUTTON') { |
|
| 301 | + if (isset($this->CI->input->post)) { |
|
| 302 | + $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 303 | + } else { |
|
| 304 | + $fieldvalue[2]['value'] = ($values) ? @$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
| 305 | + } |
|
| 305 | 306 | $fieldvalue[2]['style'] = isset($fieldvalue[2]['style']) ? $fieldvalue[2]['style'] : ""; |
| 306 | 307 | $form_contents.= form_img_delete($fieldvalue[2], 'readonly',$fieldvalue[2]['style']); |
| 307 | 308 | $form_contents.=@$fieldvalue[6]; |
@@ -312,10 +313,11 @@ discard block |
||
| 312 | 313 | } |
| 313 | 314 | /**********************************************************************************/ |
| 314 | 315 | else if ($fieldvalue[1] == 'PASSWORD') { |
| 315 | - if (isset($this->CI->input->post)) |
|
| 316 | - $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 317 | - else |
|
| 318 | - $fieldvalue[2]['value'] = ($values) ?@$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
| 316 | + if (isset($this->CI->input->post)) { |
|
| 317 | + $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 318 | + } else { |
|
| 319 | + $fieldvalue[2]['value'] = ($values) ?@$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
| 320 | + } |
|
| 319 | 321 | $form_contents.= form_password($fieldvalue[2]); |
| 320 | 322 | $this->CI->form_validation->set_rules($fieldvalue[2]['name'], $fieldvalue[0], $fieldvalue[3]); |
| 321 | 323 | $form_contents.= '<div class="tooltips error_div pull-left no-padding" id="'.$fieldvalue[2]['name'].'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
@@ -324,12 +326,12 @@ discard block |
||
| 324 | 326 | } else if ($fieldvalue[2] == 'CHECKBOX') { |
| 325 | 327 | $OptionArray = array(); |
| 326 | 328 | |
| 327 | - if(isset($fieldvalue[7]) && $fieldvalue[7] != '') |
|
| 328 | - $OptionArray = call_user_func_array(array($this->CI->common, $fieldvalue[7]), array($fieldvalue[6])); |
|
| 329 | + if(isset($fieldvalue[7]) && $fieldvalue[7] != '') { |
|
| 330 | + $OptionArray = call_user_func_array(array($this->CI->common, $fieldvalue[7]), array($fieldvalue[6])); |
|
| 331 | + } |
|
| 329 | 332 | if (isset($this->CI->input->post)){ |
| 330 | 333 | $fieldvalue[3]['value'] = (!$this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[3]['value'] : $this->CI->input->post($fieldvalue[1]); |
| 331 | - } |
|
| 332 | - else |
|
| 334 | + } else |
|
| 333 | 335 | { |
| 334 | 336 | $fieldvalue[3]['value'] = ($values) ? (isset($values[$fieldvalue[1]]) && $values[$fieldvalue[1]] ? 1: 0) : @$fieldvalue[3]['value']; |
| 335 | 337 | } |
@@ -341,18 +343,18 @@ discard block |
||
| 341 | 343 | if(isset($fieldvalue[3]['table_name']) && $fieldvalue[3]['table_name'] != ""){ |
| 342 | 344 | |
| 343 | 345 | $form_contents.= form_checkbox($fieldvalue[1], $fieldvalue[3]['value'],$checked , $OptionArray); |
| 344 | - }else{ |
|
| 346 | + } else{ |
|
| 345 | 347 | $form_contents.= form_checkbox($fieldvalue[1], $fieldvalue[3]['value'],$checked ,$OptionArray); |
| 346 | 348 | } |
| 347 | 349 | } else if ($fieldvalue[1] == 'TEXTAREA') { |
| 348 | 350 | |
| 349 | - if (isset($this->CI->input->post)) |
|
| 350 | - $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 351 | - else |
|
| 352 | - $fieldvalue[2]['value'] = ($values) ? $values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
| 351 | + if (isset($this->CI->input->post)) { |
|
| 352 | + $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
| 353 | + } else { |
|
| 354 | + $fieldvalue[2]['value'] = ($values) ? $values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
| 355 | + } |
|
| 353 | 356 | $form_contents.= form_textarea($fieldvalue[2]); |
| 354 | - } |
|
| 355 | - else if ($fieldvalue[2] == 'RADIO') { |
|
| 357 | + } else if ($fieldvalue[2] == 'RADIO') { |
|
| 356 | 358 | |
| 357 | 359 | $form_contents.= form_radio($fieldvalue[1], $fieldvalue[3]['value'], $fieldvalue[3]['checked']); |
| 358 | 360 | } |
@@ -582,8 +584,9 @@ discard block |
||
| 582 | 584 | $json_data["json_paging"]['total'] = $config['total_rows']; |
| 583 | 585 | $perpage = $config['per_page']; |
| 584 | 586 | $start = ($page_no - 1) * $perpage; |
| 585 | - if ($start < 0) |
|
| 586 | - $start = 0; |
|
| 587 | + if ($start < 0) { |
|
| 588 | + $start = 0; |
|
| 589 | + } |
|
| 587 | 590 | $json_data["paging"]['start'] = $start; |
| 588 | 591 | $json_data["paging"]['page_no'] = $perpage; |
| 589 | 592 | return $json_data; |
@@ -612,7 +615,7 @@ discard block |
||
| 612 | 615 | if($field_arr[2]=="status"){ |
| 613 | 616 | $row['id'] = $row_id; |
| 614 | 617 | $jsn_tmp[$field_key] = call_user_func_array(array($this->CI->common, $field_arr[5]), array($field_arr[3], $field_arr[4], $row)); |
| 615 | - }else{ |
|
| 618 | + } else{ |
|
| 616 | 619 | $jsn_tmp[$field_key] = call_user_func_array(array($this->CI->common, $field_arr[5]), array($field_arr[3], $field_arr[4], $row[$field_arr[2]])); |
| 617 | 620 | } |
| 618 | 621 | |
@@ -637,13 +640,13 @@ discard block |
||
| 637 | 640 | $fieldstr = $this->CI->common->build_custome_edit_button($ActionArr[5]->EDIT,$row[$field_arr[2]],$row["id"]); |
| 638 | 641 | if($acctype != ''){ |
| 639 | 642 | $jsn_tmp[$field_key] = $fieldstr."<br/>".$acctype; |
| 640 | - }else{ |
|
| 643 | + } else{ |
|
| 641 | 644 | $jsn_tmp[$field_key] = $fieldstr; |
| 642 | 645 | } |
| 643 | 646 | |
| 644 | 647 | |
| 645 | 648 | /*********************************/ |
| 646 | - }else { |
|
| 649 | + } else { |
|
| 647 | 650 | $jsn_tmp[$field_key] = $row[$field_arr[2]]; |
| 648 | 651 | } |
| 649 | 652 | } else { |
@@ -677,15 +680,13 @@ discard block |
||
| 677 | 680 | */ |
| 678 | 681 | $jsn_tmp[$field_key] = $this->CI->common->get_action_buttons($field_arr[5], $row_id); |
| 679 | 682 | /****************************************************************************/ |
| 680 | - } |
|
| 681 | - elseif($field_arr[0] == gettext("Profile Action")) |
|
| 683 | + } elseif($field_arr[0] == gettext("Profile Action")) |
|
| 682 | 684 | { |
| 683 | 685 | if(isset($field_arr[5]) && isset($field_arr[5]->START) && isset($field_arr[5]->STOP) && isset($field_arr[5]->RELOAD) && isset($field_arr[5]->RESCAN)){ |
| 684 | 686 | } |
| 685 | 687 | $jsn_tmp[$field_key] = $this->CI->common->get_action_buttons($field_arr[5], $row["id"]); |
| 686 | 688 | |
| 687 | - } |
|
| 688 | - else { |
|
| 689 | + } else { |
|
| 689 | 690 | $className = (isset($field_arr['9']) && $field_arr['9'] != '')?$field_arr['9']:"chkRefNos"; |
| 690 | 691 | $jsn_tmp[$field_key] = '<input type="checkbox" name="chkAll" id=' . $row['id'] . ' class="ace '.$className.'" onclick="clickchkbox(' . $row['id'] . ')" value=' . $row['id'] . '><lable class="lbl"></lable>'; } |
| 691 | 692 | } |
@@ -714,7 +715,7 @@ discard block |
||
| 714 | 715 | if($field_arr[2]=="status"){ |
| 715 | 716 | $row['id'] = $row_id; |
| 716 | 717 | $jsn_tmp[$field_key] = call_user_func_array(array($this->CI->common, $field_arr[5]), array($field_arr[3], $field_arr[4], $row)); |
| 717 | - }else{ |
|
| 718 | + } else{ |
|
| 718 | 719 | $jsn_tmp[$field_key] = call_user_func_array(array($this->CI->common, $field_arr[5]), array($field_arr[3], $field_arr[4], $row[$field_arr[2]])); |
| 719 | 720 | } |
| 720 | 721 | /** |
@@ -732,14 +733,13 @@ discard block |
||
| 732 | 733 | } |
| 733 | 734 | $jsn_tmp[$field_key] = $this->CI->common->build_custome_edit_button($ActionArr[5]->EDIT,$row[$field_arr[2]],$row["id"]); |
| 734 | 735 | /*******************************/ |
| 735 | - }else { |
|
| 736 | + } else { |
|
| 736 | 737 | $jsn_tmp[$field_key] = isset($row[$field_arr[2]]) ? $row[$field_arr[2]] : ""; |
| 737 | 738 | } |
| 738 | 739 | } else { |
| 739 | 740 | if ($field_arr[0] == "Action") { |
| 740 | 741 | $jsn_tmp[$field_key] = $this->CI->common->get_action_buttons($field_arr[5], $row["id"]); |
| 741 | - } |
|
| 742 | - else { |
|
| 742 | + } else { |
|
| 743 | 743 | $jsn_tmp[$field_key] = '<input type="checkbox" name="chkAll" id=' . $row['id'] . ' class="ace chkRefNos" onclick="clickchkbox(' . $row['id'] . ')" value=' . $row['id'] . '><lable class="lbl"></lable>'; |
| 744 | 744 | } |
| 745 | 745 | } |
@@ -209,24 +209,24 @@ discard block |
||
| 209 | 209 | } |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | - function customer_save($add_array = false) { |
|
| 213 | - $add_array = $this->input->post(); |
|
| 214 | - $entity_name = strtolower($this->common->get_entity_type('', '', $add_array['type'])); |
|
| 215 | - $data['country_id'] = isset($add_array['country_id'])? $add_array['country_id']:''; |
|
| 216 | - $data['timezone_id'] = isset($add_array['timezone_id']) ? $add_array['timezone_id']:''; |
|
| 217 | - $data['currency_id'] = isset($add_array['currency_id']) ? $add_array['currency_id']:''; |
|
| 218 | - $data['entity_name'] = $entity_name; |
|
| 219 | - $data['callingcard'] = Common_model::$global_config['system_config']['pinlength']; |
|
| 220 | - $data['edit_id']=$add_array['id']; |
|
| 221 | - $data['form'] = $this->form->build_form($this->accounts_form->get_customer_form_fields($entity_name, $add_array['id']), $add_array); |
|
| 222 | - if ($add_array['id'] != '') { |
|
| 223 | - $data['page_title'] = 'Edit ' . $this->common->get_entity_type('', '', $add_array['type']); |
|
| 224 | - if ($this->form_validation->run() == FALSE) { |
|
| 225 | - $data['validation_errors'] = validation_errors(); |
|
| 226 | - } else { |
|
| 227 | - ASTPP 3.0 |
|
| 228 | - Password encode |
|
| 229 | - * **** */ |
|
| 212 | + function customer_save($add_array = false) { |
|
| 213 | + $add_array = $this->input->post(); |
|
| 214 | + $entity_name = strtolower($this->common->get_entity_type('', '', $add_array['type'])); |
|
| 215 | + $data['country_id'] = isset($add_array['country_id'])? $add_array['country_id']:''; |
|
| 216 | + $data['timezone_id'] = isset($add_array['timezone_id']) ? $add_array['timezone_id']:''; |
|
| 217 | + $data['currency_id'] = isset($add_array['currency_id']) ? $add_array['currency_id']:''; |
|
| 218 | + $data['entity_name'] = $entity_name; |
|
| 219 | + $data['callingcard'] = Common_model::$global_config['system_config']['pinlength']; |
|
| 220 | + $data['edit_id']=$add_array['id']; |
|
| 221 | + $data['form'] = $this->form->build_form($this->accounts_form->get_customer_form_fields($entity_name, $add_array['id']), $add_array); |
|
| 222 | + if ($add_array['id'] != '') { |
|
| 223 | + $data['page_title'] = 'Edit ' . $this->common->get_entity_type('', '', $add_array['type']); |
|
| 224 | + if ($this->form_validation->run() == FALSE) { |
|
| 225 | + $data['validation_errors'] = validation_errors(); |
|
| 226 | + } else { |
|
| 227 | + ASTPP 3.0 |
|
| 228 | + Password encode |
|
| 229 | + * **** */ |
|
| 230 | 230 | $add_array['password'] = $this->common->encode($add_array['password']); |
| 231 | 231 | /* * ****************** */ |
| 232 | 232 | $add_array['credit_limit'] = $this->common_model->add_calculate_currency($add_array['credit_limit'], '', '', false, false); |
@@ -1385,35 +1385,35 @@ discard block |
||
| 1385 | 1385 | $invoice_id=$this->invoices->invoices->generate_receipt($reseller_info['id'],$custom_array['credit'],$reseller_info,$last_invoice_ID+1,$invoice_prefix,$due_date); |
| 1386 | 1386 | $account_balance = $this->common->get_field_name('balance', 'accounts', $reseller_info['id']); |
| 1387 | 1387 | $insert_arr = array("accountid" => $reseller_info['id'], |
| 1388 | - "description" => trim($custom_array['notes']), |
|
| 1389 | - "debit" => 0, |
|
| 1390 | - "credit" => $custom_array['credit'], |
|
| 1391 | - "created_date" => gmdate("Y-m-d H:i:s"), |
|
| 1392 | - "invoiceid"=>$invoice_id, |
|
| 1393 | - "reseller_id"=>$reseller_info['reseller_id'], |
|
| 1394 | - "item_type"=>'Refill', |
|
| 1395 | - "item_id"=>'0', |
|
| 1396 | - 'before_balance'=>$account_balance - $custom_array['credit'], |
|
| 1397 | - 'after_balance'=>$account_balance, |
|
| 1398 | - ); |
|
| 1399 | - $this->db->insert("invoice_details", $insert_arr); |
|
| 1388 | + "description" => trim($custom_array['notes']), |
|
| 1389 | + "debit" => 0, |
|
| 1390 | + "credit" => $custom_array['credit'], |
|
| 1391 | + "created_date" => gmdate("Y-m-d H:i:s"), |
|
| 1392 | + "invoiceid"=>$invoice_id, |
|
| 1393 | + "reseller_id"=>$reseller_info['reseller_id'], |
|
| 1394 | + "item_type"=>'Refill', |
|
| 1395 | + "item_id"=>'0', |
|
| 1396 | + 'before_balance'=>$account_balance - $custom_array['credit'], |
|
| 1397 | + 'after_balance'=>$account_balance, |
|
| 1398 | + ); |
|
| 1399 | + $this->db->insert("invoice_details", $insert_arr); |
|
| 1400 | + } |
|
| 1401 | + } |
|
| 1400 | 1402 | } |
| 1401 | - } |
|
| 1402 | - } |
|
| 1403 | 1403 | } |
| 1404 | - $message = $post_array['payment_type'] == 0 ? "Recharge successfully!" : "Post charge applied successfully."; |
|
| 1404 | + $message = $post_array['payment_type'] == 0 ? "Recharge successfully!" : "Post charge applied successfully."; |
|
| 1405 | 1405 | /***********************************************************************************************/ |
| 1406 | - echo json_encode(array("SUCCESS"=> $message)); |
|
| 1407 | - exit; |
|
| 1408 | - // } |
|
| 1409 | - } |
|
| 1410 | - $this->load->view('view_accounts_process_payment', $data); |
|
| 1411 | - } |
|
| 1412 | - |
|
| 1413 | - /** |
|
| 1414 | - * @param string $select |
|
| 1415 | - */ |
|
| 1416 | - function get_invoice_date($select,$accountid){ |
|
| 1406 | + echo json_encode(array("SUCCESS"=> $message)); |
|
| 1407 | + exit; |
|
| 1408 | + // } |
|
| 1409 | + } |
|
| 1410 | + $this->load->view('view_accounts_process_payment', $data); |
|
| 1411 | + } |
|
| 1412 | + |
|
| 1413 | + /** |
|
| 1414 | + * @param string $select |
|
| 1415 | + */ |
|
| 1416 | + function get_invoice_date($select,$accountid){ |
|
| 1417 | 1417 | $query = $this->db_model->select($select, "invoices", '',"id","DESC","1","0"); |
| 1418 | 1418 | if($query->num_rows >0){ |
| 1419 | 1419 | $invoiceid = $query->result_array(); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $this->load->model('Astpp_common'); |
| 39 | 39 | $this->protected_pages = array('account_list'); |
| 40 | 40 | if ($this->session->userdata('user_login') == FALSE) |
| 41 | - redirect(base_url() . '/login/login'); |
|
| 41 | + redirect(base_url().'/login/login'); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | function customer_list() { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $this->session->set_userdata('customer_list_search', $action); |
| 98 | 98 | } |
| 99 | 99 | if (@$ajax_search != 1) { |
| 100 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 100 | + redirect(base_url().'accounts/customer_list/'); |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
@@ -108,11 +108,11 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | function customer_export_cdr_xls() { |
| 110 | 110 | $account_info = $accountinfo = $this->session->userdata('accountinfo'); |
| 111 | - $currency_id=$account_info['currency_id']; |
|
| 112 | - $currency=$this->common->get_field_name('currency', 'currency', $currency_id); |
|
| 111 | + $currency_id = $account_info['currency_id']; |
|
| 112 | + $currency = $this->common->get_field_name('currency', 'currency', $currency_id); |
|
| 113 | 113 | $query = $this->accounts_model->get_customer_Account_list(true, '', '', true); |
| 114 | 114 | ob_clean(); |
| 115 | - $customer_array[] = array("Account", "First Name", "Last Name", "Company", "Rate Group ", "Balance ($currency)", "Credit Limit ($currency)", "First Used", "Expiry Date","CC","Status","Created Date"); |
|
| 115 | + $customer_array[] = array("Account", "First Name", "Last Name", "Company", "Rate Group ", "Balance ($currency)", "Credit Limit ($currency)", "First Used", "Expiry Date", "CC", "Status", "Created Date"); |
|
| 116 | 116 | if ($query->num_rows() > 0) { |
| 117 | 117 | |
| 118 | 118 | foreach ($query->result_array() as $row) { |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | $this->load->helper('csv'); |
| 136 | - array_to_csv($customer_array, 'Customers_' . date("Y-m-d") . '.csv'); |
|
| 136 | + array_to_csv($customer_array, 'Customers_'.date("Y-m-d").'.csv'); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | function provider_add() { |
@@ -154,20 +154,20 @@ discard block |
||
| 154 | 154 | $entity_type = strtolower($this->common->get_entity_type('', '', $type)); |
| 155 | 155 | $data['username'] = $this->session->userdata('user_name'); |
| 156 | 156 | $data['flag'] = 'create'; |
| 157 | - $data['page_title'] = 'Create ' . $entity_type; |
|
| 157 | + $data['page_title'] = 'Create '.$entity_type; |
|
| 158 | 158 | $data['back_flag'] = true; |
| 159 | 159 | $data['country_id'] = $accountinfo['country_id']; |
| 160 | 160 | $data['callingcard'] = Common_model::$global_config['system_config']['pinlength']; |
| 161 | 161 | $data['currency_id'] = $accountinfo['currency_id']; |
| 162 | 162 | $data['timezone_id'] = $accountinfo['timezone_id']; |
| 163 | 163 | $data['form'] = $this->form->build_form($this->accounts_form->get_customer_form_fields($entity_type), ''); |
| 164 | - if (!$data['timezone_id']) { |
|
| 164 | + if ( ! $data['timezone_id']) { |
|
| 165 | 165 | $data['timezone_id'] = 1; |
| 166 | 166 | } |
| 167 | - if (!$data['currency_id']) { |
|
| 167 | + if ( ! $data['currency_id']) { |
|
| 168 | 168 | $data['currency_id'] = 1; |
| 169 | 169 | } |
| 170 | - if (!$data['country_id']) { |
|
| 170 | + if ( ! $data['country_id']) { |
|
| 171 | 171 | $data['country_id'] = 1; |
| 172 | 172 | } |
| 173 | 173 | $data['entity_name'] = $entity_type; |
@@ -182,9 +182,9 @@ discard block |
||
| 182 | 182 | $where = array('id' => $edit_id, "reseller_id" => $reseller_id); |
| 183 | 183 | $account = $this->db_model->getSelect("*", "accounts", $where); |
| 184 | 184 | if ($account->num_rows > 0) { |
| 185 | - $account_data = (array) $account->first_row(); |
|
| 185 | + $account_data = (array)$account->first_row(); |
|
| 186 | 186 | $entity_name = strtolower($this->common->get_entity_type('', '', $account_data['type'])); |
| 187 | - $data['page_title'] =ucfirst($entity_name) . " Profile"; |
|
| 187 | + $data['page_title'] = ucfirst($entity_name)." Profile"; |
|
| 188 | 188 | $data['invoice_date'] = $account_data['invoice_day']; |
| 189 | 189 | $data["account_data"] = $account_data; |
| 190 | 190 | $data['callingcard'] = Common_model::$global_config['system_config']['pinlength']; |
@@ -202,31 +202,31 @@ discard block |
||
| 202 | 202 | $account_data['password'] = $this->common->decode($account_data['password']); |
| 203 | 203 | /* * ********************** */ |
| 204 | 204 | $data['form'] = $this->form->build_form($this->accounts_form->get_customer_form_fields($entity_name, $edit_id), $account_data); |
| 205 | - $data['edit_id']=$edit_id; |
|
| 205 | + $data['edit_id'] = $edit_id; |
|
| 206 | 206 | $this->load->view('view_customer_details', $data); |
| 207 | 207 | } else { |
| 208 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 208 | + redirect(base_url().'accounts/customer_list/'); |
|
| 209 | 209 | } |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | function customer_save($add_array = false) { |
| 213 | 213 | $add_array = $this->input->post(); |
| 214 | 214 | $entity_name = strtolower($this->common->get_entity_type('', '', $add_array['type'])); |
| 215 | - $data['country_id'] = isset($add_array['country_id'])? $add_array['country_id']:''; |
|
| 216 | - $data['timezone_id'] = isset($add_array['timezone_id']) ? $add_array['timezone_id']:''; |
|
| 217 | - $data['currency_id'] = isset($add_array['currency_id']) ? $add_array['currency_id']:''; |
|
| 215 | + $data['country_id'] = isset($add_array['country_id']) ? $add_array['country_id'] : ''; |
|
| 216 | + $data['timezone_id'] = isset($add_array['timezone_id']) ? $add_array['timezone_id'] : ''; |
|
| 217 | + $data['currency_id'] = isset($add_array['currency_id']) ? $add_array['currency_id'] : ''; |
|
| 218 | 218 | $data['entity_name'] = $entity_name; |
| 219 | 219 | $data['callingcard'] = Common_model::$global_config['system_config']['pinlength']; |
| 220 | - $data['edit_id']=$add_array['id']; |
|
| 220 | + $data['edit_id'] = $add_array['id']; |
|
| 221 | 221 | $data['form'] = $this->form->build_form($this->accounts_form->get_customer_form_fields($entity_name, $add_array['id']), $add_array); |
| 222 | 222 | if ($add_array['id'] != '') { |
| 223 | - $data['page_title'] = 'Edit ' . $this->common->get_entity_type('', '', $add_array['type']); |
|
| 223 | + $data['page_title'] = 'Edit '.$this->common->get_entity_type('', '', $add_array['type']); |
|
| 224 | 224 | if ($this->form_validation->run() == FALSE) { |
| 225 | 225 | $data['validation_errors'] = validation_errors(); |
| 226 | 226 | } else { |
| 227 | 227 | ASTPP 3.0 |
| 228 | 228 | Password encode |
| 229 | - * **** */ |
|
| 229 | + * **** * / |
|
| 230 | 230 | $add_array['password'] = $this->common->encode($add_array['password']); |
| 231 | 231 | /* * ****************** */ |
| 232 | 232 | $add_array['credit_limit'] = $this->common_model->add_calculate_currency($add_array['credit_limit'], '', '', false, false); |
@@ -244,16 +244,16 @@ discard block |
||
| 244 | 244 | unset($add_array['tax_id']); |
| 245 | 245 | } |
| 246 | 246 | //Completed |
| 247 | - unset($add_array['posttoexternal'],$add_array['number'],$add_array['balance']); |
|
| 247 | + unset($add_array['posttoexternal'], $add_array['number'], $add_array['balance']); |
|
| 248 | 248 | $this->accounts_model->edit_account($add_array, $add_array['id']); |
| 249 | - $this->session->set_flashdata('astpp_errormsg', ucfirst($entity_name) . ' updated successfully!'); |
|
| 250 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 249 | + $this->session->set_flashdata('astpp_errormsg', ucfirst($entity_name).' updated successfully!'); |
|
| 250 | + redirect(base_url().'accounts/customer_list/'); |
|
| 251 | 251 | exit; |
| 252 | 252 | } |
| 253 | 253 | $data["account_data"]["0"] = $add_array; |
| 254 | 254 | $this->load->view('view_customer_details', $data); |
| 255 | 255 | } else { |
| 256 | - $data['page_title'] = 'Create ' . $entity_name; |
|
| 256 | + $data['page_title'] = 'Create '.$entity_name; |
|
| 257 | 257 | if ($this->form_validation->run() == FALSE) { |
| 258 | 258 | $data['validation_errors'] = validation_errors(); |
| 259 | 259 | } else { |
@@ -276,8 +276,8 @@ discard block |
||
| 276 | 276 | } |
| 277 | 277 | unset($add_array['tax_id']); |
| 278 | 278 | } |
| 279 | - $this->session->set_flashdata('astpp_errormsg', ucfirst($entity_name) . ' added successfully!'); |
|
| 280 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 279 | + $this->session->set_flashdata('astpp_errormsg', ucfirst($entity_name).' added successfully!'); |
|
| 280 | + redirect(base_url().'accounts/customer_list/'); |
|
| 281 | 281 | exit; |
| 282 | 282 | } |
| 283 | 283 | $this->load->view('view_accounts_create', $data); |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | $account = $this->db_model->getSelect("*", "accounts", $where); |
| 299 | 299 | |
| 300 | 300 | if ($account->num_rows > 0) { |
| 301 | - $account_data = (array) $account->first_row(); |
|
| 301 | + $account_data = (array)$account->first_row(); |
|
| 302 | 302 | $accounttype = strtolower($this->common->get_entity_type('', '', $account_data['type'])); |
| 303 | 303 | $data['page_title'] = 'Speed Dial'; |
| 304 | 304 | $data['accounttype'] = $accounttype; |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | $data['form'] = $this->form->build_form($this->accounts_form->get_customer_form_fields($accounttype, $edit_id), $account_data); |
| 318 | 318 | $this->load->view('view_customer_speed_dial', $data); |
| 319 | 319 | } else { |
| 320 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 320 | + redirect(base_url().'accounts/customer_list/'); |
|
| 321 | 321 | } |
| 322 | 322 | } |
| 323 | 323 | |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | |
| 352 | 352 | function customer_ipmap($edit_id) { |
| 353 | 353 | $data['page_title'] = "IP Settings"; |
| 354 | - $data['add_form']=true; |
|
| 354 | + $data['add_form'] = true; |
|
| 355 | 355 | //Get Account information from session. |
| 356 | 356 | $accountinfo = $this->session->userdata('accountinfo'); |
| 357 | 357 | //Get Parent informartion |
@@ -359,14 +359,14 @@ discard block |
||
| 359 | 359 | $where = array('id' => $edit_id, "reseller_id" => $reseller_id); |
| 360 | 360 | $account_res = $this->db_model->getSelect("type", "accounts", $where); |
| 361 | 361 | if ($account_res->num_rows > 0) { |
| 362 | - $account_data = (array) $account_res->first_row(); |
|
| 362 | + $account_data = (array)$account_res->first_row(); |
|
| 363 | 363 | $accounttype = strtolower($this->common->get_entity_type('', '', $account_data['type'])); |
| 364 | 364 | $data["grid_fields"] = $this->accounts_form->build_ip_list_for_customer($edit_id, $accounttype); |
| 365 | 365 | $data['edit_id'] = $edit_id; |
| 366 | 366 | $data['accounttype'] = $accounttype; |
| 367 | 367 | $this->load->view('view_customer_ipmap', $data); |
| 368 | 368 | } else { |
| 369 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 369 | + redirect(base_url().'accounts/customer_list/'); |
|
| 370 | 370 | exit; |
| 371 | 371 | } |
| 372 | 372 | } |
@@ -374,14 +374,14 @@ discard block |
||
| 374 | 374 | function customer_ipmap_json($accountid, $accounttype) { |
| 375 | 375 | $json_data = array(); |
| 376 | 376 | $where = array("accountid" => $accountid); |
| 377 | - $instant_search=$this->session->userdata('left_panel_search_'.$accounttype.'_ipmap'); |
|
| 378 | - $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; |
|
| 379 | - if(!empty($like_str)) |
|
| 377 | + $instant_search = $this->session->userdata('left_panel_search_'.$accounttype.'_ipmap'); |
|
| 378 | + $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; |
|
| 379 | + if ( ! empty($like_str)) |
|
| 380 | 380 | $this->db->where($like_str); |
| 381 | 381 | $count_all = $this->db_model->countQuery("*", "ip_map", $where); |
| 382 | 382 | $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
| 383 | 383 | $json_data = $paging_data["json_paging"]; |
| 384 | - if(!empty($like_str)) |
|
| 384 | + if ( ! empty($like_str)) |
|
| 385 | 385 | $this->db->where($like_str); |
| 386 | 386 | $query = $this->db_model->select("*", "ip_map", $where, "id", "ASC", $paging_data["paging"]["page_no"], $paging_data["paging"]["start"]); |
| 387 | 387 | $grid_fields = json_decode($this->accounts_form->build_ip_list_for_customer($accountid, $accounttype)); |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | if (strpos($ip, '/') !== false) { |
| 403 | 403 | $add_array['ip'] = $add_array['ip']; |
| 404 | 404 | } else { |
| 405 | - $add_array['ip'] = $add_array['ip'] . '/32'; |
|
| 405 | + $add_array['ip'] = $add_array['ip'].'/32'; |
|
| 406 | 406 | } |
| 407 | 407 | $where = array("ip" => trim($add_array['ip']), "prefix" => trim($add_array['prefix'])); |
| 408 | 408 | $getdata = $this->db_model->countQuery("*", "ip_map", $where); |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | } |
| 438 | 438 | $this->session->set_flashdata('astpp_notification', 'IP removed sucessfully.'); |
| 439 | 439 | } |
| 440 | - redirect(base_url() . "accounts/" . $accounttype . "_ipmap/" . $accountid . "/"); |
|
| 440 | + redirect(base_url()."accounts/".$accounttype."_ipmap/".$accountid."/"); |
|
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | //This function using for provider t |
@@ -455,30 +455,30 @@ discard block |
||
| 455 | 455 | $where = array('id' => $edit_id, "reseller_id" => $reseller_id); |
| 456 | 456 | $account_res = $this->db_model->getSelect("type", "accounts", $where); |
| 457 | 457 | if ($account_res->num_rows > 0) { |
| 458 | - $account_data = (array) $account_res->first_row(); |
|
| 458 | + $account_data = (array)$account_res->first_row(); |
|
| 459 | 459 | $accounttype = strtolower($this->common->get_entity_type('', '', $account_data['type'])); |
| 460 | 460 | $data["grid_fields"] = $this->accounts_form->build_animap_list_for_customer($edit_id, $accounttype); |
| 461 | 461 | $data['edit_id'] = $edit_id; |
| 462 | 462 | $data['accounttype'] = $accounttype; |
| 463 | 463 | $this->load->view('view_customer_animap', $data); |
| 464 | 464 | } else { |
| 465 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 465 | + redirect(base_url().'accounts/customer_list/'); |
|
| 466 | 466 | exit; |
| 467 | 467 | } |
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | function customer_animap_json($accountid, $accounttype) { |
| 471 | 471 | $json_data = array(); |
| 472 | - $instant_search=$this->session->userdata('left_panel_search_'.$accounttype.'_animap'); |
|
| 473 | - $like_str=!empty($instant_search) ? "(number like '%$instant_search%' OR creation_date like '%$instant_search%' )" :null; |
|
| 474 | - if(!empty($like_str)) |
|
| 472 | + $instant_search = $this->session->userdata('left_panel_search_'.$accounttype.'_animap'); |
|
| 473 | + $like_str = ! empty($instant_search) ? "(number like '%$instant_search%' OR creation_date like '%$instant_search%' )" : null; |
|
| 474 | + if ( ! empty($like_str)) |
|
| 475 | 475 | $this->db->where($like_str); |
| 476 | 476 | $where = array("accountid" => $accountid); |
| 477 | 477 | $count_all = $this->db_model->countQuery("*", "ani_map", $where); |
| 478 | 478 | |
| 479 | 479 | $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
| 480 | 480 | $json_data = $paging_data["json_paging"]; |
| 481 | - if(!empty($like_str)) |
|
| 481 | + if ( ! empty($like_str)) |
|
| 482 | 482 | $this->db->where($like_str); |
| 483 | 483 | $query = $this->db_model->select("*", "ani_map", $where, "id", "ASC", $paging_data["paging"]["page_no"], $paging_data["paging"]["start"]); |
| 484 | 484 | |
@@ -496,7 +496,7 @@ discard block |
||
| 496 | 496 | function customer_animap_action($action, $accountid, $aniid = "") { |
| 497 | 497 | $entity_type = $this->common->get_field_name('type', 'accounts', array('id' => $accountid)); |
| 498 | 498 | $entity_type = strtolower($this->common->get_entity_type('', '', $entity_type)); |
| 499 | - $url = "accounts/" . $entity_type . "_animap/$accountid/"; |
|
| 499 | + $url = "accounts/".$entity_type."_animap/$accountid/"; |
|
| 500 | 500 | if ($action == "add") { |
| 501 | 501 | $ani = $this->input->post(); |
| 502 | 502 | $this->db->where('number', $ani['number']); |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | $this->session->set_flashdata('astpp_notification', 'Caller ID removed sucessfully!'); |
| 527 | 527 | $this->db_model->delete("ani_map", array("id" => $aniid)); |
| 528 | 528 | } |
| 529 | - redirect(base_url() . $url); |
|
| 529 | + redirect(base_url().$url); |
|
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | //This function using by Customer/Provider edit tab |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | } |
| 548 | 548 | if ($module == "invoices") { |
| 549 | 549 | $this->load->module('invoices/invoices'); |
| 550 | - $this->invoices->customer_invoices($accountid,$entity_type, false); |
|
| 550 | + $this->invoices->customer_invoices($accountid, $entity_type, false); |
|
| 551 | 551 | } |
| 552 | 552 | if ($module == "subscription") { |
| 553 | 553 | $this->load->module('charges/charges'); |
@@ -559,11 +559,11 @@ discard block |
||
| 559 | 559 | } |
| 560 | 560 | if ($module == "charges") { |
| 561 | 561 | $this->load->module('reports/reports'); |
| 562 | - $this->reports->customer_charge_history($accountid,$entity_type); |
|
| 562 | + $this->reports->customer_charge_history($accountid, $entity_type); |
|
| 563 | 563 | } |
| 564 | 564 | if ($module == "refill") { |
| 565 | 565 | $this->load->module('reports/reports'); |
| 566 | - $this->reports->customer_refillreport($accountid,$entity_type); |
|
| 566 | + $this->reports->customer_refillreport($accountid, $entity_type); |
|
| 567 | 567 | } |
| 568 | 568 | if ($module == "emailhistory") { |
| 569 | 569 | $this->load->module('email/email'); |
@@ -571,13 +571,13 @@ discard block |
||
| 571 | 571 | } |
| 572 | 572 | if ($module == "opensips") { |
| 573 | 573 | $this->load->module('opensips/opensips'); |
| 574 | - $this->opensips->customer_opensips_json($accountid,$entity_type); |
|
| 574 | + $this->opensips->customer_opensips_json($accountid, $entity_type); |
|
| 575 | 575 | } |
| 576 | 576 | } |
| 577 | - function customer_details_search($module_name){ |
|
| 577 | + function customer_details_search($module_name) { |
|
| 578 | 578 | $action = $this->input->post(); |
| 579 | - $this->session->set_userdata('left_panel_search_'.$module_name,""); |
|
| 580 | - if(!empty($action['left_panel_search'])){ |
|
| 579 | + $this->session->set_userdata('left_panel_search_'.$module_name, ""); |
|
| 580 | + if ( ! empty($action['left_panel_search'])) { |
|
| 581 | 581 | $this->session->set_userdata('left_panel_search_'.$module_name, $action['left_panel_search']); |
| 582 | 582 | } |
| 583 | 583 | } |
@@ -594,7 +594,7 @@ discard block |
||
| 594 | 594 | $where = array('id' => $edit_id, "reseller_id" => $reseller_id); |
| 595 | 595 | $account_res = $this->db_model->getSelect("type", "accounts", $where); |
| 596 | 596 | if ($account_res->num_rows > 0) { |
| 597 | - $account_data = (array) $account_res->first_row(); |
|
| 597 | + $account_data = (array)$account_res->first_row(); |
|
| 598 | 598 | $accounttype = strtolower($this->common->get_entity_type('', '', $account_data['type'])); |
| 599 | 599 | $this->load->module('freeswitch/freeswitch'); |
| 600 | 600 | $data["grid_buttons"] = $this->freeswitch->freeswitch_form->fsdevices_build_grid_buttons($edit_id, $accounttype); |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | $data['accounttype'] = $accounttype; |
| 604 | 604 | $this->load->view('view_customer_sipdevices', $data); |
| 605 | 605 | } else { |
| 606 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 606 | + redirect(base_url().'accounts/customer_list/'); |
|
| 607 | 607 | exit; |
| 608 | 608 | } |
| 609 | 609 | } |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | if ($action == "delete") { |
| 620 | 620 | $this->freeswitch->freeswitch_model->delete_freeswith_devices($id); |
| 621 | 621 | $this->session->set_flashdata('astpp_notification', 'Sip Device removed successfully!'); |
| 622 | - redirect(base_url() . "accounts/" . $entity_type . "_sipdevices/$accountid/"); |
|
| 622 | + redirect(base_url()."accounts/".$entity_type."_sipdevices/$accountid/"); |
|
| 623 | 623 | } |
| 624 | 624 | if ($action == "edit") { |
| 625 | 625 | $this->freeswitch->customer_fssipdevices_edit($id, $accountid); |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | $where = array('id' => $edit_id, "reseller_id" => $reseller_id); |
| 641 | 641 | $account_res = $this->db_model->getSelect("type", "accounts", $where); |
| 642 | 642 | if ($account_res->num_rows > 0) { |
| 643 | - $account_data = (array) $account_res->first_row(); |
|
| 643 | + $account_data = (array)$account_res->first_row(); |
|
| 644 | 644 | $accounttype = strtolower($this->common->get_entity_type('', '', $account_data['type'])); |
| 645 | 645 | $this->load->module('freeswitch/freeswitch'); |
| 646 | 646 | $this->load->module('opensips/opensips'); |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | $data['accounttype'] = $accounttype; |
| 651 | 651 | $this->load->view('view_customer_opensips_devices', $data); |
| 652 | 652 | } else { |
| 653 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 653 | + redirect(base_url().'accounts/customer_list/'); |
|
| 654 | 654 | exit; |
| 655 | 655 | } |
| 656 | 656 | } |
@@ -658,12 +658,12 @@ discard block |
||
| 658 | 658 | function customer_opensips_action($action, $accountid, $id) { |
| 659 | 659 | $entity_type = $this->common->get_field_name('type', 'accounts', array('id' => $accountid)); |
| 660 | 660 | $entity_type = strtolower($this->common->get_entity_type('', '', $entity_type)); |
| 661 | - $url = "accounts/" . $entity_type . "_opensips/$accountid/"; |
|
| 661 | + $url = "accounts/".$entity_type."_opensips/$accountid/"; |
|
| 662 | 662 | $this->load->module('opensips/opensips'); |
| 663 | 663 | if ($action == "delete") { |
| 664 | 664 | $this->opensips->opensips_model->remove_opensips($id); |
| 665 | 665 | $this->session->set_flashdata('astpp_notification', 'Opensips removed successfully!'); |
| 666 | - redirect(base_url() . $url); |
|
| 666 | + redirect(base_url().$url); |
|
| 667 | 667 | } |
| 668 | 668 | if ($action == "edit") { |
| 669 | 669 | $this->opensips->customer_opensips_edit($accountid, $id); |
@@ -688,7 +688,7 @@ discard block |
||
| 688 | 688 | $where = array('id' => $edit_id, "reseller_id" => $reseller_id); |
| 689 | 689 | $account_res = $this->db_model->getSelect("type", "accounts", $where); |
| 690 | 690 | if ($account_res->num_rows > 0) { |
| 691 | - $account_data = (array) $account_res->first_row(); |
|
| 691 | + $account_data = (array)$account_res->first_row(); |
|
| 692 | 692 | $accounttype = strtolower($this->common->get_entity_type('', '', $account_data['type'])); |
| 693 | 693 | $data['chargelist'] = form_dropdown('applayable_charge', $this->Astpp_common->list_applyable_charges($edit_id), ''); |
| 694 | 694 | $this->load->module('reports/reports'); |
@@ -697,7 +697,7 @@ discard block |
||
| 697 | 697 | $data['accounttype'] = $accounttype; |
| 698 | 698 | $this->load->view('view_customer_charges', $data); |
| 699 | 699 | } else { |
| 700 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 700 | + redirect(base_url().'accounts/customer_list/'); |
|
| 701 | 701 | exit; |
| 702 | 702 | } |
| 703 | 703 | } |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | $where = array('id' => $edit_id, "reseller_id" => $reseller_id); |
| 720 | 720 | $account_res = $this->db_model->getSelect("type", "accounts", $where); |
| 721 | 721 | if ($account_res->num_rows > 0) { |
| 722 | - $account_data = (array) $account_res->first_row(); |
|
| 722 | + $account_data = (array)$account_res->first_row(); |
|
| 723 | 723 | $accounttype = strtolower($this->common->get_entity_type('', '', $account_data['type'])); |
| 724 | 724 | $data['chargelist'] = form_dropdown_all(array("name" => 'applayable_charge', 'id' => 'applayable_charge', 'class' => ""), $this->Astpp_common->list_applyable_charges($edit_id), ''); |
| 725 | 725 | $this->load->module('charges/charges'); |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | $data['accounttype'] = $accounttype; |
| 729 | 729 | $this->load->view('view_customer_subscriptions', $data); |
| 730 | 730 | } else { |
| 731 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 731 | + redirect(base_url().'accounts/customer_list/'); |
|
| 732 | 732 | exit; |
| 733 | 733 | } |
| 734 | 734 | } |
@@ -748,7 +748,7 @@ discard block |
||
| 748 | 748 | For Email Broadcast when Subscription Add - Delete |
| 749 | 749 | * */ |
| 750 | 750 | $accountinfo = $this->db_model->getSelect("*", "accounts", array("id" => $accountid)); |
| 751 | - $accountinfo = (array) $accountinfo->first_row(); |
|
| 751 | + $accountinfo = (array)$accountinfo->first_row(); |
|
| 752 | 752 | /* * ****************************** */ |
| 753 | 753 | if ($action == "add") { |
| 754 | 754 | $charge_id = $this->input->post("applayable_charge", true); |
@@ -770,7 +770,7 @@ discard block |
||
| 770 | 770 | * */ |
| 771 | 771 | $this->common->mail_to_users($template_name, $accountinfo); |
| 772 | 772 | /* * ********************************* */ |
| 773 | - redirect(base_url() . "accounts/" . $accounttype . "_subscription/$accountid/"); |
|
| 773 | + redirect(base_url()."accounts/".$accounttype."_subscription/$accountid/"); |
|
| 774 | 774 | } |
| 775 | 775 | |
| 776 | 776 | function provider_dids($edit_id) { |
@@ -786,7 +786,7 @@ discard block |
||
| 786 | 786 | $where = array('id' => $edit_id, "reseller_id" => $reseller_id); |
| 787 | 787 | $account_res = $this->db_model->getSelect("type,country_id", "accounts", $where); |
| 788 | 788 | if ($account_res->num_rows > 0) { |
| 789 | - $account_data = (array) $account_res->first_row(); |
|
| 789 | + $account_data = (array)$account_res->first_row(); |
|
| 790 | 790 | $accounttype = strtolower($this->common->get_entity_type('', '', $account_data['type'])); |
| 791 | 791 | $this->load->module('did/did'); |
| 792 | 792 | $data['grid_fields'] = $this->did->did_form->build_did_list_for_customer($edit_id, $accounttype); |
@@ -798,7 +798,7 @@ discard block |
||
| 798 | 798 | $data['country_id'] = $account_data['country_id']; |
| 799 | 799 | $this->load->view('view_customer_dids', $data); |
| 800 | 800 | } else { |
| 801 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 801 | + redirect(base_url().'accounts/customer_list/'); |
|
| 802 | 802 | exit; |
| 803 | 803 | } |
| 804 | 804 | } |
@@ -819,16 +819,16 @@ discard block |
||
| 819 | 819 | $did_id = empty($did_id) ? $this->input->post("free_didlist", true) : $did_id; |
| 820 | 820 | if ($did_id != "") { |
| 821 | 821 | $account_arr = (array)$this->db->get_where("accounts", array("id" => $accountid))->first_row(); |
| 822 | - $did_arr = (array) $this->db->get_where("dids", array("id" => $did_id))->first_row(); |
|
| 823 | - $field_name = $account_arr['type'] ==1 ? "parent_id" : 'accountid'; |
|
| 822 | + $did_arr = (array)$this->db->get_where("dids", array("id" => $did_id))->first_row(); |
|
| 823 | + $field_name = $account_arr['type'] == 1 ? "parent_id" : 'accountid'; |
|
| 824 | 824 | if ($action == "add") { |
| 825 | 825 | if ($did_arr['accountid'] == 0 && $did_arr['parent_id'] == $reseller_id) { |
| 826 | 826 | if ($accountinfo['type'] == 1) { |
| 827 | 827 | //for getting reseller setup price if reseller customer purchase |
| 828 | 828 | $reseller_pricing_query = $this->db_model->getSelect("*", "reseller_pricing", array("note" => $did_arr['number'], 'reseller_id' => $reseller_id)); |
| 829 | 829 | if ($reseller_pricing_query->num_rows() > 0) { |
| 830 | - $reseller_pricing = (array) $reseller_pricing_query->first_row(); |
|
| 831 | - $did_arr=array_merge($did_arr,$reseller_pricing); |
|
| 830 | + $reseller_pricing = (array)$reseller_pricing_query->first_row(); |
|
| 831 | + $did_arr = array_merge($did_arr, $reseller_pricing); |
|
| 832 | 832 | } |
| 833 | 833 | } |
| 834 | 834 | $available_bal = $this->db_model->get_available_bal($account_arr); |
@@ -866,12 +866,12 @@ discard block |
||
| 866 | 866 | $this->db->where('note', $did_arr['number']); |
| 867 | 867 | $this->db->delete('reseller_pricing'); |
| 868 | 868 | } |
| 869 | - $account_arr['did_number']=$did_arr['number']; |
|
| 869 | + $account_arr['did_number'] = $did_arr['number']; |
|
| 870 | 870 | $this->common->mail_to_users('email_remove_did', $account_arr); |
| 871 | 871 | $this->session->set_flashdata('astpp_notification', 'Did Removed Successfully.'); |
| 872 | 872 | } |
| 873 | 873 | } |
| 874 | - redirect(base_url() . "accounts/" . $accounttype . "_dids/$accountid/"); |
|
| 874 | + redirect(base_url()."accounts/".$accounttype."_dids/$accountid/"); |
|
| 875 | 875 | } |
| 876 | 876 | |
| 877 | 877 | function provider_invoices($edit_id) { |
@@ -891,7 +891,7 @@ discard block |
||
| 891 | 891 | $where = array('id' => $edit_id, "reseller_id" => $reseller_id); |
| 892 | 892 | $account_res = $this->db_model->getSelect("type", "accounts", $where); |
| 893 | 893 | if ($account_res->num_rows > 0) { |
| 894 | - $account_data = (array) $account_res->first_row(); |
|
| 894 | + $account_data = (array)$account_res->first_row(); |
|
| 895 | 895 | $accounttype = strtolower($this->common->get_entity_type('', '', $account_data['type'])); |
| 896 | 896 | $this->load->module('invoices/invoices'); |
| 897 | 897 | $data['grid_fields'] = $this->invoices->invoices_form->build_invoices_list_for_customer_admin(false); |
@@ -899,7 +899,7 @@ discard block |
||
| 899 | 899 | $data['accounttype'] = $accounttype; |
| 900 | 900 | $this->load->view('view_customer_invoices', $data); |
| 901 | 901 | } else { |
| 902 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 902 | + redirect(base_url().'accounts/customer_list/'); |
|
| 903 | 903 | exit; |
| 904 | 904 | } |
| 905 | 905 | } |
@@ -917,7 +917,7 @@ discard block |
||
| 917 | 917 | $where = array('id' => $edit_id, "reseller_id" => $reseller_id); |
| 918 | 918 | $account_res = $this->db_model->getSelect("type", "accounts", $where); |
| 919 | 919 | if ($account_res->num_rows > 0) { |
| 920 | - $account_data = (array) $account_res->first_row(); |
|
| 920 | + $account_data = (array)$account_res->first_row(); |
|
| 921 | 921 | $accounttype = strtolower($this->common->get_entity_type('', '', $account_data['type'])); |
| 922 | 922 | $this->load->module('rates/rates'); |
| 923 | 923 | $data['grid_fields'] = $this->rates->rates_form->build_pattern_list_for_customer($edit_id, $accounttype); |
@@ -926,7 +926,7 @@ discard block |
||
| 926 | 926 | $data['accounttype'] = $accounttype; |
| 927 | 927 | $this->load->view('view_customer_blocked_prefixes', $data); |
| 928 | 928 | } else { |
| 929 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 929 | + redirect(base_url().'accounts/customer_list/'); |
|
| 930 | 930 | exit; |
| 931 | 931 | } |
| 932 | 932 | } |
@@ -967,16 +967,16 @@ discard block |
||
| 967 | 967 | function customer_delete_block_pattern($accountid, $patternid) { |
| 968 | 968 | $entity_type = $this->common->get_field_name('type', 'accounts', array('id' => $accountid)); |
| 969 | 969 | $entity_type = strtolower($this->common->get_entity_type('', '', $entity_type)); |
| 970 | - $url = "accounts/" . $entity_type . "_blocked_prefixes/$accountid"; |
|
| 970 | + $url = "accounts/".$entity_type."_blocked_prefixes/$accountid"; |
|
| 971 | 971 | $this->db_model->delete("block_patterns", array("id" => $patternid)); |
| 972 | 972 | $this->session->set_flashdata('astpp_notification', 'Block Code Removed Sucessfully!'); |
| 973 | 973 | |
| 974 | - redirect(base_url() . $url); |
|
| 974 | + redirect(base_url().$url); |
|
| 975 | 975 | } |
| 976 | - function customer_blockedprefixes_delete_multiple(){ |
|
| 976 | + function customer_blockedprefixes_delete_multiple() { |
|
| 977 | 977 | $ids = $this->input->post("selected_ids", true); |
| 978 | 978 | $where = "id IN ($ids)"; |
| 979 | - $this->db->delete("block_patterns",$where); |
|
| 979 | + $this->db->delete("block_patterns", $where); |
|
| 980 | 980 | echo TRUE; |
| 981 | 981 | } |
| 982 | 982 | |
@@ -1011,7 +1011,7 @@ discard block |
||
| 1011 | 1011 | $where = array('id' => $edit_id, "reseller_id" => $reseller_id); |
| 1012 | 1012 | $account_res = $this->db_model->getSelect("type", "accounts", $where); |
| 1013 | 1013 | if ($account_res->num_rows > 0) { |
| 1014 | - $account_data = (array) $account_res->first_row(); |
|
| 1014 | + $account_data = (array)$account_res->first_row(); |
|
| 1015 | 1015 | $accounttype = strtolower($this->common->get_entity_type('', '', $account_data['type'])); |
| 1016 | 1016 | $this->load->module('reports/reports'); |
| 1017 | 1017 | $data['grid_fields'] = $this->reports->reports_form->build_report_list_for_user($accounttype); |
@@ -1019,7 +1019,7 @@ discard block |
||
| 1019 | 1019 | $data['accounttype'] = $accounttype; |
| 1020 | 1020 | $this->load->view('view_customer_cdrs_list', $data); |
| 1021 | 1021 | } else { |
| 1022 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 1022 | + redirect(base_url().'accounts/customer_list/'); |
|
| 1023 | 1023 | exit; |
| 1024 | 1024 | } |
| 1025 | 1025 | } |
@@ -1028,27 +1028,27 @@ discard block |
||
| 1028 | 1028 | /* ASTPP 3.0 |
| 1029 | 1029 | * Using for provider refillreporttab. |
| 1030 | 1030 | */ |
| 1031 | - function reseller_packages($edit_id){ |
|
| 1031 | + function reseller_packages($edit_id) { |
|
| 1032 | 1032 | $data['page_title'] = "Packages"; |
| 1033 | 1033 | $accountinfo = $this->session->userdata('accountinfo'); |
| 1034 | 1034 | $reseller_id = ($accountinfo['type'] == 1 || $accountinfo['type'] == 5) ? $accountinfo['id'] : 0; |
| 1035 | 1035 | $where = array('id' => $edit_id, "reseller_id" => $reseller_id); |
| 1036 | 1036 | $account_res = $this->db_model->getSelect("type", "accounts", $where); |
| 1037 | 1037 | if ($account_res->num_rows > 0) { |
| 1038 | - $account_data = (array) $account_res->first_row(); |
|
| 1038 | + $account_data = (array)$account_res->first_row(); |
|
| 1039 | 1039 | $accounttype = strtolower($this->common->get_entity_type('', '', $account_data['type'])); |
| 1040 | 1040 | $this->load->module('package/package'); |
| 1041 | 1041 | $data['grid_fields'] = $this->package->package_form->build_package_list_for_reseller(); |
| 1042 | 1042 | $data['edit_id'] = $edit_id; |
| 1043 | 1043 | $data['accounttype'] = $accounttype; |
| 1044 | 1044 | $this->load->view('view_reseller_package_list', $data); |
| 1045 | - }else { |
|
| 1046 | - redirect(base_url() . 'accounts/reseller_list/'); |
|
| 1045 | + } else { |
|
| 1046 | + redirect(base_url().'accounts/reseller_list/'); |
|
| 1047 | 1047 | exit; |
| 1048 | 1048 | } |
| 1049 | 1049 | } |
| 1050 | 1050 | |
| 1051 | - function reseller_refillreport($edit_id){ |
|
| 1051 | + function reseller_refillreport($edit_id) { |
|
| 1052 | 1052 | $this->customer_refillreport($edit_id); |
| 1053 | 1053 | } |
| 1054 | 1054 | function provider_refillreport($edit_id) { |
@@ -1069,7 +1069,7 @@ discard block |
||
| 1069 | 1069 | $where = array('id' => $edit_id, "reseller_id" => $reseller_id); |
| 1070 | 1070 | $account_res = $this->db_model->getSelect("type", "accounts", $where); |
| 1071 | 1071 | if ($account_res->num_rows > 0) { |
| 1072 | - $account_data = (array) $account_res->first_row(); |
|
| 1072 | + $account_data = (array)$account_res->first_row(); |
|
| 1073 | 1073 | $accounttype = strtolower($this->common->get_entity_type('', '', $account_data['type'])); |
| 1074 | 1074 | $this->load->module('reports/reports'); |
| 1075 | 1075 | $data['grid_fields'] = $this->reports->reports_form->build_refillreport_for_customer(); |
@@ -1077,7 +1077,7 @@ discard block |
||
| 1077 | 1077 | $data['accounttype'] = $accounttype; |
| 1078 | 1078 | $this->load->view('view_customer_refill_report', $data); |
| 1079 | 1079 | } else { |
| 1080 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 1080 | + redirect(base_url().'accounts/customer_list/'); |
|
| 1081 | 1081 | exit; |
| 1082 | 1082 | } |
| 1083 | 1083 | } |
@@ -1107,7 +1107,7 @@ discard block |
||
| 1107 | 1107 | $where = array('id' => $edit_id, "reseller_id" => $reseller_id); |
| 1108 | 1108 | $account_res = $this->db_model->getSelect("type", "accounts", $where); |
| 1109 | 1109 | if ($account_res->num_rows > 0) { |
| 1110 | - $account_data = (array) $account_res->first_row(); |
|
| 1110 | + $account_data = (array)$account_res->first_row(); |
|
| 1111 | 1111 | $accounttype = strtolower($this->common->get_entity_type('', '', $account_data['type'])); |
| 1112 | 1112 | $this->load->module('email/email'); |
| 1113 | 1113 | $data['grid_fields'] = $this->email->email_form->build_list_for_email_customer($edit_id, $accounttype); |
@@ -1115,7 +1115,7 @@ discard block |
||
| 1115 | 1115 | $data['accounttype'] = $accounttype; |
| 1116 | 1116 | $this->load->view('view_customer_email_history', $data); |
| 1117 | 1117 | } else { |
| 1118 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 1118 | + redirect(base_url().'accounts/customer_list/'); |
|
| 1119 | 1119 | exit; |
| 1120 | 1120 | } |
| 1121 | 1121 | } |
@@ -1146,7 +1146,7 @@ discard block |
||
| 1146 | 1146 | $where = array('id' => $edit_id, "reseller_id" => $reseller_id); |
| 1147 | 1147 | $account_res = $this->db_model->getSelect("notify_credit_limit,notify_flag,notify_email,type,id", "accounts", $where); |
| 1148 | 1148 | if ($account_res->num_rows > 0) { |
| 1149 | - $account_data = (array) $account_res->first_row(); |
|
| 1149 | + $account_data = (array)$account_res->first_row(); |
|
| 1150 | 1150 | $accounttype = strtolower($this->common->get_entity_type('', '', $account_data['type'])); |
| 1151 | 1151 | unset($account_data['type']); |
| 1152 | 1152 | $data['form'] = $this->form->build_form($this->accounts_form->customer_alert_threshold($accounttype), $account_data); |
@@ -1154,7 +1154,7 @@ discard block |
||
| 1154 | 1154 | $data['accounttype'] = $accounttype; |
| 1155 | 1155 | $this->load->view('view_customer_alert_threshold', $data); |
| 1156 | 1156 | } else { |
| 1157 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 1157 | + redirect(base_url().'accounts/customer_list/'); |
|
| 1158 | 1158 | exit; |
| 1159 | 1159 | } |
| 1160 | 1160 | } |
@@ -1167,7 +1167,7 @@ discard block |
||
| 1167 | 1167 | |
| 1168 | 1168 | function customer_alert_threshold_save($entity_type) { |
| 1169 | 1169 | $add_array = $this->input->post(); |
| 1170 | - if (isset($add_array['id']) && !empty($add_array['id'])) { |
|
| 1170 | + if (isset($add_array['id']) && ! empty($add_array['id'])) { |
|
| 1171 | 1171 | $data['page_title'] = "Alert Threshold"; |
| 1172 | 1172 | $data['form'] = $this->form->build_form($this->accounts_form->customer_alert_threshold($entity_type), $add_array); |
| 1173 | 1173 | $data['edit_id'] = $add_array['id']; |
@@ -1183,38 +1183,38 @@ discard block |
||
| 1183 | 1183 | $data['validation_errors'] = validation_errors(); |
| 1184 | 1184 | } else { |
| 1185 | 1185 | $this->db->where('id', $add_array['id']); |
| 1186 | - $id=$add_array['id']; |
|
| 1186 | + $id = $add_array['id']; |
|
| 1187 | 1187 | unset($add_array['id'], $add_array['action']); |
| 1188 | 1188 | $this->db->update('accounts', $add_array); |
| 1189 | - $this->session->set_flashdata('astpp_errormsg','Alert threshold updated successfully!'); |
|
| 1190 | - redirect(base_url() . 'accounts/'.$entity_type.'_alert_threshold/'.$id."/"); |
|
| 1189 | + $this->session->set_flashdata('astpp_errormsg', 'Alert threshold updated successfully!'); |
|
| 1190 | + redirect(base_url().'accounts/'.$entity_type.'_alert_threshold/'.$id."/"); |
|
| 1191 | 1191 | exit; |
| 1192 | 1192 | } |
| 1193 | 1193 | } else { |
| 1194 | - redirect(base_url() . 'accounts/'.$entity_type.'_list/'); |
|
| 1194 | + redirect(base_url().'accounts/'.$entity_type.'_list/'); |
|
| 1195 | 1195 | exit; |
| 1196 | 1196 | } |
| 1197 | 1197 | $this->load->view('view_customer_alert_threshold', $data); |
| 1198 | 1198 | } else { |
| 1199 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 1199 | + redirect(base_url().'accounts/customer_list/'); |
|
| 1200 | 1200 | exit; |
| 1201 | 1201 | } |
| 1202 | 1202 | } |
| 1203 | 1203 | |
| 1204 | 1204 | function customer_bulk_creation() { |
| 1205 | - $type=0; |
|
| 1205 | + $type = 0; |
|
| 1206 | 1206 | $data['entity_name'] = strtolower($this->common->get_entity_type('', '', $type)); |
| 1207 | 1207 | $data['page_title'] = 'Mass Customer'; |
| 1208 | 1208 | $data['country_id'] = Common_model::$global_config['system_config']['country']; |
| 1209 | 1209 | $data['currency_id'] = $this->common->get_field_name('id', 'currency', array('currency' => Common_model::$global_config['system_config']['base_currency'])); |
| 1210 | 1210 | $data['timezone_id'] = Common_model::$global_config['system_config']['default_timezone']; |
| 1211 | - if (!$data['timezone_id']) { |
|
| 1211 | + if ( ! $data['timezone_id']) { |
|
| 1212 | 1212 | $data['timezone_id'] = 1; |
| 1213 | 1213 | } |
| 1214 | - if (!$data['currency_id']) { |
|
| 1214 | + if ( ! $data['currency_id']) { |
|
| 1215 | 1215 | $data['currency_id'] = 1; |
| 1216 | 1216 | } |
| 1217 | - if (!$data['country_id']) { |
|
| 1217 | + if ( ! $data['country_id']) { |
|
| 1218 | 1218 | $data['country_id'] = 1; |
| 1219 | 1219 | } |
| 1220 | 1220 | $data['form'] = $this->form->build_form($this->accounts_form->customer_bulk_generate_form(), ''); |
@@ -1224,17 +1224,17 @@ discard block |
||
| 1224 | 1224 | function customer_bulk_save() { |
| 1225 | 1225 | $data['page_title'] = 'Create Bulk Customer'; |
| 1226 | 1226 | $add_array = $this->input->post(); |
| 1227 | - if (!empty($add_array) && isset($add_array)) { |
|
| 1227 | + if ( ! empty($add_array) && isset($add_array)) { |
|
| 1228 | 1228 | $currentlength = $this->accounts_model->get_max_limit($add_array); |
| 1229 | 1229 | $account_data = $this->session->userdata("accountinfo"); |
| 1230 | - $add_array['reseller_id'] = $account_data['type']==1 ? $account_data['id']:0; |
|
| 1230 | + $add_array['reseller_id'] = $account_data['type'] == 1 ? $account_data['id'] : 0; |
|
| 1231 | 1231 | $data['form'] = $this->form->build_form($this->accounts_form->customer_bulk_generate_form(), $add_array); |
| 1232 | 1232 | if ($this->form_validation->run() == FALSE) { |
| 1233 | 1233 | $data['validation_errors'] = validation_errors(); |
| 1234 | 1234 | echo $data['validation_errors']; |
| 1235 | 1235 | exit; |
| 1236 | 1236 | } |
| 1237 | - if($currentlength <= 0){ |
|
| 1237 | + if ($currentlength <= 0) { |
|
| 1238 | 1238 | echo json_encode(array("prefix_error" => "Your Account Limit has been reached.Please Change Your Prefix.")); |
| 1239 | 1239 | exit; |
| 1240 | 1240 | } |
@@ -1243,7 +1243,7 @@ discard block |
||
| 1243 | 1243 | exit; |
| 1244 | 1244 | } |
| 1245 | 1245 | if ($currentlength > 0 && $add_array['count'] > $currentlength) { |
| 1246 | - echo json_encode(array("count_error" => "You Can Create Maximum " . $currentlength . " accounts with " . $add_array['prefix'] . " prefix")); |
|
| 1246 | + echo json_encode(array("count_error" => "You Can Create Maximum ".$currentlength." accounts with ".$add_array['prefix']." prefix")); |
|
| 1247 | 1247 | exit; |
| 1248 | 1248 | } else { |
| 1249 | 1249 | $this->accounts_model->bulk_insert_accounts($add_array); |
@@ -1251,7 +1251,7 @@ discard block |
||
| 1251 | 1251 | exit; |
| 1252 | 1252 | } |
| 1253 | 1253 | } else { |
| 1254 | - redirect(base_url() . "accounts/customer_list/"); |
|
| 1254 | + redirect(base_url()."accounts/customer_list/"); |
|
| 1255 | 1255 | } |
| 1256 | 1256 | } |
| 1257 | 1257 | |
@@ -1268,13 +1268,13 @@ discard block |
||
| 1268 | 1268 | |
| 1269 | 1269 | function customer_did_country() { |
| 1270 | 1270 | $country_id = $_POST['country_id']; |
| 1271 | - $accountid= $this->input->post('accountid',true); |
|
| 1271 | + $accountid = $this->input->post('accountid', true); |
|
| 1272 | 1272 | $accountinfo = $this->session->userdata("accountinfo"); |
| 1273 | - $entity_info=(array)$this->db->get_where('accounts',array("id"=>$accountid))->first_row(); |
|
| 1273 | + $entity_info = (array)$this->db->get_where('accounts', array("id"=>$accountid))->first_row(); |
|
| 1274 | 1274 | $reseller_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : 0; |
| 1275 | 1275 | if ($entity_info['reseller_id'] > 0) { |
| 1276 | 1276 | $parent_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : $accountinfo['reseller_id']; |
| 1277 | - $query = 'select dids.id as id,dids.number as number,reseller_pricing.setup as setup, reseller_pricing.monthlycost as monthlycost from dids,reseller_pricing where dids.number= reseller_pricing.note and reseller_pricing.reseller_id =' . $parent_id . " and dids.accountid=0 and dids.country_id =" . $country_id; |
|
| 1277 | + $query = 'select dids.id as id,dids.number as number,reseller_pricing.setup as setup, reseller_pricing.monthlycost as monthlycost from dids,reseller_pricing where dids.number= reseller_pricing.note and reseller_pricing.reseller_id ='.$parent_id." and dids.accountid=0 and dids.country_id =".$country_id; |
|
| 1278 | 1278 | $did_list = $this->db->query($query); |
| 1279 | 1279 | } else { |
| 1280 | 1280 | $did_list = $this->db_model->getSelect("id,number,setup,monthlycost", "dids", array('country_id' => $country_id, 'accountid' => '0', 'parent_id' => $reseller_id)); |
@@ -1283,7 +1283,7 @@ discard block |
||
| 1283 | 1283 | if ($did_list->num_rows > 0) { |
| 1284 | 1284 | $did_data = $did_list->result_array(); |
| 1285 | 1285 | foreach ($did_data as $key => $value) { |
| 1286 | - $did_arr[$value['id']] = $value['number'] . " (Setup Cost : " . $this->common_model->calculate_currency($value['setup'], '', '', true) . ") (Monthly cost : " . $this->common_model->calculate_currency($value['monthlycost'], '', '', true) . ")"; |
|
| 1286 | + $did_arr[$value['id']] = $value['number']." (Setup Cost : ".$this->common_model->calculate_currency($value['setup'], '', '', true).") (Monthly cost : ".$this->common_model->calculate_currency($value['monthlycost'], '', '', true).")"; |
|
| 1287 | 1287 | } |
| 1288 | 1288 | } |
| 1289 | 1289 | $did_info = array("name" => "free_didlist", "id" => "free_didlist", "class" => "free_didlist"); |
@@ -1318,28 +1318,28 @@ discard block |
||
| 1318 | 1318 | $username = $this->session->userdata('username'); |
| 1319 | 1319 | $login_user_data = $this->session->userdata("accountinfo"); |
| 1320 | 1320 | $accountinfo = $this->accounts_model->get_account_by_number($post_array['id']); |
| 1321 | - if($accountinfo['reseller_id'] == 0){ |
|
| 1321 | + if ($accountinfo['reseller_id'] == 0) { |
|
| 1322 | 1322 | $where = array("accountid"=> 1); |
| 1323 | - }else{ |
|
| 1323 | + } else { |
|
| 1324 | 1324 | $where = array("accountid"=> $accountinfo['id']); |
| 1325 | 1325 | } |
| 1326 | 1326 | $query = $this->db_model->getSelect("*", "invoice_conf", $where); |
| 1327 | - if($query->num_rows >0){ |
|
| 1327 | + if ($query->num_rows > 0) { |
|
| 1328 | 1328 | $invoice_conf = $query->result_array(); |
| 1329 | 1329 | $invoice_conf = $invoice_conf[0]; |
| 1330 | - }else{ |
|
| 1331 | - $query = $this->db_model->getSelect("*", "invoice_conf",array("accountid"=> 1)); |
|
| 1330 | + } else { |
|
| 1331 | + $query = $this->db_model->getSelect("*", "invoice_conf", array("accountid"=> 1)); |
|
| 1332 | 1332 | $invoice_conf = $query->result_array(); |
| 1333 | 1333 | $invoice_conf = $invoice_conf[0]; |
| 1334 | 1334 | } |
| 1335 | - $last_invoice_ID = $this->get_invoice_date("invoiceid",$accountinfo["id"]); |
|
| 1336 | - $invoice_prefix=$invoice_conf['invoice_prefix']; |
|
| 1337 | - $due_date = gmdate("Y-m-d H:i:s",strtotime(gmdate("Y-m-d H:i:s")." +".$invoice_conf['interval']." days")); |
|
| 1335 | + $last_invoice_ID = $this->get_invoice_date("invoiceid", $accountinfo["id"]); |
|
| 1336 | + $invoice_prefix = $invoice_conf['invoice_prefix']; |
|
| 1337 | + $due_date = gmdate("Y-m-d H:i:s", strtotime(gmdate("Y-m-d H:i:s")." +".$invoice_conf['interval']." days")); |
|
| 1338 | 1338 | $response = $this->accounts_model->account_process_payment($post_array); |
| 1339 | 1339 | |
| 1340 | - if($post_array['payment_type']== 1 ){ |
|
| 1340 | + if ($post_array['payment_type'] == 1) { |
|
| 1341 | 1341 | $this->load->module('invoices/invoices'); |
| 1342 | - $invoice_id=$this->invoices->invoices->generate_receipt($post_array['id'],$post_array['credit'],$accountinfo,$last_invoice_ID+1,$invoice_prefix,$due_date); |
|
| 1342 | + $invoice_id = $this->invoices->invoices->generate_receipt($post_array['id'], $post_array['credit'], $accountinfo, $last_invoice_ID + 1, $invoice_prefix, $due_date); |
|
| 1343 | 1343 | $account_balance = $this->common->get_field_name('balance', 'accounts', $post_array['id']); |
| 1344 | 1344 | $insert_arr = array("accountid" => $post_array['id'], |
| 1345 | 1345 | "description" => trim($post_array['notes']), |
@@ -1350,13 +1350,13 @@ discard block |
||
| 1350 | 1350 | "reseller_id"=>'0', |
| 1351 | 1351 | "item_type"=>'POSTCHARG', |
| 1352 | 1352 | "item_id"=>'0', |
| 1353 | - 'before_balance'=>$account_balance+$post_array['credit'], |
|
| 1353 | + 'before_balance'=>$account_balance + $post_array['credit'], |
|
| 1354 | 1354 | 'after_balance'=>$account_balance, |
| 1355 | 1355 | ); |
| 1356 | 1356 | $this->db->insert("invoice_details", $insert_arr); |
| 1357 | - }else{ |
|
| 1357 | + } else { |
|
| 1358 | 1358 | $this->load->module('invoices/invoices'); |
| 1359 | - $invoice_id=$this->invoices->invoices->generate_receipt($post_array['id'],$post_array['credit'],$accountinfo,$last_invoice_ID+1,$invoice_prefix,$due_date); |
|
| 1359 | + $invoice_id = $this->invoices->invoices->generate_receipt($post_array['id'], $post_array['credit'], $accountinfo, $last_invoice_ID + 1, $invoice_prefix, $due_date); |
|
| 1360 | 1360 | $account_balance = $this->common->get_field_name('balance', 'accounts', $post_array['id']); |
| 1361 | 1361 | $insert_arr = array("accountid" => $post_array['id'], |
| 1362 | 1362 | "description" => trim($post_array['notes']), |
@@ -1367,22 +1367,22 @@ discard block |
||
| 1367 | 1367 | "reseller_id"=>$accountinfo['reseller_id'], |
| 1368 | 1368 | "item_type"=>'Refill', |
| 1369 | 1369 | "item_id"=>'0', |
| 1370 | - 'before_balance'=>$account_balance-$post_array['credit'], |
|
| 1370 | + 'before_balance'=>$account_balance - $post_array['credit'], |
|
| 1371 | 1371 | 'after_balance'=>$account_balance, |
| 1372 | 1372 | ); |
| 1373 | 1373 | $this->db->insert("invoice_details", $insert_arr); |
| 1374 | - if($login_user_data['type'] ==1){ |
|
| 1375 | - $reseller_ids=$this->common->get_parent_info($login_user_data['id'],0); |
|
| 1376 | - $reseller_ids=rtrim($reseller_ids,","); |
|
| 1377 | - $reseller_arr=explode(",",$reseller_ids); |
|
| 1378 | - if(!empty($reseller_arr)){ |
|
| 1379 | - $custom_array=$post_array; |
|
| 1380 | - foreach($reseller_arr as $key=>$reseller_id){ |
|
| 1381 | - $custom_array['id']=$reseller_id; |
|
| 1374 | + if ($login_user_data['type'] == 1) { |
|
| 1375 | + $reseller_ids = $this->common->get_parent_info($login_user_data['id'], 0); |
|
| 1376 | + $reseller_ids = rtrim($reseller_ids, ","); |
|
| 1377 | + $reseller_arr = explode(",", $reseller_ids); |
|
| 1378 | + if ( ! empty($reseller_arr)) { |
|
| 1379 | + $custom_array = $post_array; |
|
| 1380 | + foreach ($reseller_arr as $key=>$reseller_id) { |
|
| 1381 | + $custom_array['id'] = $reseller_id; |
|
| 1382 | 1382 | $response = $this->accounts_model->account_process_payment($custom_array); |
| 1383 | - $reseller_info=(array)$this->db->get_where('accounts',array("id"=>$reseller_id))->first_row(); |
|
| 1384 | - $last_invoice_ID = $this->get_invoice_date("invoiceid",$reseller_info["id"]); |
|
| 1385 | - $invoice_id=$this->invoices->invoices->generate_receipt($reseller_info['id'],$custom_array['credit'],$reseller_info,$last_invoice_ID+1,$invoice_prefix,$due_date); |
|
| 1383 | + $reseller_info = (array)$this->db->get_where('accounts', array("id"=>$reseller_id))->first_row(); |
|
| 1384 | + $last_invoice_ID = $this->get_invoice_date("invoiceid", $reseller_info["id"]); |
|
| 1385 | + $invoice_id = $this->invoices->invoices->generate_receipt($reseller_info['id'], $custom_array['credit'], $reseller_info, $last_invoice_ID + 1, $invoice_prefix, $due_date); |
|
| 1386 | 1386 | $account_balance = $this->common->get_field_name('balance', 'accounts', $reseller_info['id']); |
| 1387 | 1387 | $insert_arr = array("accountid" => $reseller_info['id'], |
| 1388 | 1388 | "description" => trim($custom_array['notes']), |
@@ -1413,11 +1413,11 @@ discard block |
||
| 1413 | 1413 | /** |
| 1414 | 1414 | * @param string $select |
| 1415 | 1415 | */ |
| 1416 | - function get_invoice_date($select,$accountid){ |
|
| 1417 | - $query = $this->db_model->select($select, "invoices", '',"id","DESC","1","0"); |
|
| 1418 | - if($query->num_rows >0){ |
|
| 1416 | + function get_invoice_date($select, $accountid) { |
|
| 1417 | + $query = $this->db_model->select($select, "invoices", '', "id", "DESC", "1", "0"); |
|
| 1418 | + if ($query->num_rows > 0) { |
|
| 1419 | 1419 | $invoiceid = $query->result_array(); |
| 1420 | - $invoice_date=$invoiceid[0][$select]; |
|
| 1420 | + $invoice_date = $invoiceid[0][$select]; |
|
| 1421 | 1421 | return $invoice_date; |
| 1422 | 1422 | } |
| 1423 | 1423 | return false; |
@@ -1454,7 +1454,7 @@ discard block |
||
| 1454 | 1454 | $data['form'] = $this->form->build_form($this->accounts_form->get_customer_callerid_fields(), $data); |
| 1455 | 1455 | $post_array = $this->input->post(); |
| 1456 | 1456 | |
| 1457 | - if (!empty($post_array)) { |
|
| 1457 | + if ( ! empty($post_array)) { |
|
| 1458 | 1458 | if ($this->form_validation->run() == FALSE) { |
| 1459 | 1459 | $data['validation_errors'] = validation_errors(); |
| 1460 | 1460 | echo $data['validation_errors']; |
@@ -1483,13 +1483,13 @@ discard block |
||
| 1483 | 1483 | $data['country_id'] = $accountinfo['country_id']; |
| 1484 | 1484 | $data['currency_id'] = $accountinfo['currency_id']; |
| 1485 | 1485 | $data['timezone_id'] = $accountinfo['timezone_id']; |
| 1486 | - if (!$data['timezone_id']) { |
|
| 1486 | + if ( ! $data['timezone_id']) { |
|
| 1487 | 1487 | $data['timezone_id'] = 1; |
| 1488 | 1488 | } |
| 1489 | - if (!$data['currency_id']) { |
|
| 1489 | + if ( ! $data['currency_id']) { |
|
| 1490 | 1490 | $data['currency_id'] = 1; |
| 1491 | 1491 | } |
| 1492 | - if (!$data['country_id']) { |
|
| 1492 | + if ( ! $data['country_id']) { |
|
| 1493 | 1493 | $data['country_id'] = 1; |
| 1494 | 1494 | } |
| 1495 | 1495 | |
@@ -1517,17 +1517,17 @@ discard block |
||
| 1517 | 1517 | * */ |
| 1518 | 1518 | $encrypted_string = $this->common->encode($edit_data['id']); |
| 1519 | 1519 | $encrypt = $this->common->encode_params($encrypted_string); |
| 1520 | - $edit_data['registration_url'] = base_url() . "signup/" . $encrypt; |
|
| 1520 | + $edit_data['registration_url'] = base_url()."signup/".$encrypt; |
|
| 1521 | 1521 | /* * *********************************************************** */ |
| 1522 | 1522 | /* * *** |
| 1523 | 1523 | ASTPP 3.0 |
| 1524 | 1524 | Password decode |
| 1525 | 1525 | * **** */ |
| 1526 | 1526 | $edit_data['password'] = $this->common->decode($edit_data['password']); |
| 1527 | - $edit_data['credit_limit']=$this->common_model->calculate_currency(($edit_data['credit_limit']),'','',true,false); |
|
| 1527 | + $edit_data['credit_limit'] = $this->common_model->calculate_currency(($edit_data['credit_limit']), '', '', true, false); |
|
| 1528 | 1528 | $entity_name = strtolower($this->common->get_entity_type('', '', $edit_data['type'])); |
| 1529 | - $data['edit_id']=$edit_id; |
|
| 1530 | - $data['page_title'] =ucfirst($entity_name)." Profile"; |
|
| 1529 | + $data['edit_id'] = $edit_id; |
|
| 1530 | + $data['page_title'] = ucfirst($entity_name)." Profile"; |
|
| 1531 | 1531 | $data['entity_name'] = $entity_name; |
| 1532 | 1532 | /* * ********************** */ |
| 1533 | 1533 | $data['form'] = $this->form->build_form($this->accounts_form->get_form_reseller_fields($edit_id), $edit_data); |
@@ -1543,7 +1543,7 @@ discard block |
||
| 1543 | 1543 | $data['timezone_id'] = $add_array['timezone_id']; |
| 1544 | 1544 | $data['currency_id'] = $add_array['currency_id']; |
| 1545 | 1545 | $data['entity_name'] = $entity_name; |
| 1546 | - $data['edit_id']=$add_array['id']; |
|
| 1546 | + $data['edit_id'] = $add_array['id']; |
|
| 1547 | 1547 | $data['form'] = $this->form->build_form($this->accounts_form->get_form_reseller_fields($add_array['id']), $add_array); |
| 1548 | 1548 | if ($add_array['id'] != '') { |
| 1549 | 1549 | $data['page_title'] = 'Edit Reseller'; |
@@ -1568,11 +1568,11 @@ discard block |
||
| 1568 | 1568 | } |
| 1569 | 1569 | unset($add_array['tax_id']); |
| 1570 | 1570 | } |
| 1571 | - unset($add_array['number'],$add_array['registration_url']); |
|
| 1571 | + unset($add_array['number'], $add_array['registration_url']); |
|
| 1572 | 1572 | $this->accounts_model->edit_account($add_array, $add_array['id']); |
| 1573 | 1573 | $this->session->set_flashdata('astpp_errormsg', 'Reseller updated successfully!'); |
| 1574 | 1574 | |
| 1575 | - redirect(base_url() . 'accounts/reseller_list/'); |
|
| 1575 | + redirect(base_url().'accounts/reseller_list/'); |
|
| 1576 | 1576 | exit; |
| 1577 | 1577 | } |
| 1578 | 1578 | $data["account_data"]["0"] = $add_array; |
@@ -1620,7 +1620,7 @@ discard block |
||
| 1620 | 1620 | unset($add_array['tax_id']); |
| 1621 | 1621 | } |
| 1622 | 1622 | $this->session->set_flashdata('astpp_errormsg', 'Reseller added successfully!'); |
| 1623 | - redirect(base_url() . 'accounts/reseller_list/'); |
|
| 1623 | + redirect(base_url().'accounts/reseller_list/'); |
|
| 1624 | 1624 | exit; |
| 1625 | 1625 | } |
| 1626 | 1626 | $this->load->view('view_accounts_create', $data); |
@@ -1635,7 +1635,7 @@ discard block |
||
| 1635 | 1635 | echo $this->common->generate_password(); |
| 1636 | 1636 | } |
| 1637 | 1637 | |
| 1638 | - function customer_generate_number($digit='') { |
|
| 1638 | + function customer_generate_number($digit = '') { |
|
| 1639 | 1639 | |
| 1640 | 1640 | echo $this->common->find_uniq_rendno($digit, 'number', 'accounts'); |
| 1641 | 1641 | } |
@@ -1646,19 +1646,19 @@ discard block |
||
| 1646 | 1646 | $entitytype = str_replace(' ', '', $entity_type); |
| 1647 | 1647 | $data['username'] = $this->session->userdata('user_name'); |
| 1648 | 1648 | $data['flag'] = 'create'; |
| 1649 | - $data['page_title'] = 'Create ' . ucfirst($entity_type); |
|
| 1649 | + $data['page_title'] = 'Create '.ucfirst($entity_type); |
|
| 1650 | 1650 | $data['back_flag'] = true; |
| 1651 | 1651 | $data['form'] = $this->form->build_form($this->accounts_form->get_form_admin_fields($entitytype), ''); |
| 1652 | 1652 | $data['country_id'] = $accountinfo['country_id']; |
| 1653 | 1653 | $data['currency_id'] = $accountinfo['currency_id']; |
| 1654 | 1654 | $data['timezone_id'] = $accountinfo['timezone_id']; |
| 1655 | - if (!$data['timezone_id']) { |
|
| 1655 | + if ( ! $data['timezone_id']) { |
|
| 1656 | 1656 | $data['timezone_id'] = 1; |
| 1657 | 1657 | } |
| 1658 | - if (!$data['currency_id']) { |
|
| 1658 | + if ( ! $data['currency_id']) { |
|
| 1659 | 1659 | $data['currency_id'] = 1; |
| 1660 | 1660 | } |
| 1661 | - if (!$data['country_id']) { |
|
| 1661 | + if ( ! $data['country_id']) { |
|
| 1662 | 1662 | $data['country_id'] = 1; |
| 1663 | 1663 | } |
| 1664 | 1664 | $data['entity_name'] = $entity_type; |
@@ -1667,13 +1667,13 @@ discard block |
||
| 1667 | 1667 | |
| 1668 | 1668 | function admin_edit($edit_id = '') { |
| 1669 | 1669 | $data['back_flag'] = true; |
| 1670 | - $accountinfo=(array)$this->db->get_where('accounts',array("id"=>$edit_id))->first_row(); |
|
| 1670 | + $accountinfo = (array)$this->db->get_where('accounts', array("id"=>$edit_id))->first_row(); |
|
| 1671 | 1671 | $type = $accountinfo['type'] == -1 ? 2 : $accountinfo['type']; |
| 1672 | 1672 | $entity_type = strtolower($this->common->get_entity_type('', '', $type)); |
| 1673 | 1673 | $entitytype = str_replace(' ', '', $entity_type); |
| 1674 | 1674 | $accountinfo['password'] = $this->common->decode($accountinfo['password']); |
| 1675 | 1675 | $data['form'] = $this->form->build_form($this->accounts_form->get_form_admin_fields($entitytype, $edit_id), $accountinfo); |
| 1676 | - $data['page_title'] = 'Edit ' . ucfirst($entity_type); |
|
| 1676 | + $data['page_title'] = 'Edit '.ucfirst($entity_type); |
|
| 1677 | 1677 | $this->load->view('view_admin_details', $data); |
| 1678 | 1678 | |
| 1679 | 1679 | } |
@@ -1686,10 +1686,10 @@ discard block |
||
| 1686 | 1686 | $entitytype = str_replace(' ', '', $entity_type); |
| 1687 | 1687 | $data['username'] = $this->session->userdata('user_name'); |
| 1688 | 1688 | $data['flag'] = 'create'; |
| 1689 | - $data['page_title'] = 'Create ' . $entity_type; |
|
| 1689 | + $data['page_title'] = 'Create '.$entity_type; |
|
| 1690 | 1690 | $data['form'] = $this->form->build_form($this->accounts_form->get_form_admin_fields($entitytype, $add_array['id']), $add_array); |
| 1691 | 1691 | if ($add_array['id'] != '') { |
| 1692 | - $data['page_title'] = 'Edit ' . $entity_type; |
|
| 1692 | + $data['page_title'] = 'Edit '.$entity_type; |
|
| 1693 | 1693 | if ($this->form_validation->run() == FALSE) { |
| 1694 | 1694 | $data['validation_errors'] = validation_errors(); |
| 1695 | 1695 | } else { |
@@ -1718,13 +1718,13 @@ discard block |
||
| 1718 | 1718 | $result = $result->result_array(); |
| 1719 | 1719 | $this->session->set_userdata('accountinfo', $result[0]); |
| 1720 | 1720 | } |
| 1721 | - $this->session->set_flashdata('astpp_errormsg', ucfirst($entity_type) . ' updated successfully!'); |
|
| 1722 | - redirect(base_url() . 'accounts/admin_list/'); |
|
| 1721 | + $this->session->set_flashdata('astpp_errormsg', ucfirst($entity_type).' updated successfully!'); |
|
| 1722 | + redirect(base_url().'accounts/admin_list/'); |
|
| 1723 | 1723 | exit; |
| 1724 | 1724 | } |
| 1725 | 1725 | $this->load->view('view_admin_details', $data); |
| 1726 | 1726 | } else { |
| 1727 | - $data['page_title'] = 'Create ' . ucfirst($entity_type); |
|
| 1727 | + $data['page_title'] = 'Create '.ucfirst($entity_type); |
|
| 1728 | 1728 | if ($this->form_validation->run() == FALSE) { |
| 1729 | 1729 | $data['validation_errors'] = validation_errors(); |
| 1730 | 1730 | } else { |
@@ -1742,8 +1742,8 @@ discard block |
||
| 1742 | 1742 | } |
| 1743 | 1743 | $add_array['credit_limit'] = $this->common_model->add_calculate_currency($add_array['credit_limit'], '', '', false, false); |
| 1744 | 1744 | |
| 1745 | - $this->session->set_flashdata('astpp_errormsg', ucfirst($entity_type) . ' added successfully!'); |
|
| 1746 | - redirect(base_url() . 'accounts/admin_list/'); |
|
| 1745 | + $this->session->set_flashdata('astpp_errormsg', ucfirst($entity_type).' added successfully!'); |
|
| 1746 | + redirect(base_url().'accounts/admin_list/'); |
|
| 1747 | 1747 | exit; |
| 1748 | 1748 | }$this->load->view('view_accounts_create', $data); |
| 1749 | 1749 | } |
@@ -1894,12 +1894,12 @@ discard block |
||
| 1894 | 1894 | $action['balance']['balance'] = $this->common_model->add_calculate_currency($action['balance']['balance'], "", '', true, false); |
| 1895 | 1895 | } |
| 1896 | 1896 | if (isset($action['credit_limit']['credit_limit']) && $action['credit_limit']['credit_limit'] != '') { |
| 1897 | - $action['credit_limit']['credit_limit'] = $this->common_model->add_calculate_currency($action['credit_limit']['credit_limit'], "", '',true, false); |
|
| 1897 | + $action['credit_limit']['credit_limit'] = $this->common_model->add_calculate_currency($action['credit_limit']['credit_limit'], "", '', true, false); |
|
| 1898 | 1898 | } |
| 1899 | 1899 | $this->session->set_userdata('reseller_list_search', $action); |
| 1900 | 1900 | } |
| 1901 | 1901 | if (@$ajax_search != 1) { |
| 1902 | - redirect(base_url() . 'accounts/reseller_list/'); |
|
| 1902 | + redirect(base_url().'accounts/reseller_list/'); |
|
| 1903 | 1903 | } |
| 1904 | 1904 | } |
| 1905 | 1905 | |
@@ -1925,7 +1925,7 @@ discard block |
||
| 1925 | 1925 | $this->session->set_userdata('admin_list_search', $action); |
| 1926 | 1926 | } |
| 1927 | 1927 | if (@$ajax_search != 1) { |
| 1928 | - redirect(base_url() . 'accounts/admin_list/'); |
|
| 1928 | + redirect(base_url().'accounts/admin_list/'); |
|
| 1929 | 1929 | } |
| 1930 | 1930 | } |
| 1931 | 1931 | |
@@ -1938,13 +1938,13 @@ discard block |
||
| 1938 | 1938 | function customer_delete($id) { |
| 1939 | 1939 | $this->common->customer_delete_dependencies($id); |
| 1940 | 1940 | $this->session->set_flashdata('astpp_notification', 'Customer removed successfully!'); |
| 1941 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 1941 | + redirect(base_url().'accounts/customer_list/'); |
|
| 1942 | 1942 | } |
| 1943 | 1943 | |
| 1944 | 1944 | function reseller_delete($id) { |
| 1945 | 1945 | $this->common->subreseller_list($id); |
| 1946 | 1946 | $this->session->set_flashdata('astpp_notification', 'Reseller removed successfully!'); |
| 1947 | - redirect(base_url() . 'accounts/reseller_list/'); |
|
| 1947 | + redirect(base_url().'accounts/reseller_list/'); |
|
| 1948 | 1948 | } |
| 1949 | 1949 | |
| 1950 | 1950 | function free_customer_did($accountid) { |
@@ -1975,19 +1975,19 @@ discard block |
||
| 1975 | 1975 | function provider_delete($id) { |
| 1976 | 1976 | $this->accounts_model->remove_customer($id); |
| 1977 | 1977 | $this->session->set_flashdata('astpp_notification', 'Provider removed successfully!'); |
| 1978 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 1978 | + redirect(base_url().'accounts/customer_list/'); |
|
| 1979 | 1979 | } |
| 1980 | 1980 | |
| 1981 | 1981 | function admin_delete($id) { |
| 1982 | 1982 | $this->accounts_model->remove_customer($id); |
| 1983 | 1983 | $this->session->set_flashdata('astpp_notification', 'Admin removed successfully!'); |
| 1984 | - redirect(base_url() . 'accounts/admin_list/'); |
|
| 1984 | + redirect(base_url().'accounts/admin_list/'); |
|
| 1985 | 1985 | } |
| 1986 | 1986 | |
| 1987 | 1987 | function subadmin_delete($id) { |
| 1988 | 1988 | $this->accounts_model->remove_customer($id); |
| 1989 | 1989 | $this->session->set_flashdata('astpp_notification', 'Sub admin removed successfully!'); |
| 1990 | - redirect(base_url() . 'accounts/admin_list/'); |
|
| 1990 | + redirect(base_url().'accounts/admin_list/'); |
|
| 1991 | 1991 | } |
| 1992 | 1992 | |
| 1993 | 1993 | function reseller_details_json($module, $accountid) { |
@@ -1998,13 +1998,13 @@ discard block |
||
| 1998 | 1998 | } |
| 1999 | 1999 | if ($module == "invoices") { |
| 2000 | 2000 | $this->load->module('invoices/invoices'); |
| 2001 | - $this->invoices->customer_invoices($accountid,"reseller"); |
|
| 2001 | + $this->invoices->customer_invoices($accountid, "reseller"); |
|
| 2002 | 2002 | } |
| 2003 | 2003 | if ($module == "charges") { |
| 2004 | 2004 | $this->load->module('charges/charges'); |
| 2005 | 2005 | $this->charges->customer_charge_list($accountid, "reseller"); |
| 2006 | 2006 | } |
| 2007 | - if($module =='packages'){ |
|
| 2007 | + if ($module == 'packages') { |
|
| 2008 | 2008 | $this->load->module('package/package'); |
| 2009 | 2009 | $this->package->package_list_reseller($accountid, "reseller"); |
| 2010 | 2010 | } |
@@ -2027,9 +2027,9 @@ discard block |
||
| 2027 | 2027 | $this->db->insert("invoice_item", $insert_arr); |
| 2028 | 2028 | |
| 2029 | 2029 | $this->accounts_model->update_balance($charge, $accountid, "debit"); |
| 2030 | - redirect(base_url() . "accounts/" . $accounttype . "_edit/$accountid#packages"); |
|
| 2030 | + redirect(base_url()."accounts/".$accounttype."_edit/$accountid#packages"); |
|
| 2031 | 2031 | } else { |
| 2032 | - redirect(base_url() . "accounts/" . $accounttype . "_edit/$accountid#packages"); |
|
| 2032 | + redirect(base_url()."accounts/".$accounttype."_edit/$accountid#packages"); |
|
| 2033 | 2033 | } |
| 2034 | 2034 | } |
| 2035 | 2035 | |
@@ -2047,9 +2047,9 @@ discard block |
||
| 2047 | 2047 | $this->did->did_model->add_reseller_pricing($accountid, $did_id); |
| 2048 | 2048 | |
| 2049 | 2049 | $this->session->set_flashdata('astpp_errormsg', 'DID added successfully.'); |
| 2050 | - redirect(base_url() . "accounts/" . $accounttype . "_edit/$accountid#did"); |
|
| 2050 | + redirect(base_url()."accounts/".$accounttype."_edit/$accountid#did"); |
|
| 2051 | 2051 | } else { |
| 2052 | - redirect(base_url() . "accounts/" . $accounttype . "_edit/$accountid#did"); |
|
| 2052 | + redirect(base_url()."accounts/".$accounttype."_edit/$accountid#did"); |
|
| 2053 | 2053 | } |
| 2054 | 2054 | } |
| 2055 | 2055 | if ($action == "delete") { |
@@ -2078,14 +2078,14 @@ discard block |
||
| 2078 | 2078 | } else { |
| 2079 | 2079 | $this->session->set_flashdata('astpp_notification', 'DID already removed before.'); |
| 2080 | 2080 | } |
| 2081 | - redirect(base_url() . "accounts/" . $accounttype . "_edit/$accountid#did"); |
|
| 2081 | + redirect(base_url()."accounts/".$accounttype."_edit/$accountid#did"); |
|
| 2082 | 2082 | } |
| 2083 | 2083 | } |
| 2084 | 2084 | |
| 2085 | 2085 | function customer_selected_delete() { |
| 2086 | 2086 | $ids = $this->input->post("selected_ids", true); |
| 2087 | - $customer_ids=explode(",",$ids); |
|
| 2088 | - foreach($customer_ids as $customer_id){ |
|
| 2087 | + $customer_ids = explode(",", $ids); |
|
| 2088 | + foreach ($customer_ids as $customer_id) { |
|
| 2089 | 2089 | $customer_id = str_replace("'", "", $customer_id); |
| 2090 | 2090 | $this->common->customer_delete_dependencies($customer_id); |
| 2091 | 2091 | } |
@@ -2153,7 +2153,7 @@ discard block |
||
| 2153 | 2153 | } |
| 2154 | 2154 | } |
| 2155 | 2155 | $this->session->set_flashdata('astpp_errormsg', 'Account tax added successfully!'); |
| 2156 | - redirect(base_url() . 'accounts/customer_list/'); |
|
| 2156 | + redirect(base_url().'accounts/customer_list/'); |
|
| 2157 | 2157 | } |
| 2158 | 2158 | $data['id'] = array(); |
| 2159 | 2159 | $data['taxesList'] = $this->common_model->get_list_taxes(); |
@@ -2185,9 +2185,9 @@ discard block |
||
| 2185 | 2185 | } |
| 2186 | 2186 | } |
| 2187 | 2187 | if ($accountinfo['type'] == '0') { |
| 2188 | - $link = base_url() . '/accounts/customer_list/'; |
|
| 2188 | + $link = base_url().'/accounts/customer_list/'; |
|
| 2189 | 2189 | } else { |
| 2190 | - $link = base_url() . '/accounts/reseller_list/'; |
|
| 2190 | + $link = base_url().'/accounts/reseller_list/'; |
|
| 2191 | 2191 | } |
| 2192 | 2192 | $this->session->set_flashdata('astpp_errormsg', 'Account tax added successfully!'); |
| 2193 | 2193 | redirect($link); |
@@ -2197,7 +2197,7 @@ discard block |
||
| 2197 | 2197 | } elseif ($action == 'delete') { |
| 2198 | 2198 | $this->accounting_model->remove_account_tax($id); |
| 2199 | 2199 | $this->session->set_flashdata('astpp_notification', 'Account tax removed successfully!'); |
| 2200 | - redirect(base_url() . 'accounting/account_taxes/'); |
|
| 2200 | + redirect(base_url().'accounting/account_taxes/'); |
|
| 2201 | 2201 | } |
| 2202 | 2202 | } |
| 2203 | 2203 | |
@@ -2208,7 +2208,7 @@ discard block |
||
| 2208 | 2208 | */ |
| 2209 | 2209 | function valid_account_tax() { |
| 2210 | 2210 | $tax_id = ''; |
| 2211 | - if (!empty($_POST['username'])) { |
|
| 2211 | + if ( ! empty($_POST['username'])) { |
|
| 2212 | 2212 | |
| 2213 | 2213 | $account_num = mysql_real_escape_string($_POST['username']); |
| 2214 | 2214 | $row = $this->accounts_model->check_account_num($account_num); |
@@ -2216,11 +2216,11 @@ discard block |
||
| 2216 | 2216 | $taxes_id = $this->accounts_model->get_accounttax_by_id($row['accountid']); |
| 2217 | 2217 | if ($taxes_id) { |
| 2218 | 2218 | foreach ($taxes_id as $id) { |
| 2219 | - $tax_id.=$id['taxes_id'] . ","; |
|
| 2219 | + $tax_id .= $id['taxes_id'].","; |
|
| 2220 | 2220 | } |
| 2221 | 2221 | |
| 2222 | 2222 | $tax_id = rtrim($tax_id, ","); |
| 2223 | - echo $row['accountid'] . ',' . $tax_id; |
|
| 2223 | + echo $row['accountid'].','.$tax_id; |
|
| 2224 | 2224 | } else { |
| 2225 | 2225 | echo $row['accountid']; |
| 2226 | 2226 | } |
@@ -2246,7 +2246,7 @@ discard block |
||
| 2246 | 2246 | $this->session->set_userdata('accountinfo', $result[0]); |
| 2247 | 2247 | } |
| 2248 | 2248 | $this->session->set_flashdata('astpp_errormsg', 'Reseller updated successfully!'); |
| 2249 | - redirect(base_url() . '/dashboard/'); |
|
| 2249 | + redirect(base_url().'/dashboard/'); |
|
| 2250 | 2250 | } |
| 2251 | 2251 | $this->load->view('view_reseller_edit_details_own', $data); |
| 2252 | 2252 | } else { |
@@ -2303,7 +2303,7 @@ discard block |
||
| 2303 | 2303 | echo "2"; |
| 2304 | 2304 | exit; |
| 2305 | 2305 | } |
| 2306 | - if (isset($add_array['number']) && !empty($add_array['number'])) { |
|
| 2306 | + if (isset($add_array['number']) && ! empty($add_array['number'])) { |
|
| 2307 | 2307 | if (isset($add_array['id']) && $add_array['id'] != '') { |
| 2308 | 2308 | unset($add_array['animap_id']); |
| 2309 | 2309 | $response = $this->accounts_model->edit_animap($add_array, $add_array['id']); |
@@ -2337,7 +2337,7 @@ discard block |
||
| 2337 | 2337 | } |
| 2338 | 2338 | $value_edit = ''; |
| 2339 | 2339 | foreach ($edit_data as $key => $value) { |
| 2340 | - $value_edit.=$value . ","; |
|
| 2340 | + $value_edit .= $value.","; |
|
| 2341 | 2341 | } |
| 2342 | 2342 | echo rtrim($value_edit, ','); |
| 2343 | 2343 | exit; |
@@ -2356,11 +2356,11 @@ discard block |
||
| 2356 | 2356 | |
| 2357 | 2357 | function reseller_export_cdr_xls() { |
| 2358 | 2358 | $account_info = $accountinfo = $this->session->userdata('accountinfo'); |
| 2359 | - $currency_id=$account_info['currency_id']; |
|
| 2360 | - $currency=$this->common->get_field_name('currency', 'currency', $currency_id); |
|
| 2359 | + $currency_id = $account_info['currency_id']; |
|
| 2360 | + $currency = $this->common->get_field_name('currency', 'currency', $currency_id); |
|
| 2361 | 2361 | ob_clean(); |
| 2362 | 2362 | $query = $this->accounts_model->get_reseller_Account_list(true, '', '', true); |
| 2363 | - $customer_array[] = array("Account", "First Name", "Last Name", "Company", "Rate Group ", "Account type", "Balance($currency)", "Credit Limit($currency)", "Status","Created Date"); |
|
| 2363 | + $customer_array[] = array("Account", "First Name", "Last Name", "Company", "Rate Group ", "Account type", "Balance($currency)", "Credit Limit($currency)", "Status", "Created Date"); |
|
| 2364 | 2364 | if ($query->num_rows() > 0) { |
| 2365 | 2365 | |
| 2366 | 2366 | foreach ($query->result_array() as $row) { |
@@ -2371,40 +2371,40 @@ discard block |
||
| 2371 | 2371 | $row['company_name'], |
| 2372 | 2372 | $this->common->get_field_name('name', 'pricelists', $row['pricelist_id']), |
| 2373 | 2373 | $this->common->get_account_type('', '', $row['posttoexternal']), |
| 2374 | - $this->common_model->calculate_currency($row['balance'],false,false), |
|
| 2375 | - $this->common_model->calculate_currency($row['credit_limit'],false,false), |
|
| 2374 | + $this->common_model->calculate_currency($row['balance'], false, false), |
|
| 2375 | + $this->common_model->calculate_currency($row['credit_limit'], false, false), |
|
| 2376 | 2376 | $this->common->get_status('export', '', $row['status']), |
| 2377 | 2377 | $row['creation'], |
| 2378 | 2378 | ); |
| 2379 | 2379 | } |
| 2380 | 2380 | } |
| 2381 | 2381 | $this->load->helper('csv'); |
| 2382 | - array_to_csv($customer_array, 'Resellers_' . date("Y-m-d") . '.csv'); |
|
| 2382 | + array_to_csv($customer_array, 'Resellers_'.date("Y-m-d").'.csv'); |
|
| 2383 | 2383 | } |
| 2384 | - function customer_validate_ip(){ |
|
| 2385 | - $add_array=$this->input->post(); |
|
| 2386 | - if(!empty($add_array)){ |
|
| 2384 | + function customer_validate_ip() { |
|
| 2385 | + $add_array = $this->input->post(); |
|
| 2386 | + if ( ! empty($add_array)) { |
|
| 2387 | 2387 | $ip = $add_array['ip']; |
| 2388 | 2388 | if (strpos($ip, '/') !== false) { |
| 2389 | 2389 | $add_array['ip'] = $add_array['ip']; |
| 2390 | 2390 | } else { |
| 2391 | - $add_array['ip'] = $add_array['ip'] . '/32'; |
|
| 2391 | + $add_array['ip'] = $add_array['ip'].'/32'; |
|
| 2392 | 2392 | } |
| 2393 | - $this->db->where('ip',$add_array['ip']); |
|
| 2394 | - $this->db->where('prefix',$add_array['prefix']); |
|
| 2393 | + $this->db->where('ip', $add_array['ip']); |
|
| 2394 | + $this->db->where('prefix', $add_array['prefix']); |
|
| 2395 | 2395 | $this->db->select('count(ip) as count'); |
| 2396 | - $ip_map_result=(array)$this->db->get('ip_map')->first_row(); |
|
| 2397 | - if($ip_map_result['count'] > 0 ){ |
|
| 2396 | + $ip_map_result = (array)$this->db->get('ip_map')->first_row(); |
|
| 2397 | + if ($ip_map_result['count'] > 0) { |
|
| 2398 | 2398 | echo 'FALSE'; |
| 2399 | - }else{ |
|
| 2399 | + } else { |
|
| 2400 | 2400 | echo 'TRUE'; |
| 2401 | 2401 | } |
| 2402 | - }else{ |
|
| 2402 | + } else { |
|
| 2403 | 2403 | echo 'FALSE'; |
| 2404 | 2404 | } |
| 2405 | 2405 | |
| 2406 | 2406 | } |
| 2407 | -function reseller_invoice_config($id=''){ |
|
| 2407 | +function reseller_invoice_config($id = '') { |
|
| 2408 | 2408 | $data['page_title'] = 'Company Profile'; |
| 2409 | 2409 | $accountinfo = $this->session->userdata("accountinfo"); |
| 2410 | 2410 | $add_array = $this->input->post(); |
@@ -2414,30 +2414,30 @@ discard block |
||
| 2414 | 2414 | $this->load->module('invoices/invoices'); |
| 2415 | 2415 | $this->load->model("invoices_model"); |
| 2416 | 2416 | $invoiceconf = $this->invoices_model->get_invoiceconf(); |
| 2417 | - $file_name=($invoiceconf['logo'] != '') ? $invoiceconf['logo'] : ''; |
|
| 2417 | + $file_name = ($invoiceconf['logo'] != '') ? $invoiceconf['logo'] : ''; |
|
| 2418 | 2418 | } |
| 2419 | 2419 | if (isset($_FILES['file']['name']) && $_FILES['file']['name'] != '') { |
| 2420 | 2420 | $files = $_FILES['file']; |
| 2421 | 2421 | if ($files['size'] < 0) { |
| 2422 | 2422 | $this->session->set_flashdata('astpp_notification', 'PLease upload maximum file'); |
| 2423 | - redirect(base_url() . "accounts/reseller_invoice_config/". $add_array['accountid']."/"); |
|
| 2423 | + redirect(base_url()."accounts/reseller_invoice_config/".$add_array['accountid']."/"); |
|
| 2424 | 2424 | } |
| 2425 | 2425 | $file = $_FILES['file']; |
| 2426 | 2426 | $uploadedFile = $file["tmp_name"]; |
| 2427 | 2427 | $file_name = $file['name']; |
| 2428 | 2428 | $file_type = $file['type']; |
| 2429 | 2429 | if ($file_type == 'image/jpg' || $file_type == 'image/png' || $file_type == 'image/jpeg') { |
| 2430 | - $dir_path = FCPATH. "upload/"; |
|
| 2431 | - $path = $dir_path . $add_array['accountid']."_".$file['name']; |
|
| 2430 | + $dir_path = FCPATH."upload/"; |
|
| 2431 | + $path = $dir_path.$add_array['accountid']."_".$file['name']; |
|
| 2432 | 2432 | if (move_uploaded_file($uploadedFile, $path)) { |
| 2433 | 2433 | $this->session->set_flashdata('astpp_errormsg', gettext('files added successfully!')); |
| 2434 | 2434 | } else { |
| 2435 | 2435 | $this->session->set_flashdata('astpp_notification', "File Uploading Fail Please Try Again"); |
| 2436 | - redirect(base_url() . "accounts/reseller_invoice_config/". $add_array['accountid']."/"); |
|
| 2436 | + redirect(base_url()."accounts/reseller_invoice_config/".$add_array['accountid']."/"); |
|
| 2437 | 2437 | } |
| 2438 | 2438 | } else { |
| 2439 | 2439 | $this->session->set_flashdata('astpp_notification', 'Please upload only image!'); |
| 2440 | - redirect(base_url() . "accounts/reseller_invoice_config/". $add_array['accountid']."/"); |
|
| 2440 | + redirect(base_url()."accounts/reseller_invoice_config/".$add_array['accountid']."/"); |
|
| 2441 | 2441 | } |
| 2442 | 2442 | } |
| 2443 | 2443 | $add_array['logo'] = $file_name; |
@@ -2448,30 +2448,30 @@ discard block |
||
| 2448 | 2448 | $this->accounts_model->edit_invoice_config($add_array, $add_array['id']); |
| 2449 | 2449 | } |
| 2450 | 2450 | $this->session->set_flashdata('astpp_errormsg', 'Invoice config updated successfully!'); |
| 2451 | - redirect(base_url() . "accounts/reseller_invoice_config/". $add_array['accountid']."/"); |
|
| 2451 | + redirect(base_url()."accounts/reseller_invoice_config/".$add_array['accountid']."/"); |
|
| 2452 | 2452 | } else { |
| 2453 | - $data["account_data"] =(array)$this->db->get_where('invoice_conf',array("accountid"=>$id))->first_row(); |
|
| 2454 | - $data["accounttype"]='Reseller'; |
|
| 2455 | - $data["edit_id"]=$id; |
|
| 2456 | - if(isset($data["account_data"]['logo'])){ |
|
| 2457 | - $data["account_data"]['file']=$id."_".$data["account_data"]['logo']; |
|
| 2453 | + $data["account_data"] = (array)$this->db->get_where('invoice_conf', array("accountid"=>$id))->first_row(); |
|
| 2454 | + $data["accounttype"] = 'Reseller'; |
|
| 2455 | + $data["edit_id"] = $id; |
|
| 2456 | + if (isset($data["account_data"]['logo'])) { |
|
| 2457 | + $data["account_data"]['file'] = $id."_".$data["account_data"]['logo']; |
|
| 2458 | 2458 | } |
| 2459 | 2459 | $this->load->view('view_reseller_invoices_config', $data); |
| 2460 | 2460 | } |
| 2461 | 2461 | } |
| 2462 | 2462 | |
| 2463 | - function reseller_invoice_logo_delete($accountid){ |
|
| 2464 | - $invoiceconf = $this->db_model->getSelect("*", "invoice_conf", array("accountid"=> $accountid)); |
|
| 2465 | - $result=$invoiceconf->result_array(); |
|
| 2466 | - $logo=$result[0]['logo']; |
|
| 2467 | - $post_arr=array('logo'=>''); |
|
| 2468 | - $where_arr=array('logo'=>$logo); |
|
| 2463 | + function reseller_invoice_logo_delete($accountid) { |
|
| 2464 | + $invoiceconf = $this->db_model->getSelect("*", "invoice_conf", array("accountid"=> $accountid)); |
|
| 2465 | + $result = $invoiceconf->result_array(); |
|
| 2466 | + $logo = $result[0]['logo']; |
|
| 2467 | + $post_arr = array('logo'=>''); |
|
| 2468 | + $where_arr = array('logo'=>$logo); |
|
| 2469 | 2469 | $this->db->where($where_arr); |
| 2470 | - $this->db->update('invoice_conf',$post_arr); |
|
| 2470 | + $this->db->update('invoice_conf', $post_arr); |
|
| 2471 | 2471 | } |
| 2472 | 2472 | |
| 2473 | 2473 | |
| 2474 | - function customer_global_grid_list(){ |
|
| 2474 | + function customer_global_grid_list() { |
|
| 2475 | 2475 | echo gettext($_POST['display']); |
| 2476 | 2476 | } |
| 2477 | 2477 | |