@@ -20,26 +20,26 @@ discard block |
||
20 | 20 | // You should have received a copy of the GNU Affero General Public License |
21 | 21 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | 22 | // ############################################################################## |
23 | -if (! defined ( 'BASEPATH' )) |
|
24 | - exit ( 'No direct script access allowed' ); |
|
23 | +if ( ! defined('BASEPATH')) |
|
24 | + exit ('No direct script access allowed'); |
|
25 | 25 | class Taxes_form { |
26 | 26 | function __construct() { |
27 | - $this->CI = & get_instance (); |
|
27 | + $this->CI = & get_instance(); |
|
28 | 28 | } |
29 | 29 | function get_taxes_form_fields() { |
30 | - $form ['forms'] = array ( |
|
31 | - base_url () . 'taxes/taxes_save/', |
|
32 | - array ( |
|
30 | + $form ['forms'] = array( |
|
31 | + base_url().'taxes/taxes_save/', |
|
32 | + array( |
|
33 | 33 | 'id' => 'taxes_form', |
34 | 34 | 'method' => 'POST', |
35 | 35 | 'name' => 'taxes_form' |
36 | 36 | ) |
37 | 37 | ); |
38 | - $form [gettext ( 'Tax Information' )] = array ( |
|
39 | - array ( |
|
38 | + $form [gettext('Tax Information')] = array( |
|
39 | + array( |
|
40 | 40 | '', |
41 | 41 | 'HIDDEN', |
42 | - array ( |
|
42 | + array( |
|
43 | 43 | 'name' => 'id' |
44 | 44 | ), |
45 | 45 | '', |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | '', |
48 | 48 | '' |
49 | 49 | ), |
50 | - array ( |
|
51 | - gettext ( 'Name' ), |
|
50 | + array( |
|
51 | + gettext('Name'), |
|
52 | 52 | 'INPUT', |
53 | - array ( |
|
53 | + array( |
|
54 | 54 | 'name' => 'taxes_description', |
55 | 55 | 'size' => '20', |
56 | 56 | 'class' => "text field medium" |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | 'tOOL TIP', |
60 | 60 | '' |
61 | 61 | ), |
62 | - array ( |
|
63 | - gettext ( 'Priority' ), |
|
62 | + array( |
|
63 | + gettext('Priority'), |
|
64 | 64 | 'INPUT', |
65 | - array ( |
|
65 | + array( |
|
66 | 66 | 'name' => 'taxes_priority', |
67 | 67 | 'size' => '20', |
68 | 68 | 'maxlength' => '5', |
@@ -72,10 +72,10 @@ discard block |
||
72 | 72 | 'tOOL TIP', |
73 | 73 | '' |
74 | 74 | ), |
75 | - array ( |
|
76 | - gettext ( 'Amount' ), |
|
75 | + array( |
|
76 | + gettext('Amount'), |
|
77 | 77 | 'INPUT', |
78 | - array ( |
|
78 | + array( |
|
79 | 79 | 'name' => 'taxes_amount', |
80 | 80 | 'size' => '20', |
81 | 81 | 'maxlength' => '20', |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | 'tOOL TIP', |
86 | 86 | '' |
87 | 87 | ), |
88 | - array ( |
|
89 | - gettext ( 'Rate(%)' ), |
|
88 | + array( |
|
89 | + gettext('Rate(%)'), |
|
90 | 90 | 'INPUT', |
91 | - array ( |
|
91 | + array( |
|
92 | 92 | 'name' => 'taxes_rate', |
93 | 93 | 'size' => '20', |
94 | 94 | 'maxlength' => '20', |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | 'tOOL TIP', |
99 | 99 | '' |
100 | 100 | ), |
101 | - array ( |
|
102 | - gettext ( 'Status' ), |
|
101 | + array( |
|
102 | + gettext('Status'), |
|
103 | 103 | 'status', |
104 | 104 | 'SELECT', |
105 | 105 | '', |
@@ -113,17 +113,17 @@ discard block |
||
113 | 113 | ) |
114 | 114 | ) |
115 | 115 | ; |
116 | - $form ['button_save'] = array ( |
|
116 | + $form ['button_save'] = array( |
|
117 | 117 | 'name' => 'action', |
118 | - 'content' => gettext ( 'Save' ), |
|
118 | + 'content' => gettext('Save'), |
|
119 | 119 | 'value' => 'save', |
120 | 120 | 'id' => 'submit', |
121 | 121 | 'type' => 'button', |
122 | 122 | 'class' => 'btn btn-line-parrot' |
123 | 123 | ); |
124 | - $form ['button_cancel'] = array ( |
|
124 | + $form ['button_cancel'] = array( |
|
125 | 125 | 'name' => 'action', |
126 | - 'content' => gettext ( 'Close' ), |
|
126 | + 'content' => gettext('Close'), |
|
127 | 127 | 'value' => 'cancel', |
128 | 128 | 'type' => 'button', |
129 | 129 | 'class' => 'btn btn-line-sky margin-x-10', |
@@ -132,17 +132,17 @@ discard block |
||
132 | 132 | return $form; |
133 | 133 | } |
134 | 134 | function get_search_taxes_form() { |
135 | - $form ['forms'] = array ( |
|
135 | + $form ['forms'] = array( |
|
136 | 136 | "", |
137 | - array ( |
|
137 | + array( |
|
138 | 138 | 'id' => "taxes_search" |
139 | 139 | ) |
140 | 140 | ); |
141 | - $form [gettext ( 'Search' )] = array ( |
|
142 | - array ( |
|
143 | - gettext ( 'Name' ), |
|
141 | + $form [gettext('Search')] = array( |
|
142 | + array( |
|
143 | + gettext('Name'), |
|
144 | 144 | 'INPUT', |
145 | - array ( |
|
145 | + array( |
|
146 | 146 | 'name' => 'taxes_description[taxes_description]', |
147 | 147 | '', |
148 | 148 | 'size' => '20', |
@@ -158,10 +158,10 @@ discard block |
||
158 | 158 | 'search_string_type', |
159 | 159 | '' |
160 | 160 | ), |
161 | - array ( |
|
162 | - gettext ( 'Amount' ), |
|
161 | + array( |
|
162 | + gettext('Amount'), |
|
163 | 163 | 'INPUT', |
164 | - array ( |
|
164 | + array( |
|
165 | 165 | 'name' => 'taxes_amount[taxes_amount]', |
166 | 166 | 'value' => '', |
167 | 167 | 'size' => '20', |
@@ -177,10 +177,10 @@ discard block |
||
177 | 177 | 'search_int_type', |
178 | 178 | '' |
179 | 179 | ), |
180 | - array ( |
|
181 | - gettext ( 'Rate(%)' ), |
|
180 | + array( |
|
181 | + gettext('Rate(%)'), |
|
182 | 182 | 'INPUT', |
183 | - array ( |
|
183 | + array( |
|
184 | 184 | 'name' => 'taxes_rate[taxes_rate]', |
185 | 185 | 'value' => '', |
186 | 186 | 'size' => '20', |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | 'search_int_type', |
197 | 197 | '' |
198 | 198 | ), |
199 | - array ( |
|
199 | + array( |
|
200 | 200 | 'Status', |
201 | 201 | 'status', |
202 | 202 | 'SELECT', |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | '', |
212 | 212 | '' |
213 | 213 | ), |
214 | - array ( |
|
214 | + array( |
|
215 | 215 | '', |
216 | 216 | 'HIDDEN', |
217 | 217 | 'ajax_search', |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | '', |
221 | 221 | '' |
222 | 222 | ), |
223 | - array ( |
|
223 | + array( |
|
224 | 224 | '', |
225 | 225 | 'HIDDEN', |
226 | 226 | 'advance_search', |
@@ -230,18 +230,18 @@ discard block |
||
230 | 230 | '' |
231 | 231 | ) |
232 | 232 | ); |
233 | - $form ['button_search'] = array ( |
|
233 | + $form ['button_search'] = array( |
|
234 | 234 | 'name' => 'action', |
235 | 235 | 'id' => "taxes_search_btn", |
236 | - 'content' => gettext ( 'Search' ), |
|
236 | + 'content' => gettext('Search'), |
|
237 | 237 | 'value' => 'save', |
238 | 238 | 'type' => 'button', |
239 | 239 | 'class' => 'btn btn-line-parrot pull-right' |
240 | 240 | ); |
241 | - $form ['button_reset'] = array ( |
|
241 | + $form ['button_reset'] = array( |
|
242 | 242 | 'name' => 'action', |
243 | 243 | 'id' => "id_reset", |
244 | - 'content' => gettext ( 'Clear' ), |
|
244 | + 'content' => gettext('Clear'), |
|
245 | 245 | 'value' => 'cancel', |
246 | 246 | 'type' => 'reset', |
247 | 247 | 'class' => 'btn btn-line-sky pull-right margin-x-10' |
@@ -249,11 +249,11 @@ discard block |
||
249 | 249 | return $form; |
250 | 250 | } |
251 | 251 | function build_taxes_list_for_admin() { |
252 | - $account_info = $accountinfo = $this->CI->session->userdata ( 'accountinfo' ); |
|
252 | + $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
|
253 | 253 | $currency_id = $account_info ['currency_id']; |
254 | - $currency = $this->CI->common->get_field_name ( 'currency', 'currency', $currency_id ); |
|
255 | - $grid_field_arr = json_encode ( array ( |
|
256 | - array ( |
|
254 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
255 | + $grid_field_arr = json_encode(array( |
|
256 | + array( |
|
257 | 257 | "<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", |
258 | 258 | "30", |
259 | 259 | "", |
@@ -264,8 +264,8 @@ discard block |
||
264 | 264 | "false", |
265 | 265 | "center" |
266 | 266 | ), |
267 | - array ( |
|
268 | - gettext ( "Name" ), |
|
267 | + array( |
|
268 | + gettext("Name"), |
|
269 | 269 | "270", |
270 | 270 | "taxes_description", |
271 | 271 | "", |
@@ -275,8 +275,8 @@ discard block |
||
275 | 275 | "true", |
276 | 276 | "center" |
277 | 277 | ), |
278 | - array ( |
|
279 | - gettext ( "Priority" ), |
|
278 | + array( |
|
279 | + gettext("Priority"), |
|
280 | 280 | "145", |
281 | 281 | "taxes_priority", |
282 | 282 | "", |
@@ -286,8 +286,8 @@ discard block |
||
286 | 286 | "true", |
287 | 287 | "center" |
288 | 288 | ), |
289 | - array ( |
|
290 | - gettext ( "Amount($currency)" ), |
|
289 | + array( |
|
290 | + gettext("Amount($currency)"), |
|
291 | 291 | "260", |
292 | 292 | "taxes_amount", |
293 | 293 | "taxes_amount", |
@@ -297,8 +297,8 @@ discard block |
||
297 | 297 | "true", |
298 | 298 | "right" |
299 | 299 | ), |
300 | - array ( |
|
301 | - gettext ( "Rate(%)" ), |
|
300 | + array( |
|
301 | + gettext("Rate(%)"), |
|
302 | 302 | "230", |
303 | 303 | "taxes_rate", |
304 | 304 | "", |
@@ -308,8 +308,8 @@ discard block |
||
308 | 308 | "true", |
309 | 309 | "right" |
310 | 310 | ), |
311 | - array ( |
|
312 | - gettext ( "Status" ), |
|
311 | + array( |
|
312 | + gettext("Status"), |
|
313 | 313 | "160", |
314 | 314 | "status", |
315 | 315 | "status", |
@@ -319,44 +319,44 @@ discard block |
||
319 | 319 | "true", |
320 | 320 | "center" |
321 | 321 | ), |
322 | - array ( |
|
323 | - gettext ( "Action" ), |
|
322 | + array( |
|
323 | + gettext("Action"), |
|
324 | 324 | "175", |
325 | 325 | "", |
326 | 326 | "", |
327 | 327 | "", |
328 | - array ( |
|
329 | - "EDIT" => array ( |
|
328 | + array( |
|
329 | + "EDIT" => array( |
|
330 | 330 | "url" => "taxes/taxes_edit/", |
331 | 331 | "mode" => "popup" |
332 | 332 | ), |
333 | - "DELETE" => array ( |
|
333 | + "DELETE" => array( |
|
334 | 334 | "url" => "taxes/taxes_delete/", |
335 | 335 | "mode" => "single" |
336 | 336 | ) |
337 | 337 | ) |
338 | 338 | ) |
339 | - ) ); |
|
339 | + )); |
|
340 | 340 | return $grid_field_arr; |
341 | 341 | } |
342 | 342 | function build_grid_buttons() { |
343 | - $buttons_json = json_encode ( array ( |
|
344 | - array ( |
|
345 | - gettext ( "Create" ), |
|
343 | + $buttons_json = json_encode(array( |
|
344 | + array( |
|
345 | + gettext("Create"), |
|
346 | 346 | "btn btn-line-warning btn", |
347 | 347 | "fa fa-plus-circle fa-lg", |
348 | 348 | "button_action", |
349 | 349 | "/taxes/taxes_add/", |
350 | 350 | "popup" |
351 | 351 | ), |
352 | - array ( |
|
353 | - gettext ( "Delete" ), |
|
352 | + array( |
|
353 | + gettext("Delete"), |
|
354 | 354 | "btn btn-line-danger", |
355 | 355 | "fa fa-times-circle fa-lg", |
356 | 356 | "button_action", |
357 | 357 | "/taxes/taxes_delete_multiple/" |
358 | 358 | ) |
359 | - ) ); |
|
359 | + )); |
|
360 | 360 | return $buttons_json; |
361 | 361 | } |
362 | 362 | } |
@@ -20,8 +20,9 @@ |
||
20 | 20 | // You should have received a copy of the GNU Affero General Public License |
21 | 21 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | 22 | // ############################################################################## |
23 | -if (! defined ( 'BASEPATH' )) |
|
23 | +if (! defined ( 'BASEPATH' )) { |
|
24 | 24 | exit ( 'No direct script access allowed' ); |
25 | +} |
|
25 | 26 | class Taxes_form { |
26 | 27 | function __construct() { |
27 | 28 | $this->CI = & get_instance (); |
@@ -23,25 +23,25 @@ discard block |
||
23 | 23 | // ############################################################################## |
24 | 24 | class Charges_model extends CI_Model { |
25 | 25 | function Charges_model() { |
26 | - parent::__construct (); |
|
26 | + parent::__construct(); |
|
27 | 27 | } |
28 | 28 | function getcharges_list($flag, $start = 0, $limit = 0) { |
29 | - $this->db_model->build_search ( 'charges_list_search' ); |
|
30 | - if ($this->session->userdata ( 'logintype' ) == 1 || $this->session->userdata ( 'logintype' ) == 5) { |
|
31 | - $account_data = $this->session->userdata ( "accountinfo" ); |
|
29 | + $this->db_model->build_search('charges_list_search'); |
|
30 | + if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
31 | + $account_data = $this->session->userdata("accountinfo"); |
|
32 | 32 | $reseller = $account_data ['id']; |
33 | - $where = array ( |
|
33 | + $where = array( |
|
34 | 34 | "reseller_id" => $reseller |
35 | 35 | ); |
36 | 36 | } else { |
37 | - $where = array ( |
|
37 | + $where = array( |
|
38 | 38 | "reseller_id" => "0" |
39 | 39 | ); |
40 | 40 | } |
41 | 41 | if ($flag) { |
42 | - $query = $this->db_model->select ( "*", "charges", $where, "id", "ASC", $limit, $start ); |
|
42 | + $query = $this->db_model->select("*", "charges", $where, "id", "ASC", $limit, $start); |
|
43 | 43 | } else { |
44 | - $query = $this->db_model->countQuery ( "*", "charges", $where ); |
|
44 | + $query = $this->db_model->countQuery("*", "charges", $where); |
|
45 | 45 | } |
46 | 46 | return $query; |
47 | 47 | } |
@@ -50,97 +50,97 @@ discard block |
||
50 | 50 | * ASTPP 3.0 |
51 | 51 | * Charges Add time last creation date update |
52 | 52 | */ |
53 | - $add_array ['creation_date'] = gmdate ( 'Y-m-d H:i:s' ); |
|
53 | + $add_array ['creation_date'] = gmdate('Y-m-d H:i:s'); |
|
54 | 54 | /** |
55 | 55 | * ******************************************************************************************* |
56 | 56 | */ |
57 | - if ($this->session->userdata ( 'logintype' ) == 1 || $this->session->userdata ( 'logintype' ) == 5) { |
|
58 | - $account_data = $this->session->userdata ( "accountinfo" ); |
|
57 | + if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
58 | + $account_data = $this->session->userdata("accountinfo"); |
|
59 | 59 | $add_array ['reseller_id'] = $account_data ['id']; |
60 | 60 | } else { |
61 | 61 | $add_array ['reseller_id'] = "0"; |
62 | 62 | } |
63 | 63 | |
64 | - unset ( $add_array ['action'] ); |
|
65 | - $this->db->insert ( "charges", $add_array ); |
|
66 | - $insert_id = $this->db->insert_id (); |
|
67 | - $data = $this->db_model->getSelect ( "*", "accounts", array ( |
|
64 | + unset ($add_array ['action']); |
|
65 | + $this->db->insert("charges", $add_array); |
|
66 | + $insert_id = $this->db->insert_id(); |
|
67 | + $data = $this->db_model->getSelect("*", "accounts", array( |
|
68 | 68 | "pricelist_id" => $add_array ['pricelist_id'] |
69 | - ) ); |
|
69 | + )); |
|
70 | 70 | if ($data->num_rows > 0) { |
71 | - foreach ( $data->result_array () as $key => $value ) { |
|
72 | - $this->common->mail_to_users ( 'add_subscription', $value ); |
|
71 | + foreach ($data->result_array() as $key => $value) { |
|
72 | + $this->common->mail_to_users('add_subscription', $value); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | return $insert_id; |
76 | 76 | } |
77 | 77 | function edit_charge($data, $id) { |
78 | - unset ( $data ['action'] ); |
|
78 | + unset ($data ['action']); |
|
79 | 79 | /* |
80 | 80 | * ASTPP 3.0 |
81 | 81 | * Charges edit time last modified date update |
82 | 82 | */ |
83 | - $data ['last_modified_date'] = gmdate ( 'Y-m-d H:i:s' ); |
|
83 | + $data ['last_modified_date'] = gmdate('Y-m-d H:i:s'); |
|
84 | 84 | /** |
85 | 85 | * ******************************************************************************************* |
86 | 86 | */ |
87 | - if ($this->session->userdata ( 'logintype' ) == 1 || $this->session->userdata ( 'logintype' ) == 5) { |
|
88 | - $account_data = $this->session->userdata ( "accountinfo" ); |
|
87 | + if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
88 | + $account_data = $this->session->userdata("accountinfo"); |
|
89 | 89 | $data ['reseller_id'] = $account_data ['id']; |
90 | 90 | } else { |
91 | 91 | $data ['reseller_id'] = "0"; |
92 | 92 | } |
93 | - $this->db->where ( "id", $id ); |
|
94 | - $this->db->update ( "charges", $data ); |
|
93 | + $this->db->where("id", $id); |
|
94 | + $this->db->update("charges", $data); |
|
95 | 95 | |
96 | 96 | if ($data ['pricelist_id'] == 0) { |
97 | - $this->db->where ( "charge_id", $id ); |
|
98 | - $this->db->delete ( "charge_to_account" ); |
|
97 | + $this->db->where("charge_id", $id); |
|
98 | + $this->db->delete("charge_to_account"); |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | function remove_charge($id) { |
102 | - $this->db->where ( "id", $id ); |
|
103 | - $this->db->delete ( "charges" ); |
|
104 | - $this->db->where ( "charge_id", $id ); |
|
105 | - $this->db->delete ( "charge_to_account" ); |
|
106 | - $data = $this->db_model->getSelect ( "*", "charges", array ( |
|
102 | + $this->db->where("id", $id); |
|
103 | + $this->db->delete("charges"); |
|
104 | + $this->db->where("charge_id", $id); |
|
105 | + $this->db->delete("charge_to_account"); |
|
106 | + $data = $this->db_model->getSelect("*", "charges", array( |
|
107 | 107 | "id" => $id |
108 | - ) ); |
|
109 | - $data = $data->result_array (); |
|
108 | + )); |
|
109 | + $data = $data->result_array(); |
|
110 | 110 | $data = $data [0]; |
111 | - $data = $this->db_model->getSelect ( "*", "accounts", array ( |
|
111 | + $data = $this->db_model->getSelect("*", "accounts", array( |
|
112 | 112 | "pricelist_id" => $data ['pricelist_id'] |
113 | - ) ); |
|
113 | + )); |
|
114 | 114 | if ($data->num_rows > 0) { |
115 | - foreach ( $data->result_array () as $key => $value ) { |
|
116 | - $this->common->mail_to_users ( 'remove_subscription', $value ); |
|
115 | + foreach ($data->result_array() as $key => $value) { |
|
116 | + $this->common->mail_to_users('remove_subscription', $value); |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | return true; |
120 | 120 | } |
121 | 121 | function add_account_charges($pricelistid, $chargeid, $flag) { |
122 | 122 | if ($flag) { |
123 | - $this->db->where ( "charge_id", $chargeid ); |
|
124 | - $this->db->delete ( "charge_to_account" ); |
|
123 | + $this->db->where("charge_id", $chargeid); |
|
124 | + $this->db->delete("charge_to_account"); |
|
125 | 125 | } |
126 | - $account = $this->db_model->getSelect ( "*", "accounts", array ( |
|
126 | + $account = $this->db_model->getSelect("*", "accounts", array( |
|
127 | 127 | "pricelist_id" => $pricelistid |
128 | - ) ); |
|
128 | + )); |
|
129 | 129 | if ($account->num_rows > 0) { |
130 | - foreach ( $account->result_array () as $key => $value ) { |
|
131 | - $charge_arr = array ( |
|
130 | + foreach ($account->result_array() as $key => $value) { |
|
131 | + $charge_arr = array( |
|
132 | 132 | "charge_id" => $chargeid, |
133 | 133 | "accountid" => $value ['id'], |
134 | - "assign_date" => gmdate ( "Y-m-d H:i:s" ) |
|
134 | + "assign_date" => gmdate("Y-m-d H:i:s") |
|
135 | 135 | ); |
136 | - $this->db->insert ( "charge_to_account", $charge_arr ); |
|
137 | - require_once (APPPATH . 'controllers/ProcessCharges.php'); |
|
138 | - $ProcessCharges = new ProcessCharges (); |
|
139 | - $Params = array ( |
|
136 | + $this->db->insert("charge_to_account", $charge_arr); |
|
137 | + require_once (APPPATH.'controllers/ProcessCharges.php'); |
|
138 | + $ProcessCharges = new ProcessCharges(); |
|
139 | + $Params = array( |
|
140 | 140 | "ChargeID" => $chargeid, |
141 | 141 | "AccountInfo" => $value |
142 | 142 | ); |
143 | - $ProcessCharges->BillAccountCharges ( "ACCOUNTSUBSCRIPTION", $Params ); |
|
143 | + $ProcessCharges->BillAccountCharges("ACCOUNTSUBSCRIPTION", $Params); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 | } |
@@ -23,78 +23,78 @@ discard block |
||
23 | 23 | // ############################################################################## |
24 | 24 | class Charges extends MX_Controller { |
25 | 25 | function Charges() { |
26 | - parent::__construct (); |
|
26 | + parent::__construct(); |
|
27 | 27 | |
28 | - $this->load->helper ( 'template_inheritance' ); |
|
28 | + $this->load->helper('template_inheritance'); |
|
29 | 29 | |
30 | - $this->load->library ( 'session' ); |
|
31 | - $this->load->library ( "charges_form" ); |
|
32 | - $this->load->library ( 'astpp/form' ); |
|
33 | - $this->load->model ( 'charges_model' ); |
|
30 | + $this->load->library('session'); |
|
31 | + $this->load->library("charges_form"); |
|
32 | + $this->load->library('astpp/form'); |
|
33 | + $this->load->model('charges_model'); |
|
34 | 34 | |
35 | - if ($this->session->userdata ( 'user_login' ) == FALSE) |
|
36 | - redirect ( base_url () . '/astpp/login' ); |
|
35 | + if ($this->session->userdata('user_login') == FALSE) |
|
36 | + redirect(base_url().'/astpp/login'); |
|
37 | 37 | } |
38 | 38 | function periodiccharges_add() { |
39 | - $data ['username'] = $this->session->userdata ( 'user_name' ); |
|
39 | + $data ['username'] = $this->session->userdata('user_name'); |
|
40 | 40 | $data ['flag'] = 'create'; |
41 | - $data ['page_title'] = gettext ( 'Create Subscription' ); |
|
42 | - $data ['form'] = $this->form->build_form ( $this->charges_form->get_charge_form_fields (), '' ); |
|
43 | - $this->load->view ( 'view_periodiccharges_add_edit', $data ); |
|
41 | + $data ['page_title'] = gettext('Create Subscription'); |
|
42 | + $data ['form'] = $this->form->build_form($this->charges_form->get_charge_form_fields(), ''); |
|
43 | + $this->load->view('view_periodiccharges_add_edit', $data); |
|
44 | 44 | } |
45 | 45 | function periodiccharges_edit($edit_id = '') { |
46 | - $data ['page_title'] = gettext ( 'Edit Subscription' ); |
|
47 | - $where = array ( |
|
46 | + $data ['page_title'] = gettext('Edit Subscription'); |
|
47 | + $where = array( |
|
48 | 48 | 'id' => $edit_id |
49 | 49 | ); |
50 | - $account = $this->db_model->getSelect ( "*", "charges", $where ); |
|
51 | - foreach ( $account->result_array () as $key => $value ) { |
|
50 | + $account = $this->db_model->getSelect("*", "charges", $where); |
|
51 | + foreach ($account->result_array() as $key => $value) { |
|
52 | 52 | $edit_data = $value; |
53 | 53 | } |
54 | - $edit_data ['charge'] = $this->common_model->to_calculate_currency ( $edit_data ['charge'], '', '', true, false ); |
|
54 | + $edit_data ['charge'] = $this->common_model->to_calculate_currency($edit_data ['charge'], '', '', true, false); |
|
55 | 55 | |
56 | - $data ['form'] = $this->form->build_form ( $this->charges_form->get_charge_form_fields (), $edit_data ); |
|
57 | - $this->load->view ( 'view_periodiccharges_add_edit', $data ); |
|
56 | + $data ['form'] = $this->form->build_form($this->charges_form->get_charge_form_fields(), $edit_data); |
|
57 | + $this->load->view('view_periodiccharges_add_edit', $data); |
|
58 | 58 | } |
59 | 59 | function periodiccharges_save() { |
60 | - $add_array = $this->input->post (); |
|
61 | - $data ['form'] = $this->form->build_form ( $this->charges_form->get_charge_form_fields (), $add_array ); |
|
60 | + $add_array = $this->input->post(); |
|
61 | + $data ['form'] = $this->form->build_form($this->charges_form->get_charge_form_fields(), $add_array); |
|
62 | 62 | if ($add_array ['id'] != '') { |
63 | - $data ['page_title'] = gettext ( 'Edit Subscription' ); |
|
64 | - if ($this->form_validation->run () == FALSE) { |
|
65 | - $data ['validation_errors'] = validation_errors (); |
|
63 | + $data ['page_title'] = gettext('Edit Subscription'); |
|
64 | + if ($this->form_validation->run() == FALSE) { |
|
65 | + $data ['validation_errors'] = validation_errors(); |
|
66 | 66 | echo $data ['validation_errors']; |
67 | 67 | exit (); |
68 | 68 | } else { |
69 | 69 | if ($add_array ['pricelist_id'] == '') { |
70 | 70 | $add_array ['pricelist_id'] = '0'; |
71 | 71 | } |
72 | - $add_array ['charge'] = $this->common_model->add_calculate_currency ( $add_array ['charge'], '', '', false, false ); |
|
73 | - $this->charges_model->edit_charge ( $add_array, $add_array ['id'] ); |
|
72 | + $add_array ['charge'] = $this->common_model->add_calculate_currency($add_array ['charge'], '', '', false, false); |
|
73 | + $this->charges_model->edit_charge($add_array, $add_array ['id']); |
|
74 | 74 | |
75 | 75 | if ($add_array ['pricelist_id'] > 0) { |
76 | - $this->charges_model->add_account_charges ( $add_array ['pricelist_id'], $add_array ['id'], true ); |
|
76 | + $this->charges_model->add_account_charges($add_array ['pricelist_id'], $add_array ['id'], true); |
|
77 | 77 | } |
78 | - echo json_encode ( array ( |
|
79 | - "SUCCESS" => $add_array ["description"] . " subscription updated successfully!" |
|
80 | - ) ); |
|
78 | + echo json_encode(array( |
|
79 | + "SUCCESS" => $add_array ["description"]." subscription updated successfully!" |
|
80 | + )); |
|
81 | 81 | exit (); |
82 | 82 | } |
83 | 83 | } else { |
84 | - $data ['page_title'] = gettext ( 'Add Subscription' ); |
|
85 | - if ($this->form_validation->run () == FALSE) { |
|
86 | - $data ['validation_errors'] = validation_errors (); |
|
84 | + $data ['page_title'] = gettext('Add Subscription'); |
|
85 | + if ($this->form_validation->run() == FALSE) { |
|
86 | + $data ['validation_errors'] = validation_errors(); |
|
87 | 87 | echo $data ['validation_errors']; |
88 | 88 | exit (); |
89 | 89 | } else { |
90 | - $add_array ['charge'] = $this->common_model->add_calculate_currency ( $add_array ['charge'], '', '', false, false ); |
|
91 | - $charge_id = $this->charges_model->add_charge ( $add_array ); |
|
90 | + $add_array ['charge'] = $this->common_model->add_calculate_currency($add_array ['charge'], '', '', false, false); |
|
91 | + $charge_id = $this->charges_model->add_charge($add_array); |
|
92 | 92 | if ($add_array ['pricelist_id'] > 0 && $charge_id > 0) { |
93 | - $this->charges_model->add_account_charges ( $add_array ['pricelist_id'], $charge_id, false ); |
|
93 | + $this->charges_model->add_account_charges($add_array ['pricelist_id'], $charge_id, false); |
|
94 | 94 | } |
95 | - echo json_encode ( array ( |
|
96 | - "SUCCESS" => $add_array ["description"] . " subscription added successfully!" |
|
97 | - ) ); |
|
95 | + echo json_encode(array( |
|
96 | + "SUCCESS" => $add_array ["description"]." subscription added successfully!" |
|
97 | + )); |
|
98 | 98 | exit (); |
99 | 99 | } |
100 | 100 | } |
@@ -102,50 +102,50 @@ discard block |
||
102 | 102 | |
103 | 103 | // /*ASTPP_invoice_changes_05_05_start*/ |
104 | 104 | function periodiccharges_delete($id) { |
105 | - $this->charges_model->remove_charge ( $id ); |
|
105 | + $this->charges_model->remove_charge($id); |
|
106 | 106 | |
107 | - require_once (APPPATH . 'controllers/ProcessCharges.php'); |
|
108 | - $ProcessCharges = new ProcessCharges (); |
|
107 | + require_once (APPPATH.'controllers/ProcessCharges.php'); |
|
108 | + $ProcessCharges = new ProcessCharges(); |
|
109 | 109 | |
110 | - $Params = array ( |
|
110 | + $Params = array( |
|
111 | 111 | "ChargeID" => $id |
112 | 112 | ); |
113 | - $ProcessCharges->BillAccountCharges ( "SUBSCRIPTION", $Params ); |
|
113 | + $ProcessCharges->BillAccountCharges("SUBSCRIPTION", $Params); |
|
114 | 114 | |
115 | - $this->session->set_flashdata ( 'astpp_notification', 'Subscription removed successfully!' ); |
|
116 | - redirect ( base_url () . 'charges/periodiccharges/' ); |
|
115 | + $this->session->set_flashdata('astpp_notification', 'Subscription removed successfully!'); |
|
116 | + redirect(base_url().'charges/periodiccharges/'); |
|
117 | 117 | } |
118 | 118 | // end |
119 | 119 | function periodiccharges_search() { |
120 | - $ajax_search = $this->input->post ( 'ajax_search', 0 ); |
|
121 | - if ($this->input->post ( 'advance_search', TRUE ) == 1) { |
|
122 | - $this->session->set_userdata ( 'advance_search', $this->input->post ( 'advance_search' ) ); |
|
123 | - $action = $this->input->post (); |
|
124 | - unset ( $action ['action'] ); |
|
125 | - unset ( $action ['advance_search'] ); |
|
126 | - if (isset ( $action ['charge'] ['charge'] ) && $action ['charge'] ['charge'] != '') { |
|
127 | - $action ['charge'] ['charge'] = $this->common_model->add_calculate_currency ( $action ['charge'] ['charge'], "", '', true, false ); |
|
120 | + $ajax_search = $this->input->post('ajax_search', 0); |
|
121 | + if ($this->input->post('advance_search', TRUE) == 1) { |
|
122 | + $this->session->set_userdata('advance_search', $this->input->post('advance_search')); |
|
123 | + $action = $this->input->post(); |
|
124 | + unset ($action ['action']); |
|
125 | + unset ($action ['advance_search']); |
|
126 | + if (isset ($action ['charge'] ['charge']) && $action ['charge'] ['charge'] != '') { |
|
127 | + $action ['charge'] ['charge'] = $this->common_model->add_calculate_currency($action ['charge'] ['charge'], "", '', true, false); |
|
128 | 128 | } |
129 | - $this->session->set_userdata ( 'charges_list_search', $action ); |
|
129 | + $this->session->set_userdata('charges_list_search', $action); |
|
130 | 130 | } |
131 | 131 | if (@$ajax_search != 1) { |
132 | - redirect ( base_url () . 'charges/periodiccharges/' ); |
|
132 | + redirect(base_url().'charges/periodiccharges/'); |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 | function periodiccharges_clearsearchfilter() { |
136 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
137 | - $this->session->set_userdata ( 'charges_list_search', "" ); |
|
136 | + $this->session->set_userdata('advance_search', 0); |
|
137 | + $this->session->set_userdata('charges_list_search', ""); |
|
138 | 138 | } |
139 | 139 | function periodiccharges() { |
140 | - $data ['username'] = $this->session->userdata ( 'user_name' ); |
|
141 | - $data ['page_title'] = gettext ( 'Subscriptions' ); |
|
140 | + $data ['username'] = $this->session->userdata('user_name'); |
|
141 | + $data ['page_title'] = gettext('Subscriptions'); |
|
142 | 142 | $data ['search_flag'] = true; |
143 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
144 | - $data ['grid_fields'] = $this->charges_form->build_charge_list_for_admin (); |
|
145 | - $data ["grid_buttons"] = $this->charges_form->build_grid_buttons (); |
|
146 | - $data ['form_search'] = $this->form->build_serach_form ( $this->charges_form->get_charges_search_form () ); |
|
143 | + $this->session->set_userdata('advance_search', 0); |
|
144 | + $data ['grid_fields'] = $this->charges_form->build_charge_list_for_admin(); |
|
145 | + $data ["grid_buttons"] = $this->charges_form->build_grid_buttons(); |
|
146 | + $data ['form_search'] = $this->form->build_serach_form($this->charges_form->get_charges_search_form()); |
|
147 | 147 | |
148 | - $this->load->view ( 'view_charges_list', $data ); |
|
148 | + $this->load->view('view_charges_list', $data); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | /** |
@@ -153,68 +153,68 @@ discard block |
||
153 | 153 | * Listing of Accounts table data through php function json_encode |
154 | 154 | */ |
155 | 155 | function periodiccharges_json() { |
156 | - $json_data = array (); |
|
157 | - $count_all = $this->charges_model->getcharges_list ( false ); |
|
158 | - $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
|
156 | + $json_data = array(); |
|
157 | + $count_all = $this->charges_model->getcharges_list(false); |
|
158 | + $paging_data = $this->form->load_grid_config($count_all, $_GET ['rp'], $_GET ['page']); |
|
159 | 159 | $json_data = $paging_data ["json_paging"]; |
160 | - $query = $this->charges_model->getcharges_list ( true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
|
161 | - $grid_fields = json_decode ( $this->charges_form->build_charge_list_for_admin () ); |
|
162 | - $json_data ['rows'] = $this->form->build_grid ( $query, $grid_fields ); |
|
160 | + $query = $this->charges_model->getcharges_list(true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"]); |
|
161 | + $grid_fields = json_decode($this->charges_form->build_charge_list_for_admin()); |
|
162 | + $json_data ['rows'] = $this->form->build_grid($query, $grid_fields); |
|
163 | 163 | |
164 | - echo json_encode ( $json_data ); |
|
164 | + echo json_encode($json_data); |
|
165 | 165 | } |
166 | 166 | // /*ASTPP_invoice_changes_05_05_start*/ |
167 | 167 | function periodiccharges_delete_multiple() { |
168 | - $ids = $this->input->post ( "selected_ids", true ); |
|
168 | + $ids = $this->input->post("selected_ids", true); |
|
169 | 169 | |
170 | - $charge_where = "charge_id IN(" . $ids . ")"; |
|
171 | - $this->db->delete ( 'charge_to_account', $charge_where ); |
|
170 | + $charge_where = "charge_id IN(".$ids.")"; |
|
171 | + $this->db->delete('charge_to_account', $charge_where); |
|
172 | 172 | |
173 | 173 | $where = "id IN ($ids)"; |
174 | - $this->db->delete ( "charges", $where ); |
|
174 | + $this->db->delete("charges", $where); |
|
175 | 175 | |
176 | 176 | echo "SUBSCRIPTION"; |
177 | 177 | } |
178 | 178 | // end |
179 | 179 | function customer_charge_list($accountid, $accounttype) { |
180 | - $json_data = array (); |
|
180 | + $json_data = array(); |
|
181 | 181 | |
182 | 182 | $select = "charge_to_account.id,charges.description,charges.charge,charges.sweep_id,charges.pro_rate,charges.creation_date,charges.last_modified_date"; |
183 | 183 | $table = "charges"; |
184 | - $jionTable = array ( |
|
184 | + $jionTable = array( |
|
185 | 185 | 'charge_to_account', |
186 | 186 | 'accounts' |
187 | 187 | ); |
188 | - $jionCondition = array ( |
|
188 | + $jionCondition = array( |
|
189 | 189 | 'charges.id = charge_to_account.charge_id', |
190 | 190 | 'accounts.id = charge_to_account.accountid' |
191 | 191 | ); |
192 | - $type = array ( |
|
192 | + $type = array( |
|
193 | 193 | 'left', |
194 | 194 | 'inner' |
195 | 195 | ); |
196 | - $where = array ( |
|
196 | + $where = array( |
|
197 | 197 | 'accounts.id' => $accountid |
198 | 198 | ); |
199 | 199 | $order_type = 'id'; |
200 | 200 | $order_by = "ASC"; |
201 | - $instant_search = $this->session->userdata ( 'left_panel_search_' . $accounttype . '_subscription' ); |
|
202 | - $like_str = ! empty ( $instant_search ) ? "(charges.description like '%$instant_search%' |
|
201 | + $instant_search = $this->session->userdata('left_panel_search_'.$accounttype.'_subscription'); |
|
202 | + $like_str = ! empty ($instant_search) ? "(charges.description like '%$instant_search%' |
|
203 | 203 | OR charges.charge like '%$instant_search%' |
204 | 204 | OR charges.charge like '%$instant_search%' |
205 | 205 | )" : null; |
206 | - if (! empty ( $like_str )) |
|
207 | - $this->db->where ( $like_str ); |
|
208 | - $count_all = $this->db_model->getCountWithJion ( $table, $select, $where, $jionTable, $jionCondition, $type ); |
|
209 | - $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
|
206 | + if ( ! empty ($like_str)) |
|
207 | + $this->db->where($like_str); |
|
208 | + $count_all = $this->db_model->getCountWithJion($table, $select, $where, $jionTable, $jionCondition, $type); |
|
209 | + $paging_data = $this->form->load_grid_config($count_all, $_GET ['rp'], $_GET ['page']); |
|
210 | 210 | $json_data = $paging_data ["json_paging"]; |
211 | - if (! empty ( $like_str )) |
|
212 | - $this->db->where ( $like_str ); |
|
213 | - $account_charge_list = $this->db_model->getAllJionQuery ( $table, $select, $where, $jionTable, $jionCondition, $type, $paging_data ["paging"] ["page_no"], $paging_data ["paging"] ["start"], $order_by, $order_type, "" ); |
|
214 | - $grid_fields = json_decode ( $this->charges_form->build_charges_list_for_customer ( $accountid, $accounttype ) ); |
|
215 | - $json_data ['rows'] = $this->form->build_grid ( $account_charge_list, $grid_fields ); |
|
211 | + if ( ! empty ($like_str)) |
|
212 | + $this->db->where($like_str); |
|
213 | + $account_charge_list = $this->db_model->getAllJionQuery($table, $select, $where, $jionTable, $jionCondition, $type, $paging_data ["paging"] ["page_no"], $paging_data ["paging"] ["start"], $order_by, $order_type, ""); |
|
214 | + $grid_fields = json_decode($this->charges_form->build_charges_list_for_customer($accountid, $accounttype)); |
|
215 | + $json_data ['rows'] = $this->form->build_grid($account_charge_list, $grid_fields); |
|
216 | 216 | |
217 | - echo json_encode ( $json_data ); |
|
217 | + echo json_encode($json_data); |
|
218 | 218 | } |
219 | 219 | } |
220 | 220 |
@@ -32,8 +32,9 @@ discard block |
||
32 | 32 | $this->load->library ( 'astpp/form' ); |
33 | 33 | $this->load->model ( 'charges_model' ); |
34 | 34 | |
35 | - if ($this->session->userdata ( 'user_login' ) == FALSE) |
|
36 | - redirect ( base_url () . '/astpp/login' ); |
|
35 | + if ($this->session->userdata ( 'user_login' ) == FALSE) { |
|
36 | + redirect ( base_url () . '/astpp/login' ); |
|
37 | + } |
|
37 | 38 | } |
38 | 39 | function periodiccharges_add() { |
39 | 40 | $data ['username'] = $this->session->userdata ( 'user_name' ); |
@@ -203,13 +204,15 @@ discard block |
||
203 | 204 | OR charges.charge like '%$instant_search%' |
204 | 205 | OR charges.charge like '%$instant_search%' |
205 | 206 | )" : null; |
206 | - if (! empty ( $like_str )) |
|
207 | - $this->db->where ( $like_str ); |
|
207 | + if (! empty ( $like_str )) { |
|
208 | + $this->db->where ( $like_str ); |
|
209 | + } |
|
208 | 210 | $count_all = $this->db_model->getCountWithJion ( $table, $select, $where, $jionTable, $jionCondition, $type ); |
209 | 211 | $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
210 | 212 | $json_data = $paging_data ["json_paging"]; |
211 | - if (! empty ( $like_str )) |
|
212 | - $this->db->where ( $like_str ); |
|
213 | + if (! empty ( $like_str )) { |
|
214 | + $this->db->where ( $like_str ); |
|
215 | + } |
|
213 | 216 | $account_charge_list = $this->db_model->getAllJionQuery ( $table, $select, $where, $jionTable, $jionCondition, $type, $paging_data ["paging"] ["page_no"], $paging_data ["paging"] ["start"], $order_by, $order_type, "" ); |
214 | 217 | $grid_fields = json_decode ( $this->charges_form->build_charges_list_for_customer ( $accountid, $accounttype ) ); |
215 | 218 | $json_data ['rows'] = $this->form->build_grid ( $account_charge_list, $grid_fields ); |
@@ -21,26 +21,26 @@ discard block |
||
21 | 21 | // You should have received a copy of the GNU Affero General Public License |
22 | 22 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
23 | 23 | // ############################################################################## |
24 | -if (! defined ( 'BASEPATH' )) |
|
25 | - exit ( 'No direct script access allowed' ); |
|
24 | +if ( ! defined('BASEPATH')) |
|
25 | + exit ('No direct script access allowed'); |
|
26 | 26 | class Charges_form { |
27 | 27 | function __construct($library_name = '') { |
28 | - $this->CI = & get_instance (); |
|
28 | + $this->CI = & get_instance(); |
|
29 | 29 | } |
30 | 30 | function get_charge_form_fields() { |
31 | - $form ['forms'] = array ( |
|
32 | - base_url () . 'charges/periodiccharges_save/', |
|
33 | - array ( |
|
31 | + $form ['forms'] = array( |
|
32 | + base_url().'charges/periodiccharges_save/', |
|
33 | + array( |
|
34 | 34 | 'id' => 'charges_form', |
35 | 35 | 'method' => 'POST', |
36 | 36 | 'name' => 'charges_form' |
37 | 37 | ) |
38 | 38 | ); |
39 | - $form [gettext ( 'Information' )] = array ( |
|
40 | - array ( |
|
39 | + $form [gettext('Information')] = array( |
|
40 | + array( |
|
41 | 41 | '', |
42 | 42 | 'HIDDEN', |
43 | - array ( |
|
43 | + array( |
|
44 | 44 | 'name' => 'id' |
45 | 45 | ), |
46 | 46 | '', |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | '', |
49 | 49 | '' |
50 | 50 | ), |
51 | - array ( |
|
52 | - gettext ( 'Name' ), |
|
51 | + array( |
|
52 | + gettext('Name'), |
|
53 | 53 | 'INPUT', |
54 | - array ( |
|
54 | + array( |
|
55 | 55 | 'name' => 'description', |
56 | 56 | 'size' => '20', |
57 | 57 | 'class' => "text field medium" |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | 'tOOL TIP', |
61 | 61 | 'Please Enter account number' |
62 | 62 | ), |
63 | - array ( |
|
64 | - gettext ( 'Rate Group' ), |
|
63 | + array( |
|
64 | + gettext('Rate Group'), |
|
65 | 65 | 'pricelist_id', |
66 | 66 | 'SELECT', |
67 | 67 | '', |
@@ -73,15 +73,15 @@ discard block |
||
73 | 73 | 'pricelists', |
74 | 74 | 'build_dropdown', |
75 | 75 | 'where_arr', |
76 | - array ( |
|
76 | + array( |
|
77 | 77 | "reseller_id" => "0", |
78 | 78 | "status <>" => "2" |
79 | 79 | ) |
80 | 80 | ), |
81 | - array ( |
|
82 | - gettext ( 'Amount' ), |
|
81 | + array( |
|
82 | + gettext('Amount'), |
|
83 | 83 | 'INPUT', |
84 | - array ( |
|
84 | + array( |
|
85 | 85 | 'name' => 'charge', |
86 | 86 | 'size' => '20', |
87 | 87 | 'class' => "text field medium" |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | 'tOOL TIP', |
91 | 91 | 'Please Enter account number' |
92 | 92 | ), |
93 | - array ( |
|
94 | - gettext ( 'Prorate' ), |
|
93 | + array( |
|
94 | + gettext('Prorate'), |
|
95 | 95 | 'pro_rate', |
96 | 96 | 'SELECT', |
97 | 97 | '', |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | '', |
104 | 104 | 'set_prorate' |
105 | 105 | ), |
106 | - array ( |
|
107 | - gettext ( 'Bill cycle' ), |
|
106 | + array( |
|
107 | + gettext('Bill cycle'), |
|
108 | 108 | 'sweep_id', |
109 | 109 | 'SELECT', |
110 | 110 | '', |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | '', |
119 | 119 | '' |
120 | 120 | ), |
121 | - array ( |
|
122 | - gettext ( 'Status' ), |
|
121 | + array( |
|
122 | + gettext('Status'), |
|
123 | 123 | 'status', |
124 | 124 | 'SELECT', |
125 | 125 | '', |
@@ -132,17 +132,17 @@ discard block |
||
132 | 132 | 'set_status' |
133 | 133 | ) |
134 | 134 | ); |
135 | - $form ['button_cancel'] = array ( |
|
135 | + $form ['button_cancel'] = array( |
|
136 | 136 | 'name' => 'action', |
137 | - 'content' => gettext ( 'Close' ), |
|
137 | + 'content' => gettext('Close'), |
|
138 | 138 | 'value' => 'cancel', |
139 | 139 | 'type' => 'button', |
140 | 140 | 'class' => 'btn btn-line-sky margin-x-10', |
141 | 141 | 'onclick' => 'return redirect_page(\'NULL\')' |
142 | 142 | ); |
143 | - $form ['button_save'] = array ( |
|
143 | + $form ['button_save'] = array( |
|
144 | 144 | 'name' => 'action', |
145 | - 'content' => gettext ( 'Save' ), |
|
145 | + 'content' => gettext('Save'), |
|
146 | 146 | 'value' => 'save', |
147 | 147 | 'id' => 'submit', |
148 | 148 | 'type' => 'button', |
@@ -151,24 +151,24 @@ discard block |
||
151 | 151 | return $form; |
152 | 152 | } |
153 | 153 | function get_charges_search_form() { |
154 | - $logintype = $this->CI->session->userdata ( 'logintype' ); |
|
154 | + $logintype = $this->CI->session->userdata('logintype'); |
|
155 | 155 | if ($logintype == 1 || $logintype == 5) { |
156 | - $account_data = $this->CI->session->userdata ( "accountinfo" ); |
|
156 | + $account_data = $this->CI->session->userdata("accountinfo"); |
|
157 | 157 | $loginid = $account_data ['id']; |
158 | 158 | } else { |
159 | 159 | $loginid = "0"; |
160 | 160 | } |
161 | - $form ['forms'] = array ( |
|
161 | + $form ['forms'] = array( |
|
162 | 162 | "", |
163 | - array ( |
|
163 | + array( |
|
164 | 164 | 'id' => "charges_search" |
165 | 165 | ) |
166 | 166 | ); |
167 | - $form [gettext ( 'Search' )] = array ( |
|
168 | - array ( |
|
169 | - gettext ( 'Name' ), |
|
167 | + $form [gettext('Search')] = array( |
|
168 | + array( |
|
169 | + gettext('Name'), |
|
170 | 170 | 'INPUT', |
171 | - array ( |
|
171 | + array( |
|
172 | 172 | 'name' => 'description[description]', |
173 | 173 | '', |
174 | 174 | 'size' => '20', |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | 'search_string_type', |
185 | 185 | '' |
186 | 186 | ), |
187 | - array ( |
|
188 | - gettext ( 'Rate Group' ), |
|
187 | + array( |
|
188 | + gettext('Rate Group'), |
|
189 | 189 | 'pricelist_id', |
190 | 190 | 'SELECT', |
191 | 191 | '', |
@@ -197,15 +197,15 @@ discard block |
||
197 | 197 | 'pricelists', |
198 | 198 | 'build_dropdown', |
199 | 199 | 'where_arr', |
200 | - array ( |
|
200 | + array( |
|
201 | 201 | 'status' => 0, |
202 | 202 | 'reseller_id' => $loginid |
203 | 203 | ) |
204 | 204 | ), |
205 | - array ( |
|
206 | - gettext ( 'Amount' ), |
|
205 | + array( |
|
206 | + gettext('Amount'), |
|
207 | 207 | 'INPUT', |
208 | - array ( |
|
208 | + array( |
|
209 | 209 | 'name' => 'charge[charge]', |
210 | 210 | 'value' => '', |
211 | 211 | 'size' => '20', |
@@ -221,8 +221,8 @@ discard block |
||
221 | 221 | 'search_int_type', |
222 | 222 | '' |
223 | 223 | ), |
224 | - array ( |
|
225 | - gettext ( 'Billing Cycle' ), |
|
224 | + array( |
|
225 | + gettext('Billing Cycle'), |
|
226 | 226 | 'sweep_id', |
227 | 227 | 'SELECT', |
228 | 228 | '', |
@@ -236,8 +236,8 @@ discard block |
||
236 | 236 | '', |
237 | 237 | '' |
238 | 238 | ), |
239 | - array ( |
|
240 | - gettext ( 'Status' ), |
|
239 | + array( |
|
240 | + gettext('Status'), |
|
241 | 241 | 'status', |
242 | 242 | 'SELECT', |
243 | 243 | '', |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | '', |
250 | 250 | 'set_search_status' |
251 | 251 | ), |
252 | - array ( |
|
252 | + array( |
|
253 | 253 | '', |
254 | 254 | 'HIDDEN', |
255 | 255 | 'ajax_search', |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | '', |
259 | 259 | '' |
260 | 260 | ), |
261 | - array ( |
|
261 | + array( |
|
262 | 262 | '', |
263 | 263 | 'HIDDEN', |
264 | 264 | 'advance_search', |
@@ -268,18 +268,18 @@ discard block |
||
268 | 268 | '' |
269 | 269 | ) |
270 | 270 | ); |
271 | - $form ['button_search'] = array ( |
|
271 | + $form ['button_search'] = array( |
|
272 | 272 | 'name' => 'action', |
273 | 273 | 'id' => "charges_search_btn", |
274 | - 'content' => gettext ( 'Search' ), |
|
274 | + 'content' => gettext('Search'), |
|
275 | 275 | 'value' => 'save', |
276 | 276 | 'type' => 'button', |
277 | 277 | 'class' => 'btn btn-line-parrot pull-right' |
278 | 278 | ); |
279 | - $form ['button_reset'] = array ( |
|
279 | + $form ['button_reset'] = array( |
|
280 | 280 | 'name' => 'action', |
281 | 281 | 'id' => "id_reset", |
282 | - 'content' => gettext ( 'Clear' ), |
|
282 | + 'content' => gettext('Clear'), |
|
283 | 283 | 'value' => 'cancel', |
284 | 284 | 'type' => 'reset', |
285 | 285 | 'class' => 'btn btn-line-sky pull-right margin-x-10' |
@@ -292,13 +292,13 @@ discard block |
||
292 | 292 | * Change size of grind |
293 | 293 | */ |
294 | 294 | function build_charge_list_for_admin() { |
295 | - $account_info = $accountinfo = $this->CI->session->userdata ( 'accountinfo' ); |
|
295 | + $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
|
296 | 296 | $currency_id = $account_info ['currency_id']; |
297 | - $currency = $this->CI->common->get_field_name ( 'currency', 'currency', $currency_id ); |
|
297 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
298 | 298 | |
299 | 299 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
300 | - $grid_field_arr = json_encode ( array ( |
|
301 | - array ( |
|
300 | + $grid_field_arr = json_encode(array( |
|
301 | + array( |
|
302 | 302 | "<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", |
303 | 303 | "30", |
304 | 304 | "", |
@@ -314,8 +314,8 @@ discard block |
||
314 | 314 | * For DID edit on DID number |
315 | 315 | * * |
316 | 316 | */ |
317 | - array ( |
|
318 | - gettext ( "Name" ), |
|
317 | + array( |
|
318 | + gettext("Name"), |
|
319 | 319 | "140", |
320 | 320 | "description", |
321 | 321 | "", |
@@ -328,8 +328,8 @@ discard block |
||
328 | 328 | /** |
329 | 329 | * *********************************************** |
330 | 330 | */ |
331 | - array ( |
|
332 | - gettext ( "Rate Group" ), |
|
331 | + array( |
|
332 | + gettext("Rate Group"), |
|
333 | 333 | "140", |
334 | 334 | "pricelist_id", |
335 | 335 | "name", |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | "true", |
340 | 340 | "center" |
341 | 341 | ), |
342 | - array ( |
|
342 | + array( |
|
343 | 343 | "Amount($currency)", |
344 | 344 | "125", |
345 | 345 | "charge", |
@@ -350,8 +350,8 @@ discard block |
||
350 | 350 | "true", |
351 | 351 | "right" |
352 | 352 | ), |
353 | - array ( |
|
354 | - gettext ( "Prorate" ), |
|
353 | + array( |
|
354 | + gettext("Prorate"), |
|
355 | 355 | "125", |
356 | 356 | "pro_rate", |
357 | 357 | "pro_rate", |
@@ -361,8 +361,8 @@ discard block |
||
361 | 361 | "true", |
362 | 362 | "center" |
363 | 363 | ), |
364 | - array ( |
|
365 | - gettext ( "Billing Cycle" ), |
|
364 | + array( |
|
365 | + gettext("Billing Cycle"), |
|
366 | 366 | "130", |
367 | 367 | "sweep_id", |
368 | 368 | "sweep", |
@@ -376,8 +376,8 @@ discard block |
||
376 | 376 | * ASTPP 3.0 |
377 | 377 | * Show Creation date,last_modified date in reseller grid with admin login |
378 | 378 | */ |
379 | - array ( |
|
380 | - gettext ( "Status" ), |
|
379 | + array( |
|
380 | + gettext("Status"), |
|
381 | 381 | "125", |
382 | 382 | "status", |
383 | 383 | "status", |
@@ -387,8 +387,8 @@ discard block |
||
387 | 387 | "true", |
388 | 388 | "center" |
389 | 389 | ), |
390 | - array ( |
|
391 | - gettext ( "Created Date" ), |
|
390 | + array( |
|
391 | + gettext("Created Date"), |
|
392 | 392 | "150", |
393 | 393 | "creation_date", |
394 | 394 | "", |
@@ -398,8 +398,8 @@ discard block |
||
398 | 398 | "true", |
399 | 399 | "center" |
400 | 400 | ), |
401 | - array ( |
|
402 | - gettext ( "Modified Date" ), |
|
401 | + array( |
|
402 | + gettext("Modified Date"), |
|
403 | 403 | "150", |
404 | 404 | "last_modified_date", |
405 | 405 | "", |
@@ -420,33 +420,33 @@ discard block |
||
420 | 420 | /** |
421 | 421 | * ******************************************** |
422 | 422 | */ |
423 | - array ( |
|
424 | - gettext ( "Action" ), |
|
423 | + array( |
|
424 | + gettext("Action"), |
|
425 | 425 | "150", |
426 | 426 | "", |
427 | 427 | "", |
428 | 428 | "", |
429 | - array ( |
|
430 | - "EDIT" => array ( |
|
429 | + array( |
|
430 | + "EDIT" => array( |
|
431 | 431 | "url" => "charges/periodiccharges_edit/", |
432 | 432 | "mode" => "popup", |
433 | 433 | 'popup' |
434 | 434 | ), |
435 | - "DELETE" => array ( |
|
435 | + "DELETE" => array( |
|
436 | 436 | "url" => "charges/periodiccharges_delete/", |
437 | 437 | "mode" => "single" |
438 | 438 | ) |
439 | 439 | ) |
440 | 440 | ) |
441 | - ) ); |
|
441 | + )); |
|
442 | 442 | return $grid_field_arr; |
443 | 443 | } |
444 | 444 | /** |
445 | 445 | * ***************************************** |
446 | 446 | */ |
447 | 447 | function build_grid_buttons() { |
448 | - $buttons_json = json_encode ( array ( |
|
449 | - array ( |
|
448 | + $buttons_json = json_encode(array( |
|
449 | + array( |
|
450 | 450 | "Create", |
451 | 451 | "btn btn-line-warning btn", |
452 | 452 | "fa fa-plus-circle fa-lg", |
@@ -454,23 +454,23 @@ discard block |
||
454 | 454 | "/charges/periodiccharges_add/", |
455 | 455 | "popup" |
456 | 456 | ), |
457 | - array ( |
|
458 | - gettext ( "Delete" ), |
|
457 | + array( |
|
458 | + gettext("Delete"), |
|
459 | 459 | "btn btn-line-danger", |
460 | 460 | "fa fa-times-circle fa-lg", |
461 | 461 | "button_action", |
462 | 462 | "/charges/periodiccharges_delete_multiple/" |
463 | 463 | ) |
464 | - ) ); |
|
464 | + )); |
|
465 | 465 | return $buttons_json; |
466 | 466 | } |
467 | 467 | function build_charges_list_for_customer($accountid, $accounttype) { |
468 | - $account_info = $accountinfo = $this->CI->session->userdata ( 'accountinfo' ); |
|
468 | + $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
|
469 | 469 | $currency_id = $account_info ['currency_id']; |
470 | - $currency = $this->CI->common->get_field_name ( 'currency', 'currency', $currency_id ); |
|
470 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
471 | 471 | |
472 | - $grid_field_arr = json_encode ( array ( |
|
473 | - array ( |
|
472 | + $grid_field_arr = json_encode(array( |
|
473 | + array( |
|
474 | 474 | "Name", |
475 | 475 | "140", |
476 | 476 | "description", |
@@ -481,8 +481,8 @@ discard block |
||
481 | 481 | "true", |
482 | 482 | "center" |
483 | 483 | ), |
484 | - array ( |
|
485 | - gettext ( "Amount($currency)" ), |
|
484 | + array( |
|
485 | + gettext("Amount($currency)"), |
|
486 | 486 | "140", |
487 | 487 | "charge", |
488 | 488 | "charge", |
@@ -492,8 +492,8 @@ discard block |
||
492 | 492 | "true", |
493 | 493 | "right" |
494 | 494 | ), |
495 | - array ( |
|
496 | - gettext ( "Prorate" ), |
|
495 | + array( |
|
496 | + gettext("Prorate"), |
|
497 | 497 | "125", |
498 | 498 | "pro_rate", |
499 | 499 | "pro_rate", |
@@ -503,8 +503,8 @@ discard block |
||
503 | 503 | "true", |
504 | 504 | "center" |
505 | 505 | ), |
506 | - array ( |
|
507 | - gettext ( "Billing Cycle" ), |
|
506 | + array( |
|
507 | + gettext("Billing Cycle"), |
|
508 | 508 | "170", |
509 | 509 | "sweep_id", |
510 | 510 | "sweep", |
@@ -514,8 +514,8 @@ discard block |
||
514 | 514 | "true", |
515 | 515 | "center" |
516 | 516 | ), |
517 | - array ( |
|
518 | - gettext ( "Created Date" ), |
|
517 | + array( |
|
518 | + gettext("Created Date"), |
|
519 | 519 | "150", |
520 | 520 | "creation_date", |
521 | 521 | "", |
@@ -525,8 +525,8 @@ discard block |
||
525 | 525 | "true", |
526 | 526 | "center" |
527 | 527 | ), |
528 | - array ( |
|
529 | - gettext ( "Modified Date" ), |
|
528 | + array( |
|
529 | + gettext("Modified Date"), |
|
530 | 530 | "150", |
531 | 531 | "last_modified_date", |
532 | 532 | "", |
@@ -536,20 +536,20 @@ discard block |
||
536 | 536 | "true", |
537 | 537 | "center" |
538 | 538 | ), |
539 | - array ( |
|
540 | - gettext ( "Action" ), |
|
539 | + array( |
|
540 | + gettext("Action"), |
|
541 | 541 | "150", |
542 | 542 | "", |
543 | 543 | "", |
544 | 544 | "", |
545 | - array ( |
|
546 | - "DELETE" => array ( |
|
547 | - "url" => "accounts/" . $accounttype . "_subscription_action/delete/$accountid/$accounttype/", |
|
545 | + array( |
|
546 | + "DELETE" => array( |
|
547 | + "url" => "accounts/".$accounttype."_subscription_action/delete/$accountid/$accounttype/", |
|
548 | 548 | "mode" => "single" |
549 | 549 | ) |
550 | 550 | ) |
551 | 551 | ) |
552 | - ) ); |
|
552 | + )); |
|
553 | 553 | return $grid_field_arr; |
554 | 554 | } |
555 | 555 | } |
@@ -21,8 +21,9 @@ |
||
21 | 21 | // You should have received a copy of the GNU Affero General Public License |
22 | 22 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
23 | 23 | // ############################################################################## |
24 | -if (! defined ( 'BASEPATH' )) |
|
24 | +if (! defined ( 'BASEPATH' )) { |
|
25 | 25 | exit ( 'No direct script access allowed' ); |
26 | +} |
|
26 | 27 | class Charges_form { |
27 | 28 | function __construct($library_name = '') { |
28 | 29 | $this->CI = & get_instance (); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | // ############################################################################# |
24 | 24 | class Freeswitch_model extends CI_Model { |
25 | 25 | function Freeswitch_model() { |
26 | - parent::__construct (); |
|
26 | + parent::__construct(); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
@@ -34,26 +34,26 @@ discard block |
||
34 | 34 | */ |
35 | 35 | function get_sipdevices_list($flag, $accountid = "", $entitytype = '', $start = "", $limit = "") { |
36 | 36 | if ($accountid != "") { |
37 | - $where = array ( |
|
37 | + $where = array( |
|
38 | 38 | "accountid" => $accountid |
39 | 39 | ); |
40 | 40 | } |
41 | - $this->db_model->build_search ( 'fssipdevices_list_search' ); |
|
42 | - $instant_search = $this->session->userdata ( 'left_panel_search_' . $entitytype . '_sipdevices' ); |
|
43 | - if (! empty ( $instant_search )) { |
|
41 | + $this->db_model->build_search('fssipdevices_list_search'); |
|
42 | + $instant_search = $this->session->userdata('left_panel_search_'.$entitytype.'_sipdevices'); |
|
43 | + if ( ! empty ($instant_search)) { |
|
44 | 44 | $like_str = "(username like '%$instant_search%' OR creation_date like '%$instant_search%' OR last_modified_date like '%$instant_search%')"; |
45 | - $this->db->where ( $like_str ); |
|
45 | + $this->db->where($like_str); |
|
46 | 46 | } |
47 | - $query = array (); |
|
47 | + $query = array(); |
|
48 | 48 | if ($flag) { |
49 | - $deviceinfo = $this->db_model->select ( "*", "sip_devices", $where, "id", "ASC", $limit, $start ); |
|
49 | + $deviceinfo = $this->db_model->select("*", "sip_devices", $where, "id", "ASC", $limit, $start); |
|
50 | 50 | if ($deviceinfo->num_rows > 0) { |
51 | - $add_array = $deviceinfo->result_array (); |
|
52 | - foreach ( $add_array as $key => $value ) { |
|
53 | - $vars = json_decode ( $value ['dir_vars'] ); |
|
54 | - $vars_new = json_decode ( $value ['dir_params'], true ); |
|
55 | - $passowrds = json_decode ( $value ['dir_params'] ); |
|
56 | - $query [] = array ( |
|
51 | + $add_array = $deviceinfo->result_array(); |
|
52 | + foreach ($add_array as $key => $value) { |
|
53 | + $vars = json_decode($value ['dir_vars']); |
|
54 | + $vars_new = json_decode($value ['dir_params'], true); |
|
55 | + $passowrds = json_decode($value ['dir_params']); |
|
56 | + $query [] = array( |
|
57 | 57 | 'id' => $value ['id'], |
58 | 58 | 'username' => $value ['username'], |
59 | 59 | 'accountid' => $value ['accountid'], |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | } |
82 | 82 | } else { |
83 | - $query = $this->db_model->countQuery ( "*", "sip_devices", $where ); |
|
83 | + $query = $this->db_model->countQuery("*", "sip_devices", $where); |
|
84 | 84 | } |
85 | 85 | return $query; |
86 | 86 | } |
@@ -94,22 +94,22 @@ discard block |
||
94 | 94 | * ***** |
95 | 95 | */ |
96 | 96 | function add_freeswith($add_array) { |
97 | - $where = array ( |
|
97 | + $where = array( |
|
98 | 98 | 'id' => $add_array ['accountcode'] |
99 | 99 | ); |
100 | - $query = $this->db_model->getSelect ( "*", "accounts", $where ); |
|
101 | - $query = $query->result_array (); |
|
100 | + $query = $this->db_model->getSelect("*", "accounts", $where); |
|
101 | + $query = $query->result_array(); |
|
102 | 102 | $account_data = $query [0]; |
103 | 103 | |
104 | - $log_type = $this->session->userdata ( "logintype" ); |
|
104 | + $log_type = $this->session->userdata("logintype"); |
|
105 | 105 | |
106 | 106 | $reseller_id = $log_type == 1 ? $account_data ['reseller_id'] : 0; |
107 | 107 | |
108 | - $sip_profile_id = isset ( $add_array ['sip_profile_id'] ) ? $add_array ['sip_profile_id'] : $this->common->get_field_name ( 'id', 'sip_profiles', array ( |
|
108 | + $sip_profile_id = isset ($add_array ['sip_profile_id']) ? $add_array ['sip_profile_id'] : $this->common->get_field_name('id', 'sip_profiles', array( |
|
109 | 109 | 'name' => 'default' |
110 | - ) ); |
|
110 | + )); |
|
111 | 111 | |
112 | - $parms_array = array ( |
|
112 | + $parms_array = array( |
|
113 | 113 | 'password' => $add_array ['fs_password'], |
114 | 114 | 'vm-enabled' => $add_array ['voicemail_enabled'], |
115 | 115 | 'vm-password' => $add_array ['fs_password'], |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | 'vm-email-all-messages' => $add_array ['vm_send_all_message'] |
120 | 120 | ); |
121 | 121 | |
122 | - $add_array ['status'] = isset ( $add_array ['status'] ) ? $add_array ['status'] : "0"; |
|
123 | - $parms_array_vars = array ( |
|
122 | + $add_array ['status'] = isset ($add_array ['status']) ? $add_array ['status'] : "0"; |
|
123 | + $parms_array_vars = array( |
|
124 | 124 | 'effective_caller_id_name' => $add_array ['effective_caller_id_name'], |
125 | 125 | 'effective_caller_id_number' => $add_array ['effective_caller_id_number'], |
126 | 126 | 'user_context' => 'default' |
@@ -129,27 +129,27 @@ discard block |
||
129 | 129 | * ASTPP 3.0 |
130 | 130 | * creation date add |
131 | 131 | */ |
132 | - $new_array = array ( |
|
133 | - 'creation_date' => gmdate ( 'Y-m-d H:i:s' ), |
|
132 | + $new_array = array( |
|
133 | + 'creation_date' => gmdate('Y-m-d H:i:s'), |
|
134 | 134 | 'username' => $add_array ['fs_username'], |
135 | 135 | 'reseller_id' => $reseller_id, |
136 | 136 | 'accountid' => $add_array ['accountcode'], |
137 | 137 | 'status' => $add_array ['status'], |
138 | - 'dir_params' => json_encode ( $parms_array ), |
|
139 | - 'dir_vars' => json_encode ( $parms_array_vars ), |
|
138 | + 'dir_params' => json_encode($parms_array), |
|
139 | + 'dir_vars' => json_encode($parms_array_vars), |
|
140 | 140 | 'sip_profile_id' => $sip_profile_id |
141 | 141 | ); |
142 | 142 | /** |
143 | 143 | * **************************************8 |
144 | 144 | */ |
145 | - $this->db->insert ( 'sip_devices', $new_array ); |
|
145 | + $this->db->insert('sip_devices', $new_array); |
|
146 | 146 | /** |
147 | 147 | * **** |
148 | 148 | * ASTPP 3.0 |
149 | 149 | * Email broadcast when Sip Device create |
150 | 150 | * ***** |
151 | 151 | */ |
152 | - $mail = (isset ( $add_array ['voicemail_mail_to'] ) && $add_array ['voicemail_mail_to'] != "") ? $add_array ['voicemail_mail_to'] : $account_data ['email']; |
|
152 | + $mail = (isset ($add_array ['voicemail_mail_to']) && $add_array ['voicemail_mail_to'] != "") ? $add_array ['voicemail_mail_to'] : $account_data ['email']; |
|
153 | 153 | |
154 | 154 | $add_array ['id'] = $add_array ['accountcode']; |
155 | 155 | $add_array ['reseller_id'] = $account_data ['reseller_id']; |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | // $add_array['password']=$this->common->decode($add_array['fs_password']); |
161 | 161 | $add_array ['password'] = $add_array ['fs_password']; |
162 | 162 | // echo "<pre>"; print_r($add_array); exit; |
163 | - $this->common->mail_to_users ( 'add_sip_device', $add_array ); |
|
163 | + $this->common->mail_to_users('add_sip_device', $add_array); |
|
164 | 164 | /** |
165 | 165 | * ************************* |
166 | 166 | */ |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * ***** |
177 | 177 | */ |
178 | 178 | function edit_freeswith($add_array, $id) { |
179 | - $parms_array = array ( |
|
179 | + $parms_array = array( |
|
180 | 180 | 'password' => $add_array ['fs_password'], |
181 | 181 | 'vm-enabled' => $add_array ['voicemail_enabled'], |
182 | 182 | 'vm-password' => $add_array ['voicemail_password'], |
@@ -187,34 +187,34 @@ discard block |
||
187 | 187 | ); |
188 | 188 | // echo "<pre>";print_r($parms_array);exit; |
189 | 189 | |
190 | - $parms_array_vars = array ( |
|
190 | + $parms_array_vars = array( |
|
191 | 191 | 'effective_caller_id_name' => $add_array ['effective_caller_id_name'], |
192 | 192 | 'effective_caller_id_number' => $add_array ['effective_caller_id_number'] |
193 | 193 | ); |
194 | - $log_type = $this->session->userdata ( "logintype" ); |
|
194 | + $log_type = $this->session->userdata("logintype"); |
|
195 | 195 | if ($log_type == 0 || $log_type == 3 || $log_type == 1) { |
196 | - $add_array ['sip_profile_id'] = $this->common->get_field_name ( 'id', 'sip_profiles', array ( |
|
196 | + $add_array ['sip_profile_id'] = $this->common->get_field_name('id', 'sip_profiles', array( |
|
197 | 197 | 'name' => 'default' |
198 | - ) ); |
|
198 | + )); |
|
199 | 199 | } |
200 | - $add_array ['status'] = isset ( $add_array ['status'] ) ? $add_array ['status'] : "0"; |
|
200 | + $add_array ['status'] = isset ($add_array ['status']) ? $add_array ['status'] : "0"; |
|
201 | 201 | /* |
202 | 202 | * ASTPP 3.0 edit modified date |
203 | 203 | */ |
204 | - $new_array = array ( |
|
205 | - 'last_modified_date' => gmdate ( 'Y-m-d H:i:s' ), |
|
204 | + $new_array = array( |
|
205 | + 'last_modified_date' => gmdate('Y-m-d H:i:s'), |
|
206 | 206 | 'username' => $add_array ['fs_username'], |
207 | 207 | 'accountid' => $add_array ['accountcode'], |
208 | 208 | 'status' => $add_array ['status'], |
209 | - 'dir_params' => json_encode ( $parms_array ), |
|
210 | - 'dir_vars' => json_encode ( $parms_array_vars ), |
|
209 | + 'dir_params' => json_encode($parms_array), |
|
210 | + 'dir_vars' => json_encode($parms_array_vars), |
|
211 | 211 | 'sip_profile_id' => $add_array ['sip_profile_id'] |
212 | 212 | ); |
213 | 213 | /** |
214 | 214 | * **************************************** |
215 | 215 | */ |
216 | - $this->db->where ( 'id', $id ); |
|
217 | - $this->db->update ( 'sip_devices', $new_array ); |
|
216 | + $this->db->where('id', $id); |
|
217 | + $this->db->update('sip_devices', $new_array); |
|
218 | 218 | // echo $this->db->last_query(); exit; |
219 | 219 | return true; |
220 | 220 | } |
@@ -228,17 +228,17 @@ discard block |
||
228 | 228 | * ***** |
229 | 229 | */ |
230 | 230 | function get_edited_data($edit_id) { |
231 | - $deviceinfo = array (); |
|
232 | - $where = array ( |
|
231 | + $deviceinfo = array(); |
|
232 | + $where = array( |
|
233 | 233 | 'id' => $edit_id |
234 | 234 | ); |
235 | - $deviceinfo = $this->db_model->getSelect ( "*", "sip_devices", $where ); |
|
236 | - $add_array = $deviceinfo->result_array (); |
|
237 | - foreach ( $add_array as $key => $value ) { |
|
238 | - $vars = json_decode ( $value ['dir_vars'] ); |
|
239 | - $vars_new = json_decode ( $value ['dir_params'], true ); |
|
240 | - $passowrds = json_decode ( $value ['dir_params'] ); |
|
241 | - $query = array ( |
|
235 | + $deviceinfo = $this->db_model->getSelect("*", "sip_devices", $where); |
|
236 | + $add_array = $deviceinfo->result_array(); |
|
237 | + foreach ($add_array as $key => $value) { |
|
238 | + $vars = json_decode($value ['dir_vars']); |
|
239 | + $vars_new = json_decode($value ['dir_params'], true); |
|
240 | + $passowrds = json_decode($value ['dir_params']); |
|
241 | + $query = array( |
|
242 | 242 | 'id' => $value ['id'], |
243 | 243 | 'fs_username' => $value ['username'], |
244 | 244 | 'accountcode' => $value ['accountid'], |
@@ -261,8 +261,8 @@ discard block |
||
261 | 261 | * ********************** |
262 | 262 | */ |
263 | 263 | function delete_freeswith_devices($id) { |
264 | - $this->db->where ( 'id', $id ); |
|
265 | - $this->db->delete ( 'sip_devices' ); |
|
264 | + $this->db->where('id', $id); |
|
265 | + $this->db->delete('sip_devices'); |
|
266 | 266 | return true; |
267 | 267 | } |
268 | 268 | /** |
@@ -272,28 +272,28 @@ discard block |
||
272 | 272 | * ***** |
273 | 273 | */ |
274 | 274 | function fs_retrieve_sip_user($flag, $start = 0, $limit = 0) { |
275 | - $deviceinfo = array (); |
|
276 | - $this->db_model->build_search ( 'fssipdevices_list_search' ); |
|
277 | - $accountinfo = $this->session->userdata ( "accountinfo" ); |
|
275 | + $deviceinfo = array(); |
|
276 | + $this->db_model->build_search('fssipdevices_list_search'); |
|
277 | + $accountinfo = $this->session->userdata("accountinfo"); |
|
278 | 278 | $reseller_id = $accountinfo ['type'] == 1 ? $accountinfo ['id'] : 0; |
279 | - $query = array (); |
|
280 | - $logintype = $this->session->userdata ( "logintype" ); |
|
279 | + $query = array(); |
|
280 | + $logintype = $this->session->userdata("logintype"); |
|
281 | 281 | |
282 | 282 | $where ['reseller_id'] = $reseller_id; |
283 | 283 | |
284 | 284 | if ($flag) { |
285 | - $deviceinfo = $this->db_model->select ( "*", "sip_devices", $where, "id", "ASC", $limit, $start ); |
|
285 | + $deviceinfo = $this->db_model->select("*", "sip_devices", $where, "id", "ASC", $limit, $start); |
|
286 | 286 | if ($deviceinfo->num_rows > 0) { |
287 | - $add_array = $deviceinfo->result_array (); |
|
288 | - foreach ( $add_array as $key => $value ) { |
|
289 | - $vars = json_decode ( $value ['dir_vars'] ); |
|
290 | - $vars_new = json_decode ( $value ['dir_params'], true ); |
|
291 | - $passowrds = json_decode ( $value ['dir_params'] ); |
|
287 | + $add_array = $deviceinfo->result_array(); |
|
288 | + foreach ($add_array as $key => $value) { |
|
289 | + $vars = json_decode($value ['dir_vars']); |
|
290 | + $vars_new = json_decode($value ['dir_params'], true); |
|
291 | + $passowrds = json_decode($value ['dir_params']); |
|
292 | 292 | /* |
293 | 293 | * ASTPP 3.0 |
294 | 294 | * add two filed show on gried |
295 | 295 | */ |
296 | - $query [] = array ( |
|
296 | + $query [] = array( |
|
297 | 297 | 'id' => $value ['id'], |
298 | 298 | 'username' => $value ['username'], |
299 | 299 | 'accountid' => $value ['accountid'], |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | } |
314 | 314 | } |
315 | 315 | } else { |
316 | - $query = $this->db_model->countQuery ( "*", 'sip_devices', $where ); |
|
316 | + $query = $this->db_model->countQuery("*", 'sip_devices', $where); |
|
317 | 317 | } |
318 | 318 | return $query; |
319 | 319 | } |
@@ -321,45 +321,45 @@ discard block |
||
321 | 321 | * ******************* |
322 | 322 | */ |
323 | 323 | function get_gateway_list($flag, $start = 0, $limit = 0) { |
324 | - $this->db_model->build_search ( 'fsgateway_list_search' ); |
|
324 | + $this->db_model->build_search('fsgateway_list_search'); |
|
325 | 325 | if ($flag) { |
326 | - $query = $this->db_model->select ( "*", "gateways", "", "id", "desc", $limit, $start ); |
|
326 | + $query = $this->db_model->select("*", "gateways", "", "id", "desc", $limit, $start); |
|
327 | 327 | } else { |
328 | - $query = $this->db_model->countQuery ( "*", "gateways", "" ); |
|
328 | + $query = $this->db_model->countQuery("*", "gateways", ""); |
|
329 | 329 | } |
330 | 330 | return $query; |
331 | 331 | } |
332 | 332 | function get_sipprofile_list($flag, $start = 0, $limit = 0) { |
333 | - $this->db_model->build_search ( 'fssipprofile_list_search' ); |
|
333 | + $this->db_model->build_search('fssipprofile_list_search'); |
|
334 | 334 | if ($flag) { |
335 | - $query = $this->db_model->select ( "*", "sip_profiles", "", "id", "desc", $limit, $start ); |
|
335 | + $query = $this->db_model->select("*", "sip_profiles", "", "id", "desc", $limit, $start); |
|
336 | 336 | } else { |
337 | - $query = $this->db_model->countQuery ( "*", "sip_profiles", "" ); |
|
337 | + $query = $this->db_model->countQuery("*", "sip_profiles", ""); |
|
338 | 338 | } |
339 | 339 | return $query; |
340 | 340 | } |
341 | 341 | function profile_authentication($profile_data) { |
342 | 342 | if ($profile_data ['id'] != '') { |
343 | - $where = array ( |
|
343 | + $where = array( |
|
344 | 344 | 'id <>' => $profile_data ["id"], |
345 | 345 | 'sip_ip' => $profile_data ["sip_ip"], |
346 | 346 | "sip_port" => $profile_data ["sip_port"] |
347 | 347 | ); |
348 | 348 | } else { |
349 | - $where = array ( |
|
349 | + $where = array( |
|
350 | 350 | 'sip_ip' => $profile_data ["sip_ip"], |
351 | 351 | "sip_port" => $profile_data ["sip_port"] |
352 | 352 | ); |
353 | 353 | } |
354 | - $query = $this->db_model->getSelect ( "*", "sip_profiles", $where ); |
|
354 | + $query = $this->db_model->getSelect("*", "sip_profiles", $where); |
|
355 | 355 | return $query; |
356 | 356 | } |
357 | 357 | function get_fsserver_list($flag, $start = 0, $limit = 0) { |
358 | - $this->db_model->build_search ( 'fsserver_list_search' ); |
|
358 | + $this->db_model->build_search('fsserver_list_search'); |
|
359 | 359 | if ($flag) { |
360 | - $query = $this->db_model->select ( "*", "freeswich_servers", "", "id", "desc", $limit, $start ); |
|
360 | + $query = $this->db_model->select("*", "freeswich_servers", "", "id", "desc", $limit, $start); |
|
361 | 361 | } else { |
362 | - $query = $this->db_model->countQuery ( "*", "freeswich_servers", "" ); |
|
362 | + $query = $this->db_model->countQuery("*", "freeswich_servers", ""); |
|
363 | 363 | } |
364 | 364 | return $query; |
365 | 365 | } |
@@ -367,58 +367,58 @@ discard block |
||
367 | 367 | /* |
368 | 368 | * ASTPP 3.0 ADD creation date |
369 | 369 | */ |
370 | - $data ['creation_date'] = gmdate ( 'Y-m-d H:i:s' ); |
|
370 | + $data ['creation_date'] = gmdate('Y-m-d H:i:s'); |
|
371 | 371 | /** |
372 | 372 | * ******************************** |
373 | 373 | */ |
374 | - unset ( $data ['action'] ); |
|
375 | - $this->db->insert ( 'freeswich_servers', $data ); |
|
374 | + unset ($data ['action']); |
|
375 | + $this->db->insert('freeswich_servers', $data); |
|
376 | 376 | return true; |
377 | 377 | } |
378 | 378 | function edit_fsserver($data, $id) { |
379 | - unset ( $data ['action'] ); |
|
379 | + unset ($data ['action']); |
|
380 | 380 | /* |
381 | 381 | * ASTPP 3.0 edit modified date add |
382 | 382 | */ |
383 | - $data ['last_modified_date'] = gmdate ( 'Y-m-d H:i:s' ); |
|
383 | + $data ['last_modified_date'] = gmdate('Y-m-d H:i:s'); |
|
384 | 384 | /** |
385 | 385 | * ******************************************** |
386 | 386 | */ |
387 | - $this->db->where ( 'id', $id ); |
|
388 | - $this->db->update ( 'freeswich_servers', $data ); |
|
387 | + $this->db->where('id', $id); |
|
388 | + $this->db->update('freeswich_servers', $data); |
|
389 | 389 | return true; |
390 | 390 | } |
391 | 391 | function fsserver_delete($id) { |
392 | - $this->db->where ( 'id', $id ); |
|
393 | - $this->db->delete ( 'freeswich_servers' ); |
|
392 | + $this->db->where('id', $id); |
|
393 | + $this->db->delete('freeswich_servers'); |
|
394 | 394 | return true; |
395 | 395 | } |
396 | 396 | function reload_freeswitch($command, $server_host = "") { |
397 | 397 | $response = ''; |
398 | - $query = $this->db_model->getSelect ( "*", "freeswich_servers", "" ); |
|
399 | - $fs_data = $query->result_array (); |
|
400 | - foreach ( $fs_data as $fs_key => $fs_value ) { |
|
401 | - $fp = $this->freeswitch_lib->event_socket_create ( $fs_value ["freeswitch_host"], $fs_value ["freeswitch_port"], $fs_value ["freeswitch_password"] ); |
|
398 | + $query = $this->db_model->getSelect("*", "freeswich_servers", ""); |
|
399 | + $fs_data = $query->result_array(); |
|
400 | + foreach ($fs_data as $fs_key => $fs_value) { |
|
401 | + $fp = $this->freeswitch_lib->event_socket_create($fs_value ["freeswitch_host"], $fs_value ["freeswitch_port"], $fs_value ["freeswitch_password"]); |
|
402 | 402 | if ($fp) { |
403 | - $response .= $this->freeswitch_lib->event_socket_request ( $fp, $command ); |
|
404 | - fclose ( $fp ); |
|
403 | + $response .= $this->freeswitch_lib->event_socket_request($fp, $command); |
|
404 | + fclose($fp); |
|
405 | 405 | } |
406 | 406 | } |
407 | 407 | return $response; |
408 | 408 | } |
409 | 409 | function reload_live_freeswitch($command) { |
410 | 410 | $response = ''; |
411 | - $query = $this->db_model->getSelect ( "*", "freeswich_servers", "" ); |
|
412 | - $fs_data = $query->result_array (); |
|
411 | + $query = $this->db_model->getSelect("*", "freeswich_servers", ""); |
|
412 | + $fs_data = $query->result_array(); |
|
413 | 413 | |
414 | - foreach ( $fs_data as $fs_key => $fs_value ) { |
|
415 | - $fp = $this->freeswitch_lib->event_socket_create ( $fs_value ["freeswitch_host"], $fs_value ["freeswitch_port"], $fs_value ["freeswitch_password"] ); |
|
414 | + foreach ($fs_data as $fs_key => $fs_value) { |
|
415 | + $fp = $this->freeswitch_lib->event_socket_create($fs_value ["freeswitch_host"], $fs_value ["freeswitch_port"], $fs_value ["freeswitch_password"]); |
|
416 | 416 | if ($fp) { |
417 | - $response .= $this->freeswitch_lib->event_socket_request ( $fp, $command ); |
|
418 | - fclose ( $fp ); |
|
417 | + $response .= $this->freeswitch_lib->event_socket_request($fp, $command); |
|
418 | + fclose($fp); |
|
419 | 419 | } |
420 | 420 | } |
421 | - $response = str_replace ( "0 total.", "", $response ); |
|
421 | + $response = str_replace("0 total.", "", $response); |
|
422 | 422 | return $response; |
423 | 423 | } |
424 | 424 | } |
@@ -23,240 +23,240 @@ discard block |
||
23 | 23 | // ############################################################################## |
24 | 24 | class Freeswitch extends MX_Controller { |
25 | 25 | function Freeswitch() { |
26 | - parent::__construct (); |
|
26 | + parent::__construct(); |
|
27 | 27 | |
28 | - $this->load->helper ( 'template_inheritance' ); |
|
28 | + $this->load->helper('template_inheritance'); |
|
29 | 29 | |
30 | - $this->load->library ( 'session' ); |
|
31 | - $this->load->library ( "freeswitch_form" ); |
|
32 | - $this->load->library ( 'astpp/form' ); |
|
33 | - $this->load->library ( 'freeswitch_lib' ); |
|
34 | - $this->load->model ( 'freeswitch_model' ); |
|
30 | + $this->load->library('session'); |
|
31 | + $this->load->library("freeswitch_form"); |
|
32 | + $this->load->library('astpp/form'); |
|
33 | + $this->load->library('freeswitch_lib'); |
|
34 | + $this->load->model('freeswitch_model'); |
|
35 | 35 | |
36 | - if ($this->session->userdata ( 'user_login' ) == FALSE) |
|
37 | - redirect ( base_url () . '/astpp/login' ); |
|
36 | + if ($this->session->userdata('user_login') == FALSE) |
|
37 | + redirect(base_url().'/astpp/login'); |
|
38 | 38 | } |
39 | 39 | function fssipdevices_add($type = "") { |
40 | - $data ['username'] = $this->session->userdata ( 'user_name' ); |
|
41 | - $account_data = $this->session->userdata ( "accountinfo" ); |
|
40 | + $data ['username'] = $this->session->userdata('user_name'); |
|
41 | + $account_data = $this->session->userdata("accountinfo"); |
|
42 | 42 | $data ['flag'] = 'create'; |
43 | - $data ['page_title'] = gettext ( 'Create SIP Device' ); |
|
43 | + $data ['page_title'] = gettext('Create SIP Device'); |
|
44 | 44 | if ($account_data ['type'] == '-1' || $account_data ['type'] == '1') { |
45 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->fsdevice_form_fields_for_customer ( $type ), '' ); |
|
46 | - $this->load->view ( 'view_freeswitch_add_edit', $data ); |
|
45 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($type), ''); |
|
46 | + $this->load->view('view_freeswitch_add_edit', $data); |
|
47 | 47 | } else { |
48 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->get_freeswith_form_fields (), '' ); |
|
49 | - $this->load->view ( 'view_freeswitch_customer_add_edit', $data ); |
|
48 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->get_freeswith_form_fields(), ''); |
|
49 | + $this->load->view('view_freeswitch_customer_add_edit', $data); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | function customer_fssipdevices_add($accountid) { |
53 | - $data ['username'] = $this->session->userdata ( 'user_name' ); |
|
54 | - $account_data = $this->session->userdata ( "accountinfo" ); |
|
55 | - $data ['page_title'] = gettext ( 'Create SIP Device' ); |
|
56 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->fsdevice_form_fields_for_customer ( $accountid ), "" ); |
|
53 | + $data ['username'] = $this->session->userdata('user_name'); |
|
54 | + $account_data = $this->session->userdata("accountinfo"); |
|
55 | + $data ['page_title'] = gettext('Create SIP Device'); |
|
56 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($accountid), ""); |
|
57 | 57 | if ($account_data ['type'] == '-1' || $account_data ['type'] == '1') { |
58 | - $this->load->view ( 'view_freeswitch_add_edit', $data ); |
|
58 | + $this->load->view('view_freeswitch_add_edit', $data); |
|
59 | 59 | } else { |
60 | - $this->load->view ( 'view_freeswitch_customer_add_edit', $data ); |
|
60 | + $this->load->view('view_freeswitch_customer_add_edit', $data); |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | function fssipdevices_edit($edit_id = '') { |
64 | - $data ['page_title'] = gettext ( 'Edit SIP Device' ); |
|
65 | - $account_data = $this->session->userdata ( "accountinfo" ); |
|
66 | - $where = array ( |
|
64 | + $data ['page_title'] = gettext('Edit SIP Device'); |
|
65 | + $account_data = $this->session->userdata("accountinfo"); |
|
66 | + $where = array( |
|
67 | 67 | 'id' => $edit_id |
68 | 68 | ); |
69 | - $account = $this->freeswitch_model->get_edited_data ( $edit_id ); |
|
69 | + $account = $this->freeswitch_model->get_edited_data($edit_id); |
|
70 | 70 | if ($account_data ['type'] == '-1') { |
71 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->get_freeswith_form_fields ( $edit_id ), $account ); |
|
72 | - $this->load->view ( 'view_freeswitch_add_edit', $data ); |
|
71 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->get_freeswith_form_fields($edit_id), $account); |
|
72 | + $this->load->view('view_freeswitch_add_edit', $data); |
|
73 | 73 | } else { |
74 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->get_freeswith_form_fields ( $edit_id ), $account ); |
|
75 | - $this->load->view ( 'view_freeswitch_customer_add_edit', $data ); |
|
74 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->get_freeswith_form_fields($edit_id), $account); |
|
75 | + $this->load->view('view_freeswitch_customer_add_edit', $data); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | function customer_fssipdevices_edit($edit_id, $accountid) { |
79 | - $data ['username'] = $this->session->userdata ( 'user_name' ); |
|
80 | - $account_data = $this->session->userdata ( "accountinfo" ); |
|
81 | - $data ['page_title'] = gettext ( 'Edit SIP device' ); |
|
82 | - $where = array ( |
|
79 | + $data ['username'] = $this->session->userdata('user_name'); |
|
80 | + $account_data = $this->session->userdata("accountinfo"); |
|
81 | + $data ['page_title'] = gettext('Edit SIP device'); |
|
82 | + $where = array( |
|
83 | 83 | 'id' => $edit_id |
84 | 84 | ); |
85 | - $account = $this->freeswitch_model->get_edited_data ( $edit_id ); |
|
85 | + $account = $this->freeswitch_model->get_edited_data($edit_id); |
|
86 | 86 | if ($account_data ['type'] == '-1' || $account_data ['type'] == '1') { |
87 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->fsdevice_form_fields_for_customer ( $accountid, $edit_id ), $account ); |
|
88 | - $this->load->view ( 'view_freeswitch_add_edit', $data ); |
|
87 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($accountid, $edit_id), $account); |
|
88 | + $this->load->view('view_freeswitch_add_edit', $data); |
|
89 | 89 | } else { |
90 | 90 | |
91 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->fsdevice_form_fields_for_customer ( $accountid, $edit_id ), $account ); |
|
92 | - $this->load->view ( 'view_freeswitch_customer_add_edit', $data ); |
|
91 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($accountid, $edit_id), $account); |
|
92 | + $this->load->view('view_freeswitch_customer_add_edit', $data); |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | function fsgateway_search() { |
96 | - $ajax_search = $this->input->post ( 'ajax_search', 0 ); |
|
96 | + $ajax_search = $this->input->post('ajax_search', 0); |
|
97 | 97 | |
98 | - if ($this->input->post ( 'advance_search', TRUE ) == 1) { |
|
99 | - $this->session->set_userdata ( 'advance_search', $this->input->post ( 'advance_search' ) ); |
|
100 | - $action = $this->input->post (); |
|
101 | - unset ( $action ['action'] ); |
|
102 | - unset ( $action ['advance_search'] ); |
|
103 | - $this->session->set_userdata ( 'fsgateway_list_search', $action ); |
|
98 | + if ($this->input->post('advance_search', TRUE) == 1) { |
|
99 | + $this->session->set_userdata('advance_search', $this->input->post('advance_search')); |
|
100 | + $action = $this->input->post(); |
|
101 | + unset ($action ['action']); |
|
102 | + unset ($action ['advance_search']); |
|
103 | + $this->session->set_userdata('fsgateway_list_search', $action); |
|
104 | 104 | } |
105 | 105 | if (@$ajax_search != 1) { |
106 | - redirect ( base_url () . 'freeswitch/fsgateway/' ); |
|
106 | + redirect(base_url().'freeswitch/fsgateway/'); |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | function fssipprofile_search() { |
110 | - $ajax_search = $this->input->post ( 'ajax_search', 0 ); |
|
110 | + $ajax_search = $this->input->post('ajax_search', 0); |
|
111 | 111 | |
112 | - if ($this->input->post ( 'advance_search', TRUE ) == 1) { |
|
113 | - $this->session->set_userdata ( 'advance_search', $this->input->post ( 'advance_search' ) ); |
|
114 | - $action = $this->input->post (); |
|
115 | - unset ( $action ['action'] ); |
|
116 | - unset ( $action ['advance_search'] ); |
|
117 | - $this->session->set_userdata ( 'fssipprofile_list_search', $action ); |
|
112 | + if ($this->input->post('advance_search', TRUE) == 1) { |
|
113 | + $this->session->set_userdata('advance_search', $this->input->post('advance_search')); |
|
114 | + $action = $this->input->post(); |
|
115 | + unset ($action ['action']); |
|
116 | + unset ($action ['advance_search']); |
|
117 | + $this->session->set_userdata('fssipprofile_list_search', $action); |
|
118 | 118 | } |
119 | 119 | if (@$ajax_search != 1) { |
120 | - redirect ( base_url () . 'freeswitch/fssipprofile/' ); |
|
120 | + redirect(base_url().'freeswitch/fssipprofile/'); |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | function fssipdevices_clearsearchfilter() { |
124 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
125 | - $this->session->set_userdata ( 'account_search', "" ); |
|
124 | + $this->session->set_userdata('advance_search', 0); |
|
125 | + $this->session->set_userdata('account_search', ""); |
|
126 | 126 | } |
127 | 127 | function fsgateway_clearsearchfilter() { |
128 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
129 | - $this->session->set_userdata ( 'account_search', "" ); |
|
128 | + $this->session->set_userdata('advance_search', 0); |
|
129 | + $this->session->set_userdata('account_search', ""); |
|
130 | 130 | } |
131 | 131 | function fssipprofile_clearsearchfilter() { |
132 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
133 | - $this->session->set_userdata ( 'account_search', "" ); |
|
132 | + $this->session->set_userdata('advance_search', 0); |
|
133 | + $this->session->set_userdata('account_search', ""); |
|
134 | 134 | } |
135 | 135 | function fssipdevices_save($user_flg = false) { |
136 | - $add_array = $this->input->post (); |
|
137 | - if (! $user_flg) { |
|
138 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->get_freeswith_form_fields ( $add_array ['id'] ), $add_array ); |
|
136 | + $add_array = $this->input->post(); |
|
137 | + if ( ! $user_flg) { |
|
138 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->get_freeswith_form_fields($add_array ['id']), $add_array); |
|
139 | 139 | } else { |
140 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->fsdevice_form_fields_for_customer ( $add_array ["accountcode"], $add_array ['id'] ), $add_array ); |
|
140 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($add_array ["accountcode"], $add_array ['id']), $add_array); |
|
141 | 141 | } |
142 | 142 | if ($add_array ['id'] != '') { |
143 | - $data ['page_title'] = gettext ( 'Freeswitch SIP Devices' ); |
|
144 | - if ($this->form_validation->run () == FALSE) { |
|
145 | - $data ['validation_errors'] = validation_errors (); |
|
143 | + $data ['page_title'] = gettext('Freeswitch SIP Devices'); |
|
144 | + if ($this->form_validation->run() == FALSE) { |
|
145 | + $data ['validation_errors'] = validation_errors(); |
|
146 | 146 | echo $data ['validation_errors']; |
147 | 147 | exit (); |
148 | 148 | } else { |
149 | - $this->freeswitch_model->edit_freeswith ( $add_array, $add_array ['id'] ); |
|
150 | - echo json_encode ( array ( |
|
149 | + $this->freeswitch_model->edit_freeswith($add_array, $add_array ['id']); |
|
150 | + echo json_encode(array( |
|
151 | 151 | "SUCCESS" => "SIP Device Updated Successfully!" |
152 | - ) ); |
|
152 | + )); |
|
153 | 153 | exit (); |
154 | 154 | } |
155 | 155 | } else { |
156 | - $data ['page_title'] = gettext ( 'Create Freeswitch SIP Devices' ); |
|
157 | - if ($this->form_validation->run () == FALSE) { |
|
158 | - $data ['validation_errors'] = validation_errors (); |
|
156 | + $data ['page_title'] = gettext('Create Freeswitch SIP Devices'); |
|
157 | + if ($this->form_validation->run() == FALSE) { |
|
158 | + $data ['validation_errors'] = validation_errors(); |
|
159 | 159 | echo $data ['validation_errors']; |
160 | 160 | exit (); |
161 | 161 | } else { |
162 | - $this->freeswitch_model->add_freeswith ( $add_array ); |
|
163 | - echo json_encode ( array ( |
|
162 | + $this->freeswitch_model->add_freeswith($add_array); |
|
163 | + echo json_encode(array( |
|
164 | 164 | "SUCCESS" => "SIP Device Added Successfully!" |
165 | - ) ); |
|
165 | + )); |
|
166 | 166 | exit (); |
167 | 167 | } |
168 | 168 | } |
169 | 169 | } |
170 | 170 | function customer_fssipdevices_save($user_flg = false) { |
171 | - $add_array = $this->input->post (); |
|
172 | - if (! $user_flg) { |
|
173 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->get_freeswith_form_fields (), $add_array ); |
|
171 | + $add_array = $this->input->post(); |
|
172 | + if ( ! $user_flg) { |
|
173 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->get_freeswith_form_fields(), $add_array); |
|
174 | 174 | } else { |
175 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->fsdevice_form_fields_for_customer ( $add_array ["accountcode"], $add_array ['id'] ), $add_array ); |
|
175 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($add_array ["accountcode"], $add_array ['id']), $add_array); |
|
176 | 176 | } |
177 | 177 | if ($add_array ['id'] != '') { |
178 | - $data ['page_title'] = gettext ( 'Edit Freeswitch SIP Devices' ); |
|
179 | - if ($this->form_validation->run () == FALSE) { |
|
180 | - $data ['validation_errors'] = validation_errors (); |
|
178 | + $data ['page_title'] = gettext('Edit Freeswitch SIP Devices'); |
|
179 | + if ($this->form_validation->run() == FALSE) { |
|
180 | + $data ['validation_errors'] = validation_errors(); |
|
181 | 181 | echo $data ['validation_errors']; |
182 | 182 | exit (); |
183 | 183 | } else { |
184 | - $this->freeswitch_model->edit_freeswith ( $add_array, $add_array ['id'] ); |
|
185 | - echo json_encode ( array ( |
|
184 | + $this->freeswitch_model->edit_freeswith($add_array, $add_array ['id']); |
|
185 | + echo json_encode(array( |
|
186 | 186 | "SUCCESS" => "SIP Device Updated Successfully!" |
187 | - ) ); |
|
187 | + )); |
|
188 | 188 | exit (); |
189 | 189 | } |
190 | 190 | } else { |
191 | - $data ['page_title'] = gettext ( 'Create Freeswitch SIP Devices' ); |
|
192 | - if ($this->form_validation->run () == FALSE) { |
|
193 | - $data ['validation_errors'] = validation_errors (); |
|
191 | + $data ['page_title'] = gettext('Create Freeswitch SIP Devices'); |
|
192 | + if ($this->form_validation->run() == FALSE) { |
|
193 | + $data ['validation_errors'] = validation_errors(); |
|
194 | 194 | echo $data ['validation_errors']; |
195 | 195 | exit (); |
196 | 196 | } else { |
197 | - $this->freeswitch_model->add_freeswith ( $add_array ); |
|
198 | - echo json_encode ( array ( |
|
197 | + $this->freeswitch_model->add_freeswith($add_array); |
|
198 | + echo json_encode(array( |
|
199 | 199 | "SUCCESS" => "SIP Device Added Successfully!" |
200 | - ) ); |
|
200 | + )); |
|
201 | 201 | exit (); |
202 | 202 | } |
203 | 203 | } |
204 | 204 | } |
205 | 205 | function user_fssipdevices_save($user_flg = false) { |
206 | - $add_array = $this->input->post (); |
|
207 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->fsdevice_form_fields_for_customer ( $add_array ["accountcode"], $add_array ['id'] ), $add_array ); |
|
206 | + $add_array = $this->input->post(); |
|
207 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($add_array ["accountcode"], $add_array ['id']), $add_array); |
|
208 | 208 | if ($add_array ['id'] != '') { |
209 | - $data ['page_title'] = gettext ( 'Edit Freeswitch SIP Devices' ); |
|
210 | - if ($this->form_validation->run () == FALSE) { |
|
211 | - $data ['validation_errors'] = validation_errors (); |
|
209 | + $data ['page_title'] = gettext('Edit Freeswitch SIP Devices'); |
|
210 | + if ($this->form_validation->run() == FALSE) { |
|
211 | + $data ['validation_errors'] = validation_errors(); |
|
212 | 212 | echo $data ['validation_errors']; |
213 | 213 | exit (); |
214 | 214 | } else { |
215 | - $this->freeswitch_model->edit_freeswith ( $add_array, $add_array ['id'] ); |
|
216 | - echo json_encode ( array ( |
|
215 | + $this->freeswitch_model->edit_freeswith($add_array, $add_array ['id']); |
|
216 | + echo json_encode(array( |
|
217 | 217 | "SUCCESS" => "SIP Device Updated Successfully!" |
218 | - ) ); |
|
218 | + )); |
|
219 | 219 | exit (); |
220 | 220 | } |
221 | 221 | } else { |
222 | - $data ['page_title'] = gettext ( 'Create Freeswitch SIP Devices' ); |
|
223 | - if ($this->form_validation->run () == FALSE) { |
|
224 | - $data ['validation_errors'] = validation_errors (); |
|
222 | + $data ['page_title'] = gettext('Create Freeswitch SIP Devices'); |
|
223 | + if ($this->form_validation->run() == FALSE) { |
|
224 | + $data ['validation_errors'] = validation_errors(); |
|
225 | 225 | echo $data ['validation_errors']; |
226 | 226 | exit (); |
227 | 227 | } else { |
228 | - $sip_profile_id = $this->common->get_field_name ( 'id', 'sip_profiles', array ( |
|
228 | + $sip_profile_id = $this->common->get_field_name('id', 'sip_profiles', array( |
|
229 | 229 | 'name' => 'default' |
230 | - ) ); |
|
231 | - $this->freeswitch_model->add_freeswith ( $add_array ); |
|
232 | - echo json_encode ( array ( |
|
230 | + )); |
|
231 | + $this->freeswitch_model->add_freeswith($add_array); |
|
232 | + echo json_encode(array( |
|
233 | 233 | "SUCCESS" => "SIP Device Added Successfully!" |
234 | - ) ); |
|
234 | + )); |
|
235 | 235 | exit (); |
236 | 236 | } |
237 | 237 | } |
238 | 238 | } |
239 | 239 | function fssipdevices_search() { |
240 | - $ajax_search = $this->input->post ( 'ajax_search', 0 ); |
|
241 | - if ($this->input->post ( 'advance_search', TRUE ) == 1) { |
|
242 | - $this->session->set_userdata ( 'advance_search', $this->input->post ( 'advance_search' ) ); |
|
243 | - $action = $this->input->post (); |
|
244 | - unset ( $action ['action'] ); |
|
245 | - unset ( $action ['advance_search'] ); |
|
246 | - $this->session->set_userdata ( 'fssipdevices_list_search', $action ); |
|
240 | + $ajax_search = $this->input->post('ajax_search', 0); |
|
241 | + if ($this->input->post('advance_search', TRUE) == 1) { |
|
242 | + $this->session->set_userdata('advance_search', $this->input->post('advance_search')); |
|
243 | + $action = $this->input->post(); |
|
244 | + unset ($action ['action']); |
|
245 | + unset ($action ['advance_search']); |
|
246 | + $this->session->set_userdata('fssipdevices_list_search', $action); |
|
247 | 247 | } |
248 | 248 | if (@$ajax_search != 1) { |
249 | - redirect ( base_url () . 'freeswitch/fssipdevices/' ); |
|
249 | + redirect(base_url().'freeswitch/fssipdevices/'); |
|
250 | 250 | } |
251 | 251 | } |
252 | 252 | function fssipdevices() { |
253 | - $data ['page_title'] = gettext ( 'SIP Devices' ); |
|
253 | + $data ['page_title'] = gettext('SIP Devices'); |
|
254 | 254 | $data ['search_flag'] = true; |
255 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
256 | - $data ['grid_fields'] = $this->freeswitch_form->build_system_list_for_admin (); |
|
257 | - $data ["grid_buttons"] = $this->freeswitch_form->build_grid_buttons (); |
|
258 | - $data ['form_search'] = $this->form->build_serach_form ( $this->freeswitch_form->get_sipdevice_search_form () ); |
|
259 | - $this->load->view ( 'view_freeswitch_sip_devices_list', $data ); |
|
255 | + $this->session->set_userdata('advance_search', 0); |
|
256 | + $data ['grid_fields'] = $this->freeswitch_form->build_system_list_for_admin(); |
|
257 | + $data ["grid_buttons"] = $this->freeswitch_form->build_grid_buttons(); |
|
258 | + $data ['form_search'] = $this->form->build_serach_form($this->freeswitch_form->get_sipdevice_search_form()); |
|
259 | + $this->load->view('view_freeswitch_sip_devices_list', $data); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | /** |
@@ -266,63 +266,63 @@ discard block |
||
266 | 266 | * ***** |
267 | 267 | */ |
268 | 268 | function fssipdevices_json() { |
269 | - $json_data = array (); |
|
270 | - $count_all = $this->freeswitch_model->fs_retrieve_sip_user ( false ); |
|
271 | - $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
|
269 | + $json_data = array(); |
|
270 | + $count_all = $this->freeswitch_model->fs_retrieve_sip_user(false); |
|
271 | + $paging_data = $this->form->load_grid_config($count_all, $_GET ['rp'], $_GET ['page']); |
|
272 | 272 | $json_data = $paging_data ["json_paging"]; |
273 | - $query = $this->freeswitch_model->fs_retrieve_sip_user ( true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
|
274 | - foreach ( $query as $key => $value ) { |
|
275 | - $path_true = base_url () . '/assets/images/true.png'; |
|
276 | - $path_false = base_url () . '/assets/images/false.png'; |
|
273 | + $query = $this->freeswitch_model->fs_retrieve_sip_user(true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"]); |
|
274 | + foreach ($query as $key => $value) { |
|
275 | + $path_true = base_url().'/assets/images/true.png'; |
|
276 | + $path_false = base_url().'/assets/images/false.png'; |
|
277 | 277 | if ($value ['voicemail_enabled'] == 'true') { |
278 | - $voicemail_enabled = '<img src=' . $path_true . ' style="height:20px;width:20px;" title="Enable">'; |
|
278 | + $voicemail_enabled = '<img src='.$path_true.' style="height:20px;width:20px;" title="Enable">'; |
|
279 | 279 | } else { |
280 | - $voicemail_enabled = '<img src=' . $path_false . ' style="height:20px;width:20px;" title="Disable">'; |
|
280 | + $voicemail_enabled = '<img src='.$path_false.' style="height:20px;width:20px;" title="Disable">'; |
|
281 | 281 | } |
282 | - $json_data ['rows'] [] = array ( |
|
283 | - 'cell' => array ( |
|
284 | - '<input type="checkbox" name="chkAll" id=' . $value ['id'] . ' class="ace chkRefNos" onclick="clickchkbox(' . $value ['id'] . ')" value=' . $value ['id'] . '><lable class="lbl"></lable>', |
|
285 | - "<a href='/freeswitch/fssipdevices_edit/" . $value ['id'] . "' style='cursor:pointer;color:#005298;' rel='facebox_medium' title='username'>" . $value ['username'] . "</a>", |
|
282 | + $json_data ['rows'] [] = array( |
|
283 | + 'cell' => array( |
|
284 | + '<input type="checkbox" name="chkAll" id='.$value ['id'].' class="ace chkRefNos" onclick="clickchkbox('.$value ['id'].')" value='.$value ['id'].'><lable class="lbl"></lable>', |
|
285 | + "<a href='/freeswitch/fssipdevices_edit/".$value ['id']."' style='cursor:pointer;color:#005298;' rel='facebox_medium' title='username'>".$value ['username']."</a>", |
|
286 | 286 | /** |
287 | 287 | * *********************** |
288 | 288 | */ |
289 | 289 | $value ['password'], |
290 | - $this->common->get_field_name ( 'name', '`sip_profiles', array ( |
|
290 | + $this->common->get_field_name('name', '`sip_profiles', array( |
|
291 | 291 | 'id' => $value ['sip_profile_id'] |
292 | - ) ), |
|
293 | - $this->common->get_field_name_coma_new ( 'first_name,last_name,number', 'accounts', array ( |
|
292 | + )), |
|
293 | + $this->common->get_field_name_coma_new('first_name,last_name,number', 'accounts', array( |
|
294 | 294 | '0' => $value ['accountid'] |
295 | - ) ), |
|
295 | + )), |
|
296 | 296 | $value ['effective_caller_id_name'], |
297 | 297 | $value ['effective_caller_id_number'], |
298 | 298 | $voicemail_enabled, |
299 | - $this->common->get_status ( 'status', 'sip_devices', $value ), |
|
300 | - $this->common->convert_GMT_to ( '', '', $value ['creation_date'] ), |
|
301 | - $this->common->convert_GMT_to ( '', '', $value ['last_modified_date'] ), |
|
302 | - $this->get_action_buttons_fssipdevices ( $value ['id'] ) |
|
299 | + $this->common->get_status('status', 'sip_devices', $value), |
|
300 | + $this->common->convert_GMT_to('', '', $value ['creation_date']), |
|
301 | + $this->common->convert_GMT_to('', '', $value ['last_modified_date']), |
|
302 | + $this->get_action_buttons_fssipdevices($value ['id']) |
|
303 | 303 | ) |
304 | 304 | ); |
305 | 305 | } |
306 | - echo json_encode ( $json_data ); |
|
306 | + echo json_encode($json_data); |
|
307 | 307 | } |
308 | 308 | function fssipdevices_delete_multiple() { |
309 | - $ids = $this->input->post ( "selected_ids", true ); |
|
309 | + $ids = $this->input->post("selected_ids", true); |
|
310 | 310 | $where = "id IN ($ids)"; |
311 | - $this->db->where ( $where ); |
|
312 | - echo $this->db->delete ( "sip_devices" ); |
|
311 | + $this->db->where($where); |
|
312 | + echo $this->db->delete("sip_devices"); |
|
313 | 313 | } |
314 | 314 | function user_fssipdevices_delete_multiple() { |
315 | - $ids = $this->input->post ( "selected_ids", true ); |
|
315 | + $ids = $this->input->post("selected_ids", true); |
|
316 | 316 | $where = "id IN ($ids)"; |
317 | - $this->db->where ( $where ); |
|
318 | - $this->db->delete ( "sip_devices" ); |
|
317 | + $this->db->where($where); |
|
318 | + $this->db->delete("sip_devices"); |
|
319 | 319 | echo TRUE; |
320 | 320 | } |
321 | 321 | function customer_fssipdevices_delete_multiple() { |
322 | - $ids = $this->input->post ( "selected_ids", true ); |
|
322 | + $ids = $this->input->post("selected_ids", true); |
|
323 | 323 | $where = "id IN ($ids)"; |
324 | - $this->db->where ( $where ); |
|
325 | - $this->db->delete ( "sip_devices" ); |
|
324 | + $this->db->where($where); |
|
325 | + $this->db->delete("sip_devices"); |
|
326 | 326 | echo TRUE; |
327 | 327 | } |
328 | 328 | |
@@ -333,112 +333,112 @@ discard block |
||
333 | 333 | * ***** |
334 | 334 | */ |
335 | 335 | function customer_fssipdevices_json($accountid, $entity_type = '') { |
336 | - $json_data = array (); |
|
337 | - $count_all = $this->freeswitch_model->get_sipdevices_list ( false, $accountid, $entity_type ); |
|
338 | - $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
|
336 | + $json_data = array(); |
|
337 | + $count_all = $this->freeswitch_model->get_sipdevices_list(false, $accountid, $entity_type); |
|
338 | + $paging_data = $this->form->load_grid_config($count_all, $_GET ['rp'], $_GET ['page']); |
|
339 | 339 | $json_data = $paging_data ["json_paging"]; |
340 | - $devices_result = array (); |
|
341 | - $query = $this->freeswitch_model->get_sipdevices_list ( true, $accountid, $entity_type, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
|
342 | - foreach ( $query as $key => $value ) { |
|
343 | - $path_true = base_url () . '/assets/images/true.png'; |
|
344 | - $path_false = base_url () . '/assets/images/false.png'; |
|
345 | - $voicemail_enabled = $value ['voicemail_enabled'] == 'true' ? '<img src=' . $path_true . ' style="height:20px;width:20px;" title="Enable">' : '<img src=' . $path_false . ' style="height:20px;width:20px;" title="Disable">'; |
|
346 | - $json_data ['rows'] [] = array ( |
|
347 | - 'cell' => array ( |
|
348 | - '<input type="checkbox" name="chkAll" id="' . $value ['id'] . '" class="ace chkRefNos" onclick="clickchkbox(' . $value ['id'] . ')" value=' . $value ['id'] . '><lable class="lbl"></lable>', |
|
340 | + $devices_result = array(); |
|
341 | + $query = $this->freeswitch_model->get_sipdevices_list(true, $accountid, $entity_type, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"]); |
|
342 | + foreach ($query as $key => $value) { |
|
343 | + $path_true = base_url().'/assets/images/true.png'; |
|
344 | + $path_false = base_url().'/assets/images/false.png'; |
|
345 | + $voicemail_enabled = $value ['voicemail_enabled'] == 'true' ? '<img src='.$path_true.' style="height:20px;width:20px;" title="Enable">' : '<img src='.$path_false.' style="height:20px;width:20px;" title="Disable">'; |
|
346 | + $json_data ['rows'] [] = array( |
|
347 | + 'cell' => array( |
|
348 | + '<input type="checkbox" name="chkAll" id="'.$value ['id'].'" class="ace chkRefNos" onclick="clickchkbox('.$value ['id'].')" value='.$value ['id'].'><lable class="lbl"></lable>', |
|
349 | 349 | $value ['username'], |
350 | 350 | $value ['password'], |
351 | - $this->common->get_field_name ( 'name', '`sip_profiles', array ( |
|
351 | + $this->common->get_field_name('name', '`sip_profiles', array( |
|
352 | 352 | 'id' => $value ['sip_profile_id'] |
353 | - ) ), |
|
353 | + )), |
|
354 | 354 | $value ['effective_caller_id_name'], |
355 | 355 | $value ['effective_caller_id_number'], |
356 | 356 | $voicemail_enabled, |
357 | - $this->common->get_status ( 'status', 'sip_devices', $value ), |
|
358 | - $this->common->convert_GMT_to ( '', '', $value ['creation_date'] ), |
|
359 | - $this->common->convert_GMT_to ( '', '', $value ['last_modified_date'] ), |
|
360 | - $this->get_action_fssipdevices_buttons ( $value ['id'], $value ['accountid'], $entity_type ) |
|
357 | + $this->common->get_status('status', 'sip_devices', $value), |
|
358 | + $this->common->convert_GMT_to('', '', $value ['creation_date']), |
|
359 | + $this->common->convert_GMT_to('', '', $value ['last_modified_date']), |
|
360 | + $this->get_action_fssipdevices_buttons($value ['id'], $value ['accountid'], $entity_type) |
|
361 | 361 | ) |
362 | 362 | ); |
363 | 363 | } // exit; |
364 | - echo json_encode ( $json_data ); |
|
364 | + echo json_encode($json_data); |
|
365 | 365 | } |
366 | 366 | /** |
367 | 367 | * ************************* |
368 | 368 | */ |
369 | 369 | function get_action_fssipdevices_buttons($id, $accountid, $entity_type = '') { |
370 | 370 | $ret_url = ''; |
371 | - if ($this->session->userdata ( "logintype" ) == '0' || $this->session->userdata ( "logintype" ) == '3') { |
|
372 | - $ret_url = '<a href="' . base_url () . 'user/user_fssipdevices_action/edit/' . $id . '/' . $accountid . '/" class="btn btn-royelblue btn-sm" rel="facebox_medium" title="Edit"> <i class="fa fa-pencil-square-o fa-fw"></i></a> '; |
|
373 | - $ret_url .= '<a href="' . base_url () . 'user/user_fssipdevices_action/delete/' . $id . '/' . $accountid . '/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();"> <i class="fa fa-trash fa-fw"></i></a>'; |
|
371 | + if ($this->session->userdata("logintype") == '0' || $this->session->userdata("logintype") == '3') { |
|
372 | + $ret_url = '<a href="'.base_url().'user/user_fssipdevices_action/edit/'.$id.'/'.$accountid.'/" class="btn btn-royelblue btn-sm" rel="facebox_medium" title="Edit"> <i class="fa fa-pencil-square-o fa-fw"></i></a> '; |
|
373 | + $ret_url .= '<a href="'.base_url().'user/user_fssipdevices_action/delete/'.$id.'/'.$accountid.'/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();"> <i class="fa fa-trash fa-fw"></i></a>'; |
|
374 | 374 | } else { |
375 | - $ret_url = '<a href="' . base_url () . 'accounts/' . $entity_type . '_fssipdevices_action/edit/' . $id . '/' . $accountid . '/" class="btn btn-royelblue btn-sm" rel="facebox_medium" title="Edit"> <i class="fa fa-pencil-square-o fa-fw"></i></a> '; |
|
376 | - $ret_url .= '<a href="' . base_url () . 'accounts/' . $entity_type . '_fssipdevices_action/delete/' . $id . '/' . $accountid . '/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();"> <i class="fa fa-trash fa-fw"></i></a>'; |
|
375 | + $ret_url = '<a href="'.base_url().'accounts/'.$entity_type.'_fssipdevices_action/edit/'.$id.'/'.$accountid.'/" class="btn btn-royelblue btn-sm" rel="facebox_medium" title="Edit"> <i class="fa fa-pencil-square-o fa-fw"></i></a> '; |
|
376 | + $ret_url .= '<a href="'.base_url().'accounts/'.$entity_type.'_fssipdevices_action/delete/'.$id.'/'.$accountid.'/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();"> <i class="fa fa-trash fa-fw"></i></a>'; |
|
377 | 377 | } |
378 | 378 | return $ret_url; |
379 | 379 | } |
380 | 380 | function fssipdevices_delete($id) { |
381 | - $this->freeswitch_model->delete_freeswith_devices ( $id ); |
|
382 | - $this->session->set_flashdata ( 'astpp_notification', 'SIP Device Removed Successfully!' ); |
|
383 | - redirect ( base_url () . 'freeswitch/fssipdevices/' ); |
|
381 | + $this->freeswitch_model->delete_freeswith_devices($id); |
|
382 | + $this->session->set_flashdata('astpp_notification', 'SIP Device Removed Successfully!'); |
|
383 | + redirect(base_url().'freeswitch/fssipdevices/'); |
|
384 | 384 | exit (); |
385 | 385 | } |
386 | 386 | function get_action_buttons_fssipdevices($id) { |
387 | 387 | $ret_url = ''; |
388 | - $ret_url = '<a href="' . base_url () . 'freeswitch/fssipdevices_edit/' . $id . '/" class="btn btn-royelblue btn-sm" rel="facebox_medium" title="Edit"> <i class="fa fa-pencil-square-o fa-fw"></i></a> '; |
|
389 | - $ret_url .= '<a href="' . base_url () . 'freeswitch/fssipdevices_delete/' . $id . '/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();"> <i class="fa fa-trash fa-fw"></i></a>'; |
|
388 | + $ret_url = '<a href="'.base_url().'freeswitch/fssipdevices_edit/'.$id.'/" class="btn btn-royelblue btn-sm" rel="facebox_medium" title="Edit"> <i class="fa fa-pencil-square-o fa-fw"></i></a> '; |
|
389 | + $ret_url .= '<a href="'.base_url().'freeswitch/fssipdevices_delete/'.$id.'/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();"> <i class="fa fa-trash fa-fw"></i></a>'; |
|
390 | 390 | return $ret_url; |
391 | 391 | } |
392 | 392 | function livecall_report() { |
393 | - $data ['username'] = $this->session->userdata ( 'user_name' ); |
|
394 | - $data ['page_title'] = gettext ( 'Live Call Report' ); |
|
395 | - $this->load->view ( 'view_fs_livecall_report', $data ); |
|
393 | + $data ['username'] = $this->session->userdata('user_name'); |
|
394 | + $data ['page_title'] = gettext('Live Call Report'); |
|
395 | + $this->load->view('view_fs_livecall_report', $data); |
|
396 | 396 | } |
397 | 397 | function livecall_report_json() { |
398 | 398 | $command = "api show channels"; |
399 | - $response = $this->freeswitch_model->reload_live_freeswitch ( $command ); |
|
400 | - $calls = array (); |
|
401 | - $calls_final = array (); |
|
402 | - $data_header = array (); |
|
399 | + $response = $this->freeswitch_model->reload_live_freeswitch($command); |
|
400 | + $calls = array(); |
|
401 | + $calls_final = array(); |
|
402 | + $data_header = array(); |
|
403 | 403 | $k = 0; |
404 | - $data = explode ( "\n", $response ); |
|
405 | - for($i = 0; $i < count ( $data ) - 2; $i ++) { |
|
406 | - if (trim ( $data [$i] ) != '') { |
|
407 | - if (count ( $data_header ) == 0 || substr ( $data [$i], 0, 4 ) == "uuid") { |
|
408 | - $data_header = explode ( ",", $data [$i] ); |
|
404 | + $data = explode("\n", $response); |
|
405 | + for ($i = 0; $i < count($data) - 2; $i++) { |
|
406 | + if (trim($data [$i]) != '') { |
|
407 | + if (count($data_header) == 0 || substr($data [$i], 0, 4) == "uuid") { |
|
408 | + $data_header = explode(",", $data [$i]); |
|
409 | 409 | } else { |
410 | - $data_call = explode ( ",", $data [$i] ); |
|
411 | - for($j = 0; $j < count ( $data_call ); $j ++) { |
|
410 | + $data_call = explode(",", $data [$i]); |
|
411 | + for ($j = 0; $j < count($data_call); $j++) { |
|
412 | 412 | $calls [$k] [@$data_header [$j]] = @$data_call [$j]; |
413 | 413 | $calls_final [@$calls [$k] ['uuid']] = @$calls [$k]; |
414 | 414 | } |
415 | - $k ++; |
|
415 | + $k++; |
|
416 | 416 | } |
417 | 417 | } |
418 | 418 | } |
419 | - $json_data = array (); |
|
419 | + $json_data = array(); |
|
420 | 420 | $count = 0; |
421 | - foreach ( $calls as $key => $value ) { |
|
422 | - if (isset ( $value ['state'] ) && ($value ['state'] == 'CS_EXCHANGE_MEDIA' || $value ['state'] == 'CS_CONSUME_MEDIA')) { |
|
421 | + foreach ($calls as $key => $value) { |
|
422 | + if (isset ($value ['state']) && ($value ['state'] == 'CS_EXCHANGE_MEDIA' || $value ['state'] == 'CS_CONSUME_MEDIA')) { |
|
423 | 423 | $calls [$i] ['application'] = @$calls_final [$value ['call_uuid']] ['application']; |
424 | 424 | $calls [$i] ['application_data'] = @$calls_final [$value ['call_uuid']] ['application_data']; |
425 | 425 | |
426 | 426 | $diff_value = 0; |
427 | 427 | if ($value ['callstate'] == 'ACTIVE') { |
428 | - $cmd = "api uuid_dump " . $value ['uuid'] . ""; |
|
429 | - $fs_result = $this->freeswitch_model->reload_freeswitch ( $cmd ); |
|
430 | - $fs_array = explode ( "\n", $fs_result ); |
|
431 | - foreach ( $fs_array as $key => $sub_value ) { |
|
432 | - $sub_fs_array = explode ( ':', $sub_value ); |
|
433 | - if (trim ( $sub_fs_array [0] ) == 'Caller-Channel-Answered-Time') { |
|
428 | + $cmd = "api uuid_dump ".$value ['uuid'].""; |
|
429 | + $fs_result = $this->freeswitch_model->reload_freeswitch($cmd); |
|
430 | + $fs_array = explode("\n", $fs_result); |
|
431 | + foreach ($fs_array as $key => $sub_value) { |
|
432 | + $sub_fs_array = explode(':', $sub_value); |
|
433 | + if (trim($sub_fs_array [0]) == 'Caller-Channel-Answered-Time') { |
|
434 | 434 | $answer_min = $sub_fs_array [1]; |
435 | - $diff_value = substr ( $answer_min, 0, 11 ) - $value ['created_epoch']; |
|
435 | + $diff_value = substr($answer_min, 0, 11) - $value ['created_epoch']; |
|
436 | 436 | } |
437 | 437 | } |
438 | 438 | } |
439 | - $duration = ($value ['callstate'] == 'ACTIVE') ? date ( "H:i:s", strtotime ( date ( "Y-m-d H:i:s" ) ) - $value ['created_epoch'] - $diff_value ) : "00:00:00"; |
|
440 | - $json_data ['rows'] [] = array ( |
|
441 | - 'cell' => array ( |
|
439 | + $duration = ($value ['callstate'] == 'ACTIVE') ? date ("H:i:s", strtotime(date("Y-m-d H:i:s")) - $value ['created_epoch'] - $diff_value) : "00:00:00"; |
|
440 | + $json_data ['rows'] [] = array( |
|
441 | + 'cell' => array( |
|
442 | 442 | $value ['created'], |
443 | 443 | $value ['cid_name'], |
444 | 444 | $value ['cid_num'], |
@@ -451,73 +451,73 @@ discard block |
||
451 | 451 | $duration |
452 | 452 | ) |
453 | 453 | ); |
454 | - $count ++; |
|
454 | + $count++; |
|
455 | 455 | } else { |
456 | - unset ( $calls [$i] ); |
|
456 | + unset ($calls [$i]); |
|
457 | 457 | } |
458 | 458 | } |
459 | 459 | $json_data ['page'] = 1; |
460 | 460 | $json_data ['total'] = $count; |
461 | - echo json_encode ( $json_data ); |
|
461 | + echo json_encode($json_data); |
|
462 | 462 | } |
463 | 463 | function fsgateway() { |
464 | - $data ['username'] = $this->session->userdata ( 'user_name' ); |
|
465 | - $data ['page_title'] = gettext ( 'Gateways' ); |
|
464 | + $data ['username'] = $this->session->userdata('user_name'); |
|
465 | + $data ['page_title'] = gettext('Gateways'); |
|
466 | 466 | $data ['search_flag'] = true; |
467 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
468 | - $data ['grid_fields'] = $this->freeswitch_form->build_fsgateway_list_for_admin (); |
|
469 | - $data ["grid_buttons"] = $this->freeswitch_form->build_fdgateway_grid_buttons (); |
|
470 | - $data ['form_search'] = $this->form->build_serach_form ( $this->freeswitch_form->get_gateway_search_form () ); |
|
471 | - $this->load->view ( 'view_fsgateway_list', $data ); |
|
467 | + $this->session->set_userdata('advance_search', 0); |
|
468 | + $data ['grid_fields'] = $this->freeswitch_form->build_fsgateway_list_for_admin(); |
|
469 | + $data ["grid_buttons"] = $this->freeswitch_form->build_fdgateway_grid_buttons(); |
|
470 | + $data ['form_search'] = $this->form->build_serach_form($this->freeswitch_form->get_gateway_search_form()); |
|
471 | + $this->load->view('view_fsgateway_list', $data); |
|
472 | 472 | } |
473 | 473 | function fsgateway_json() { |
474 | - $json_data = array (); |
|
474 | + $json_data = array(); |
|
475 | 475 | |
476 | - $count_all = $this->freeswitch_model->get_gateway_list ( false ); |
|
476 | + $count_all = $this->freeswitch_model->get_gateway_list(false); |
|
477 | 477 | |
478 | - $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
|
478 | + $paging_data = $this->form->load_grid_config($count_all, $_GET ['rp'], $_GET ['page']); |
|
479 | 479 | $json_data = $paging_data ["json_paging"]; |
480 | - $gateway_data = array (); |
|
481 | - $query = $this->freeswitch_model->get_gateway_list ( true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
|
482 | - $gateway_result = array (); |
|
480 | + $gateway_data = array(); |
|
481 | + $query = $this->freeswitch_model->get_gateway_list(true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"]); |
|
482 | + $gateway_result = array(); |
|
483 | 483 | if ($query->num_rows > 0) { |
484 | - $query = $query->result_array (); |
|
485 | - foreach ( $query as $key => $query_value ) { |
|
486 | - $gateway_data = array (); |
|
484 | + $query = $query->result_array(); |
|
485 | + foreach ($query as $key => $query_value) { |
|
486 | + $gateway_data = array(); |
|
487 | 487 | $tmp = null; |
488 | - foreach ( $query_value as $gateway_key => $gateway_val ) { |
|
488 | + foreach ($query_value as $gateway_key => $gateway_val) { |
|
489 | 489 | if ($gateway_key != "gateway_data") { |
490 | 490 | $gateway_data [$gateway_key] = $gateway_val; |
491 | 491 | } else { |
492 | - $tmp = ( array ) json_decode ( $gateway_val ); |
|
492 | + $tmp = (array)json_decode($gateway_val); |
|
493 | 493 | } |
494 | 494 | } |
495 | - $gateway_result [$key] = array_merge ( $gateway_data, $tmp ); |
|
495 | + $gateway_result [$key] = array_merge($gateway_data, $tmp); |
|
496 | 496 | } |
497 | 497 | } |
498 | 498 | |
499 | - $grid_fields = json_decode ( $this->freeswitch_form->build_fsgateway_list_for_admin () ); |
|
500 | - $json_data ['rows'] = $this->form->build_json_grid ( $gateway_result, $grid_fields ); |
|
501 | - echo json_encode ( $json_data ); |
|
499 | + $grid_fields = json_decode($this->freeswitch_form->build_fsgateway_list_for_admin()); |
|
500 | + $json_data ['rows'] = $this->form->build_json_grid($gateway_result, $grid_fields); |
|
501 | + echo json_encode($json_data); |
|
502 | 502 | } |
503 | 503 | function fsgateway_add() { |
504 | - $data ['username'] = $this->session->userdata ( 'user_name' ); |
|
504 | + $data ['username'] = $this->session->userdata('user_name'); |
|
505 | 505 | $data ['flag'] = 'create'; |
506 | - $data ['page_title'] = gettext ( 'Create Gateway' ); |
|
507 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->get_gateway_form_fields (), '' ); |
|
508 | - $this->load->view ( 'view_fsgateway_add', $data ); |
|
506 | + $data ['page_title'] = gettext('Create Gateway'); |
|
507 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->get_gateway_form_fields(), ''); |
|
508 | + $this->load->view('view_fsgateway_add', $data); |
|
509 | 509 | } |
510 | 510 | function fsgateway_edit($edit_id = '') { |
511 | - $data ['page_title'] = gettext ( 'Edit Gateway' ); |
|
512 | - $where = array ( |
|
511 | + $data ['page_title'] = gettext('Edit Gateway'); |
|
512 | + $where = array( |
|
513 | 513 | 'id' => $edit_id |
514 | 514 | ); |
515 | - $query = $this->db_model->getSelect ( "*", "gateways", $where ); |
|
516 | - $query = $query->result_array (); |
|
517 | - $gateway_result = array (); |
|
518 | - foreach ( $query as $key => $query_value ) { |
|
519 | - foreach ( $query_value as $gateway_key => $gatewau_val ) { |
|
520 | - $gateway_data ["status"] = isset ( $query_value ["status"] ) ? $query_value ["status"] : ""; |
|
515 | + $query = $this->db_model->getSelect("*", "gateways", $where); |
|
516 | + $query = $query->result_array(); |
|
517 | + $gateway_result = array(); |
|
518 | + foreach ($query as $key => $query_value) { |
|
519 | + foreach ($query_value as $gateway_key => $gatewau_val) { |
|
520 | + $gateway_data ["status"] = isset ($query_value ["status"]) ? $query_value ["status"] : ""; |
|
521 | 521 | if ($gateway_key != "gateway_data") { |
522 | 522 | $gateway_data [$gateway_key] = $gatewau_val; |
523 | 523 | } else if ($gateway_key == "status") { |
@@ -532,8 +532,8 @@ discard block |
||
532 | 532 | * ************************************************* |
533 | 533 | */ |
534 | 534 | else { |
535 | - $tmp = ( array ) json_decode ( $gatewau_val ); |
|
536 | - $gateway_result = array_merge ( $gateway_data, $tmp ); |
|
535 | + $tmp = (array)json_decode($gatewau_val); |
|
536 | + $gateway_result = array_merge($gateway_data, $tmp); |
|
537 | 537 | } |
538 | 538 | } |
539 | 539 | } |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | * ASTPP 3.0 |
542 | 542 | * put one variable with the name of dialplan variable |
543 | 543 | */ |
544 | - if (! empty ( $gateway_data ['dialplan_variable'] ) && $gateway_data ['dialplan_variable'] != '') { |
|
544 | + if ( ! empty ($gateway_data ['dialplan_variable']) && $gateway_data ['dialplan_variable'] != '') { |
|
545 | 545 | $gateway_result ['dialplan_variable'] = $gateway_data ['dialplan_variable']; |
546 | 546 | } else { |
547 | 547 | $gateway_result ['dialplan_variable'] = ''; |
@@ -549,16 +549,16 @@ discard block |
||
549 | 549 | /** |
550 | 550 | * ******************************************************************************************* |
551 | 551 | */ |
552 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->get_gateway_form_fields (), $gateway_result ); |
|
553 | - $this->load->view ( 'view_fsgateway_add', $data ); |
|
552 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->get_gateway_form_fields(), $gateway_result); |
|
553 | + $this->load->view('view_fsgateway_add', $data); |
|
554 | 554 | } |
555 | 555 | function fsgateway_save() { |
556 | - $gateway_data = $this->input->post (); |
|
557 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->get_gateway_form_fields (), $gateway_data ); |
|
558 | - $insert_arr = array (); |
|
559 | - $gateway_arr = array (); |
|
556 | + $gateway_data = $this->input->post(); |
|
557 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->get_gateway_form_fields(), $gateway_data); |
|
558 | + $insert_arr = array(); |
|
559 | + $gateway_arr = array(); |
|
560 | 560 | $insert_arr ['dialplan_variable'] = ""; |
561 | - foreach ( $gateway_data as $key => $gateway_value ) { |
|
561 | + foreach ($gateway_data as $key => $gateway_value) { |
|
562 | 562 | if ($gateway_value != "") { |
563 | 563 | if ($key == "sip_profile_id") { |
564 | 564 | $insert_arr ['sip_profile_id'] = $gateway_data ["sip_profile_id"]; |
@@ -585,313 +585,313 @@ discard block |
||
585 | 585 | } |
586 | 586 | } |
587 | 587 | |
588 | - $insert_arr ["gateway_data"] = json_encode ( $gateway_arr ); |
|
588 | + $insert_arr ["gateway_data"] = json_encode($gateway_arr); |
|
589 | 589 | |
590 | 590 | if ($gateway_data ['id'] != '') { |
591 | - $data ['page_title'] = gettext ( 'Edit Gateway Details' ); |
|
592 | - if ($this->form_validation->run () == FALSE) { |
|
593 | - $data ['validation_errors'] = validation_errors (); |
|
591 | + $data ['page_title'] = gettext('Edit Gateway Details'); |
|
592 | + if ($this->form_validation->run() == FALSE) { |
|
593 | + $data ['validation_errors'] = validation_errors(); |
|
594 | 594 | echo $data ['validation_errors']; |
595 | 595 | exit (); |
596 | 596 | } else { |
597 | - if (preg_match ( '/\s/', $insert_arr ['name'] )) { |
|
598 | - echo json_encode ( array ( |
|
597 | + if (preg_match('/\s/', $insert_arr ['name'])) { |
|
598 | + echo json_encode(array( |
|
599 | 599 | "name_error" => "Gateway name must not have any space." |
600 | - ) ); |
|
600 | + )); |
|
601 | 601 | exit (); |
602 | 602 | } |
603 | 603 | /* |
604 | 604 | * ASTPP 3.0 |
605 | 605 | * gateway last modified date |
606 | 606 | */ |
607 | - $insert_arr ['last_modified_date'] = gmdate ( 'Y-m-d H:i:s' ); |
|
608 | - $this->db->select ( 'name,sip_profile_id' ); |
|
609 | - $old_gateway_info = ( array ) $this->db->get_where ( 'gateways', array ( |
|
607 | + $insert_arr ['last_modified_date'] = gmdate('Y-m-d H:i:s'); |
|
608 | + $this->db->select('name,sip_profile_id'); |
|
609 | + $old_gateway_info = (array)$this->db->get_where('gateways', array( |
|
610 | 610 | 'id' => $gateway_data ['id'] |
611 | - ) )->first_row (); |
|
611 | + ))->first_row(); |
|
612 | 612 | /** |
613 | 613 | * ********************************************** |
614 | 614 | */ |
615 | - $update = $this->db->update ( "gateways", $insert_arr, array ( |
|
615 | + $update = $this->db->update("gateways", $insert_arr, array( |
|
616 | 616 | 'id' => $gateway_data ['id'] |
617 | - ) ); |
|
617 | + )); |
|
618 | 618 | if ($update) { |
619 | - $this->db->select ( 'name,sip_ip' ); |
|
620 | - $old_sip_profile_info = ( array ) $this->db->get_where ( 'sip_profiles', array ( |
|
619 | + $this->db->select('name,sip_ip'); |
|
620 | + $old_sip_profile_info = (array)$this->db->get_where('sip_profiles', array( |
|
621 | 621 | 'id' => $old_gateway_info ['sip_profile_id'] |
622 | - ) )->first_row (); |
|
623 | - $sip_profile_info = ( array ) $this->db->get_where ( 'sip_profiles', array ( |
|
622 | + ))->first_row(); |
|
623 | + $sip_profile_info = (array)$this->db->get_where('sip_profiles', array( |
|
624 | 624 | 'id' => $old_gateway_info ['sip_profile_id'] |
625 | - ) )->first_row (); |
|
626 | - $cmd = "api sofia profile " . $old_sip_profile_info ['name'] . " killgw '" . $old_gateway_info ['name'] . "' "; |
|
625 | + ))->first_row(); |
|
626 | + $cmd = "api sofia profile ".$old_sip_profile_info ['name']." killgw '".$old_gateway_info ['name']."' "; |
|
627 | 627 | $sip_ip = $sip_profile_info ['id']; |
628 | - $this->freeswitch_model->reload_freeswitch ( $cmd, $sip_ip ); |
|
629 | - $cmd2 = "api sofia profile " . $sip_profile_info ['name'] . " rescan reloadacl reloadxml"; |
|
630 | - $this->freeswitch_model->reload_freeswitch ( $cmd2, $sip_ip ); |
|
628 | + $this->freeswitch_model->reload_freeswitch($cmd, $sip_ip); |
|
629 | + $cmd2 = "api sofia profile ".$sip_profile_info ['name']." rescan reloadacl reloadxml"; |
|
630 | + $this->freeswitch_model->reload_freeswitch($cmd2, $sip_ip); |
|
631 | 631 | } |
632 | - echo json_encode ( array ( |
|
633 | - "SUCCESS" => $insert_arr ['name'] . " Gateway Updated Successfully!" |
|
634 | - ) ); |
|
632 | + echo json_encode(array( |
|
633 | + "SUCCESS" => $insert_arr ['name']." Gateway Updated Successfully!" |
|
634 | + )); |
|
635 | 635 | exit (); |
636 | 636 | } |
637 | 637 | } else { |
638 | - $data ['page_title'] = gettext ( 'Create Gateway Details' ); |
|
639 | - if ($this->form_validation->run () == FALSE) { |
|
640 | - $data ['validation_errors'] = validation_errors (); |
|
638 | + $data ['page_title'] = gettext('Create Gateway Details'); |
|
639 | + if ($this->form_validation->run() == FALSE) { |
|
640 | + $data ['validation_errors'] = validation_errors(); |
|
641 | 641 | echo $data ['validation_errors']; |
642 | 642 | exit (); |
643 | 643 | } else { |
644 | - if (preg_match ( '/\s/', $insert_arr ['name'] )) { |
|
645 | - echo json_encode ( array ( |
|
644 | + if (preg_match('/\s/', $insert_arr ['name'])) { |
|
645 | + echo json_encode(array( |
|
646 | 646 | "name_error" => "Gateway name must not have any space." |
647 | - ) ); |
|
647 | + )); |
|
648 | 648 | exit (); |
649 | 649 | } |
650 | - $insert_arr ['created_date'] = gmdate ( 'Y-m-d H:i:s' ); |
|
651 | - $insert = $this->db->insert ( "gateways", $insert_arr ); |
|
650 | + $insert_arr ['created_date'] = gmdate('Y-m-d H:i:s'); |
|
651 | + $insert = $this->db->insert("gateways", $insert_arr); |
|
652 | 652 | if ($insert) { |
653 | - $profile_name = $this->common->get_field_name ( 'name', 'sip_profiles', $insert_arr ['sip_profile_id'] ); |
|
654 | - $sip_ip = $this->common->get_field_name ( 'sip_ip', 'sip_profiles', $insert_arr ['sip_profile_id'] ); |
|
655 | - $cmd = "api sofia profile " . $profile_name . " rescan reloadacl reloadxml"; |
|
656 | - $this->freeswitch_model->reload_freeswitch ( $cmd, $sip_ip ); |
|
653 | + $profile_name = $this->common->get_field_name('name', 'sip_profiles', $insert_arr ['sip_profile_id']); |
|
654 | + $sip_ip = $this->common->get_field_name('sip_ip', 'sip_profiles', $insert_arr ['sip_profile_id']); |
|
655 | + $cmd = "api sofia profile ".$profile_name." rescan reloadacl reloadxml"; |
|
656 | + $this->freeswitch_model->reload_freeswitch($cmd, $sip_ip); |
|
657 | 657 | } |
658 | - echo json_encode ( array ( |
|
659 | - "SUCCESS" => $insert_arr ['name'] . " Gateway Added Successfully!" |
|
660 | - ) ); |
|
658 | + echo json_encode(array( |
|
659 | + "SUCCESS" => $insert_arr ['name']." Gateway Added Successfully!" |
|
660 | + )); |
|
661 | 661 | exit (); |
662 | 662 | } |
663 | 663 | } |
664 | 664 | } |
665 | 665 | function fsgateway_delete($gateway_id) { |
666 | - $this->db->select ( 'name,sip_profile_id' ); |
|
667 | - $gateway_info = ( array ) $this->db->get_where ( 'gateways', array ( |
|
666 | + $this->db->select('name,sip_profile_id'); |
|
667 | + $gateway_info = (array)$this->db->get_where('gateways', array( |
|
668 | 668 | 'id' => $gateway_id |
669 | - ) )->first_row (); |
|
670 | - $this->db->select ( 'name,sip_ip' ); |
|
671 | - $profile_info = ( array ) $this->db->get_where ( 'sip_profiles', array ( |
|
669 | + ))->first_row(); |
|
670 | + $this->db->select('name,sip_ip'); |
|
671 | + $profile_info = (array)$this->db->get_where('sip_profiles', array( |
|
672 | 672 | 'id' => $gateway_info ['sip_profile_id'] |
673 | - ) )->first_row (); |
|
674 | - $cmd = "api sofia profile " . $profile_info ['name'] . " killgw " . $gateway_info ['name'] . " rescan reloadacl reloadxml"; |
|
675 | - $this->db_model->delete ( "gateways", array ( |
|
673 | + ))->first_row(); |
|
674 | + $cmd = "api sofia profile ".$profile_info ['name']." killgw ".$gateway_info ['name']." rescan reloadacl reloadxml"; |
|
675 | + $this->db_model->delete("gateways", array( |
|
676 | 676 | "id" => $gateway_id |
677 | - ) ); |
|
678 | - $this->freeswitch_model->reload_freeswitch ( $cmd, $sip_ip ); |
|
679 | - $this->session->set_flashdata ( 'astpp_notification', 'Gateway Removed Successfully!' ); |
|
680 | - redirect ( base_url () . 'freeswitch/fsgateway/' ); |
|
677 | + )); |
|
678 | + $this->freeswitch_model->reload_freeswitch($cmd, $sip_ip); |
|
679 | + $this->session->set_flashdata('astpp_notification', 'Gateway Removed Successfully!'); |
|
680 | + redirect(base_url().'freeswitch/fsgateway/'); |
|
681 | 681 | } |
682 | 682 | function fsgateway_delete_multiple() { |
683 | - $ids = $this->input->post ( "selected_ids", true ); |
|
683 | + $ids = $this->input->post("selected_ids", true); |
|
684 | 684 | $where = "id IN ($ids)"; |
685 | - $this->db->where ( $where ); |
|
686 | - $this->db->select ( 'group_concat(sip_profile_id) as sip_profile_id' ); |
|
687 | - $this->db->from ( 'gateways' ); |
|
688 | - $sip_profile_ids = ( array ) $this->db->get ()->first_row (); |
|
689 | - $sip_profile_where = "id IN (" . $sip_profile_ids ['sip_profile_id'] . ")"; |
|
690 | - $this->db->select ( 'id,name,sip_ip' ); |
|
691 | - $this->db->where ( $sip_profile_where ); |
|
692 | - $this->db->from ( 'sip_profiles' ); |
|
693 | - $result_array = $this->db->get ()->result_array (); |
|
694 | - $sip_profile_arr = array (); |
|
695 | - foreach ( $result_array as $key => $value ) { |
|
696 | - $sip_profile_arr [$value ['id']] = array ( |
|
685 | + $this->db->where($where); |
|
686 | + $this->db->select('group_concat(sip_profile_id) as sip_profile_id'); |
|
687 | + $this->db->from('gateways'); |
|
688 | + $sip_profile_ids = (array)$this->db->get()->first_row(); |
|
689 | + $sip_profile_where = "id IN (".$sip_profile_ids ['sip_profile_id'].")"; |
|
690 | + $this->db->select('id,name,sip_ip'); |
|
691 | + $this->db->where($sip_profile_where); |
|
692 | + $this->db->from('sip_profiles'); |
|
693 | + $result_array = $this->db->get()->result_array(); |
|
694 | + $sip_profile_arr = array(); |
|
695 | + foreach ($result_array as $key => $value) { |
|
696 | + $sip_profile_arr [$value ['id']] = array( |
|
697 | 697 | "name" => $value ['name'], |
698 | 698 | "sip_ip" => $value ['sip_ip'] |
699 | 699 | ); |
700 | 700 | } |
701 | - $this->db->select ( 'id,name,sip_profile_id' ); |
|
702 | - $this->db->where ( $where ); |
|
703 | - $this->db->from ( 'gateways' ); |
|
704 | - $gateway_info = $this->db->get ()->result_array (); |
|
705 | - foreach ( $gateway_info as $key => $value ) { |
|
706 | - $cmd = "api sofia profile " . $sip_profile_arr [$value ['sip_profile_id']] ['name'] . " killgw " . $value ['name'] . " rescan reloadacl reloadxml"; |
|
707 | - $this->freeswitch_model->reload_freeswitch ( $cmd, $sip_profile_arr [$value ['sip_profile_id']] ['sip_ip'] ); |
|
701 | + $this->db->select('id,name,sip_profile_id'); |
|
702 | + $this->db->where($where); |
|
703 | + $this->db->from('gateways'); |
|
704 | + $gateway_info = $this->db->get()->result_array(); |
|
705 | + foreach ($gateway_info as $key => $value) { |
|
706 | + $cmd = "api sofia profile ".$sip_profile_arr [$value ['sip_profile_id']] ['name']." killgw ".$value ['name']." rescan reloadacl reloadxml"; |
|
707 | + $this->freeswitch_model->reload_freeswitch($cmd, $sip_profile_arr [$value ['sip_profile_id']] ['sip_ip']); |
|
708 | 708 | } |
709 | - $this->db->where ( $where ); |
|
710 | - echo $this->db->delete ( "gateways" ); |
|
709 | + $this->db->where($where); |
|
710 | + echo $this->db->delete("gateways"); |
|
711 | 711 | } |
712 | 712 | function fssipprofile() { |
713 | - $data ['username'] = $this->session->userdata ( 'user_name' ); |
|
714 | - $data ['page_title'] = gettext ( 'SIP Profile' ); |
|
713 | + $data ['username'] = $this->session->userdata('user_name'); |
|
714 | + $data ['page_title'] = gettext('SIP Profile'); |
|
715 | 715 | $data ['search_flag'] = true; |
716 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
717 | - $data ['grid_fields'] = $this->freeswitch_form->build_fssipprofile_list_for_admin (); |
|
718 | - $data ["grid_buttons"] = $this->freeswitch_form->build_fssipprofile_grid_buttons (); |
|
719 | - $data ['form_search'] = $this->form->build_serach_form ( $this->freeswitch_form->get_sipprofile_search_form () ); |
|
716 | + $this->session->set_userdata('advance_search', 0); |
|
717 | + $data ['grid_fields'] = $this->freeswitch_form->build_fssipprofile_list_for_admin(); |
|
718 | + $data ["grid_buttons"] = $this->freeswitch_form->build_fssipprofile_grid_buttons(); |
|
719 | + $data ['form_search'] = $this->form->build_serach_form($this->freeswitch_form->get_sipprofile_search_form()); |
|
720 | 720 | $data ['button_name'] = "Add Setting"; |
721 | 721 | // $data['form_search'] = $this->form->build_serach_form($this->trunk_form->get_trunk_search_form()); |
722 | - $this->load->view ( 'view_fssipprofile_list', $data ); |
|
722 | + $this->load->view('view_fssipprofile_list', $data); |
|
723 | 723 | } |
724 | 724 | function fssipprofile_delete_multiple() { |
725 | - $ids = $this->input->post ( "selected_ids", true ); |
|
725 | + $ids = $this->input->post("selected_ids", true); |
|
726 | 726 | $where = "id IN ($ids)"; |
727 | - $this->db->where ( $where ); |
|
728 | - echo $this->db->delete ( "sip_profiles" ); |
|
727 | + $this->db->where($where); |
|
728 | + echo $this->db->delete("sip_profiles"); |
|
729 | 729 | } |
730 | 730 | function fssipprofile_json() { |
731 | - $json_data = array (); |
|
732 | - $count_all = $this->freeswitch_model->get_sipprofile_list ( false ); |
|
733 | - $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
|
731 | + $json_data = array(); |
|
732 | + $count_all = $this->freeswitch_model->get_sipprofile_list(false); |
|
733 | + $paging_data = $this->form->load_grid_config($count_all, $_GET ['rp'], $_GET ['page']); |
|
734 | 734 | $json_data = $paging_data ["json_paging"]; |
735 | - $gateway_data = array (); |
|
736 | - $query = $this->freeswitch_model->get_sipprofile_list ( true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
|
737 | - $grid_fields = json_decode ( $this->freeswitch_form->build_fssipprofile_list_for_admin () ); |
|
738 | - $json_data ['rows'] = $this->form->build_grid ( $query, $grid_fields ); |
|
739 | - echo json_encode ( $json_data ); |
|
735 | + $gateway_data = array(); |
|
736 | + $query = $this->freeswitch_model->get_sipprofile_list(true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"]); |
|
737 | + $grid_fields = json_decode($this->freeswitch_form->build_fssipprofile_list_for_admin()); |
|
738 | + $json_data ['rows'] = $this->form->build_grid($query, $grid_fields); |
|
739 | + echo json_encode($json_data); |
|
740 | 740 | } |
741 | 741 | function fssipprofile_params_json($edited_id) { |
742 | - $json_data = array (); |
|
743 | - $gateway_data = array (); |
|
744 | - $where = array ( |
|
742 | + $json_data = array(); |
|
743 | + $gateway_data = array(); |
|
744 | + $where = array( |
|
745 | 745 | 'id' => $edited_id |
746 | 746 | ); |
747 | - $query = $this->db_model->getSelect ( "*", "sip_profiles", $where ); |
|
748 | - $query = $query->result_array (); |
|
749 | - $gateway_result = array (); |
|
747 | + $query = $this->db_model->getSelect("*", "sip_profiles", $where); |
|
748 | + $query = $query->result_array(); |
|
749 | + $gateway_result = array(); |
|
750 | 750 | $i = 0; |
751 | - foreach ( $query as $key => $query_value ) { |
|
752 | - foreach ( $query_value as $gateway_key => $gatewau_val ) { |
|
751 | + foreach ($query as $key => $query_value) { |
|
752 | + foreach ($query_value as $gateway_key => $gatewau_val) { |
|
753 | 753 | if ($gateway_key != 'id' && $gateway_key != 'name' && $gateway_key != 'sip_ip' && $gateway_key != 'sip_port') { |
754 | 754 | if ($gateway_key != "profile_data") { |
755 | 755 | $gateway_data [$gateway_key] = $gatewau_val; |
756 | 756 | } else { |
757 | - $tmp = ( array ) json_decode ( $gatewau_val ); |
|
758 | - $gateway_result = array_merge ( $gateway_data, $tmp ); |
|
757 | + $tmp = (array)json_decode($gatewau_val); |
|
758 | + $gateway_result = array_merge($gateway_data, $tmp); |
|
759 | 759 | } |
760 | 760 | } |
761 | 761 | } |
762 | 762 | } |
763 | - $paging_data = $this->form->load_grid_config ( count ( $gateway_result ), $_GET ['rp'], $_GET ['page'] ); |
|
763 | + $paging_data = $this->form->load_grid_config(count($gateway_result), $_GET ['rp'], $_GET ['page']); |
|
764 | 764 | $json_data = $paging_data ["json_paging"]; |
765 | 765 | |
766 | - foreach ( $gateway_result as $key => $value ) { |
|
767 | - $json_data ['rows'] [] = array ( |
|
768 | - 'cell' => array ( |
|
766 | + foreach ($gateway_result as $key => $value) { |
|
767 | + $json_data ['rows'] [] = array( |
|
768 | + 'cell' => array( |
|
769 | 769 | $key, |
770 | 770 | $value, |
771 | - array ( |
|
772 | - '<a href="/freeswitch/fssipprofile_edit/' . $edited_id . '/edit/' . $key . '/" class="btn btn-royelblue btn-sm" title="Edit"> <i class="fa fa-pencil-square-o fa-fw"></i></a> <a href="/freeswitch/fssipprofile_delete_params/' . $edited_id . '/' . $key . '/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();"> <i class="fa fa-trash fa-fw"></i></a>' |
|
771 | + array( |
|
772 | + '<a href="/freeswitch/fssipprofile_edit/'.$edited_id.'/edit/'.$key.'/" class="btn btn-royelblue btn-sm" title="Edit"> <i class="fa fa-pencil-square-o fa-fw"></i></a> <a href="/freeswitch/fssipprofile_delete_params/'.$edited_id.'/'.$key.'/" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();"> <i class="fa fa-trash fa-fw"></i></a>' |
|
773 | 773 | ) |
774 | 774 | ) |
775 | 775 | ); |
776 | 776 | } |
777 | - echo json_encode ( $json_data ); |
|
777 | + echo json_encode($json_data); |
|
778 | 778 | } |
779 | 779 | function fssipprofile_action($button_name, $id) { |
780 | - $where = array ( |
|
780 | + $where = array( |
|
781 | 781 | 'id' => $id |
782 | 782 | ); |
783 | - $query = $this->db_model->getSelect ( "*", "sip_profiles", $where ); |
|
784 | - $query = $query->result_array (); |
|
785 | - $where = array ( |
|
783 | + $query = $this->db_model->getSelect("*", "sip_profiles", $where); |
|
784 | + $query = $query->result_array(); |
|
785 | + $where = array( |
|
786 | 786 | 'sip_profile_id' => $id |
787 | 787 | ); |
788 | 788 | if ($button_name == "start") { |
789 | - $cmd = "api sofia profile " . trim ( $query [0] ['name'] ) . " start"; |
|
789 | + $cmd = "api sofia profile ".trim($query [0] ['name'])." start"; |
|
790 | 790 | } elseif ($button_name == "stop") { |
791 | 791 | $cmd = "api sofia profile stop"; |
792 | 792 | } elseif ($button_name == "reload") { |
793 | 793 | $cmd = "api reloadxml"; |
794 | 794 | } elseif ($button_name == "rescan") { |
795 | - $cmd = "api sofia profile " . trim ( $query [0] ['name'] ) . " rescan"; |
|
795 | + $cmd = "api sofia profile ".trim($query [0] ['name'])." rescan"; |
|
796 | 796 | } |
797 | 797 | |
798 | - $this->freeswitch_model->reload_freeswitch ( $cmd ); |
|
799 | - redirect ( base_url () . 'freeswitch/fssipprofile/' ); |
|
798 | + $this->freeswitch_model->reload_freeswitch($cmd); |
|
799 | + redirect(base_url().'freeswitch/fssipprofile/'); |
|
800 | 800 | } |
801 | 801 | function fssipprofile_add($add = '') { |
802 | - $data ['username'] = $this->session->userdata ( 'user_name' ); |
|
802 | + $data ['username'] = $this->session->userdata('user_name'); |
|
803 | 803 | $data ['flag'] = 'create'; |
804 | - $data ['page_title'] = gettext ( 'Create SIP Profile' ); |
|
805 | - $sipprofile_data = $this->input->post (); |
|
804 | + $data ['page_title'] = gettext('Create SIP Profile'); |
|
805 | + $sipprofile_data = $this->input->post(); |
|
806 | 806 | $sipprofile_data ['status'] = $sipprofile_data ['sipstatus']; |
807 | 807 | $data ['button_name'] = "Add Setting"; |
808 | 808 | if ($add == 'add') { |
809 | 809 | |
810 | - unset ( $sipprofile_data ['action'] ); |
|
811 | - unset ( $sipprofile_data ['sipstatus'] ); |
|
810 | + unset ($sipprofile_data ['action']); |
|
811 | + unset ($sipprofile_data ['sipstatus']); |
|
812 | 812 | $insert_data = $sipprofile_data; |
813 | 813 | |
814 | 814 | if ($sipprofile_data ['name'] == '' || $sipprofile_data ['sip_ip'] == '' || $sipprofile_data ['sip_port'] == '') { |
815 | - $this->session->set_flashdata ( 'astpp_notification', 'Please enter All profile value!' ); |
|
816 | - redirect ( base_url () . 'freeswitch/fssipprofile_add/' ); |
|
815 | + $this->session->set_flashdata('astpp_notification', 'Please enter All profile value!'); |
|
816 | + redirect(base_url().'freeswitch/fssipprofile_add/'); |
|
817 | 817 | exit (); |
818 | 818 | } |
819 | - if (preg_match ( '/\s/', $sipprofile_data ['name'] )) { |
|
820 | - $this->session->set_flashdata ( 'astpp_notification', 'SIP Profile name must not have any space!' ); |
|
821 | - redirect ( base_url () . 'freeswitch/fssipprofile_add/' ); |
|
819 | + if (preg_match('/\s/', $sipprofile_data ['name'])) { |
|
820 | + $this->session->set_flashdata('astpp_notification', 'SIP Profile name must not have any space!'); |
|
821 | + redirect(base_url().'freeswitch/fssipprofile_add/'); |
|
822 | 822 | exit (); |
823 | 823 | } |
824 | - if (! preg_match ( '/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\z/', $sipprofile_data ['sip_ip'] )) { |
|
825 | - $this->session->set_flashdata ( 'astpp_notification', 'SIP IP must be proper!' ); |
|
826 | - redirect ( base_url () . 'freeswitch/fssipprofile_add/' ); |
|
824 | + if ( ! preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\z/', $sipprofile_data ['sip_ip'])) { |
|
825 | + $this->session->set_flashdata('astpp_notification', 'SIP IP must be proper!'); |
|
826 | + redirect(base_url().'freeswitch/fssipprofile_add/'); |
|
827 | 827 | exit (); |
828 | 828 | } |
829 | 829 | $sipprofile_data ['id'] = ''; |
830 | - $check_authentication = $this->freeswitch_model->profile_authentication ( $sipprofile_data ); |
|
830 | + $check_authentication = $this->freeswitch_model->profile_authentication($sipprofile_data); |
|
831 | 831 | if ($check_authentication->num_rows == 0) { |
832 | 832 | |
833 | - $sipprofile_data ['created_date'] = gmdate ( 'Y-m-d H:i:s' ); |
|
833 | + $sipprofile_data ['created_date'] = gmdate('Y-m-d H:i:s'); |
|
834 | 834 | /** |
835 | 835 | * Version 2.1 |
836 | 836 | * Purpose : Set default data for new created profile |
837 | 837 | */ |
838 | - $sipprofile_data ['profile_data'] = $this->common->sip_profile_date (); |
|
838 | + $sipprofile_data ['profile_data'] = $this->common->sip_profile_date(); |
|
839 | 839 | /** |
840 | 840 | * ==================================================================== |
841 | 841 | */ |
842 | - $insert = $this->db->insert ( "sip_profiles", $sipprofile_data ); |
|
842 | + $insert = $this->db->insert("sip_profiles", $sipprofile_data); |
|
843 | 843 | } else { |
844 | - $this->session->set_flashdata ( 'astpp_notification', 'Duplicate SIP IP OR Port found it must be unique!' ); |
|
845 | - redirect ( base_url () . 'freeswitch/fssipprofile_add/' ); |
|
844 | + $this->session->set_flashdata('astpp_notification', 'Duplicate SIP IP OR Port found it must be unique!'); |
|
845 | + redirect(base_url().'freeswitch/fssipprofile_add/'); |
|
846 | 846 | } |
847 | - $this->session->set_flashdata ( 'astpp_errormsg', 'SIP Profile Added Successfully!' ); |
|
848 | - redirect ( base_url () . 'freeswitch/fssipprofile/' ); |
|
847 | + $this->session->set_flashdata('astpp_errormsg', 'SIP Profile Added Successfully!'); |
|
848 | + redirect(base_url().'freeswitch/fssipprofile/'); |
|
849 | 849 | } |
850 | 850 | |
851 | 851 | if ($add == 'edit') { |
852 | - $check_authentication = $this->freeswitch_model->profile_authentication ( $sipprofile_data ); |
|
853 | - unset ( $sipprofile_data ['action'] ); |
|
854 | - unset ( $sipprofile_data ['sipstatus'] ); |
|
852 | + $check_authentication = $this->freeswitch_model->profile_authentication($sipprofile_data); |
|
853 | + unset ($sipprofile_data ['action']); |
|
854 | + unset ($sipprofile_data ['sipstatus']); |
|
855 | 855 | $insert_arr = $sipprofile_data; |
856 | 856 | if ($check_authentication->num_rows == 0) { |
857 | - $insert_arr ['last_modified_date'] = gmdate ( "Y-m-d H:i:s" ); |
|
858 | - $update = $this->db->update ( "sip_profiles", $insert_arr, array ( |
|
857 | + $insert_arr ['last_modified_date'] = gmdate("Y-m-d H:i:s"); |
|
858 | + $update = $this->db->update("sip_profiles", $insert_arr, array( |
|
859 | 859 | 'id' => $sipprofile_data ['id'] |
860 | - ) ); |
|
861 | - $this->session->set_flashdata ( 'astpp_errormsg', $sipprofile_data ['name'] . " SIP Profile Updated Successfully!" ); |
|
862 | - redirect ( base_url () . 'freeswitch/fssipprofile/' ); |
|
860 | + )); |
|
861 | + $this->session->set_flashdata('astpp_errormsg', $sipprofile_data ['name']." SIP Profile Updated Successfully!"); |
|
862 | + redirect(base_url().'freeswitch/fssipprofile/'); |
|
863 | 863 | exit (); |
864 | 864 | } else { |
865 | - $this->session->set_flashdata ( 'astpp_notification', 'Duplicate SIP IP OR Port found it must be unique!' ); |
|
866 | - redirect ( base_url () . 'freeswitch/fssipprofile/' ); |
|
865 | + $this->session->set_flashdata('astpp_notification', 'Duplicate SIP IP OR Port found it must be unique!'); |
|
866 | + redirect(base_url().'freeswitch/fssipprofile/'); |
|
867 | 867 | } |
868 | - redirect ( base_url () . 'freeswitch/fssipprofile/' ); |
|
868 | + redirect(base_url().'freeswitch/fssipprofile/'); |
|
869 | 869 | } |
870 | - $this->load->view ( 'view_fssipprofile_add', $data ); |
|
870 | + $this->load->view('view_fssipprofile_add', $data); |
|
871 | 871 | } |
872 | 872 | function fssipprofile_edit($edit_id = '', $type = '', $name_prams = '') { |
873 | - $data ['page_title'] = gettext ( 'Edit SIP Profile' ); |
|
874 | - $sipprofile_data = $this->input->post (); |
|
875 | - if (! $edit_id) { |
|
873 | + $data ['page_title'] = gettext('Edit SIP Profile'); |
|
874 | + $sipprofile_data = $this->input->post(); |
|
875 | + if ( ! $edit_id) { |
|
876 | 876 | $edit_id = $sipprofile_data ['id']; |
877 | 877 | } |
878 | - $where = array ( |
|
878 | + $where = array( |
|
879 | 879 | 'id' => $edit_id |
880 | 880 | ); |
881 | - $query = $this->db_model->getSelect ( "*", "sip_profiles", $where ); |
|
882 | - $query = $query->result_array (); |
|
883 | - $gateway_result = array (); |
|
884 | - foreach ( $query as $key => $query_value ) { |
|
885 | - foreach ( $query_value as $gateway_key => $gatewau_val ) { |
|
881 | + $query = $this->db_model->getSelect("*", "sip_profiles", $where); |
|
882 | + $query = $query->result_array(); |
|
883 | + $gateway_result = array(); |
|
884 | + foreach ($query as $key => $query_value) { |
|
885 | + foreach ($query_value as $gateway_key => $gatewau_val) { |
|
886 | 886 | if ($gateway_key != "profile_data") { |
887 | 887 | $gateway_data [$gateway_key] = $gatewau_val; |
888 | 888 | } else { |
889 | - $tmp = ( array ) json_decode ( $gatewau_val ); |
|
890 | - $gateway_result = array_merge ( $gateway_data, $tmp ); |
|
889 | + $tmp = (array)json_decode($gatewau_val); |
|
890 | + $gateway_result = array_merge($gateway_data, $tmp); |
|
891 | 891 | } |
892 | 892 | } |
893 | 893 | } |
894 | - $data ['grid_fields'] = $this->freeswitch_form->build_fssipprofile_params_list_for_admin (); |
|
894 | + $data ['grid_fields'] = $this->freeswitch_form->build_fssipprofile_params_list_for_admin(); |
|
895 | 895 | $data ['edited_id'] = $edit_id; |
896 | 896 | $data ['sip_name'] = $query [0] ['name']; |
897 | 897 | $data ['status'] = $query [0] ['status']; |
@@ -899,7 +899,7 @@ discard block |
||
899 | 899 | $data ['sip_port'] = $query [0] ['sip_port']; |
900 | 900 | $data ['id'] = $query [0] ['id']; |
901 | 901 | $data ['button_name'] = "Add Setting"; |
902 | - if ($type == 'edit' || isset ( $sipprofile_data ['type'] ) && $sipprofile_data ['type'] == 'save') { |
|
902 | + if ($type == 'edit' || isset ($sipprofile_data ['type']) && $sipprofile_data ['type'] == 'save') { |
|
903 | 903 | if ($type == 'edit') { |
904 | 904 | $data ['params_name'] = $name_prams; |
905 | 905 | $data ['params_status'] = 0; |
@@ -909,100 +909,100 @@ discard block |
||
909 | 909 | $data ['params_value'] = $gateway_result [$name_prams]; |
910 | 910 | $data ['button_name'] = "Update Setting"; |
911 | 911 | } |
912 | - if (isset ( $sipprofile_data ['type'] ) && $sipprofile_data ['type'] == 'save') { |
|
913 | - $sipprofile_data = $this->input->post (); |
|
912 | + if (isset ($sipprofile_data ['type']) && $sipprofile_data ['type'] == 'save') { |
|
913 | + $sipprofile_data = $this->input->post(); |
|
914 | 914 | $tmp [$sipprofile_data ['params_name']] = $sipprofile_data ['params_value']; |
915 | - $final_data = json_encode ( $tmp ); |
|
916 | - $insert_arr ["profile_data"] = json_encode ( $tmp ); |
|
917 | - $update = $this->db->update ( "sip_profiles", $insert_arr, array ( |
|
915 | + $final_data = json_encode($tmp); |
|
916 | + $insert_arr ["profile_data"] = json_encode($tmp); |
|
917 | + $update = $this->db->update("sip_profiles", $insert_arr, array( |
|
918 | 918 | 'id' => $edit_id |
919 | - ) ); |
|
919 | + )); |
|
920 | 920 | if ($sipprofile_data ['type_settings'] == "add_setting") { |
921 | - $this->session->set_flashdata ( 'astpp_errormsg', $data ['sip_name'] . " SIP Setting Added Successfully!" ); |
|
921 | + $this->session->set_flashdata('astpp_errormsg', $data ['sip_name']." SIP Setting Added Successfully!"); |
|
922 | 922 | } else { |
923 | - $this->session->set_flashdata ( 'astpp_errormsg', $data ['sip_name'] . " SIP Setting Updated Successfully!" ); |
|
923 | + $this->session->set_flashdata('astpp_errormsg', $data ['sip_name']." SIP Setting Updated Successfully!"); |
|
924 | 924 | } |
925 | - redirect ( base_url () . 'freeswitch/fssipprofile_edit/' . $sipprofile_data ['id'] ); |
|
925 | + redirect(base_url().'freeswitch/fssipprofile_edit/'.$sipprofile_data ['id']); |
|
926 | 926 | exit (); |
927 | 927 | } |
928 | 928 | } |
929 | - $this->load->view ( 'view_fssipprofile_edit', $data ); |
|
929 | + $this->load->view('view_fssipprofile_edit', $data); |
|
930 | 930 | } |
931 | 931 | function fssipprofile_save($id) { |
932 | - $sipprofile_data = $this->input->post (); |
|
933 | - $insert_arr = array (); |
|
934 | - $sipprofile_arr = array (); |
|
935 | - $where = array ( |
|
932 | + $sipprofile_data = $this->input->post(); |
|
933 | + $insert_arr = array(); |
|
934 | + $sipprofile_arr = array(); |
|
935 | + $where = array( |
|
936 | 936 | 'id' => $id |
937 | 937 | ); |
938 | - $query = $this->db_model->getSelect ( "*", "sip_profiles", $where ); |
|
939 | - $query = $query->result_array (); |
|
940 | - $gateway_result = array (); |
|
941 | - foreach ( $query as $key => $query_value ) { |
|
942 | - foreach ( $query_value as $gateway_key => $gatewau_val ) { |
|
938 | + $query = $this->db_model->getSelect("*", "sip_profiles", $where); |
|
939 | + $query = $query->result_array(); |
|
940 | + $gateway_result = array(); |
|
941 | + foreach ($query as $key => $query_value) { |
|
942 | + foreach ($query_value as $gateway_key => $gatewau_val) { |
|
943 | 943 | if ($gateway_key != "profile_data") { |
944 | 944 | $gateway_data [$gateway_key] = $gatewau_val; |
945 | 945 | } else { |
946 | - $tmp = ( array ) json_decode ( $gatewau_val ); |
|
947 | - $gateway_result = array_merge ( $gateway_data, $tmp ); |
|
946 | + $tmp = (array)json_decode($gatewau_val); |
|
947 | + $gateway_result = array_merge($gateway_data, $tmp); |
|
948 | 948 | } |
949 | 949 | } |
950 | 950 | } |
951 | 951 | $tmp [$sipprofile_data ['params_name']] = $sipprofile_data ['params_value']; |
952 | - $final_data = json_encode ( $tmp ); |
|
953 | - $insert_arr ["profile_data"] = json_encode ( $tmp ); |
|
954 | - $update = $this->db->update ( "sip_profiles", $insert_arr, array ( |
|
952 | + $final_data = json_encode($tmp); |
|
953 | + $insert_arr ["profile_data"] = json_encode($tmp); |
|
954 | + $update = $this->db->update("sip_profiles", $insert_arr, array( |
|
955 | 955 | 'id' => $id |
956 | - ) ); |
|
957 | - $this->load->view ( 'view_fssipprofile_edit', $data ); |
|
956 | + )); |
|
957 | + $this->load->view('view_fssipprofile_edit', $data); |
|
958 | 958 | } |
959 | 959 | function fssipprofile_delete_params($id, $name) { |
960 | - $where = array ( |
|
960 | + $where = array( |
|
961 | 961 | 'id' => $id |
962 | 962 | ); |
963 | - $query = $this->db_model->getSelect ( "*", "sip_profiles", $where ); |
|
964 | - $query = $query->result_array (); |
|
965 | - $gateway_result = array (); |
|
966 | - foreach ( $query as $key => $query_value ) { |
|
967 | - foreach ( $query_value as $gateway_key => $gatewau_val ) { |
|
963 | + $query = $this->db_model->getSelect("*", "sip_profiles", $where); |
|
964 | + $query = $query->result_array(); |
|
965 | + $gateway_result = array(); |
|
966 | + foreach ($query as $key => $query_value) { |
|
967 | + foreach ($query_value as $gateway_key => $gatewau_val) { |
|
968 | 968 | if ($gateway_key != "profile_data") { |
969 | 969 | $gateway_data [$gateway_key] = $gatewau_val; |
970 | 970 | } else { |
971 | - $tmp = ( array ) json_decode ( $gatewau_val ); |
|
972 | - $gateway_result = array_merge ( $gateway_data, $tmp ); |
|
971 | + $tmp = (array)json_decode($gatewau_val); |
|
972 | + $gateway_result = array_merge($gateway_data, $tmp); |
|
973 | 973 | } |
974 | 974 | } |
975 | 975 | } |
976 | - if (isset ( $tmp [$name] )) { |
|
977 | - unset ( $tmp [$name] ); |
|
976 | + if (isset ($tmp [$name])) { |
|
977 | + unset ($tmp [$name]); |
|
978 | 978 | } |
979 | - $insert_arr ["profile_data"] = json_encode ( $tmp ); |
|
980 | - $update = $this->db->update ( "sip_profiles", $insert_arr, array ( |
|
979 | + $insert_arr ["profile_data"] = json_encode($tmp); |
|
980 | + $update = $this->db->update("sip_profiles", $insert_arr, array( |
|
981 | 981 | 'id' => $id |
982 | - ) ); |
|
983 | - $this->session->set_flashdata ( 'astpp_notification', $name . ' SIP Setting Removed Successfully!' ); |
|
984 | - redirect ( base_url () . 'freeswitch/fssipprofile_edit/' . $id ); |
|
982 | + )); |
|
983 | + $this->session->set_flashdata('astpp_notification', $name.' SIP Setting Removed Successfully!'); |
|
984 | + redirect(base_url().'freeswitch/fssipprofile_edit/'.$id); |
|
985 | 985 | } |
986 | 986 | function fssipprofile_delete($profile_id) { |
987 | - $profile_name = $this->common->get_field_name ( 'name', 'sip_profiles', $profile_id ); |
|
988 | - $sip_ip = $this->common->get_field_name ( 'sip_ip', 'sip_profiles', $profile_id ); |
|
989 | - $delete = $this->db_model->delete ( "sip_profiles", array ( |
|
987 | + $profile_name = $this->common->get_field_name('name', 'sip_profiles', $profile_id); |
|
988 | + $sip_ip = $this->common->get_field_name('sip_ip', 'sip_profiles', $profile_id); |
|
989 | + $delete = $this->db_model->delete("sip_profiles", array( |
|
990 | 990 | "id" => $profile_id |
991 | - ) ); |
|
992 | - $this->session->set_flashdata ( 'astpp_notification', 'SIP Profile Removed Successfully!' ); |
|
993 | - redirect ( base_url () . 'freeswitch/fssipprofile/' ); |
|
991 | + )); |
|
992 | + $this->session->set_flashdata('astpp_notification', 'SIP Profile Removed Successfully!'); |
|
993 | + redirect(base_url().'freeswitch/fssipprofile/'); |
|
994 | 994 | } |
995 | 995 | function fsserver_list() { |
996 | - $data ['username'] = $this->session->userdata ( 'user_name' ); |
|
997 | - $data ['page_title'] = gettext ( 'Freeswitch Servers' ); |
|
996 | + $data ['username'] = $this->session->userdata('user_name'); |
|
997 | + $data ['page_title'] = gettext('Freeswitch Servers'); |
|
998 | 998 | $data ['search_flag'] = true; |
999 | 999 | $data ['cur_menu_no'] = 1; |
1000 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
1001 | - $data ['grid_fields'] = $this->freeswitch_form->build_fsserver_list (); |
|
1002 | - $data ["grid_buttons"] = $this->freeswitch_form->build_fsserver_grid_buttons (); |
|
1000 | + $this->session->set_userdata('advance_search', 0); |
|
1001 | + $data ['grid_fields'] = $this->freeswitch_form->build_fsserver_list(); |
|
1002 | + $data ["grid_buttons"] = $this->freeswitch_form->build_fsserver_grid_buttons(); |
|
1003 | 1003 | |
1004 | - $data ['form_search'] = $this->form->build_serach_form ( $this->freeswitch_form->get_search_fsserver_form () ); |
|
1005 | - $this->load->view ( 'view_fsserver_list', $data ); |
|
1004 | + $data ['form_search'] = $this->form->build_serach_form($this->freeswitch_form->get_search_fsserver_form()); |
|
1005 | + $this->load->view('view_fsserver_list', $data); |
|
1006 | 1006 | } |
1007 | 1007 | |
1008 | 1008 | /** |
@@ -1010,98 +1010,98 @@ discard block |
||
1010 | 1010 | * Listing of Accounts table data through php function json_encode |
1011 | 1011 | */ |
1012 | 1012 | function fsserver_list_json() { |
1013 | - $json_data = array (); |
|
1013 | + $json_data = array(); |
|
1014 | 1014 | |
1015 | - $count_all = $this->freeswitch_model->get_fsserver_list ( false ); |
|
1016 | - $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
|
1015 | + $count_all = $this->freeswitch_model->get_fsserver_list(false); |
|
1016 | + $paging_data = $this->form->load_grid_config($count_all, $_GET ['rp'], $_GET ['page']); |
|
1017 | 1017 | $json_data = $paging_data ["json_paging"]; |
1018 | - $query = $this->freeswitch_model->get_fsserver_list ( true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
|
1019 | - $grid_fields = json_decode ( $this->freeswitch_form->build_fsserver_list () ); |
|
1020 | - $json_data ['rows'] = $this->form->build_grid ( $query, $grid_fields ); |
|
1018 | + $query = $this->freeswitch_model->get_fsserver_list(true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"]); |
|
1019 | + $grid_fields = json_decode($this->freeswitch_form->build_fsserver_list()); |
|
1020 | + $json_data ['rows'] = $this->form->build_grid($query, $grid_fields); |
|
1021 | 1021 | |
1022 | - echo json_encode ( $json_data ); |
|
1022 | + echo json_encode($json_data); |
|
1023 | 1023 | } |
1024 | 1024 | function fsserver_add($type = "") { |
1025 | - $data ['username'] = $this->session->userdata ( 'user_name' ); |
|
1025 | + $data ['username'] = $this->session->userdata('user_name'); |
|
1026 | 1026 | $data ['flag'] = 'create'; |
1027 | - $data ['page_title'] = gettext ( 'Create Freeswich Server' ); |
|
1028 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->get_form_fsserver_fields (), '' ); |
|
1027 | + $data ['page_title'] = gettext('Create Freeswich Server'); |
|
1028 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->get_form_fsserver_fields(), ''); |
|
1029 | 1029 | |
1030 | - $this->load->view ( 'view_fsserver_add_edit', $data ); |
|
1030 | + $this->load->view('view_fsserver_add_edit', $data); |
|
1031 | 1031 | } |
1032 | 1032 | function fsserver_edit($edit_id = '') { |
1033 | - $data ['page_title'] = gettext ( 'Edit Freeswich Server' ); |
|
1034 | - $where = array ( |
|
1033 | + $data ['page_title'] = gettext('Edit Freeswich Server'); |
|
1034 | + $where = array( |
|
1035 | 1035 | 'id' => $edit_id |
1036 | 1036 | ); |
1037 | - $account = $this->db_model->getSelect ( "*", "freeswich_servers", $where ); |
|
1038 | - foreach ( $account->result_array () as $key => $value ) { |
|
1037 | + $account = $this->db_model->getSelect("*", "freeswich_servers", $where); |
|
1038 | + foreach ($account->result_array() as $key => $value) { |
|
1039 | 1039 | $edit_data = $value; |
1040 | 1040 | } |
1041 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->get_form_fsserver_fields (), $edit_data ); |
|
1042 | - $this->load->view ( 'view_fsserver_add_edit', $data ); |
|
1041 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->get_form_fsserver_fields(), $edit_data); |
|
1042 | + $this->load->view('view_fsserver_add_edit', $data); |
|
1043 | 1043 | } |
1044 | 1044 | function fsserver_save() { |
1045 | - $add_array = $this->input->post (); |
|
1045 | + $add_array = $this->input->post(); |
|
1046 | 1046 | |
1047 | - $data ['form'] = $this->form->build_form ( $this->freeswitch_form->get_form_fsserver_fields (), $add_array ); |
|
1047 | + $data ['form'] = $this->form->build_form($this->freeswitch_form->get_form_fsserver_fields(), $add_array); |
|
1048 | 1048 | if ($add_array ['id'] != '') { |
1049 | - $data ['page_title'] = gettext ( 'Edit Freeswitch Server' ); |
|
1050 | - if ($this->form_validation->run () == FALSE) { |
|
1051 | - $data ['validation_errors'] = validation_errors (); |
|
1049 | + $data ['page_title'] = gettext('Edit Freeswitch Server'); |
|
1050 | + if ($this->form_validation->run() == FALSE) { |
|
1051 | + $data ['validation_errors'] = validation_errors(); |
|
1052 | 1052 | echo $data ['validation_errors']; |
1053 | 1053 | exit (); |
1054 | 1054 | } else { |
1055 | - $this->freeswitch_model->edit_fsserver ( $add_array, $add_array ['id'] ); |
|
1056 | - echo json_encode ( array ( |
|
1055 | + $this->freeswitch_model->edit_fsserver($add_array, $add_array ['id']); |
|
1056 | + echo json_encode(array( |
|
1057 | 1057 | "SUCCESS" => " Freeswitch Server Updated Successfully!" |
1058 | - ) ); |
|
1058 | + )); |
|
1059 | 1059 | exit (); |
1060 | 1060 | } |
1061 | 1061 | } else { |
1062 | - $data ['page_title'] = gettext ( 'Freeswich Server' ); |
|
1063 | - if ($this->form_validation->run () == FALSE) { |
|
1064 | - $data ['validation_errors'] = validation_errors (); |
|
1062 | + $data ['page_title'] = gettext('Freeswich Server'); |
|
1063 | + if ($this->form_validation->run() == FALSE) { |
|
1064 | + $data ['validation_errors'] = validation_errors(); |
|
1065 | 1065 | echo $data ['validation_errors']; |
1066 | 1066 | exit (); |
1067 | 1067 | } else { |
1068 | - $this->freeswitch_model->add_fssever ( $add_array ); |
|
1069 | - echo json_encode ( array ( |
|
1068 | + $this->freeswitch_model->add_fssever($add_array); |
|
1069 | + echo json_encode(array( |
|
1070 | 1070 | "SUCCESS" => "Freeswitch Server Added Successfully!" |
1071 | - ) ); |
|
1071 | + )); |
|
1072 | 1072 | exit (); |
1073 | 1073 | } |
1074 | 1074 | } |
1075 | - $this->load->view ( 'view_callshop_details', $data ); |
|
1075 | + $this->load->view('view_callshop_details', $data); |
|
1076 | 1076 | } |
1077 | 1077 | function fsserver_delete($id) { |
1078 | - $this->freeswitch_model->fsserver_delete ( $id ); |
|
1079 | - $this->session->set_flashdata ( 'astpp_notification', 'Freeswitch Server Removed Successfully!' ); |
|
1080 | - redirect ( base_url () . 'freeswitch/fsserver_list/' ); |
|
1078 | + $this->freeswitch_model->fsserver_delete($id); |
|
1079 | + $this->session->set_flashdata('astpp_notification', 'Freeswitch Server Removed Successfully!'); |
|
1080 | + redirect(base_url().'freeswitch/fsserver_list/'); |
|
1081 | 1081 | exit (); |
1082 | 1082 | } |
1083 | 1083 | function fsserver_list_search() { |
1084 | - $ajax_search = $this->input->post ( 'ajax_search', 0 ); |
|
1084 | + $ajax_search = $this->input->post('ajax_search', 0); |
|
1085 | 1085 | |
1086 | - if ($this->input->post ( 'advance_search', TRUE ) == 1) { |
|
1087 | - $this->session->set_userdata ( 'advance_search', $this->input->post ( 'advance_search' ) ); |
|
1088 | - $action = $this->input->post (); |
|
1089 | - unset ( $action ['action'] ); |
|
1090 | - unset ( $action ['advance_search'] ); |
|
1091 | - $this->session->set_userdata ( 'fsserver_list_search', $action ); |
|
1086 | + if ($this->input->post('advance_search', TRUE) == 1) { |
|
1087 | + $this->session->set_userdata('advance_search', $this->input->post('advance_search')); |
|
1088 | + $action = $this->input->post(); |
|
1089 | + unset ($action ['action']); |
|
1090 | + unset ($action ['advance_search']); |
|
1091 | + $this->session->set_userdata('fsserver_list_search', $action); |
|
1092 | 1092 | } |
1093 | 1093 | if (@$ajax_search != 1) { |
1094 | - redirect ( base_url () . 'freeswitch/fsserver_list/' ); |
|
1094 | + redirect(base_url().'freeswitch/fsserver_list/'); |
|
1095 | 1095 | } |
1096 | 1096 | } |
1097 | 1097 | function fsserver_list_clearsearchfilter() { |
1098 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
1099 | - $this->session->set_userdata ( 'account_search', "" ); |
|
1098 | + $this->session->set_userdata('advance_search', 0); |
|
1099 | + $this->session->set_userdata('account_search', ""); |
|
1100 | 1100 | } |
1101 | 1101 | function fssipprofile_edit_validation($id, $name) { |
1102 | - $sip_profile_data = $this->common->get_field_name ( 'profile_data', 'sip_profiles', $id ); |
|
1103 | - $final_data = json_decode ( $sip_profile_data, true ); |
|
1104 | - foreach ( $final_data as $key => $value ) { |
|
1102 | + $sip_profile_data = $this->common->get_field_name('profile_data', 'sip_profiles', $id); |
|
1103 | + $final_data = json_decode($sip_profile_data, true); |
|
1104 | + foreach ($final_data as $key => $value) { |
|
1105 | 1105 | if ($key == $name) { |
1106 | 1106 | echo 1; |
1107 | 1107 | return true; |
@@ -33,8 +33,9 @@ |
||
33 | 33 | $this->load->library ( 'freeswitch_lib' ); |
34 | 34 | $this->load->model ( 'freeswitch_model' ); |
35 | 35 | |
36 | - if ($this->session->userdata ( 'user_login' ) == FALSE) |
|
37 | - redirect ( base_url () . '/astpp/login' ); |
|
36 | + if ($this->session->userdata ( 'user_login' ) == FALSE) { |
|
37 | + redirect ( base_url () . '/astpp/login' ); |
|
38 | + } |
|
38 | 39 | } |
39 | 40 | function fssipdevices_add($type = "") { |
40 | 41 | $data ['username'] = $this->session->userdata ( 'user_name' ); |
@@ -21,18 +21,18 @@ discard block |
||
21 | 21 | // You should have received a copy of the GNU Affero General Public License |
22 | 22 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
23 | 23 | // ############################################################################## |
24 | -if (! defined ( 'BASEPATH' )) |
|
25 | - exit ( 'No direct script access allowed' ); |
|
24 | +if ( ! defined('BASEPATH')) |
|
25 | + exit ('No direct script access allowed'); |
|
26 | 26 | class Freeswitch_form { |
27 | 27 | function __construct() { |
28 | - $this->CI = & get_instance (); |
|
28 | + $this->CI = & get_instance(); |
|
29 | 29 | } |
30 | 30 | function get_freeswith_form_fields($id = false) { |
31 | - $log_type = $this->CI->session->userdata ( "logintype" ); |
|
31 | + $log_type = $this->CI->session->userdata("logintype"); |
|
32 | 32 | if ($log_type == 0 || $log_type == 3 || $log_type == 1) { |
33 | 33 | $sip_pro = null; |
34 | 34 | } else { |
35 | - $sip_pro = array ( |
|
35 | + $sip_pro = array( |
|
36 | 36 | 'SIP Profile', |
37 | 37 | 'sip_profile_id', |
38 | 38 | 'SELECT', |
@@ -48,22 +48,22 @@ discard block |
||
48 | 48 | '' |
49 | 49 | ); |
50 | 50 | } |
51 | - $val = $id > 0 ? 'sip_devices.username.' . $id : 'sip_devices.username'; |
|
52 | - $uname_user = $this->CI->common->find_uniq_rendno ( '10', '', '' ); |
|
53 | - $password = $this->CI->common->generate_password (); |
|
51 | + $val = $id > 0 ? 'sip_devices.username.'.$id : 'sip_devices.username'; |
|
52 | + $uname_user = $this->CI->common->find_uniq_rendno('10', '', ''); |
|
53 | + $password = $this->CI->common->generate_password(); |
|
54 | 54 | /* Edit functionality */ |
55 | - $form ['forms'] = array ( |
|
56 | - base_url () . 'freeswitch/fssipdevices_save/', |
|
57 | - array ( |
|
55 | + $form ['forms'] = array( |
|
56 | + base_url().'freeswitch/fssipdevices_save/', |
|
57 | + array( |
|
58 | 58 | "id" => "sipdevices_form", |
59 | 59 | "name" => "sipdevices_form" |
60 | 60 | ) |
61 | 61 | ); |
62 | - $form [gettext ( 'Device Information' )] = array ( |
|
63 | - array ( |
|
62 | + $form [gettext('Device Information')] = array( |
|
63 | + array( |
|
64 | 64 | '', |
65 | 65 | 'HIDDEN', |
66 | - array ( |
|
66 | + array( |
|
67 | 67 | 'name' => 'id' |
68 | 68 | ), |
69 | 69 | '', |
@@ -71,25 +71,25 @@ discard block |
||
71 | 71 | '', |
72 | 72 | '' |
73 | 73 | ), |
74 | - array ( |
|
75 | - gettext ( 'Username' ), |
|
74 | + array( |
|
75 | + gettext('Username'), |
|
76 | 76 | 'INPUT', |
77 | - array ( |
|
77 | + array( |
|
78 | 78 | 'name' => 'fs_username', |
79 | 79 | 'size' => '20', |
80 | 80 | 'value' => $uname_user, |
81 | 81 | 'id' => 'username1', |
82 | 82 | 'class' => "text field medium" |
83 | 83 | ), |
84 | - 'trim|required|is_unique[' . $val . ']|xss_clean', |
|
84 | + 'trim|required|is_unique['.$val.']|xss_clean', |
|
85 | 85 | 'tOOL TIP', |
86 | 86 | 'Please Enter account number', |
87 | 87 | '<i style="cursor:pointer; color:#1BCB61 !important; font-size:14px; padding-left:5px; padding-top:8px; float:left;" title="Reset Password" class="change_number fa fa-refresh"></i>' |
88 | 88 | ), |
89 | - array ( |
|
90 | - gettext ( 'Password' ), |
|
89 | + array( |
|
90 | + gettext('Password'), |
|
91 | 91 | 'INPUT', |
92 | - array ( |
|
92 | + array( |
|
93 | 93 | 'name' => 'fs_password', |
94 | 94 | 'size' => '20', |
95 | 95 | 'value' => $password, |
@@ -101,8 +101,8 @@ discard block |
||
101 | 101 | 'Please Enter Password', |
102 | 102 | '<i style="cursor:pointer; color:#1BCB61 !important; font-size:14px; padding-left:5px; padding-top:8px; float:left;" title="Reset Password" class="change_pass fa fa-refresh"></i>' |
103 | 103 | ), |
104 | - array ( |
|
105 | - gettext ( 'Account' ), |
|
104 | + array( |
|
105 | + gettext('Account'), |
|
106 | 106 | 'accountcode', |
107 | 107 | 'SELECT', |
108 | 108 | '', |
@@ -114,16 +114,16 @@ discard block |
||
114 | 114 | 'accounts', |
115 | 115 | 'build_concat_dropdown', |
116 | 116 | 'where_arr', |
117 | - array ( |
|
117 | + array( |
|
118 | 118 | "reseller_id" => "0", |
119 | 119 | "type" => "0", |
120 | 120 | "deleted" => "0" |
121 | 121 | ) |
122 | 122 | ), |
123 | - array ( |
|
124 | - gettext ( 'Caller Name' ), |
|
123 | + array( |
|
124 | + gettext('Caller Name'), |
|
125 | 125 | 'INPUT', |
126 | - array ( |
|
126 | + array( |
|
127 | 127 | 'name' => 'effective_caller_id_name', |
128 | 128 | 'size' => '20', |
129 | 129 | 'class' => "text field medium" |
@@ -132,10 +132,10 @@ discard block |
||
132 | 132 | 'tOOL TIP', |
133 | 133 | 'Please Enter account number' |
134 | 134 | ), |
135 | - array ( |
|
136 | - gettext ( 'Caller Number' ), |
|
135 | + array( |
|
136 | + gettext('Caller Number'), |
|
137 | 137 | 'INPUT', |
138 | - array ( |
|
138 | + array( |
|
139 | 139 | 'name' => 'effective_caller_id_number', |
140 | 140 | 'size' => '20', |
141 | 141 | 'class' => "text field medium" |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | 'tOOL TIP', |
145 | 145 | 'Please Enter account number' |
146 | 146 | ), |
147 | - array ( |
|
148 | - gettext ( 'Status' ), |
|
147 | + array( |
|
148 | + gettext('Status'), |
|
149 | 149 | 'status', |
150 | 150 | 'SELECT', |
151 | 151 | '', |
@@ -166,9 +166,9 @@ discard block |
||
166 | 166 | * ***** |
167 | 167 | */ |
168 | 168 | |
169 | - $form [gettext ( 'Voicemail Options' )] = array ( |
|
170 | - array ( |
|
171 | - gettext ( 'Enable' ), |
|
169 | + $form [gettext('Voicemail Options')] = array( |
|
170 | + array( |
|
171 | + gettext('Enable'), |
|
172 | 172 | 'voicemail_enabled', |
173 | 173 | 'SELECT', |
174 | 174 | '', |
@@ -181,10 +181,10 @@ discard block |
||
181 | 181 | 'set_sip_config_option' |
182 | 182 | ), |
183 | 183 | |
184 | - array ( |
|
185 | - gettext ( 'Password' ), |
|
184 | + array( |
|
185 | + gettext('Password'), |
|
186 | 186 | 'INPUT', |
187 | - array ( |
|
187 | + array( |
|
188 | 188 | 'name' => 'voicemail_password', |
189 | 189 | 'size' => '20', |
190 | 190 | 'class' => "text field medium" |
@@ -193,10 +193,10 @@ discard block |
||
193 | 193 | 'tOOL TIP', |
194 | 194 | 'Please Enter account number' |
195 | 195 | ), |
196 | - array ( |
|
197 | - gettext ( 'Mail To' ), |
|
196 | + array( |
|
197 | + gettext('Mail To'), |
|
198 | 198 | 'INPUT', |
199 | - array ( |
|
199 | + array( |
|
200 | 200 | 'name' => 'voicemail_mail_to', |
201 | 201 | 'size' => '20', |
202 | 202 | 'class' => "text field medium" |
@@ -206,8 +206,8 @@ discard block |
||
206 | 206 | 'Please Enter account number' |
207 | 207 | ), |
208 | 208 | |
209 | - array ( |
|
210 | - gettext ( 'Attach File' ), |
|
209 | + array( |
|
210 | + gettext('Attach File'), |
|
211 | 211 | 'voicemail_attach_file', |
212 | 212 | 'SELECT', |
213 | 213 | '', |
@@ -220,8 +220,8 @@ discard block |
||
220 | 220 | 'custom_status_voicemail' |
221 | 221 | ), |
222 | 222 | |
223 | - array ( |
|
224 | - gettext ( 'Local After Email' ), |
|
223 | + array( |
|
224 | + gettext('Local After Email'), |
|
225 | 225 | 'vm_keep_local_after_email', |
226 | 226 | 'SELECT', |
227 | 227 | '', |
@@ -234,8 +234,8 @@ discard block |
||
234 | 234 | 'custom_status_voicemail' |
235 | 235 | ), |
236 | 236 | |
237 | - array ( |
|
238 | - gettext ( 'Send all Message' ), |
|
237 | + array( |
|
238 | + gettext('Send all Message'), |
|
239 | 239 | 'vm_send_all_message', |
240 | 240 | 'SELECT', |
241 | 241 | '', |
@@ -252,17 +252,17 @@ discard block |
||
252 | 252 | /** |
253 | 253 | * *********************** |
254 | 254 | */ |
255 | - $form ['button_cancel'] = array ( |
|
255 | + $form ['button_cancel'] = array( |
|
256 | 256 | 'name' => 'action', |
257 | - 'content' => gettext ( 'Close' ), |
|
257 | + 'content' => gettext('Close'), |
|
258 | 258 | 'value' => 'cancel', |
259 | 259 | 'type' => 'button', |
260 | 260 | 'class' => 'btn btn-line-sky margin-x-10', |
261 | 261 | 'onclick' => 'return redirect_page(\'NULL\')' |
262 | 262 | ); |
263 | - $form ['button_save'] = array ( |
|
263 | + $form ['button_save'] = array( |
|
264 | 264 | 'name' => 'action', |
265 | - 'content' => gettext ( 'Save' ), |
|
265 | + 'content' => gettext('Save'), |
|
266 | 266 | 'value' => 'save', |
267 | 267 | 'id' => 'submit', |
268 | 268 | 'type' => 'button', |
@@ -272,16 +272,16 @@ discard block |
||
272 | 272 | return $form; |
273 | 273 | } |
274 | 274 | function get_freeswith_search_form() { |
275 | - $form ['forms'] = array ( |
|
275 | + $form ['forms'] = array( |
|
276 | 276 | "", |
277 | - array ( |
|
277 | + array( |
|
278 | 278 | 'id' => "freeswith_search" |
279 | 279 | ) |
280 | 280 | ); |
281 | - $form [gettext ( 'Search' )] = array ( |
|
281 | + $form [gettext('Search')] = array( |
|
282 | 282 | |
283 | - array ( |
|
284 | - gettext ( 'SIP Profile' ), |
|
283 | + array( |
|
284 | + gettext('SIP Profile'), |
|
285 | 285 | 'sip_profile_id', |
286 | 286 | 'SELECT', |
287 | 287 | '', |
@@ -295,10 +295,10 @@ discard block |
||
295 | 295 | 'where_arr', |
296 | 296 | '' |
297 | 297 | ), |
298 | - array ( |
|
299 | - gettext ( 'Username' ), |
|
298 | + array( |
|
299 | + gettext('Username'), |
|
300 | 300 | 'INPUT', |
301 | - array ( |
|
301 | + array( |
|
302 | 302 | 'name' => 'username[username]', |
303 | 303 | '', |
304 | 304 | 'size' => '20', |
@@ -314,8 +314,8 @@ discard block |
||
314 | 314 | 'search_string_type', |
315 | 315 | '' |
316 | 316 | ), |
317 | - array ( |
|
318 | - gettext ( 'Gateway' ), |
|
317 | + array( |
|
318 | + gettext('Gateway'), |
|
319 | 319 | 'gateway_id', |
320 | 320 | 'SELECT', |
321 | 321 | '', |
@@ -329,8 +329,8 @@ discard block |
||
329 | 329 | 'where_arr', |
330 | 330 | '' |
331 | 331 | ), |
332 | - array ( |
|
333 | - gettext ( 'Account' ), |
|
332 | + array( |
|
333 | + gettext('Account'), |
|
334 | 334 | 'accountid', |
335 | 335 | 'SELECT', |
336 | 336 | '', |
@@ -342,14 +342,14 @@ discard block |
||
342 | 342 | 'accounts', |
343 | 343 | 'build_concat_dropdown', |
344 | 344 | 'where_arr', |
345 | - array ( |
|
345 | + array( |
|
346 | 346 | "reseller_id" => "0", |
347 | 347 | "type" => "0", |
348 | 348 | "deleted" => "0" |
349 | 349 | ) |
350 | 350 | ), |
351 | - array ( |
|
352 | - gettext ( 'Status' ), |
|
351 | + array( |
|
352 | + gettext('Status'), |
|
353 | 353 | 'status', |
354 | 354 | 'SELECT', |
355 | 355 | '', |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | '', |
364 | 364 | '' |
365 | 365 | ), |
366 | - array ( |
|
366 | + array( |
|
367 | 367 | '', |
368 | 368 | 'HIDDEN', |
369 | 369 | 'ajax_search', |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | '', |
373 | 373 | '' |
374 | 374 | ), |
375 | - array ( |
|
375 | + array( |
|
376 | 376 | '', |
377 | 377 | 'HIDDEN', |
378 | 378 | 'advance_search', |
@@ -382,18 +382,18 @@ discard block |
||
382 | 382 | '' |
383 | 383 | ) |
384 | 384 | ); |
385 | - $form ['button_search'] = array ( |
|
385 | + $form ['button_search'] = array( |
|
386 | 386 | 'name' => 'action', |
387 | 387 | 'id' => "freeswith_search_btn", |
388 | - 'content' => gettext ( 'Search' ), |
|
388 | + 'content' => gettext('Search'), |
|
389 | 389 | 'value' => 'save', |
390 | 390 | 'type' => 'button', |
391 | 391 | 'class' => 'btn btn-line-parrot pull-right' |
392 | 392 | ); |
393 | - $form ['button_reset'] = array ( |
|
393 | + $form ['button_reset'] = array( |
|
394 | 394 | 'name' => 'action', |
395 | 395 | 'id' => "id_reset", |
396 | - 'content' => gettext ( 'Clear' ), |
|
396 | + 'content' => gettext('Clear'), |
|
397 | 397 | 'value' => 'cancel', |
398 | 398 | 'type' => 'reset', |
399 | 399 | 'class' => 'btn btn-line-sky pull-right margin-x-10' |
@@ -401,17 +401,17 @@ discard block |
||
401 | 401 | return $form; |
402 | 402 | } |
403 | 403 | function get_sipdevices_search_form_user() { |
404 | - $form ['forms'] = array ( |
|
404 | + $form ['forms'] = array( |
|
405 | 405 | "", |
406 | - array ( |
|
406 | + array( |
|
407 | 407 | 'id' => "sipdevices_search" |
408 | 408 | ) |
409 | 409 | ); |
410 | - $form [gettext ( 'Search' )] = array ( |
|
411 | - array ( |
|
412 | - gettext ( 'Username' ), |
|
410 | + $form [gettext('Search')] = array( |
|
411 | + array( |
|
412 | + gettext('Username'), |
|
413 | 413 | 'INPUT', |
414 | - array ( |
|
414 | + array( |
|
415 | 415 | 'name' => 'username[username]', |
416 | 416 | '', |
417 | 417 | 'size' => '20', |
@@ -427,8 +427,8 @@ discard block |
||
427 | 427 | 'search_string_type', |
428 | 428 | '' |
429 | 429 | ), |
430 | - array ( |
|
431 | - gettext ( 'SIP Profile' ), |
|
430 | + array( |
|
431 | + gettext('SIP Profile'), |
|
432 | 432 | 'sip_profile_id', |
433 | 433 | 'SELECT', |
434 | 434 | '', |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | 'where_arr', |
443 | 443 | '' |
444 | 444 | ), |
445 | - array ( |
|
445 | + array( |
|
446 | 446 | '', |
447 | 447 | 'HIDDEN', |
448 | 448 | 'ajax_search', |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | '', |
452 | 452 | '' |
453 | 453 | ), |
454 | - array ( |
|
454 | + array( |
|
455 | 455 | '', |
456 | 456 | 'HIDDEN', |
457 | 457 | 'advance_search', |
@@ -462,18 +462,18 @@ discard block |
||
462 | 462 | ) |
463 | 463 | ) |
464 | 464 | ; |
465 | - $form ['button_search'] = array ( |
|
465 | + $form ['button_search'] = array( |
|
466 | 466 | 'name' => 'action', |
467 | 467 | 'id' => "sipdevices_search_btn", |
468 | - 'content' => gettext ( 'Search' ), |
|
468 | + 'content' => gettext('Search'), |
|
469 | 469 | 'value' => 'save', |
470 | 470 | 'type' => 'button', |
471 | 471 | 'class' => 'btn btn-line-parrot pull-right' |
472 | 472 | ); |
473 | - $form ['button_reset'] = array ( |
|
473 | + $form ['button_reset'] = array( |
|
474 | 474 | 'name' => 'action', |
475 | 475 | 'id' => "id_reset", |
476 | - 'content' => gettext ( 'Clear' ), |
|
476 | + 'content' => gettext('Clear'), |
|
477 | 477 | 'value' => 'cancel', |
478 | 478 | 'type' => 'reset', |
479 | 479 | 'class' => 'btn btn-line-sky pull-right margin-x-10' |
@@ -481,18 +481,18 @@ discard block |
||
481 | 481 | return $form; |
482 | 482 | } |
483 | 483 | function get_gateway_search_form() { |
484 | - $form ['forms'] = array ( |
|
484 | + $form ['forms'] = array( |
|
485 | 485 | "", |
486 | - array ( |
|
486 | + array( |
|
487 | 487 | 'id' => "freeswith_search" |
488 | 488 | ) |
489 | 489 | ); |
490 | - $form [gettext ( 'Search' )] = array ( |
|
490 | + $form [gettext('Search')] = array( |
|
491 | 491 | |
492 | - array ( |
|
493 | - gettext ( 'Name' ), |
|
492 | + array( |
|
493 | + gettext('Name'), |
|
494 | 494 | 'INPUT', |
495 | - array ( |
|
495 | + array( |
|
496 | 496 | 'name' => 'name[name]', |
497 | 497 | '', |
498 | 498 | 'size' => '20', |
@@ -509,8 +509,8 @@ discard block |
||
509 | 509 | '' |
510 | 510 | ), |
511 | 511 | // array('Gateway Name', 'id', 'SELECT', '', '', 'tOOL TIP', 'Please select gateway first', 'id', 'name', 'gateways', 'build_dropdown','where_arr', ''), |
512 | - array ( |
|
513 | - gettext ( 'SIP Profile' ), |
|
512 | + array( |
|
513 | + gettext('SIP Profile'), |
|
514 | 514 | 'sip_profile_id', |
515 | 515 | 'SELECT', |
516 | 516 | '', |
@@ -526,8 +526,8 @@ discard block |
||
526 | 526 | ), |
527 | 527 | // array('Username', 'INPUT', array('name' => 'username[username]', '', 'size' => '20', 'maxlength' => '15', 'class' => "text field"), '', 'tOOL TIP', '1', 'username[username-string]', '', '', '', 'search_string_type', ''), |
528 | 528 | |
529 | - array ( |
|
530 | - gettext ( 'Status' ), |
|
529 | + array( |
|
530 | + gettext('Status'), |
|
531 | 531 | 'status', |
532 | 532 | 'SELECT', |
533 | 533 | '', |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | 'set_search_status' |
541 | 541 | ), |
542 | 542 | // array('Account', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'first_name,last_name,number', 'accounts', 'build_concat_dropdown', 'where_arr', array("reseller_id" => "0","type"=>"0", "deleted" => "0")), |
543 | - array ( |
|
543 | + array( |
|
544 | 544 | '', |
545 | 545 | 'HIDDEN', |
546 | 546 | 'ajax_search', |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | '', |
550 | 550 | '' |
551 | 551 | ), |
552 | - array ( |
|
552 | + array( |
|
553 | 553 | '', |
554 | 554 | 'HIDDEN', |
555 | 555 | 'advance_search', |
@@ -559,18 +559,18 @@ discard block |
||
559 | 559 | '' |
560 | 560 | ) |
561 | 561 | ); |
562 | - $form ['button_search'] = array ( |
|
562 | + $form ['button_search'] = array( |
|
563 | 563 | 'name' => 'action', |
564 | 564 | 'id' => "fsgateway_search_btn", |
565 | - 'content' => gettext ( 'Search' ), |
|
565 | + 'content' => gettext('Search'), |
|
566 | 566 | 'value' => 'save', |
567 | 567 | 'type' => 'button', |
568 | 568 | 'class' => 'btn btn-line-parrot pull-right' |
569 | 569 | ); |
570 | - $form ['button_reset'] = array ( |
|
570 | + $form ['button_reset'] = array( |
|
571 | 571 | 'name' => 'action', |
572 | 572 | 'id' => "id_reset", |
573 | - 'content' => gettext ( 'Clear' ), |
|
573 | + 'content' => gettext('Clear'), |
|
574 | 574 | 'value' => 'cancel', |
575 | 575 | 'type' => 'reset', |
576 | 576 | 'class' => 'btn btn-line-sky pull-right margin-x-10' |
@@ -578,18 +578,18 @@ discard block |
||
578 | 578 | return $form; |
579 | 579 | } |
580 | 580 | function get_sipprofile_search_form() { |
581 | - $form ['forms'] = array ( |
|
581 | + $form ['forms'] = array( |
|
582 | 582 | "", |
583 | - array ( |
|
583 | + array( |
|
584 | 584 | 'id' => "freeswitch_search" |
585 | 585 | ) |
586 | 586 | ); |
587 | - $form [gettext ( 'Search' )] = array ( |
|
587 | + $form [gettext('Search')] = array( |
|
588 | 588 | |
589 | - array ( |
|
590 | - gettext ( 'Name' ), |
|
589 | + array( |
|
590 | + gettext('Name'), |
|
591 | 591 | 'INPUT', |
592 | - array ( |
|
592 | + array( |
|
593 | 593 | 'name' => 'name[name]', |
594 | 594 | '', |
595 | 595 | 'size' => '20', |
@@ -605,10 +605,10 @@ discard block |
||
605 | 605 | 'search_string_type', |
606 | 606 | '' |
607 | 607 | ), |
608 | - array ( |
|
609 | - gettext ( 'SIP IP' ), |
|
608 | + array( |
|
609 | + gettext('SIP IP'), |
|
610 | 610 | 'INPUT', |
611 | - array ( |
|
611 | + array( |
|
612 | 612 | 'name' => 'sip_ip[sip_ip]', |
613 | 613 | 'value' => '', |
614 | 614 | 'size' => '20', |
@@ -624,10 +624,10 @@ discard block |
||
624 | 624 | 'search_string_type', |
625 | 625 | '' |
626 | 626 | ), |
627 | - array ( |
|
628 | - gettext ( 'SIP Port' ), |
|
627 | + array( |
|
628 | + gettext('SIP Port'), |
|
629 | 629 | 'INPUT', |
630 | - array ( |
|
630 | + array( |
|
631 | 631 | 'name' => 'sip_port[sip_port]', |
632 | 632 | 'value' => '', |
633 | 633 | 'size' => '20', |
@@ -644,8 +644,8 @@ discard block |
||
644 | 644 | '' |
645 | 645 | ), |
646 | 646 | |
647 | - array ( |
|
648 | - gettext ( 'Status' ), |
|
647 | + array( |
|
648 | + gettext('Status'), |
|
649 | 649 | 'status', |
650 | 650 | 'SELECT', |
651 | 651 | '', |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | '', |
658 | 658 | 'set_search_status' |
659 | 659 | ), |
660 | - array ( |
|
660 | + array( |
|
661 | 661 | '', |
662 | 662 | 'HIDDEN', |
663 | 663 | 'ajax_search', |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | '', |
667 | 667 | '' |
668 | 668 | ), |
669 | - array ( |
|
669 | + array( |
|
670 | 670 | '', |
671 | 671 | 'HIDDEN', |
672 | 672 | 'advance_search', |
@@ -676,18 +676,18 @@ discard block |
||
676 | 676 | '' |
677 | 677 | ) |
678 | 678 | ); |
679 | - $form ['button_search'] = array ( |
|
679 | + $form ['button_search'] = array( |
|
680 | 680 | 'name' => 'action', |
681 | 681 | 'id' => "fssipprofile_search_btn", |
682 | - 'content' => gettext ( 'Search' ), |
|
682 | + 'content' => gettext('Search'), |
|
683 | 683 | 'value' => 'save', |
684 | 684 | 'type' => 'button', |
685 | 685 | 'class' => 'btn btn-line-parrot pull-right' |
686 | 686 | ); |
687 | - $form ['button_reset'] = array ( |
|
687 | + $form ['button_reset'] = array( |
|
688 | 688 | 'name' => 'action', |
689 | 689 | 'id' => "id_reset", |
690 | - 'content' => gettext ( 'Clear' ), |
|
690 | + 'content' => gettext('Clear'), |
|
691 | 691 | 'value' => 'cancel', |
692 | 692 | 'type' => 'reset', |
693 | 693 | 'class' => 'btn btn-line-sky pull-right margin-x-10' |
@@ -695,18 +695,18 @@ discard block |
||
695 | 695 | return $form; |
696 | 696 | } |
697 | 697 | function get_sipdevice_search_form() { |
698 | - $form ['forms'] = array ( |
|
698 | + $form ['forms'] = array( |
|
699 | 699 | "", |
700 | - array ( |
|
700 | + array( |
|
701 | 701 | 'id' => "freeswith_search" |
702 | 702 | ) |
703 | 703 | ); |
704 | - $form [gettext ( 'Search' )] = array ( |
|
704 | + $form [gettext('Search')] = array( |
|
705 | 705 | |
706 | - array ( |
|
707 | - gettext ( 'Username' ), |
|
706 | + array( |
|
707 | + gettext('Username'), |
|
708 | 708 | 'INPUT', |
709 | - array ( |
|
709 | + array( |
|
710 | 710 | 'name' => 'username[username]', |
711 | 711 | '', |
712 | 712 | 'size' => '20', |
@@ -722,8 +722,8 @@ discard block |
||
722 | 722 | 'search_string_type', |
723 | 723 | '' |
724 | 724 | ), |
725 | - array ( |
|
726 | - gettext ( 'SIP Profile' ), |
|
725 | + array( |
|
726 | + gettext('SIP Profile'), |
|
727 | 727 | 'sip_profile_id', |
728 | 728 | 'SELECT', |
729 | 729 | '', |
@@ -737,8 +737,8 @@ discard block |
||
737 | 737 | 'where_arr', |
738 | 738 | '' |
739 | 739 | ), |
740 | - array ( |
|
741 | - gettext ( 'Account' ), |
|
740 | + array( |
|
741 | + gettext('Account'), |
|
742 | 742 | 'accountid', |
743 | 743 | 'SELECT', |
744 | 744 | '', |
@@ -750,14 +750,14 @@ discard block |
||
750 | 750 | 'accounts', |
751 | 751 | 'build_concat_dropdown', |
752 | 752 | 'where_arr', |
753 | - array ( |
|
753 | + array( |
|
754 | 754 | "reseller_id" => "0", |
755 | 755 | "type" => "GLOBAL", |
756 | 756 | "deleted" => "0" |
757 | 757 | ) |
758 | 758 | ), |
759 | - array ( |
|
760 | - gettext ( 'Status' ), |
|
759 | + array( |
|
760 | + gettext('Status'), |
|
761 | 761 | 'status', |
762 | 762 | 'SELECT', |
763 | 763 | '', |
@@ -770,7 +770,7 @@ discard block |
||
770 | 770 | 'set_search_status' |
771 | 771 | ), |
772 | 772 | // array('Voicemail', 'vm-enabled', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_voicemail_status'), |
773 | - array ( |
|
773 | + array( |
|
774 | 774 | '', |
775 | 775 | 'HIDDEN', |
776 | 776 | 'ajax_search', |
@@ -779,7 +779,7 @@ discard block |
||
779 | 779 | '', |
780 | 780 | '' |
781 | 781 | ), |
782 | - array ( |
|
782 | + array( |
|
783 | 783 | '', |
784 | 784 | 'HIDDEN', |
785 | 785 | 'advance_search', |
@@ -789,18 +789,18 @@ discard block |
||
789 | 789 | '' |
790 | 790 | ) |
791 | 791 | ); |
792 | - $form ['button_search'] = array ( |
|
792 | + $form ['button_search'] = array( |
|
793 | 793 | 'name' => 'action', |
794 | 794 | 'id' => "fssipdevice_search_btn", |
795 | - 'content' => gettext ( 'Search' ), |
|
795 | + 'content' => gettext('Search'), |
|
796 | 796 | 'value' => 'save', |
797 | 797 | 'type' => 'button', |
798 | 798 | 'class' => 'btn btn-line-parrot pull-right' |
799 | 799 | ); |
800 | - $form ['button_reset'] = array ( |
|
800 | + $form ['button_reset'] = array( |
|
801 | 801 | 'name' => 'action', |
802 | 802 | 'id' => "id_reset", |
803 | - 'content' => gettext ( 'Clear' ), |
|
803 | + 'content' => gettext('Clear'), |
|
804 | 804 | 'value' => 'cancel', |
805 | 805 | 'type' => 'reset', |
806 | 806 | 'class' => 'btn btn-line-sky pull-right margin-x-10' |
@@ -812,8 +812,8 @@ discard block |
||
812 | 812 | * Changes in gried size |
813 | 813 | */ |
814 | 814 | function build_system_list_for_admin() { |
815 | - $grid_field_arr = json_encode ( array ( |
|
816 | - array ( |
|
815 | + $grid_field_arr = json_encode(array( |
|
816 | + array( |
|
817 | 817 | "<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", |
818 | 818 | "50", |
819 | 819 | "", |
@@ -824,8 +824,8 @@ discard block |
||
824 | 824 | "false", |
825 | 825 | "center" |
826 | 826 | ), |
827 | - array ( |
|
828 | - gettext ( "User Name" ), |
|
827 | + array( |
|
828 | + gettext("User Name"), |
|
829 | 829 | "100", |
830 | 830 | "username", |
831 | 831 | "", |
@@ -835,8 +835,8 @@ discard block |
||
835 | 835 | "true", |
836 | 836 | "center" |
837 | 837 | ), |
838 | - array ( |
|
839 | - gettext ( "Password" ), |
|
838 | + array( |
|
839 | + gettext("Password"), |
|
840 | 840 | "100", |
841 | 841 | "password", |
842 | 842 | "", |
@@ -846,8 +846,8 @@ discard block |
||
846 | 846 | "true", |
847 | 847 | "center" |
848 | 848 | ), |
849 | - array ( |
|
850 | - gettext ( "SIP Profile" ), |
|
849 | + array( |
|
850 | + gettext("SIP Profile"), |
|
851 | 851 | "100", |
852 | 852 | "sip_profile_id", |
853 | 853 | "name", |
@@ -857,8 +857,8 @@ discard block |
||
857 | 857 | "true", |
858 | 858 | "center" |
859 | 859 | ), |
860 | - array ( |
|
861 | - gettext ( "Account" ), |
|
860 | + array( |
|
861 | + gettext("Account"), |
|
862 | 862 | "150", |
863 | 863 | "accountid", |
864 | 864 | "first_name,last_name,number", |
@@ -868,8 +868,8 @@ discard block |
||
868 | 868 | "true", |
869 | 869 | "center" |
870 | 870 | ), |
871 | - array ( |
|
872 | - gettext ( "Caller Name" ), |
|
871 | + array( |
|
872 | + gettext("Caller Name"), |
|
873 | 873 | "100", |
874 | 874 | "effective_caller_id_name", |
875 | 875 | "", |
@@ -879,8 +879,8 @@ discard block |
||
879 | 879 | "true", |
880 | 880 | "center" |
881 | 881 | ), |
882 | - array ( |
|
883 | - gettext ( "Caller Number" ), |
|
882 | + array( |
|
883 | + gettext("Caller Number"), |
|
884 | 884 | "100", |
885 | 885 | "effective_caller_id_number", |
886 | 886 | "", |
@@ -890,8 +890,8 @@ discard block |
||
890 | 890 | "true", |
891 | 891 | "center" |
892 | 892 | ), |
893 | - array ( |
|
894 | - gettext ( "Voicemail" ), |
|
893 | + array( |
|
894 | + gettext("Voicemail"), |
|
895 | 895 | "100", |
896 | 896 | "voicemail_enabled", |
897 | 897 | "", |
@@ -901,8 +901,8 @@ discard block |
||
901 | 901 | "true", |
902 | 902 | "center" |
903 | 903 | ), |
904 | - array ( |
|
905 | - gettext ( "Status" ), |
|
904 | + array( |
|
905 | + gettext("Status"), |
|
906 | 906 | "100", |
907 | 907 | "status", |
908 | 908 | "status", |
@@ -912,8 +912,8 @@ discard block |
||
912 | 912 | "true", |
913 | 913 | "center" |
914 | 914 | ), |
915 | - array ( |
|
916 | - gettext ( "Created Date" ), |
|
915 | + array( |
|
916 | + gettext("Created Date"), |
|
917 | 917 | "130", |
918 | 918 | "creation_date", |
919 | 919 | "creation_date", |
@@ -923,8 +923,8 @@ discard block |
||
923 | 923 | "true", |
924 | 924 | "center" |
925 | 925 | ), |
926 | - array ( |
|
927 | - gettext ( "Modified Date" ), |
|
926 | + array( |
|
927 | + gettext("Modified Date"), |
|
928 | 928 | "130", |
929 | 929 | "last_modified_date", |
930 | 930 | "last_modified_date", |
@@ -934,34 +934,34 @@ discard block |
||
934 | 934 | "true", |
935 | 935 | "center" |
936 | 936 | ), |
937 | - array ( |
|
938 | - gettext ( "Action" ), |
|
937 | + array( |
|
938 | + gettext("Action"), |
|
939 | 939 | "107", |
940 | 940 | "", |
941 | 941 | "", |
942 | 942 | "", |
943 | - array ( |
|
944 | - "EDIT" => array ( |
|
943 | + array( |
|
944 | + "EDIT" => array( |
|
945 | 945 | "url" => "/freeswitch/fssipdevices_edit/", |
946 | 946 | "mode" => "single", |
947 | 947 | "layout" => "medium" |
948 | 948 | ), |
949 | - "DELETE" => array ( |
|
949 | + "DELETE" => array( |
|
950 | 950 | "url" => "/freeswitch/fssipdevices_delete/", |
951 | 951 | "mode" => "single" |
952 | 952 | ) |
953 | 953 | ) |
954 | 954 | ) |
955 | - ) ); |
|
955 | + )); |
|
956 | 956 | return $grid_field_arr; |
957 | 957 | } |
958 | 958 | /** |
959 | 959 | * ****************************** |
960 | 960 | */ |
961 | 961 | function build_grid_buttons() { |
962 | - $buttons_json = json_encode ( array ( |
|
963 | - array ( |
|
964 | - gettext ( "Create" ), |
|
962 | + $buttons_json = json_encode(array( |
|
963 | + array( |
|
964 | + gettext("Create"), |
|
965 | 965 | "btn btn-line-warning btn", |
966 | 966 | "fa fa-plus-circle fa-lg", |
967 | 967 | "button_action", |
@@ -969,20 +969,20 @@ discard block |
||
969 | 969 | "popup", |
970 | 970 | "medium" |
971 | 971 | ), |
972 | - array ( |
|
973 | - gettext ( "Delete" ), |
|
972 | + array( |
|
973 | + gettext("Delete"), |
|
974 | 974 | "btn btn-line-danger", |
975 | 975 | "fa fa-times-circle fa-lg", |
976 | 976 | "button_action", |
977 | 977 | "/freeswitch/fssipdevices_delete_multiple/" |
978 | 978 | ) |
979 | - ) ); |
|
979 | + )); |
|
980 | 980 | return $buttons_json; |
981 | 981 | } |
982 | 982 | function fsdevices_build_grid_buttons($accountid) { |
983 | - $buttons_json = json_encode ( array ( |
|
984 | - array ( |
|
985 | - gettext ( "Create" ), |
|
983 | + $buttons_json = json_encode(array( |
|
984 | + array( |
|
985 | + gettext("Create"), |
|
986 | 986 | "btn btn-line-warning btn", |
987 | 987 | "fa fa-plus-circle fa-lg", |
988 | 988 | "button_action", |
@@ -990,29 +990,29 @@ discard block |
||
990 | 990 | "popup", |
991 | 991 | "medium" |
992 | 992 | ), |
993 | - array ( |
|
994 | - gettext ( "Delete" ), |
|
993 | + array( |
|
994 | + gettext("Delete"), |
|
995 | 995 | "btn btn-line-danger", |
996 | 996 | "fa fa-times-circle fa-lg", |
997 | 997 | "button_action", |
998 | 998 | "/freeswitch/customer_fssipdevices_delete_multiple/" |
999 | 999 | ) |
1000 | - ) ); |
|
1000 | + )); |
|
1001 | 1001 | return $buttons_json; |
1002 | 1002 | } |
1003 | 1003 | function get_gateway_form_fields() { |
1004 | - $form ['forms'] = array ( |
|
1005 | - base_url () . 'freeswitch/fsgateway_save/', |
|
1006 | - array ( |
|
1004 | + $form ['forms'] = array( |
|
1005 | + base_url().'freeswitch/fsgateway_save/', |
|
1006 | + array( |
|
1007 | 1007 | "id" => "gateway_form", |
1008 | 1008 | "name" => "gateway_form" |
1009 | 1009 | ) |
1010 | 1010 | ); |
1011 | - $form [gettext ( 'Basic Information' )] = array ( |
|
1012 | - array ( |
|
1011 | + $form [gettext('Basic Information')] = array( |
|
1012 | + array( |
|
1013 | 1013 | '', |
1014 | 1014 | 'HIDDEN', |
1015 | - array ( |
|
1015 | + array( |
|
1016 | 1016 | 'name' => 'id' |
1017 | 1017 | ), |
1018 | 1018 | '', |
@@ -1020,10 +1020,10 @@ discard block |
||
1020 | 1020 | '', |
1021 | 1021 | '' |
1022 | 1022 | ), |
1023 | - array ( |
|
1024 | - gettext ( 'Name' ), |
|
1023 | + array( |
|
1024 | + gettext('Name'), |
|
1025 | 1025 | 'INPUT', |
1026 | - array ( |
|
1026 | + array( |
|
1027 | 1027 | 'name' => 'name', |
1028 | 1028 | 'size' => '20', |
1029 | 1029 | 'class' => "text field medium" |
@@ -1032,8 +1032,8 @@ discard block |
||
1032 | 1032 | 'tOOL TIP', |
1033 | 1033 | 'Please Enter Gateway Name' |
1034 | 1034 | ), |
1035 | - array ( |
|
1036 | - gettext ( 'SIP Profile' ), |
|
1035 | + array( |
|
1036 | + gettext('SIP Profile'), |
|
1037 | 1037 | 'sip_profile_id', |
1038 | 1038 | 'SELECT', |
1039 | 1039 | '', |
@@ -1047,10 +1047,10 @@ discard block |
||
1047 | 1047 | '', |
1048 | 1048 | '' |
1049 | 1049 | ), |
1050 | - array ( |
|
1051 | - gettext ( 'Username' ), |
|
1050 | + array( |
|
1051 | + gettext('Username'), |
|
1052 | 1052 | 'INPUT', |
1053 | - array ( |
|
1053 | + array( |
|
1054 | 1054 | 'name' => 'username', |
1055 | 1055 | 'size' => '20', |
1056 | 1056 | 'class' => "text field medium" |
@@ -1059,10 +1059,10 @@ discard block |
||
1059 | 1059 | 'tOOL TIP', |
1060 | 1060 | 'Please Enter user name' |
1061 | 1061 | ), |
1062 | - array ( |
|
1063 | - gettext ( 'Password' ), |
|
1062 | + array( |
|
1063 | + gettext('Password'), |
|
1064 | 1064 | 'INPUT', |
1065 | - array ( |
|
1065 | + array( |
|
1066 | 1066 | 'name' => 'password', |
1067 | 1067 | 'size' => '20', |
1068 | 1068 | 'class' => "text field medium" |
@@ -1071,10 +1071,10 @@ discard block |
||
1071 | 1071 | 'tOOL TIP', |
1072 | 1072 | 'Please Enter Password' |
1073 | 1073 | ), |
1074 | - array ( |
|
1075 | - gettext ( 'Proxy' ), |
|
1074 | + array( |
|
1075 | + gettext('Proxy'), |
|
1076 | 1076 | 'INPUT', |
1077 | - array ( |
|
1077 | + array( |
|
1078 | 1078 | 'name' => 'proxy', |
1079 | 1079 | 'size' => '20', |
1080 | 1080 | 'class' => "text field medium" |
@@ -1083,10 +1083,10 @@ discard block |
||
1083 | 1083 | 'tOOL TIP', |
1084 | 1084 | '' |
1085 | 1085 | ), |
1086 | - array ( |
|
1087 | - gettext ( 'Outbound-<br/>Proxy' ), |
|
1086 | + array( |
|
1087 | + gettext('Outbound-<br/>Proxy'), |
|
1088 | 1088 | 'INPUT', |
1089 | - array ( |
|
1089 | + array( |
|
1090 | 1090 | 'name' => 'outbound-proxy', |
1091 | 1091 | 'size' => '20', |
1092 | 1092 | 'class' => "text field medium" |
@@ -1095,9 +1095,9 @@ discard block |
||
1095 | 1095 | 'tOOL TIP', |
1096 | 1096 | '' |
1097 | 1097 | ), |
1098 | - array ( |
|
1099 | - gettext ( 'Register' ), |
|
1100 | - array ( |
|
1098 | + array( |
|
1099 | + gettext('Register'), |
|
1100 | + array( |
|
1101 | 1101 | 'name' => 'register', |
1102 | 1102 | 'class' => 'add_settings' |
1103 | 1103 | ), |
@@ -1111,9 +1111,9 @@ discard block |
||
1111 | 1111 | '', |
1112 | 1112 | 'set_sip_config_option' |
1113 | 1113 | ), |
1114 | - array ( |
|
1115 | - gettext ( 'Caller-id-in-from' ), |
|
1116 | - array ( |
|
1114 | + array( |
|
1115 | + gettext('Caller-id-in-from'), |
|
1116 | + array( |
|
1117 | 1117 | 'name' => 'caller-id-in-from', |
1118 | 1118 | 'class' => 'add_settings' |
1119 | 1119 | ), |
@@ -1127,8 +1127,8 @@ discard block |
||
1127 | 1127 | '', |
1128 | 1128 | 'set_sip_config_option' |
1129 | 1129 | ), |
1130 | - array ( |
|
1131 | - gettext ( 'Status' ), |
|
1130 | + array( |
|
1131 | + gettext('Status'), |
|
1132 | 1132 | 'status', |
1133 | 1133 | 'SELECT', |
1134 | 1134 | '', |
@@ -1142,11 +1142,11 @@ discard block |
||
1142 | 1142 | ) |
1143 | 1143 | ) |
1144 | 1144 | ; |
1145 | - $form [gettext ( 'Optional Information' )] = array ( |
|
1146 | - array ( |
|
1147 | - gettext ( 'From- Domain' ), |
|
1145 | + $form [gettext('Optional Information')] = array( |
|
1146 | + array( |
|
1147 | + gettext('From- Domain'), |
|
1148 | 1148 | 'INPUT', |
1149 | - array ( |
|
1149 | + array( |
|
1150 | 1150 | 'name' => 'from_domain', |
1151 | 1151 | 'size' => '20', |
1152 | 1152 | 'class' => "text field medium" |
@@ -1155,10 +1155,10 @@ discard block |
||
1155 | 1155 | 'tOOL TIP', |
1156 | 1156 | '' |
1157 | 1157 | ), |
1158 | - array ( |
|
1159 | - gettext ( 'From User' ), |
|
1158 | + array( |
|
1159 | + gettext('From User'), |
|
1160 | 1160 | 'INPUT', |
1161 | - array ( |
|
1161 | + array( |
|
1162 | 1162 | 'name' => 'from_user', |
1163 | 1163 | 'size' => '20', |
1164 | 1164 | 'class' => "text field medium" |
@@ -1167,10 +1167,10 @@ discard block |
||
1167 | 1167 | 'tOOL TIP', |
1168 | 1168 | '' |
1169 | 1169 | ), |
1170 | - array ( |
|
1171 | - gettext ( 'Realm' ), |
|
1170 | + array( |
|
1171 | + gettext('Realm'), |
|
1172 | 1172 | 'INPUT', |
1173 | - array ( |
|
1173 | + array( |
|
1174 | 1174 | 'name' => 'realm', |
1175 | 1175 | 'size' => '20', |
1176 | 1176 | 'class' => "text field medium" |
@@ -1179,10 +1179,10 @@ discard block |
||
1179 | 1179 | 'tOOL TIP', |
1180 | 1180 | '' |
1181 | 1181 | ), |
1182 | - array ( |
|
1183 | - gettext ( 'Extension' ), |
|
1182 | + array( |
|
1183 | + gettext('Extension'), |
|
1184 | 1184 | 'INPUT', |
1185 | - array ( |
|
1185 | + array( |
|
1186 | 1186 | 'name' => 'extension', |
1187 | 1187 | 'size' => '20', |
1188 | 1188 | 'class' => "text field medium" |
@@ -1191,10 +1191,10 @@ discard block |
||
1191 | 1191 | 'tOOL TIP', |
1192 | 1192 | '' |
1193 | 1193 | ), |
1194 | - array ( |
|
1195 | - gettext ( 'Expire Seconds' ), |
|
1194 | + array( |
|
1195 | + gettext('Expire Seconds'), |
|
1196 | 1196 | 'INPUT', |
1197 | - array ( |
|
1197 | + array( |
|
1198 | 1198 | 'name' => 'expire-seconds', |
1199 | 1199 | 'size' => '20', |
1200 | 1200 | 'class' => "text field medium" |
@@ -1203,10 +1203,10 @@ discard block |
||
1203 | 1203 | 'tOOL TIP', |
1204 | 1204 | '' |
1205 | 1205 | ), |
1206 | - array ( |
|
1207 | - gettext ( 'Reg-<br/>Transport' ), |
|
1206 | + array( |
|
1207 | + gettext('Reg-<br/>Transport'), |
|
1208 | 1208 | 'INPUT', |
1209 | - array ( |
|
1209 | + array( |
|
1210 | 1210 | 'name' => 'register-transport', |
1211 | 1211 | 'size' => '20', |
1212 | 1212 | 'class' => "text field medium" |
@@ -1215,10 +1215,10 @@ discard block |
||
1215 | 1215 | 'tOOL TIP', |
1216 | 1216 | '' |
1217 | 1217 | ), |
1218 | - array ( |
|
1219 | - gettext ( 'Contact Params' ), |
|
1218 | + array( |
|
1219 | + gettext('Contact Params'), |
|
1220 | 1220 | 'INPUT', |
1221 | - array ( |
|
1221 | + array( |
|
1222 | 1222 | 'name' => 'contact-params', |
1223 | 1223 | 'size' => '20', |
1224 | 1224 | 'class' => "text field medium" |
@@ -1227,10 +1227,10 @@ discard block |
||
1227 | 1227 | 'tOOL TIP', |
1228 | 1228 | '' |
1229 | 1229 | ), |
1230 | - array ( |
|
1231 | - gettext ( 'Ping' ), |
|
1230 | + array( |
|
1231 | + gettext('Ping'), |
|
1232 | 1232 | 'INPUT', |
1233 | - array ( |
|
1233 | + array( |
|
1234 | 1234 | 'name' => 'ping', |
1235 | 1235 | 'size' => '20', |
1236 | 1236 | 'class' => "text field medium" |
@@ -1239,10 +1239,10 @@ discard block |
||
1239 | 1239 | 'tOOL TIP', |
1240 | 1240 | '' |
1241 | 1241 | ), |
1242 | - array ( |
|
1243 | - gettext ( 'Retry-<br/>Seconds' ), |
|
1242 | + array( |
|
1243 | + gettext('Retry-<br/>Seconds'), |
|
1244 | 1244 | 'INPUT', |
1245 | - array ( |
|
1245 | + array( |
|
1246 | 1246 | 'name' => 'retry-seconds', |
1247 | 1247 | 'size' => '20', |
1248 | 1248 | 'class' => "text field medium" |
@@ -1251,10 +1251,10 @@ discard block |
||
1251 | 1251 | 'tOOL TIP', |
1252 | 1252 | '' |
1253 | 1253 | ), |
1254 | - array ( |
|
1255 | - gettext ( 'Register-<br/>Proxy' ), |
|
1254 | + array( |
|
1255 | + gettext('Register-<br/>Proxy'), |
|
1256 | 1256 | 'INPUT', |
1257 | - array ( |
|
1257 | + array( |
|
1258 | 1258 | 'name' => 'register-proxy', |
1259 | 1259 | 'size' => '20', |
1260 | 1260 | 'class' => "text field medium" |
@@ -1263,10 +1263,10 @@ discard block |
||
1263 | 1263 | 'tOOL TIP', |
1264 | 1264 | '' |
1265 | 1265 | ), |
1266 | - array ( |
|
1267 | - gettext ( 'Channel' ), |
|
1266 | + array( |
|
1267 | + gettext('Channel'), |
|
1268 | 1268 | 'INPUT', |
1269 | - array ( |
|
1269 | + array( |
|
1270 | 1270 | 'name' => 'channel', |
1271 | 1271 | 'size' => '20', |
1272 | 1272 | 'class' => "text field medium" |
@@ -1281,10 +1281,10 @@ discard block |
||
1281 | 1281 | * put one variable with the name of dialplan variable |
1282 | 1282 | */ |
1283 | 1283 | // array('Dialplan Variable', 'TEXTAREA', array('name' => 'dialplan_variable', 'size' => '20','cols'=>'10','rows'=>'5', 'class' => "col_md-5 form-control", 'style'=>"width: 200px; height: 100px;font-family: Open sans,sans-serif !important;"), '', 'tOOL TIP', ''), |
1284 | - array ( |
|
1284 | + array( |
|
1285 | 1285 | 'Dialplan Variable', |
1286 | 1286 | 'TEXTAREA', |
1287 | - array ( |
|
1287 | + array( |
|
1288 | 1288 | 'name' => 'dialplan_variable', |
1289 | 1289 | 'size' => '0', |
1290 | 1290 | 'cols' => '0', |
@@ -1301,17 +1301,17 @@ discard block |
||
1301 | 1301 | */ |
1302 | 1302 | ; |
1303 | 1303 | |
1304 | - $form ['button_cancel'] = array ( |
|
1304 | + $form ['button_cancel'] = array( |
|
1305 | 1305 | 'name' => 'action', |
1306 | - 'content' => gettext ( 'Close' ), |
|
1306 | + 'content' => gettext('Close'), |
|
1307 | 1307 | 'value' => 'cancel', |
1308 | 1308 | 'type' => 'button', |
1309 | 1309 | 'class' => 'btn btn-line-sky margin-x-10', |
1310 | 1310 | 'onclick' => 'return redirect_page(\'NULL\')' |
1311 | 1311 | ); |
1312 | - $form ['button_save'] = array ( |
|
1312 | + $form ['button_save'] = array( |
|
1313 | 1313 | 'name' => 'action', |
1314 | - 'content' => gettext ( 'Save' ), |
|
1314 | + 'content' => gettext('Save'), |
|
1315 | 1315 | 'value' => 'save', |
1316 | 1316 | 'id' => 'submit', |
1317 | 1317 | 'type' => 'button', |
@@ -1327,8 +1327,8 @@ discard block |
||
1327 | 1327 | */ |
1328 | 1328 | function build_fsgateway_list_for_admin() { |
1329 | 1329 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
1330 | - $grid_field_arr = json_encode ( array ( |
|
1331 | - array ( |
|
1330 | + $grid_field_arr = json_encode(array( |
|
1331 | + array( |
|
1332 | 1332 | "<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", |
1333 | 1333 | "30", |
1334 | 1334 | "", |
@@ -1344,8 +1344,8 @@ discard block |
||
1344 | 1344 | * For Gateway Edit on Gateway name |
1345 | 1345 | * * |
1346 | 1346 | */ |
1347 | - array ( |
|
1348 | - gettext ( "Name" ), |
|
1347 | + array( |
|
1348 | + gettext("Name"), |
|
1349 | 1349 | "140", |
1350 | 1350 | "name", |
1351 | 1351 | "", |
@@ -1358,8 +1358,8 @@ discard block |
||
1358 | 1358 | /** |
1359 | 1359 | * ******************************* |
1360 | 1360 | */ |
1361 | - array ( |
|
1362 | - gettext ( "SIP Profile" ), |
|
1361 | + array( |
|
1362 | + gettext("SIP Profile"), |
|
1363 | 1363 | "115", |
1364 | 1364 | "sip_profile_id", |
1365 | 1365 | "name", |
@@ -1369,8 +1369,8 @@ discard block |
||
1369 | 1369 | "true", |
1370 | 1370 | "center" |
1371 | 1371 | ), |
1372 | - array ( |
|
1373 | - gettext ( "Username" ), |
|
1372 | + array( |
|
1373 | + gettext("Username"), |
|
1374 | 1374 | "140", |
1375 | 1375 | "username", |
1376 | 1376 | "", |
@@ -1381,8 +1381,8 @@ discard block |
||
1381 | 1381 | "center" |
1382 | 1382 | ), |
1383 | 1383 | // array("Password", "181", "password", "", "", ""), |
1384 | - array ( |
|
1385 | - gettext ( "Proxy" ), |
|
1384 | + array( |
|
1385 | + gettext("Proxy"), |
|
1386 | 1386 | "145", |
1387 | 1387 | "proxy", |
1388 | 1388 | "", |
@@ -1392,8 +1392,8 @@ discard block |
||
1392 | 1392 | "true", |
1393 | 1393 | "center" |
1394 | 1394 | ), |
1395 | - array ( |
|
1396 | - gettext ( "Register" ), |
|
1395 | + array( |
|
1396 | + gettext("Register"), |
|
1397 | 1397 | "120", |
1398 | 1398 | "register", |
1399 | 1399 | "register", |
@@ -1403,8 +1403,8 @@ discard block |
||
1403 | 1403 | "true", |
1404 | 1404 | "center" |
1405 | 1405 | ), |
1406 | - array ( |
|
1407 | - gettext ( "Caller-Id-In-Form" ), |
|
1406 | + array( |
|
1407 | + gettext("Caller-Id-In-Form"), |
|
1408 | 1408 | "130", |
1409 | 1409 | "caller-id-in-from", |
1410 | 1410 | "caller-id-in-from", |
@@ -1418,8 +1418,8 @@ discard block |
||
1418 | 1418 | ASTPP 3.0 |
1419 | 1419 | creation field show in grid |
1420 | 1420 | */ |
1421 | - array ( |
|
1422 | - gettext ( "Status" ), |
|
1421 | + array( |
|
1422 | + gettext("Status"), |
|
1423 | 1423 | "110", |
1424 | 1424 | "status", |
1425 | 1425 | "status", |
@@ -1429,8 +1429,8 @@ discard block |
||
1429 | 1429 | "true", |
1430 | 1430 | "center" |
1431 | 1431 | ), |
1432 | - array ( |
|
1433 | - gettext ( "Created Date" ), |
|
1432 | + array( |
|
1433 | + gettext("Created Date"), |
|
1434 | 1434 | "100", |
1435 | 1435 | "created_date", |
1436 | 1436 | "creation_date", |
@@ -1440,8 +1440,8 @@ discard block |
||
1440 | 1440 | "true", |
1441 | 1441 | "center" |
1442 | 1442 | ), |
1443 | - array ( |
|
1444 | - gettext ( "Modified Date" ), |
|
1443 | + array( |
|
1444 | + gettext("Modified Date"), |
|
1445 | 1445 | "130", |
1446 | 1446 | "last_modified_date", |
1447 | 1447 | "last_modified_date", |
@@ -1463,34 +1463,34 @@ discard block |
||
1463 | 1463 | /** |
1464 | 1464 | * *************************************** |
1465 | 1465 | */ |
1466 | - array ( |
|
1466 | + array( |
|
1467 | 1467 | "Action", |
1468 | 1468 | "106", |
1469 | 1469 | "", |
1470 | 1470 | "", |
1471 | 1471 | "", |
1472 | - array ( |
|
1473 | - "EDIT" => array ( |
|
1472 | + array( |
|
1473 | + "EDIT" => array( |
|
1474 | 1474 | "url" => "/freeswitch/fsgateway_edit/", |
1475 | 1475 | "mode" => "popup", |
1476 | 1476 | "layout" => "medium" |
1477 | 1477 | ), |
1478 | - "DELETE" => array ( |
|
1478 | + "DELETE" => array( |
|
1479 | 1479 | "url" => "/freeswitch/fsgateway_delete/", |
1480 | 1480 | "mode" => "single" |
1481 | 1481 | ) |
1482 | 1482 | ) |
1483 | 1483 | ) |
1484 | - ) ); |
|
1484 | + )); |
|
1485 | 1485 | return $grid_field_arr; |
1486 | 1486 | } |
1487 | 1487 | /** |
1488 | 1488 | * *************************************************** |
1489 | 1489 | */ |
1490 | 1490 | function build_fdgateway_grid_buttons() { |
1491 | - $buttons_json = json_encode ( array ( |
|
1492 | - array ( |
|
1493 | - gettext ( "Create" ), |
|
1491 | + $buttons_json = json_encode(array( |
|
1492 | + array( |
|
1493 | + gettext("Create"), |
|
1494 | 1494 | "btn btn-line-warning btn", |
1495 | 1495 | "fa fa-plus-circle fa-lg", |
1496 | 1496 | "button_action", |
@@ -1498,29 +1498,29 @@ discard block |
||
1498 | 1498 | "popup", |
1499 | 1499 | "medium" |
1500 | 1500 | ), |
1501 | - array ( |
|
1502 | - gettext ( "Delete" ), |
|
1501 | + array( |
|
1502 | + gettext("Delete"), |
|
1503 | 1503 | "btn btn-line-danger", |
1504 | 1504 | "fa fa-times-circle fa-lg", |
1505 | 1505 | "button_action", |
1506 | 1506 | "/freeswitch/fsgateway_delete_multiple/" |
1507 | 1507 | ) |
1508 | - ) ); |
|
1508 | + )); |
|
1509 | 1509 | return $buttons_json; |
1510 | 1510 | } |
1511 | 1511 | function get_sipprofile_form_fields() { |
1512 | - $form ['forms'] = array ( |
|
1513 | - base_url () . 'freeswitch/fssipprofile_save/', |
|
1514 | - array ( |
|
1512 | + $form ['forms'] = array( |
|
1513 | + base_url().'freeswitch/fssipprofile_save/', |
|
1514 | + array( |
|
1515 | 1515 | "id" => "fssipprofile_form", |
1516 | 1516 | "name" => "fssipprofile_form" |
1517 | 1517 | ) |
1518 | 1518 | ); |
1519 | - $form [gettext ( 'Basic Information' )] = array ( |
|
1520 | - array ( |
|
1519 | + $form [gettext('Basic Information')] = array( |
|
1520 | + array( |
|
1521 | 1521 | '', |
1522 | 1522 | 'HIDDEN', |
1523 | - array ( |
|
1523 | + array( |
|
1524 | 1524 | 'name' => 'id' |
1525 | 1525 | ), |
1526 | 1526 | '', |
@@ -1528,10 +1528,10 @@ discard block |
||
1528 | 1528 | '', |
1529 | 1529 | '' |
1530 | 1530 | ), |
1531 | - array ( |
|
1532 | - gettext ( 'Profile name' ), |
|
1531 | + array( |
|
1532 | + gettext('Profile name'), |
|
1533 | 1533 | 'INPUT', |
1534 | - array ( |
|
1534 | + array( |
|
1535 | 1535 | 'name' => 'name', |
1536 | 1536 | 'size' => '20', |
1537 | 1537 | 'class' => "text field medium" |
@@ -1540,10 +1540,10 @@ discard block |
||
1540 | 1540 | 'tOOL TIP', |
1541 | 1541 | 'Please Enter Name' |
1542 | 1542 | ), |
1543 | - array ( |
|
1544 | - gettext ( 'sip-ip' ), |
|
1543 | + array( |
|
1544 | + gettext('sip-ip'), |
|
1545 | 1545 | 'INPUT', |
1546 | - array ( |
|
1546 | + array( |
|
1547 | 1547 | 'name' => 'sip_ip', |
1548 | 1548 | 'size' => '20', |
1549 | 1549 | 'class' => "text field medium" |
@@ -1552,10 +1552,10 @@ discard block |
||
1552 | 1552 | 'tOOL TIP', |
1553 | 1553 | 'Please Enter SIP IP Name' |
1554 | 1554 | ), |
1555 | - array ( |
|
1556 | - gettext ( 'sip-port' ), |
|
1555 | + array( |
|
1556 | + gettext('sip-port'), |
|
1557 | 1557 | 'INPUT', |
1558 | - array ( |
|
1558 | + array( |
|
1559 | 1559 | 'name' => 'sip_port', |
1560 | 1560 | 'size' => '20', |
1561 | 1561 | 'value' => '5060', |
@@ -1565,10 +1565,10 @@ discard block |
||
1565 | 1565 | 'tOOL TIP', |
1566 | 1566 | 'Please Enter SIP Port' |
1567 | 1567 | ), |
1568 | - array ( |
|
1569 | - gettext ( 'rtp-ip' ), |
|
1568 | + array( |
|
1569 | + gettext('rtp-ip'), |
|
1570 | 1570 | 'INPUT', |
1571 | - array ( |
|
1571 | + array( |
|
1572 | 1572 | 'name' => 'rtp_ip', |
1573 | 1573 | 'size' => '20', |
1574 | 1574 | 'class' => "text field medium" |
@@ -1577,10 +1577,10 @@ discard block |
||
1577 | 1577 | 'tOOL TIP', |
1578 | 1578 | '' |
1579 | 1579 | ), |
1580 | - array ( |
|
1581 | - gettext ( 'Dial Plan' ), |
|
1580 | + array( |
|
1581 | + gettext('Dial Plan'), |
|
1582 | 1582 | 'INPUT', |
1583 | - array ( |
|
1583 | + array( |
|
1584 | 1584 | 'name' => 'dialplan', |
1585 | 1585 | 'size' => '20', |
1586 | 1586 | 'value' => 'XML', |
@@ -1590,10 +1590,10 @@ discard block |
||
1590 | 1590 | 'tOOL TIP', |
1591 | 1591 | '' |
1592 | 1592 | ), |
1593 | - array ( |
|
1594 | - gettext ( 'user-agent-string' ), |
|
1593 | + array( |
|
1594 | + gettext('user-agent-string'), |
|
1595 | 1595 | 'INPUT', |
1596 | - array ( |
|
1596 | + array( |
|
1597 | 1597 | 'name' => 'user-agent-string', |
1598 | 1598 | 'size' => '20', |
1599 | 1599 | 'value' => 'ASTPP', |
@@ -1603,10 +1603,10 @@ discard block |
||
1603 | 1603 | 'tOOL TIP', |
1604 | 1604 | '' |
1605 | 1605 | ), |
1606 | - array ( |
|
1607 | - gettext ( 'debug' ), |
|
1606 | + array( |
|
1607 | + gettext('debug'), |
|
1608 | 1608 | 'INPUT', |
1609 | - array ( |
|
1609 | + array( |
|
1610 | 1610 | 'name' => 'debug', |
1611 | 1611 | 'size' => '20', |
1612 | 1612 | 'value' => '0', |
@@ -1616,8 +1616,8 @@ discard block |
||
1616 | 1616 | 'tOOL TIP', |
1617 | 1617 | '' |
1618 | 1618 | ), |
1619 | - array ( |
|
1620 | - gettext ( 'sip-trace' ), |
|
1619 | + array( |
|
1620 | + gettext('sip-trace'), |
|
1621 | 1621 | 'sip-trace', |
1622 | 1622 | 'SELECT', |
1623 | 1623 | '', |
@@ -1629,8 +1629,8 @@ discard block |
||
1629 | 1629 | '', |
1630 | 1630 | 'set_sip_drp_option' |
1631 | 1631 | ), |
1632 | - array ( |
|
1633 | - gettext ( 'tls' ), |
|
1632 | + array( |
|
1633 | + gettext('tls'), |
|
1634 | 1634 | 'tls', |
1635 | 1635 | 'SELECT', |
1636 | 1636 | '', |
@@ -1642,8 +1642,8 @@ discard block |
||
1642 | 1642 | '', |
1643 | 1643 | 'set_sip_config_options' |
1644 | 1644 | ), |
1645 | - array ( |
|
1646 | - gettext ( 'inbound-reg-force-matching-username' ), |
|
1645 | + array( |
|
1646 | + gettext('inbound-reg-force-matching-username'), |
|
1647 | 1647 | 'inbound-reg-force-matching-username', |
1648 | 1648 | 'SELECT', |
1649 | 1649 | '', |
@@ -1655,8 +1655,8 @@ discard block |
||
1655 | 1655 | '', |
1656 | 1656 | 'set_sip_config_option' |
1657 | 1657 | ), |
1658 | - array ( |
|
1659 | - gettext ( 'disable-transcoding' ), |
|
1658 | + array( |
|
1659 | + gettext('disable-transcoding'), |
|
1660 | 1660 | 'disable-transcoding', |
1661 | 1661 | 'SELECT', |
1662 | 1662 | '', |
@@ -1668,8 +1668,8 @@ discard block |
||
1668 | 1668 | '', |
1669 | 1669 | 'set_sip_config_option' |
1670 | 1670 | ), |
1671 | - array ( |
|
1672 | - gettext ( 'all-reg-options-ping' ), |
|
1671 | + array( |
|
1672 | + gettext('all-reg-options-ping'), |
|
1673 | 1673 | 'all-reg-options-ping', |
1674 | 1674 | 'SELECT', |
1675 | 1675 | '', |
@@ -1681,8 +1681,8 @@ discard block |
||
1681 | 1681 | '', |
1682 | 1682 | 'set_sip_config_option' |
1683 | 1683 | ), |
1684 | - array ( |
|
1685 | - gettext ( 'unregister-on-options-fail' ), |
|
1684 | + array( |
|
1685 | + gettext('unregister-on-options-fail'), |
|
1686 | 1686 | 'unregister-on-options-fail', |
1687 | 1687 | 'SELECT', |
1688 | 1688 | '', |
@@ -1694,8 +1694,8 @@ discard block |
||
1694 | 1694 | '', |
1695 | 1695 | 'set_sip_config_option' |
1696 | 1696 | ), |
1697 | - array ( |
|
1698 | - gettext ( 'log-auth-failures' ), |
|
1697 | + array( |
|
1698 | + gettext('log-auth-failures'), |
|
1699 | 1699 | 'log-auth-failures', |
1700 | 1700 | 'SELECT', |
1701 | 1701 | '', |
@@ -1707,8 +1707,8 @@ discard block |
||
1707 | 1707 | '', |
1708 | 1708 | 'set_sip_config_option' |
1709 | 1709 | ), |
1710 | - array ( |
|
1711 | - gettext ( 'Status' ), |
|
1710 | + array( |
|
1711 | + gettext('Status'), |
|
1712 | 1712 | 'status', |
1713 | 1713 | 'SELECT', |
1714 | 1714 | '', |
@@ -1722,9 +1722,9 @@ discard block |
||
1722 | 1722 | ) |
1723 | 1723 | ); |
1724 | 1724 | |
1725 | - $form [gettext ( 'Others Information' )] = array ( |
|
1726 | - array ( |
|
1727 | - gettext ( 'inbound-bypass-media' ), |
|
1725 | + $form [gettext('Others Information')] = array( |
|
1726 | + array( |
|
1727 | + gettext('inbound-bypass-media'), |
|
1728 | 1728 | 'inbound-bypass-media', |
1729 | 1729 | 'SELECT', |
1730 | 1730 | '', |
@@ -1736,8 +1736,8 @@ discard block |
||
1736 | 1736 | '', |
1737 | 1737 | 'set_sip_config_options' |
1738 | 1738 | ), |
1739 | - array ( |
|
1740 | - gettext ( 'inbound-proxy-media' ), |
|
1739 | + array( |
|
1740 | + gettext('inbound-proxy-media'), |
|
1741 | 1741 | 'inbound-proxy-media', |
1742 | 1742 | 'SELECT', |
1743 | 1743 | '', |
@@ -1749,8 +1749,8 @@ discard block |
||
1749 | 1749 | '', |
1750 | 1750 | 'set_sip_config_options' |
1751 | 1751 | ), |
1752 | - array ( |
|
1753 | - gettext ( 'disable-transfer' ), |
|
1752 | + array( |
|
1753 | + gettext('disable-transfer'), |
|
1754 | 1754 | 'disable-transfer', |
1755 | 1755 | 'SELECT', |
1756 | 1756 | '', |
@@ -1762,8 +1762,8 @@ discard block |
||
1762 | 1762 | '', |
1763 | 1763 | 'set_sip_config_option' |
1764 | 1764 | ), |
1765 | - array ( |
|
1766 | - gettext ( 'enable-100rel' ), |
|
1765 | + array( |
|
1766 | + gettext('enable-100rel'), |
|
1767 | 1767 | 'enable-100rel', |
1768 | 1768 | 'SELECT', |
1769 | 1769 | '', |
@@ -1775,10 +1775,10 @@ discard block |
||
1775 | 1775 | '', |
1776 | 1776 | 'set_sip_config_options' |
1777 | 1777 | ), |
1778 | - array ( |
|
1779 | - gettext ( 'rtp-timeout-sec' ), |
|
1778 | + array( |
|
1779 | + gettext('rtp-timeout-sec'), |
|
1780 | 1780 | 'INPUT', |
1781 | - array ( |
|
1781 | + array( |
|
1782 | 1782 | 'name' => 'rtp-timeout-sec', |
1783 | 1783 | 'size' => '20', |
1784 | 1784 | 'value' => '60', |
@@ -1788,10 +1788,10 @@ discard block |
||
1788 | 1788 | 'tOOL TIP', |
1789 | 1789 | '' |
1790 | 1790 | ), |
1791 | - array ( |
|
1792 | - gettext ( 'dtmf-duration' ), |
|
1791 | + array( |
|
1792 | + gettext('dtmf-duration'), |
|
1793 | 1793 | 'INPUT', |
1794 | - array ( |
|
1794 | + array( |
|
1795 | 1795 | 'name' => 'dtmf-duration', |
1796 | 1796 | 'size' => '20', |
1797 | 1797 | 'value' => '2000', |
@@ -1801,8 +1801,8 @@ discard block |
||
1801 | 1801 | 'tOOL TIP', |
1802 | 1802 | '' |
1803 | 1803 | ), |
1804 | - array ( |
|
1805 | - gettext ( 'manual-redirect' ), |
|
1804 | + array( |
|
1805 | + gettext('manual-redirect'), |
|
1806 | 1806 | 'manual-redirect', |
1807 | 1807 | 'SELECT', |
1808 | 1808 | '', |
@@ -1814,8 +1814,8 @@ discard block |
||
1814 | 1814 | '', |
1815 | 1815 | 'set_sip_config_options' |
1816 | 1816 | ), |
1817 | - array ( |
|
1818 | - gettext ( 'aggressive-nat-detection' ), |
|
1817 | + array( |
|
1818 | + gettext('aggressive-nat-detection'), |
|
1819 | 1819 | 'aggressive-nat-detection', |
1820 | 1820 | 'SELECT', |
1821 | 1821 | '', |
@@ -1827,8 +1827,8 @@ discard block |
||
1827 | 1827 | '', |
1828 | 1828 | 'set_sip_config_option' |
1829 | 1829 | ), |
1830 | - array ( |
|
1831 | - gettext ( 'enable-Timer' ), |
|
1830 | + array( |
|
1831 | + gettext('enable-Timer'), |
|
1832 | 1832 | 'enable-timer', |
1833 | 1833 | 'SELECT', |
1834 | 1834 | '', |
@@ -1840,10 +1840,10 @@ discard block |
||
1840 | 1840 | '', |
1841 | 1841 | 'set_sip_config_options' |
1842 | 1842 | ), |
1843 | - array ( |
|
1844 | - gettext ( 'minimum-session-expires' ), |
|
1843 | + array( |
|
1844 | + gettext('minimum-session-expires'), |
|
1845 | 1845 | 'INPUT', |
1846 | - array ( |
|
1846 | + array( |
|
1847 | 1847 | 'name' => 'minimum-session-expires', |
1848 | 1848 | 'value' => '120', |
1849 | 1849 | 'size' => '20', |
@@ -1853,10 +1853,10 @@ discard block |
||
1853 | 1853 | 'tOOL TIP', |
1854 | 1854 | '' |
1855 | 1855 | ), |
1856 | - array ( |
|
1857 | - gettext ( 'session-timeout' ), |
|
1856 | + array( |
|
1857 | + gettext('session-timeout'), |
|
1858 | 1858 | 'INPUT', |
1859 | - array ( |
|
1859 | + array( |
|
1860 | 1860 | 'name' => 'session-timeout-pt', |
1861 | 1861 | 'value' => '1800', |
1862 | 1862 | 'size' => '20', |
@@ -1866,8 +1866,8 @@ discard block |
||
1866 | 1866 | 'tOOL TIP', |
1867 | 1867 | '' |
1868 | 1868 | ), |
1869 | - array ( |
|
1870 | - gettext ( 'auth-calls' ), |
|
1869 | + array( |
|
1870 | + gettext('auth-calls'), |
|
1871 | 1871 | 'auth-calls', |
1872 | 1872 | 'SELECT', |
1873 | 1873 | '', |
@@ -1879,10 +1879,10 @@ discard block |
||
1879 | 1879 | '', |
1880 | 1880 | 'set_sip_config_option' |
1881 | 1881 | ), |
1882 | - array ( |
|
1883 | - gettext ( 'apply-inbound-acl' ), |
|
1882 | + array( |
|
1883 | + gettext('apply-inbound-acl'), |
|
1884 | 1884 | 'INPUT', |
1885 | - array ( |
|
1885 | + array( |
|
1886 | 1886 | 'name' => 'apply-inbound-acl', |
1887 | 1887 | 'value' => 'default', |
1888 | 1888 | 'size' => '20', |
@@ -1892,10 +1892,10 @@ discard block |
||
1892 | 1892 | 'tOOL TIP', |
1893 | 1893 | '' |
1894 | 1894 | ), |
1895 | - array ( |
|
1896 | - gettext ( 'inbound-codec-prefs' ), |
|
1895 | + array( |
|
1896 | + gettext('inbound-codec-prefs'), |
|
1897 | 1897 | 'INPUT', |
1898 | - array ( |
|
1898 | + array( |
|
1899 | 1899 | 'name' => 'inbound-codec-prefs', |
1900 | 1900 | 'size' => '25', |
1901 | 1901 | 'class' => "text field medium" |
@@ -1904,10 +1904,10 @@ discard block |
||
1904 | 1904 | 'tOOL TIP', |
1905 | 1905 | '' |
1906 | 1906 | ), |
1907 | - array ( |
|
1908 | - gettext ( 'outbound-codec-prefs' ), |
|
1907 | + array( |
|
1908 | + gettext('outbound-codec-prefs'), |
|
1909 | 1909 | 'INPUT', |
1910 | - array ( |
|
1910 | + array( |
|
1911 | 1911 | 'name' => 'outbound-codec-prefs', |
1912 | 1912 | 'size' => '25', |
1913 | 1913 | 'class' => "text field medium" |
@@ -1916,8 +1916,8 @@ discard block |
||
1916 | 1916 | 'tOOL TIP', |
1917 | 1917 | '' |
1918 | 1918 | ), |
1919 | - array ( |
|
1920 | - gettext ( 'inbound-late-negotiation' ), |
|
1919 | + array( |
|
1920 | + gettext('inbound-late-negotiation'), |
|
1921 | 1921 | 'inbound-late-negotiation', |
1922 | 1922 | 'SELECT', |
1923 | 1923 | '', |
@@ -1929,10 +1929,10 @@ discard block |
||
1929 | 1929 | '', |
1930 | 1930 | 'set_sip_config_options' |
1931 | 1931 | ), |
1932 | - array ( |
|
1933 | - gettext ( 'inbound-codec-negotiation' ), |
|
1932 | + array( |
|
1933 | + gettext('inbound-codec-negotiation'), |
|
1934 | 1934 | 'INPUT', |
1935 | - array ( |
|
1935 | + array( |
|
1936 | 1936 | 'name' => 'inbound-codec-negotiation', |
1937 | 1937 | 'size' => '25', |
1938 | 1938 | 'class' => "text field medium" |
@@ -1942,16 +1942,16 @@ discard block |
||
1942 | 1942 | '' |
1943 | 1943 | ) |
1944 | 1944 | ); |
1945 | - $form ['button_cancel'] = array ( |
|
1945 | + $form ['button_cancel'] = array( |
|
1946 | 1946 | 'name' => 'action', |
1947 | - 'content' => gettext ( 'Close' ), |
|
1947 | + 'content' => gettext('Close'), |
|
1948 | 1948 | 'value' => 'cancel', |
1949 | 1949 | 'type' => 'button', |
1950 | 1950 | 'class' => 'btn btn-line-sky margin-x-10', |
1951 | 1951 | 'onclick' => 'return redirect_page(\'NULL\')' |
1952 | 1952 | ); |
1953 | - $form ['button_save'] = array ( |
|
1954 | - 'content' => gettext ( 'Save' ), |
|
1953 | + $form ['button_save'] = array( |
|
1954 | + 'content' => gettext('Save'), |
|
1955 | 1955 | 'value' => 'save', |
1956 | 1956 | 'type' => 'button', |
1957 | 1957 | 'id' => 'submit', |
@@ -1962,8 +1962,8 @@ discard block |
||
1962 | 1962 | } |
1963 | 1963 | function build_fssipprofile_list_for_admin() { |
1964 | 1964 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
1965 | - $grid_field_arr = json_encode ( array ( |
|
1966 | - array ( |
|
1965 | + $grid_field_arr = json_encode(array( |
|
1966 | + array( |
|
1967 | 1967 | "<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", |
1968 | 1968 | "30", |
1969 | 1969 | "", |
@@ -1979,8 +1979,8 @@ discard block |
||
1979 | 1979 | * For Sip Profile edit on Profile name |
1980 | 1980 | * * |
1981 | 1981 | */ |
1982 | - array ( |
|
1983 | - gettext ( "Name" ), |
|
1982 | + array( |
|
1983 | + gettext("Name"), |
|
1984 | 1984 | "190", |
1985 | 1985 | "name", |
1986 | 1986 | "", |
@@ -1993,8 +1993,8 @@ discard block |
||
1993 | 1993 | /** |
1994 | 1994 | * ********************************* |
1995 | 1995 | */ |
1996 | - array ( |
|
1997 | - gettext ( "SIP IP" ), |
|
1996 | + array( |
|
1997 | + gettext("SIP IP"), |
|
1998 | 1998 | "205", |
1999 | 1999 | "sip_ip", |
2000 | 2000 | "", |
@@ -2004,8 +2004,8 @@ discard block |
||
2004 | 2004 | "true", |
2005 | 2005 | "center" |
2006 | 2006 | ), |
2007 | - array ( |
|
2008 | - gettext ( "SIP Port" ), |
|
2007 | + array( |
|
2008 | + gettext("SIP Port"), |
|
2009 | 2009 | "200", |
2010 | 2010 | "sip_port", |
2011 | 2011 | "", |
@@ -2019,8 +2019,8 @@ discard block |
||
2019 | 2019 | ASTPP 3.0 |
2020 | 2020 | status show active or inactive |
2021 | 2021 | */ |
2022 | - array ( |
|
2023 | - gettext ( "Status" ), |
|
2022 | + array( |
|
2023 | + gettext("Status"), |
|
2024 | 2024 | "160", |
2025 | 2025 | "status", |
2026 | 2026 | "status", |
@@ -2033,83 +2033,83 @@ discard block |
||
2033 | 2033 | /** |
2034 | 2034 | * **************************************************** |
2035 | 2035 | */ |
2036 | - array ( |
|
2037 | - gettext ( "Profile Action" ), |
|
2036 | + array( |
|
2037 | + gettext("Profile Action"), |
|
2038 | 2038 | "282", |
2039 | 2039 | "", |
2040 | 2040 | "", |
2041 | 2041 | "", |
2042 | - array ( |
|
2043 | - "START" => array ( |
|
2042 | + array( |
|
2043 | + "START" => array( |
|
2044 | 2044 | "url" => "/freeswitch/fssipprofile_action/start/", |
2045 | 2045 | "mode" => "single" |
2046 | 2046 | ), |
2047 | - "STOP" => array ( |
|
2047 | + "STOP" => array( |
|
2048 | 2048 | "url" => "/freeswitch/fssipprofile_action/stop/", |
2049 | 2049 | "mode" => "single" |
2050 | 2050 | ), |
2051 | - "RELOAD" => array ( |
|
2051 | + "RELOAD" => array( |
|
2052 | 2052 | "url" => "/freeswitch/fssipprofile_action/reload/", |
2053 | 2053 | "mode" => "single" |
2054 | 2054 | ), |
2055 | - "RESCAN" => array ( |
|
2055 | + "RESCAN" => array( |
|
2056 | 2056 | "url" => "/freeswitch/fssipprofile_action/rescan/", |
2057 | 2057 | "mode" => "single" |
2058 | 2058 | ) |
2059 | 2059 | ) |
2060 | 2060 | ), |
2061 | - array ( |
|
2062 | - gettext ( "Action" ), |
|
2061 | + array( |
|
2062 | + gettext("Action"), |
|
2063 | 2063 | "202", |
2064 | 2064 | "", |
2065 | 2065 | "", |
2066 | 2066 | "", |
2067 | - array ( |
|
2068 | - "EDIT" => array ( |
|
2067 | + array( |
|
2068 | + "EDIT" => array( |
|
2069 | 2069 | "url" => "/freeswitch/fssipprofile_edit/", |
2070 | 2070 | "mode" => "" |
2071 | 2071 | ), |
2072 | - "DELETE" => array ( |
|
2072 | + "DELETE" => array( |
|
2073 | 2073 | "url" => "/freeswitch/fssipprofile_delete/", |
2074 | 2074 | "mode" => "single" |
2075 | 2075 | ) |
2076 | 2076 | ) |
2077 | 2077 | ) |
2078 | - ) ); |
|
2078 | + )); |
|
2079 | 2079 | return $grid_field_arr; |
2080 | 2080 | } |
2081 | 2081 | function build_fssipprofile_grid_buttons() { |
2082 | - $buttons_json = json_encode ( array ( |
|
2083 | - array ( |
|
2084 | - gettext ( "Create" ), |
|
2082 | + $buttons_json = json_encode(array( |
|
2083 | + array( |
|
2084 | + gettext("Create"), |
|
2085 | 2085 | "btn btn-line-warning btn", |
2086 | 2086 | "fa fa-plus-circle fa-lg", |
2087 | 2087 | "button_action", |
2088 | 2088 | "/freeswitch/fssipprofile_add/", |
2089 | 2089 | "" |
2090 | 2090 | ), |
2091 | - array ( |
|
2092 | - gettext ( "Delete" ), |
|
2091 | + array( |
|
2092 | + gettext("Delete"), |
|
2093 | 2093 | "btn btn-line-danger", |
2094 | 2094 | "fa fa-times-circle fa-lg", |
2095 | 2095 | "button_action", |
2096 | 2096 | "/freeswitch/fssipprofile_delete_multiple/" |
2097 | 2097 | ) |
2098 | - ) ); |
|
2098 | + )); |
|
2099 | 2099 | return $buttons_json; |
2100 | 2100 | } |
2101 | 2101 | function build_fssipprofile_params_list_for_admin() { |
2102 | - $grid_field_arr = json_encode ( array ( |
|
2103 | - array ( |
|
2104 | - gettext ( "Name" ), |
|
2102 | + $grid_field_arr = json_encode(array( |
|
2103 | + array( |
|
2104 | + gettext("Name"), |
|
2105 | 2105 | "450", |
2106 | 2106 | "name", |
2107 | 2107 | "", |
2108 | 2108 | "", |
2109 | 2109 | "" |
2110 | 2110 | ), |
2111 | - array ( |
|
2112 | - gettext ( "Value" ), |
|
2111 | + array( |
|
2112 | + gettext("Value"), |
|
2113 | 2113 | "414", |
2114 | 2114 | "sip_ip", |
2115 | 2115 | "", |
@@ -2117,20 +2117,20 @@ discard block |
||
2117 | 2117 | "" |
2118 | 2118 | ), |
2119 | 2119 | // array("SIP Port", "250", "sip_port", "", "", ""), |
2120 | - array ( |
|
2121 | - gettext ( "Action" ), |
|
2120 | + array( |
|
2121 | + gettext("Action"), |
|
2122 | 2122 | "400", |
2123 | 2123 | "", |
2124 | 2124 | "", |
2125 | 2125 | "", |
2126 | - array ( |
|
2127 | - "DELETE" => array ( |
|
2126 | + array( |
|
2127 | + "DELETE" => array( |
|
2128 | 2128 | "url" => "/freeswitch/fssipprofile_delete/", |
2129 | 2129 | "mode" => "single" |
2130 | 2130 | ) |
2131 | 2131 | ) |
2132 | 2132 | ) |
2133 | - ) ); |
|
2133 | + )); |
|
2134 | 2134 | return $grid_field_arr; |
2135 | 2135 | } |
2136 | 2136 | /* |
@@ -2139,9 +2139,9 @@ discard block |
||
2139 | 2139 | */ |
2140 | 2140 | function build_fsserver_list() { |
2141 | 2141 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
2142 | - $grid_field_arr = json_encode ( array ( |
|
2143 | - array ( |
|
2144 | - gettext ( "Host" ), |
|
2142 | + $grid_field_arr = json_encode(array( |
|
2143 | + array( |
|
2144 | + gettext("Host"), |
|
2145 | 2145 | "200", |
2146 | 2146 | "freeswitch_host", |
2147 | 2147 | "", |
@@ -2151,8 +2151,8 @@ discard block |
||
2151 | 2151 | "true", |
2152 | 2152 | "center" |
2153 | 2153 | ), |
2154 | - array ( |
|
2155 | - gettext ( "Password" ), |
|
2154 | + array( |
|
2155 | + gettext("Password"), |
|
2156 | 2156 | "200", |
2157 | 2157 | "freeswitch_password", |
2158 | 2158 | "", |
@@ -2162,8 +2162,8 @@ discard block |
||
2162 | 2162 | "true", |
2163 | 2163 | "center" |
2164 | 2164 | ), |
2165 | - array ( |
|
2166 | - gettext ( "Port" ), |
|
2165 | + array( |
|
2166 | + gettext("Port"), |
|
2167 | 2167 | "200", |
2168 | 2168 | "freeswitch_port", |
2169 | 2169 | "", |
@@ -2176,8 +2176,8 @@ discard block |
||
2176 | 2176 | /* |
2177 | 2177 | ASTPP 3.0 .3 creation field show in grid |
2178 | 2178 | */ |
2179 | - array ( |
|
2180 | - gettext ( "Status" ), |
|
2179 | + array( |
|
2180 | + gettext("Status"), |
|
2181 | 2181 | "145", |
2182 | 2182 | "status", |
2183 | 2183 | "status", |
@@ -2187,8 +2187,8 @@ discard block |
||
2187 | 2187 | "true", |
2188 | 2188 | "center" |
2189 | 2189 | ), |
2190 | - array ( |
|
2191 | - gettext ( "Created Date" ), |
|
2190 | + array( |
|
2191 | + gettext("Created Date"), |
|
2192 | 2192 | "170", |
2193 | 2193 | "creation_date", |
2194 | 2194 | "creation_date", |
@@ -2198,8 +2198,8 @@ discard block |
||
2198 | 2198 | "true", |
2199 | 2199 | "center" |
2200 | 2200 | ), |
2201 | - array ( |
|
2202 | - gettext ( "Modified Date" ), |
|
2201 | + array( |
|
2202 | + gettext("Modified Date"), |
|
2203 | 2203 | "170", |
2204 | 2204 | "last_modified_date", |
2205 | 2205 | "last_modified_date", |
@@ -2213,33 +2213,33 @@ discard block |
||
2213 | 2213 | * ***************************************************************** |
2214 | 2214 | */ |
2215 | 2215 | |
2216 | - array ( |
|
2217 | - gettext ( "Action" ), |
|
2216 | + array( |
|
2217 | + gettext("Action"), |
|
2218 | 2218 | "182", |
2219 | 2219 | "", |
2220 | 2220 | "", |
2221 | 2221 | "", |
2222 | - array ( |
|
2223 | - "EDIT" => array ( |
|
2222 | + array( |
|
2223 | + "EDIT" => array( |
|
2224 | 2224 | "url" => "/freeswitch/fsserver_edit/", |
2225 | 2225 | "mode" => "popup" |
2226 | 2226 | ), |
2227 | - "DELETE" => array ( |
|
2227 | + "DELETE" => array( |
|
2228 | 2228 | "url" => "/freeswitch/fsserver_delete/", |
2229 | 2229 | "mode" => "single" |
2230 | 2230 | ) |
2231 | 2231 | ) |
2232 | 2232 | ) |
2233 | - ) ); |
|
2233 | + )); |
|
2234 | 2234 | return $grid_field_arr; |
2235 | 2235 | } |
2236 | 2236 | /** |
2237 | 2237 | * *********************************************** |
2238 | 2238 | */ |
2239 | 2239 | function build_fsserver_grid_buttons() { |
2240 | - $buttons_json = json_encode ( array ( |
|
2241 | - array ( |
|
2242 | - gettext ( "Create" ), |
|
2240 | + $buttons_json = json_encode(array( |
|
2241 | + array( |
|
2242 | + gettext("Create"), |
|
2243 | 2243 | "btn btn-line-warning btn", |
2244 | 2244 | "fa fa-plus-circle fa-lg", |
2245 | 2245 | "button_action", |
@@ -2252,18 +2252,18 @@ discard block |
||
2252 | 2252 | return $buttons_json; |
2253 | 2253 | } |
2254 | 2254 | function get_form_fsserver_fields() { |
2255 | - $form ['forms'] = array ( |
|
2256 | - base_url () . '/freeswitch/fsserver_save/', |
|
2257 | - array ( |
|
2255 | + $form ['forms'] = array( |
|
2256 | + base_url().'/freeswitch/fsserver_save/', |
|
2257 | + array( |
|
2258 | 2258 | "id" => "fsserver_form", |
2259 | 2259 | "name" => "fsserver_form" |
2260 | 2260 | ) |
2261 | 2261 | ); |
2262 | - $form [gettext ( 'Freeswitch Server Information' )] = array ( |
|
2263 | - array ( |
|
2262 | + $form [gettext('Freeswitch Server Information')] = array( |
|
2263 | + array( |
|
2264 | 2264 | '', |
2265 | 2265 | 'HIDDEN', |
2266 | - array ( |
|
2266 | + array( |
|
2267 | 2267 | 'name' => 'id' |
2268 | 2268 | ), |
2269 | 2269 | '', |
@@ -2271,10 +2271,10 @@ discard block |
||
2271 | 2271 | '', |
2272 | 2272 | '' |
2273 | 2273 | ), |
2274 | - array ( |
|
2275 | - gettext ( 'Host' ), |
|
2274 | + array( |
|
2275 | + gettext('Host'), |
|
2276 | 2276 | 'INPUT', |
2277 | - array ( |
|
2277 | + array( |
|
2278 | 2278 | 'name' => 'freeswitch_host', |
2279 | 2279 | 'size' => '20', |
2280 | 2280 | 'class' => "text field medium" |
@@ -2283,10 +2283,10 @@ discard block |
||
2283 | 2283 | 'tOOL TIP', |
2284 | 2284 | 'Please Enter account number' |
2285 | 2285 | ), |
2286 | - array ( |
|
2287 | - gettext ( 'Password' ), |
|
2286 | + array( |
|
2287 | + gettext('Password'), |
|
2288 | 2288 | 'INPUT', |
2289 | - array ( |
|
2289 | + array( |
|
2290 | 2290 | 'name' => 'freeswitch_password', |
2291 | 2291 | 'size' => '20', |
2292 | 2292 | 'class' => "text field medium" |
@@ -2295,10 +2295,10 @@ discard block |
||
2295 | 2295 | 'tOOL TIP', |
2296 | 2296 | 'Please Enter account number' |
2297 | 2297 | ), |
2298 | - array ( |
|
2299 | - gettext ( 'Port' ), |
|
2298 | + array( |
|
2299 | + gettext('Port'), |
|
2300 | 2300 | 'INPUT', |
2301 | - array ( |
|
2301 | + array( |
|
2302 | 2302 | 'name' => 'freeswitch_port', |
2303 | 2303 | 'size' => '20', |
2304 | 2304 | 'class' => "text field medium" |
@@ -2309,17 +2309,17 @@ discard block |
||
2309 | 2309 | ) |
2310 | 2310 | ); |
2311 | 2311 | |
2312 | - $form ['button_cancel'] = array ( |
|
2312 | + $form ['button_cancel'] = array( |
|
2313 | 2313 | 'name' => 'action', |
2314 | - 'content' => gettext ( 'Close' ), |
|
2314 | + 'content' => gettext('Close'), |
|
2315 | 2315 | 'value' => 'cancel', |
2316 | 2316 | 'type' => 'button', |
2317 | 2317 | 'class' => 'btn btn-line-sky margin-x-10', |
2318 | 2318 | 'onclick' => 'return redirect_page(\'NULL\')' |
2319 | 2319 | ); |
2320 | - $form ['button_save'] = array ( |
|
2320 | + $form ['button_save'] = array( |
|
2321 | 2321 | 'name' => 'action', |
2322 | - 'content' => gettext ( 'Save' ), |
|
2322 | + 'content' => gettext('Save'), |
|
2323 | 2323 | 'value' => 'save', |
2324 | 2324 | 'id' => 'submit', |
2325 | 2325 | 'type' => 'button', |
@@ -2329,17 +2329,17 @@ discard block |
||
2329 | 2329 | return $form; |
2330 | 2330 | } |
2331 | 2331 | function get_search_fsserver_form() { |
2332 | - $form ['forms'] = array ( |
|
2332 | + $form ['forms'] = array( |
|
2333 | 2333 | "", |
2334 | - array ( |
|
2334 | + array( |
|
2335 | 2335 | 'id' => "fsserver_search" |
2336 | 2336 | ) |
2337 | 2337 | ); |
2338 | - $form [gettext ( 'Search' )] = array ( |
|
2339 | - array ( |
|
2340 | - gettext ( 'Host' ), |
|
2338 | + $form [gettext('Search')] = array( |
|
2339 | + array( |
|
2340 | + gettext('Host'), |
|
2341 | 2341 | 'INPUT', |
2342 | - array ( |
|
2342 | + array( |
|
2343 | 2343 | 'name' => 'freeswitch_host[freeswitch_host]', |
2344 | 2344 | '', |
2345 | 2345 | 'id' => 'first_name', |
@@ -2356,10 +2356,10 @@ discard block |
||
2356 | 2356 | 'search_string_type', |
2357 | 2357 | '' |
2358 | 2358 | ), |
2359 | - array ( |
|
2360 | - gettext ( 'Port' ), |
|
2359 | + array( |
|
2360 | + gettext('Port'), |
|
2361 | 2361 | 'INPUT', |
2362 | - array ( |
|
2362 | + array( |
|
2363 | 2363 | 'name' => 'freeswitch_port[freeswitch_port]', |
2364 | 2364 | 'value' => '', |
2365 | 2365 | 'size' => '20', |
@@ -2375,8 +2375,8 @@ discard block |
||
2375 | 2375 | 'search_string_type', |
2376 | 2376 | '' |
2377 | 2377 | ), |
2378 | - array ( |
|
2379 | - gettext ( 'Status' ), |
|
2378 | + array( |
|
2379 | + gettext('Status'), |
|
2380 | 2380 | 'status', |
2381 | 2381 | 'SELECT', |
2382 | 2382 | '', |
@@ -2388,7 +2388,7 @@ discard block |
||
2388 | 2388 | '', |
2389 | 2389 | 'set_search_status' |
2390 | 2390 | ), |
2391 | - array ( |
|
2391 | + array( |
|
2392 | 2392 | '', |
2393 | 2393 | 'HIDDEN', |
2394 | 2394 | 'ajax_search', |
@@ -2397,7 +2397,7 @@ discard block |
||
2397 | 2397 | '', |
2398 | 2398 | '' |
2399 | 2399 | ), |
2400 | - array ( |
|
2400 | + array( |
|
2401 | 2401 | '', |
2402 | 2402 | 'HIDDEN', |
2403 | 2403 | 'advance_search', |
@@ -2407,18 +2407,18 @@ discard block |
||
2407 | 2407 | '' |
2408 | 2408 | ) |
2409 | 2409 | ); |
2410 | - $form ['button_search'] = array ( |
|
2410 | + $form ['button_search'] = array( |
|
2411 | 2411 | 'name' => 'action', |
2412 | 2412 | 'id' => "fsserver_search_btn", |
2413 | - 'content' => gettext ( 'Search' ), |
|
2413 | + 'content' => gettext('Search'), |
|
2414 | 2414 | 'value' => 'save', |
2415 | 2415 | 'type' => 'button', |
2416 | 2416 | 'class' => 'btn btn-line-parrot pull-right' |
2417 | 2417 | ); |
2418 | - $form ['button_reset'] = array ( |
|
2418 | + $form ['button_reset'] = array( |
|
2419 | 2419 | 'name' => 'action', |
2420 | 2420 | 'id' => "id_reset", |
2421 | - 'content' => gettext ( 'Clear' ), |
|
2421 | + 'content' => gettext('Clear'), |
|
2422 | 2422 | 'value' => 'cancel', |
2423 | 2423 | 'type' => 'reset', |
2424 | 2424 | 'class' => 'btn btn-line-sky pull-right margin-x-10' |
@@ -2431,8 +2431,8 @@ discard block |
||
2431 | 2431 | * CHanges in grid size |
2432 | 2432 | */ |
2433 | 2433 | function build_devices_list_for_customer() { |
2434 | - $grid_field_arr = json_encode ( array ( |
|
2435 | - array ( |
|
2434 | + $grid_field_arr = json_encode(array( |
|
2435 | + array( |
|
2436 | 2436 | "<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", |
2437 | 2437 | "30", |
2438 | 2438 | "", |
@@ -2443,8 +2443,8 @@ discard block |
||
2443 | 2443 | "false", |
2444 | 2444 | "center" |
2445 | 2445 | ), |
2446 | - array ( |
|
2447 | - gettext ( "User Name" ), |
|
2446 | + array( |
|
2447 | + gettext("User Name"), |
|
2448 | 2448 | "100", |
2449 | 2449 | "username", |
2450 | 2450 | "", |
@@ -2454,8 +2454,8 @@ discard block |
||
2454 | 2454 | "true", |
2455 | 2455 | "center" |
2456 | 2456 | ), |
2457 | - array ( |
|
2458 | - gettext ( "Password" ), |
|
2457 | + array( |
|
2458 | + gettext("Password"), |
|
2459 | 2459 | "100", |
2460 | 2460 | "password", |
2461 | 2461 | "", |
@@ -2465,8 +2465,8 @@ discard block |
||
2465 | 2465 | "true", |
2466 | 2466 | "center" |
2467 | 2467 | ), |
2468 | - array ( |
|
2469 | - gettext ( "SIP Profile" ), |
|
2468 | + array( |
|
2469 | + gettext("SIP Profile"), |
|
2470 | 2470 | "90", |
2471 | 2471 | "sip_profile_id", |
2472 | 2472 | "name", |
@@ -2476,8 +2476,8 @@ discard block |
||
2476 | 2476 | "true", |
2477 | 2477 | "center" |
2478 | 2478 | ), |
2479 | - array ( |
|
2480 | - gettext ( "Caller Name" ), |
|
2479 | + array( |
|
2480 | + gettext("Caller Name"), |
|
2481 | 2481 | "100", |
2482 | 2482 | "effective_caller_id_name", |
2483 | 2483 | "", |
@@ -2487,8 +2487,8 @@ discard block |
||
2487 | 2487 | "true", |
2488 | 2488 | "center" |
2489 | 2489 | ), |
2490 | - array ( |
|
2491 | - gettext ( "Caller Number" ), |
|
2490 | + array( |
|
2491 | + gettext("Caller Number"), |
|
2492 | 2492 | "100", |
2493 | 2493 | "effective_caller_id_number", |
2494 | 2494 | "", |
@@ -2498,8 +2498,8 @@ discard block |
||
2498 | 2498 | "true", |
2499 | 2499 | "center" |
2500 | 2500 | ), |
2501 | - array ( |
|
2502 | - gettext ( "Voicemail" ), |
|
2501 | + array( |
|
2502 | + gettext("Voicemail"), |
|
2503 | 2503 | "100", |
2504 | 2504 | "voicemail_enabled", |
2505 | 2505 | "", |
@@ -2510,8 +2510,8 @@ discard block |
||
2510 | 2510 | "center" |
2511 | 2511 | ), |
2512 | 2512 | // array("Call Waiting", "105", "call_waiting", "", "", ""), |
2513 | - array ( |
|
2514 | - gettext ( "Status" ), |
|
2513 | + array( |
|
2514 | + gettext("Status"), |
|
2515 | 2515 | "100", |
2516 | 2516 | "status", |
2517 | 2517 | "", |
@@ -2521,8 +2521,8 @@ discard block |
||
2521 | 2521 | "true", |
2522 | 2522 | "center" |
2523 | 2523 | ), |
2524 | - array ( |
|
2525 | - gettext ( "Created Date" ), |
|
2524 | + array( |
|
2525 | + gettext("Created Date"), |
|
2526 | 2526 | "100", |
2527 | 2527 | "creation_date", |
2528 | 2528 | "creation_date", |
@@ -2532,8 +2532,8 @@ discard block |
||
2532 | 2532 | "true", |
2533 | 2533 | "center" |
2534 | 2534 | ), |
2535 | - array ( |
|
2536 | - gettext ( "Modified Date" ), |
|
2535 | + array( |
|
2536 | + gettext("Modified Date"), |
|
2537 | 2537 | "100", |
2538 | 2538 | "last_modified_date", |
2539 | 2539 | "last_modified_date", |
@@ -2543,24 +2543,24 @@ discard block |
||
2543 | 2543 | "true", |
2544 | 2544 | "center" |
2545 | 2545 | ), |
2546 | - array ( |
|
2547 | - gettext ( "Action" ), |
|
2546 | + array( |
|
2547 | + gettext("Action"), |
|
2548 | 2548 | "110", |
2549 | 2549 | "", |
2550 | 2550 | "", |
2551 | 2551 | "", |
2552 | - array ( |
|
2553 | - "EDIT" => array ( |
|
2552 | + array( |
|
2553 | + "EDIT" => array( |
|
2554 | 2554 | "url" => "/accounts/fssipdevices_action/edit/", |
2555 | 2555 | "mode" => "single" |
2556 | 2556 | ), |
2557 | - "DELETE" => array ( |
|
2557 | + "DELETE" => array( |
|
2558 | 2558 | "url" => "/accounts/fssipdevices_action/delete/", |
2559 | 2559 | "mode" => "single" |
2560 | 2560 | ) |
2561 | 2561 | ) |
2562 | 2562 | ) |
2563 | - ) ); |
|
2563 | + )); |
|
2564 | 2564 | return $grid_field_arr; |
2565 | 2565 | } |
2566 | 2566 | |
@@ -2570,23 +2570,23 @@ discard block |
||
2570 | 2570 | function fsdevice_form_fields_for_customer($accountid, $id = false) { |
2571 | 2571 | |
2572 | 2572 | // $val = $id > 0 ? 'sip_devices.username.' . $id : 'sip_devices.username'; |
2573 | - $val = $id > 0 ? 'sip_devices.username.' . $id : 'sip_devices.username'; |
|
2574 | - $uname_user = $this->CI->common->find_uniq_rendno ( '10', '', '' ); |
|
2575 | - $password = $this->CI->common->generate_password (); |
|
2576 | - if ($this->CI->session->userdata ( "logintype" ) == '0' || $this->CI->session->userdata ( "logintype" ) == '3') { |
|
2577 | - $link = base_url () . 'freeswitch/user_fssipdevices_save/true'; |
|
2578 | - $form ['forms'] = array ( |
|
2573 | + $val = $id > 0 ? 'sip_devices.username.'.$id : 'sip_devices.username'; |
|
2574 | + $uname_user = $this->CI->common->find_uniq_rendno('10', '', ''); |
|
2575 | + $password = $this->CI->common->generate_password(); |
|
2576 | + if ($this->CI->session->userdata("logintype") == '0' || $this->CI->session->userdata("logintype") == '3') { |
|
2577 | + $link = base_url().'freeswitch/user_fssipdevices_save/true'; |
|
2578 | + $form ['forms'] = array( |
|
2579 | 2579 | $link, |
2580 | - array ( |
|
2580 | + array( |
|
2581 | 2581 | "id" => "sipdevices_form", |
2582 | 2582 | "name" => "sipdevices_form" |
2583 | 2583 | ) |
2584 | 2584 | ); |
2585 | - $form [gettext ( 'Device Information' )] = array ( |
|
2586 | - array ( |
|
2585 | + $form [gettext('Device Information')] = array( |
|
2586 | + array( |
|
2587 | 2587 | '', |
2588 | 2588 | 'HIDDEN', |
2589 | - array ( |
|
2589 | + array( |
|
2590 | 2590 | 'name' => 'id' |
2591 | 2591 | ), |
2592 | 2592 | '', |
@@ -2594,10 +2594,10 @@ discard block |
||
2594 | 2594 | '', |
2595 | 2595 | '' |
2596 | 2596 | ), |
2597 | - array ( |
|
2597 | + array( |
|
2598 | 2598 | '', |
2599 | 2599 | 'HIDDEN', |
2600 | - array ( |
|
2600 | + array( |
|
2601 | 2601 | 'name' => 'accountcode', |
2602 | 2602 | 'value' => $accountid |
2603 | 2603 | ), |
@@ -2606,25 +2606,25 @@ discard block |
||
2606 | 2606 | '', |
2607 | 2607 | '' |
2608 | 2608 | ), |
2609 | - array ( |
|
2610 | - gettext ( 'Username' ), |
|
2609 | + array( |
|
2610 | + gettext('Username'), |
|
2611 | 2611 | 'INPUT', |
2612 | - array ( |
|
2612 | + array( |
|
2613 | 2613 | 'name' => 'fs_username', |
2614 | 2614 | 'size' => '20', |
2615 | 2615 | 'value' => $uname_user, |
2616 | 2616 | 'id' => 'username', |
2617 | 2617 | 'class' => "text field medium" |
2618 | 2618 | ), |
2619 | - 'trim|required|is_unique[' . $val . ']|xss_clean', |
|
2619 | + 'trim|required|is_unique['.$val.']|xss_clean', |
|
2620 | 2620 | 'tOOL TIP', |
2621 | 2621 | 'Please Enter account number', |
2622 | 2622 | '<i style="cursor:pointer;color:#1BCB61 !important;font-size:14px; padding-left:5px; padding-top:8px; float:left; " title="Reset Password" class="change_number fa fa-refresh"></i>' |
2623 | 2623 | ), |
2624 | - array ( |
|
2625 | - gettext ( 'Password' ), |
|
2624 | + array( |
|
2625 | + gettext('Password'), |
|
2626 | 2626 | 'INPUT', |
2627 | - array ( |
|
2627 | + array( |
|
2628 | 2628 | 'name' => 'fs_password', |
2629 | 2629 | 'size' => '20', |
2630 | 2630 | 'id' => 'password1', |
@@ -2636,10 +2636,10 @@ discard block |
||
2636 | 2636 | 'Please Enter Password', |
2637 | 2637 | '<i style="cursor:pointer;color:#1BCB61 !important; font-size:14px; padding-left:5px; padding-top:8px; float:left;" title="Reset Password" class="change_pass fa fa-refresh"></i>' |
2638 | 2638 | ), |
2639 | - array ( |
|
2640 | - gettext ( 'Caller Name' ), |
|
2639 | + array( |
|
2640 | + gettext('Caller Name'), |
|
2641 | 2641 | 'INPUT', |
2642 | - array ( |
|
2642 | + array( |
|
2643 | 2643 | 'name' => 'effective_caller_id_name', |
2644 | 2644 | 'size' => '20', |
2645 | 2645 | 'class' => "text field medium" |
@@ -2648,10 +2648,10 @@ discard block |
||
2648 | 2648 | 'tOOL TIP', |
2649 | 2649 | 'Please Enter account number' |
2650 | 2650 | ), |
2651 | - array ( |
|
2652 | - gettext ( 'Caller Number' ), |
|
2651 | + array( |
|
2652 | + gettext('Caller Number'), |
|
2653 | 2653 | 'INPUT', |
2654 | - array ( |
|
2654 | + array( |
|
2655 | 2655 | 'name' => 'effective_caller_id_number', |
2656 | 2656 | 'size' => '20', |
2657 | 2657 | 'class' => "text field medium" |
@@ -2661,8 +2661,8 @@ discard block |
||
2661 | 2661 | 'Please Enter account number' |
2662 | 2662 | ), |
2663 | 2663 | // array('Call Waiting', 'call_waiting', 'SELECT', '', '', 'tOOL TIP', 'Please Select Status', '', '', '', 'set_call_waiting'), |
2664 | - array ( |
|
2665 | - gettext ( 'Status' ), |
|
2664 | + array( |
|
2665 | + gettext('Status'), |
|
2666 | 2666 | 'status', |
2667 | 2667 | 'SELECT', |
2668 | 2668 | '', |
@@ -2681,10 +2681,10 @@ discard block |
||
2681 | 2681 | * Voicemail add edit |
2682 | 2682 | * ***** |
2683 | 2683 | */ |
2684 | - $form [gettext ( 'Voicemail Options' )] = array ( |
|
2684 | + $form [gettext('Voicemail Options')] = array( |
|
2685 | 2685 | |
2686 | - array ( |
|
2687 | - gettext ( 'Enable' ), |
|
2686 | + array( |
|
2687 | + gettext('Enable'), |
|
2688 | 2688 | 'voicemail_enabled', |
2689 | 2689 | 'SELECT', |
2690 | 2690 | '', |
@@ -2697,10 +2697,10 @@ discard block |
||
2697 | 2697 | 'set_sip_config_option' |
2698 | 2698 | ), |
2699 | 2699 | |
2700 | - array ( |
|
2701 | - gettext ( 'Password' ), |
|
2700 | + array( |
|
2701 | + gettext('Password'), |
|
2702 | 2702 | 'INPUT', |
2703 | - array ( |
|
2703 | + array( |
|
2704 | 2704 | 'name' => 'voicemail_password', |
2705 | 2705 | 'size' => '20', |
2706 | 2706 | 'class' => "text field medium" |
@@ -2709,10 +2709,10 @@ discard block |
||
2709 | 2709 | 'tOOL TIP', |
2710 | 2710 | 'Please Enter account number' |
2711 | 2711 | ), |
2712 | - array ( |
|
2713 | - gettext ( 'Mail To' ), |
|
2712 | + array( |
|
2713 | + gettext('Mail To'), |
|
2714 | 2714 | 'INPUT', |
2715 | - array ( |
|
2715 | + array( |
|
2716 | 2716 | 'name' => 'voicemail_mail_to', |
2717 | 2717 | 'size' => '20', |
2718 | 2718 | 'class' => "text field medium" |
@@ -2722,8 +2722,8 @@ discard block |
||
2722 | 2722 | 'Please Enter account number' |
2723 | 2723 | ), |
2724 | 2724 | |
2725 | - array ( |
|
2726 | - gettext ( 'Attach File' ), |
|
2725 | + array( |
|
2726 | + gettext('Attach File'), |
|
2727 | 2727 | 'voicemail_attach_file', |
2728 | 2728 | 'SELECT', |
2729 | 2729 | '', |
@@ -2735,8 +2735,8 @@ discard block |
||
2735 | 2735 | '', |
2736 | 2736 | 'custom_status_voicemail' |
2737 | 2737 | ), |
2738 | - array ( |
|
2739 | - gettext ( 'Local After Email' ), |
|
2738 | + array( |
|
2739 | + gettext('Local After Email'), |
|
2740 | 2740 | 'vm_keep_local_after_email', |
2741 | 2741 | 'SELECT', |
2742 | 2742 | '', |
@@ -2749,11 +2749,11 @@ discard block |
||
2749 | 2749 | 'custom_status_voicemail' |
2750 | 2750 | ), |
2751 | 2751 | |
2752 | - array ( |
|
2753 | - gettext ( 'Send all Message' ), |
|
2752 | + array( |
|
2753 | + gettext('Send all Message'), |
|
2754 | 2754 | 'vm_send_all_message', |
2755 | 2755 | 'CHECKBOX', |
2756 | - array ( |
|
2756 | + array( |
|
2757 | 2757 | 'name' => 'vm_send_all_message', |
2758 | 2758 | 'value' => 'on', |
2759 | 2759 | 'checked' => false |
@@ -2775,7 +2775,7 @@ discard block |
||
2775 | 2775 | if ($accountid) { |
2776 | 2776 | $account_Arr = null; |
2777 | 2777 | } else { |
2778 | - $account_Arr = array ( |
|
2778 | + $account_Arr = array( |
|
2779 | 2779 | 'Account', |
2780 | 2780 | 'accountcode', |
2781 | 2781 | 'SELECT', |
@@ -2788,18 +2788,18 @@ discard block |
||
2788 | 2788 | 'accounts', |
2789 | 2789 | 'build_concat_dropdown', |
2790 | 2790 | 'where_arr', |
2791 | - array ( |
|
2791 | + array( |
|
2792 | 2792 | "reseller_id" => "0", |
2793 | 2793 | "type" => "0", |
2794 | 2794 | "deleted" => "0" |
2795 | 2795 | ) |
2796 | 2796 | ); |
2797 | 2797 | } |
2798 | - if ($this->CI->session->userdata ( "logintype" ) == '1') { |
|
2798 | + if ($this->CI->session->userdata("logintype") == '1') { |
|
2799 | 2799 | $sip_pro = null; |
2800 | - $link = base_url () . 'freeswitch/customer_fssipdevices_save/true'; |
|
2800 | + $link = base_url().'freeswitch/customer_fssipdevices_save/true'; |
|
2801 | 2801 | } else { |
2802 | - $sip_pro = array ( |
|
2802 | + $sip_pro = array( |
|
2803 | 2803 | 'SIP Profile', |
2804 | 2804 | 'sip_profile_id', |
2805 | 2805 | 'SELECT', |
@@ -2814,21 +2814,21 @@ discard block |
||
2814 | 2814 | '', |
2815 | 2815 | '' |
2816 | 2816 | ); |
2817 | - $link = base_url () . 'freeswitch/fssipdevices_save/true'; |
|
2817 | + $link = base_url().'freeswitch/fssipdevices_save/true'; |
|
2818 | 2818 | } |
2819 | - $form ['forms'] = array ( |
|
2819 | + $form ['forms'] = array( |
|
2820 | 2820 | $link, |
2821 | - array ( |
|
2821 | + array( |
|
2822 | 2822 | "id" => "sipdevices_form", |
2823 | 2823 | "name" => "sipdevices_form" |
2824 | 2824 | ) |
2825 | 2825 | ); |
2826 | 2826 | /* Add sipdevice */ |
2827 | - $form [gettext ( 'Device Information' )] = array ( |
|
2828 | - array ( |
|
2827 | + $form [gettext('Device Information')] = array( |
|
2828 | + array( |
|
2829 | 2829 | '', |
2830 | 2830 | 'HIDDEN', |
2831 | - array ( |
|
2831 | + array( |
|
2832 | 2832 | 'name' => 'id' |
2833 | 2833 | ), |
2834 | 2834 | '', |
@@ -2836,10 +2836,10 @@ discard block |
||
2836 | 2836 | '', |
2837 | 2837 | '' |
2838 | 2838 | ), |
2839 | - array ( |
|
2839 | + array( |
|
2840 | 2840 | '', |
2841 | 2841 | 'HIDDEN', |
2842 | - array ( |
|
2842 | + array( |
|
2843 | 2843 | 'name' => 'accountcode', |
2844 | 2844 | 'value' => $accountid |
2845 | 2845 | ), |
@@ -2848,25 +2848,25 @@ discard block |
||
2848 | 2848 | '', |
2849 | 2849 | '' |
2850 | 2850 | ), |
2851 | - array ( |
|
2852 | - gettext ( 'Username' ), |
|
2851 | + array( |
|
2852 | + gettext('Username'), |
|
2853 | 2853 | 'INPUT', |
2854 | - array ( |
|
2854 | + array( |
|
2855 | 2855 | 'name' => 'fs_username', |
2856 | 2856 | 'size' => '20', |
2857 | 2857 | 'value' => $uname_user, |
2858 | 2858 | 'id' => 'username1', |
2859 | 2859 | 'class' => "text field medium" |
2860 | 2860 | ), |
2861 | - 'trim|required|is_unique[' . $val . ']|xss_clean', |
|
2861 | + 'trim|required|is_unique['.$val.']|xss_clean', |
|
2862 | 2862 | 'tOOL TIP', |
2863 | 2863 | 'Please Enter account number', |
2864 | 2864 | '<i style="cursor:pointer; color:#1BCB61; font-size:14px; padding-left:5px; padding-top:8px; float:left;" title="Reset Password" class="change_number fa fa-refresh"></i>' |
2865 | 2865 | ), |
2866 | - array ( |
|
2867 | - gettext ( 'Password' ), |
|
2866 | + array( |
|
2867 | + gettext('Password'), |
|
2868 | 2868 | 'INPUT', |
2869 | - array ( |
|
2869 | + array( |
|
2870 | 2870 | 'name' => 'fs_password', |
2871 | 2871 | 'size' => '20', |
2872 | 2872 | 'id' => 'password1', |
@@ -2878,10 +2878,10 @@ discard block |
||
2878 | 2878 | 'Please Enter Password', |
2879 | 2879 | '<i style="cursor:pointer; color:#1BCB61; font-size:14px; padding-left:5px;padding-top:8px; float:left;" title="Reset Password" class="change_pass fa fa-refresh"></i>' |
2880 | 2880 | ), |
2881 | - array ( |
|
2882 | - gettext ( 'Caller Name' ), |
|
2881 | + array( |
|
2882 | + gettext('Caller Name'), |
|
2883 | 2883 | 'INPUT', |
2884 | - array ( |
|
2884 | + array( |
|
2885 | 2885 | 'name' => 'effective_caller_id_name', |
2886 | 2886 | 'size' => '20', |
2887 | 2887 | 'class' => "text field medium" |
@@ -2890,10 +2890,10 @@ discard block |
||
2890 | 2890 | 'tOOL TIP', |
2891 | 2891 | 'Please Enter account number' |
2892 | 2892 | ), |
2893 | - array ( |
|
2894 | - gettext ( 'Caller Number' ), |
|
2893 | + array( |
|
2894 | + gettext('Caller Number'), |
|
2895 | 2895 | 'INPUT', |
2896 | - array ( |
|
2896 | + array( |
|
2897 | 2897 | 'name' => 'effective_caller_id_number', |
2898 | 2898 | 'size' => '20', |
2899 | 2899 | 'class' => "text field medium" |
@@ -2903,8 +2903,8 @@ discard block |
||
2903 | 2903 | 'Please Enter account number' |
2904 | 2904 | ), |
2905 | 2905 | $account_Arr, |
2906 | - array ( |
|
2907 | - gettext ( 'Status' ), |
|
2906 | + array( |
|
2907 | + gettext('Status'), |
|
2908 | 2908 | 'status', |
2909 | 2909 | 'SELECT', |
2910 | 2910 | '', |
@@ -2924,9 +2924,9 @@ discard block |
||
2924 | 2924 | * Voicemail add edit |
2925 | 2925 | * ***** |
2926 | 2926 | */ |
2927 | - $form [gettext ( 'Voicemail Options' )] = array ( |
|
2928 | - array ( |
|
2929 | - gettext ( 'Enable' ), |
|
2927 | + $form [gettext('Voicemail Options')] = array( |
|
2928 | + array( |
|
2929 | + gettext('Enable'), |
|
2930 | 2930 | 'voicemail_enabled', |
2931 | 2931 | 'SELECT', |
2932 | 2932 | '', |
@@ -2938,10 +2938,10 @@ discard block |
||
2938 | 2938 | '', |
2939 | 2939 | 'set_sip_config_option' |
2940 | 2940 | ), |
2941 | - array ( |
|
2942 | - gettext ( 'Password' ), |
|
2941 | + array( |
|
2942 | + gettext('Password'), |
|
2943 | 2943 | 'INPUT', |
2944 | - array ( |
|
2944 | + array( |
|
2945 | 2945 | 'name' => 'voicemail_password', |
2946 | 2946 | 'size' => '20', |
2947 | 2947 | 'class' => "text field medium" |
@@ -2950,10 +2950,10 @@ discard block |
||
2950 | 2950 | 'tOOL TIP', |
2951 | 2951 | 'PleaseEnter account number' |
2952 | 2952 | ), |
2953 | - array ( |
|
2954 | - gettext ( 'Mail To' ), |
|
2953 | + array( |
|
2954 | + gettext('Mail To'), |
|
2955 | 2955 | 'INPUT', |
2956 | - array ( |
|
2956 | + array( |
|
2957 | 2957 | 'name' => 'voicemail_mail_to', |
2958 | 2958 | 'size' => '20', |
2959 | 2959 | 'class' => "text field medium" |
@@ -2962,8 +2962,8 @@ discard block |
||
2962 | 2962 | 'tOOL TIP', |
2963 | 2963 | 'Please Enter account number' |
2964 | 2964 | ), |
2965 | - array ( |
|
2966 | - gettext ( 'Attach File' ), |
|
2965 | + array( |
|
2966 | + gettext('Attach File'), |
|
2967 | 2967 | 'voicemail_attach_file', |
2968 | 2968 | 'SELECT', |
2969 | 2969 | '', |
@@ -2976,8 +2976,8 @@ discard block |
||
2976 | 2976 | 'custom_status_voicemail' |
2977 | 2977 | ), |
2978 | 2978 | // array('Local After Email', 'vm_keep_local_after_email', 'CHECKBOX', array('name' => 'vm_keep_local_after_email', 'value' => 'on', 'checked' => false), '', 'tOOL TIP', 'Please Select Status', 'custom_status_true', '', '', ''), |
2979 | - array ( |
|
2980 | - gettext ( 'Local After Email' ), |
|
2979 | + array( |
|
2980 | + gettext('Local After Email'), |
|
2981 | 2981 | 'vm_keep_local_after_email', |
2982 | 2982 | 'SELECT', |
2983 | 2983 | '', |
@@ -2991,8 +2991,8 @@ discard block |
||
2991 | 2991 | ), |
2992 | 2992 | // array('Send all Message', 'vm_send_all_message', 'CHECKBOX', array('name' => 'vm_send_all_message', 'value' => 'on', 'checked' => false), '', 'tOOL TIP', 'Please Select Status', 'custom_status_true', '', '', ''), |
2993 | 2993 | |
2994 | - array ( |
|
2995 | - gettext ( 'Send all Message' ), |
|
2994 | + array( |
|
2995 | + gettext('Send all Message'), |
|
2996 | 2996 | 'vm_send_all_message', |
2997 | 2997 | 'SELECT', |
2998 | 2998 | '', |
@@ -3011,17 +3011,17 @@ discard block |
||
3011 | 3011 | */ |
3012 | 3012 | } |
3013 | 3013 | |
3014 | - $form ['button_cancel'] = array ( |
|
3014 | + $form ['button_cancel'] = array( |
|
3015 | 3015 | 'name' => 'action', |
3016 | - 'content' => gettext ( 'Close' ), |
|
3016 | + 'content' => gettext('Close'), |
|
3017 | 3017 | 'value' => 'cancel', |
3018 | 3018 | 'type' => 'button', |
3019 | 3019 | 'class' => 'btn btn-line-sky margin-x-10', |
3020 | 3020 | 'onclick' => 'return redirect_page(\'NULL\')' |
3021 | 3021 | ); |
3022 | - $form ['button_save'] = array ( |
|
3022 | + $form ['button_save'] = array( |
|
3023 | 3023 | 'name' => 'action', |
3024 | - 'content' => gettext ( 'Save' ), |
|
3024 | + 'content' => gettext('Save'), |
|
3025 | 3025 | 'value' => 'save', |
3026 | 3026 | 'id' => 'submit', |
3027 | 3027 | 'type' => 'button', |
@@ -21,8 +21,9 @@ |
||
21 | 21 | // You should have received a copy of the GNU Affero General Public License |
22 | 22 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
23 | 23 | // ############################################################################## |
24 | -if (! defined ( 'BASEPATH' )) |
|
24 | +if (! defined ( 'BASEPATH' )) { |
|
25 | 25 | exit ( 'No direct script access allowed' ); |
26 | +} |
|
26 | 27 | class Freeswitch_form { |
27 | 28 | function __construct() { |
28 | 29 | $this->CI = & get_instance (); |
@@ -262,6 +262,6 @@ |
||
262 | 262 | return $query; |
263 | 263 | } |
264 | 264 | /** |
265 | - * ********************************************************************** |
|
266 | - */ |
|
265 | + * ********************************************************************** |
|
266 | + */ |
|
267 | 267 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | // ############################################################################## |
23 | 23 | class Reports_model extends CI_Model { |
24 | 24 | function Reports_model() { |
25 | - parent::__construct (); |
|
25 | + parent::__construct(); |
|
26 | 26 | } |
27 | 27 | /** |
28 | 28 | * ASTPP 3.0 |
@@ -30,112 +30,112 @@ discard block |
||
30 | 30 | * * |
31 | 31 | */ |
32 | 32 | function getcustomer_cdrs($flag, $start, $limit, $export = false) { |
33 | - $this->db_model->build_search ( 'customer_cdr_list_search' ); |
|
34 | - $account_data = $this->session->userdata ( "accountinfo" ); |
|
33 | + $this->db_model->build_search('customer_cdr_list_search'); |
|
34 | + $account_data = $this->session->userdata("accountinfo"); |
|
35 | 35 | $where ['reseller_id'] = $account_data ['type'] == 1 ? $account_data ['id'] : 0; |
36 | 36 | // $where['type']=0; |
37 | - if ($this->session->userdata ( 'advance_search' ) != 1) { |
|
38 | - $where ['callstart >= '] = date ( "Y-m-d" ) . " 00:00:00"; |
|
39 | - $where ['callstart <='] = date ( "Y-m-d" ) . " 23:59:59"; |
|
37 | + if ($this->session->userdata('advance_search') != 1) { |
|
38 | + $where ['callstart >= '] = date("Y-m-d")." 00:00:00"; |
|
39 | + $where ['callstart <='] = date("Y-m-d")." 23:59:59"; |
|
40 | 40 | } |
41 | 41 | |
42 | - $types = array ( |
|
42 | + $types = array( |
|
43 | 43 | '0', |
44 | 44 | '3' |
45 | 45 | ); |
46 | 46 | // $this->db->or_where_in('type', $types); |
47 | - $this->db->where_in ( 'type', $types ); |
|
47 | + $this->db->where_in('type', $types); |
|
48 | 48 | |
49 | - $this->db->where ( $where ); |
|
50 | - if (isset ( $_GET ['sortname'] ) && $_GET ['sortname'] != 'undefined') { |
|
51 | - $this->db->order_by ( $_GET ['sortname'], ($_GET ['sortorder'] == 'undefined') ? 'desc' : $_GET ['sortorder'] ); |
|
49 | + $this->db->where($where); |
|
50 | + if (isset ($_GET ['sortname']) && $_GET ['sortname'] != 'undefined') { |
|
51 | + $this->db->order_by($_GET ['sortname'], ($_GET ['sortorder'] == 'undefined') ? 'desc' : $_GET ['sortorder']); |
|
52 | 52 | } else { |
53 | - $this->db->order_by ( "callstart desc" ); |
|
53 | + $this->db->order_by("callstart desc"); |
|
54 | 54 | } |
55 | 55 | if ($flag) { |
56 | - if (! $export) |
|
57 | - $this->db->limit ( $limit, $start ); |
|
56 | + if ( ! $export) |
|
57 | + $this->db->limit($limit, $start); |
|
58 | 58 | // Add is_recording for enabled recording. |
59 | - $this->db->select ( 'callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype,trunk_id,uniqueid' ); |
|
59 | + $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype,trunk_id,uniqueid'); |
|
60 | 60 | } else { |
61 | - $this->db->select ( 'count(*) as count,sum(billseconds) as billseconds,sum(debit) as total_debit,sum(cost) as total_cost,group_concat(distinct(pricelist_id)) as pricelist_ids,group_concat(distinct(trunk_id)) as trunk_ids,group_concat(distinct(accountid)) as accounts_ids' ); |
|
61 | + $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(debit) as total_debit,sum(cost) as total_cost,group_concat(distinct(pricelist_id)) as pricelist_ids,group_concat(distinct(trunk_id)) as trunk_ids,group_concat(distinct(accountid)) as accounts_ids'); |
|
62 | 62 | } |
63 | - $result = $this->db->get ( 'cdrs' ); |
|
63 | + $result = $this->db->get('cdrs'); |
|
64 | 64 | return $result; |
65 | 65 | } |
66 | 66 | /* |
67 | 67 | * Below function using by Detail reseller report |
68 | 68 | */ |
69 | 69 | function getreseller_cdrs($flag, $start, $limit, $export = false) { |
70 | - $this->db_model->build_search ( 'reseller_cdr_list_search' ); |
|
71 | - $account_data = $this->session->userdata ( "accountinfo" ); |
|
70 | + $this->db_model->build_search('reseller_cdr_list_search'); |
|
71 | + $account_data = $this->session->userdata("accountinfo"); |
|
72 | 72 | $where ['reseller_id'] = $account_data ['type'] == 1 ? $account_data ['id'] : 0; |
73 | 73 | $where ["accountid <>"] = $account_data ['type'] == 1 ? $account_data ['id'] : 0; |
74 | - if ($this->session->userdata ( 'advance_search' ) != 1) { |
|
75 | - $where ['callstart >= '] = date ( "Y-m-d" ) . " 00:00:00"; |
|
76 | - $where ['callstart <='] = date ( "Y-m-d" ) . " 23:59:59"; |
|
74 | + if ($this->session->userdata('advance_search') != 1) { |
|
75 | + $where ['callstart >= '] = date("Y-m-d")." 00:00:00"; |
|
76 | + $where ['callstart <='] = date("Y-m-d")." 23:59:59"; |
|
77 | 77 | } |
78 | - $this->db->where ( $where ); |
|
79 | - if (isset ( $_GET ['sortname'] ) && $_GET ['sortname'] != 'undefined') { |
|
80 | - $this->db->order_by ( $_GET ['sortname'], ($_GET ['sortorder'] == 'undefined') ? 'desc' : $_GET ['sortorder'] ); |
|
78 | + $this->db->where($where); |
|
79 | + if (isset ($_GET ['sortname']) && $_GET ['sortname'] != 'undefined') { |
|
80 | + $this->db->order_by($_GET ['sortname'], ($_GET ['sortorder'] == 'undefined') ? 'desc' : $_GET ['sortorder']); |
|
81 | 81 | } else { |
82 | - $this->db->order_by ( "callstart desc" ); |
|
82 | + $this->db->order_by("callstart desc"); |
|
83 | 83 | } |
84 | 84 | if ($flag) { |
85 | - if (! $export) |
|
86 | - $this->db->limit ( $limit, $start ); |
|
87 | - $this->db->select ( 'callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype' ); |
|
85 | + if ( ! $export) |
|
86 | + $this->db->limit($limit, $start); |
|
87 | + $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype'); |
|
88 | 88 | } else { |
89 | - $this->db->select ( 'count(*) as count,sum(billseconds) as billseconds,sum(debit) as total_debit,sum(cost) as total_cost,group_concat(distinct(pricelist_id)) as pricelist_ids' ); |
|
89 | + $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(debit) as total_debit,sum(cost) as total_cost,group_concat(distinct(pricelist_id)) as pricelist_ids'); |
|
90 | 90 | } |
91 | - $result = $this->db->get ( 'reseller_cdrs' ); |
|
91 | + $result = $this->db->get('reseller_cdrs'); |
|
92 | 92 | return $result; |
93 | 93 | } |
94 | 94 | /* |
95 | 95 | * Below function using by Detail provider report |
96 | 96 | */ |
97 | 97 | function getprovider_cdrs($flag, $start, $limit, $export = false) { |
98 | - $this->db_model->build_search ( 'provider_cdr_list_search' ); |
|
99 | - $account_data = $this->session->userdata ( "accountinfo" ); |
|
100 | - $where = array (); |
|
98 | + $this->db_model->build_search('provider_cdr_list_search'); |
|
99 | + $account_data = $this->session->userdata("accountinfo"); |
|
100 | + $where = array(); |
|
101 | 101 | if ($account_data ['type'] == 3) { |
102 | 102 | $where ['provider_id'] = $account_data ['id']; |
103 | 103 | } |
104 | 104 | |
105 | - if ($this->session->userdata ( 'advance_search' ) != 1) { |
|
106 | - $where ['callstart >= '] = date ( "Y-m-d" ) . " 00:00:00"; |
|
107 | - $where ['callstart <='] = date ( "Y-m-d" ) . " 23:59:59"; |
|
105 | + if ($this->session->userdata('advance_search') != 1) { |
|
106 | + $where ['callstart >= '] = date("Y-m-d")." 00:00:00"; |
|
107 | + $where ['callstart <='] = date("Y-m-d")." 23:59:59"; |
|
108 | 108 | } |
109 | - $this->db->where ( 'trunk_id !=', '' ); |
|
110 | - $this->db->where ( $where ); |
|
111 | - if (isset ( $_GET ['sortname'] ) && $_GET ['sortname'] != 'undefined') { |
|
112 | - $this->db->order_by ( $_GET ['sortname'], ($_GET ['sortorder'] == 'undefined') ? 'desc' : $_GET ['sortorder'] ); |
|
109 | + $this->db->where('trunk_id !=', ''); |
|
110 | + $this->db->where($where); |
|
111 | + if (isset ($_GET ['sortname']) && $_GET ['sortname'] != 'undefined') { |
|
112 | + $this->db->order_by($_GET ['sortname'], ($_GET ['sortorder'] == 'undefined') ? 'desc' : $_GET ['sortorder']); |
|
113 | 113 | } else { |
114 | - $this->db->order_by ( "callstart desc" ); |
|
114 | + $this->db->order_by("callstart desc"); |
|
115 | 115 | } |
116 | 116 | if ($flag) { |
117 | - if (! $export) |
|
118 | - $this->db->limit ( $limit, $start ); |
|
119 | - $this->db->select ( 'callstart,callerid,callednum,pattern,notes,billseconds,provider_call_cost,disposition,provider_id,cost' ); |
|
117 | + if ( ! $export) |
|
118 | + $this->db->limit($limit, $start); |
|
119 | + $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,provider_call_cost,disposition,provider_id,cost'); |
|
120 | 120 | } else { |
121 | - $this->db->select ( 'count(*) as count,sum(billseconds) as billseconds,sum(cost) as total_cost' ); |
|
121 | + $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(cost) as total_cost'); |
|
122 | 122 | } |
123 | - $result = $this->db->get ( 'cdrs' ); |
|
123 | + $result = $this->db->get('cdrs'); |
|
124 | 124 | // echo $this->db->last_query(); |
125 | 125 | return $result; |
126 | 126 | } |
127 | 127 | function users_cdrs_list($flag, $accountid, $entity_type, $start, $limit) { |
128 | - $where = "callstart >= '" . date ( 'Y-m-d 00:00:00' ) . "' AND callstart <='" . date ( 'Y-m-d 23:59:59' ) . "' AND "; |
|
128 | + $where = "callstart >= '".date('Y-m-d 00:00:00')."' AND callstart <='".date('Y-m-d 23:59:59')."' AND "; |
|
129 | 129 | $account_type = $entity_type == 'provider' ? 'provider_id' : 'accountid'; |
130 | - $where .= "accountid = '" . $accountid . "' "; |
|
130 | + $where .= "accountid = '".$accountid."' "; |
|
131 | 131 | // ~ if($entity_type == 'provider'){ |
132 | 132 | // ~ $where.="OR provider_id = '".$accountid."'"; |
133 | 133 | // ~ } |
134 | 134 | $table = $entity_type == 'reseller' ? 'reseller_cdrs' : 'cdrs'; |
135 | 135 | if ($flag) { |
136 | - $query = $this->db_model->select ( "*", $table, $where, "callstart", "DESC", $limit, $start ); |
|
136 | + $query = $this->db_model->select("*", $table, $where, "callstart", "DESC", $limit, $start); |
|
137 | 137 | } else { |
138 | - $query = $this->db_model->countQuery ( "*", $table, $where ); |
|
138 | + $query = $this->db_model->countQuery("*", $table, $where); |
|
139 | 139 | } |
140 | 140 | return $query; |
141 | 141 | } |
@@ -147,30 +147,30 @@ discard block |
||
147 | 147 | * ***** |
148 | 148 | */ |
149 | 149 | function getuser_refill_list($flag, $start, $limit) { |
150 | - $this->db_model->build_search ( 'cdr_refill_search' ); |
|
151 | - $account_data = $this->session->userdata ( "accountinfo" ); |
|
152 | - $this->db_model->build_search ( 'customer_cdr_list_search' ); |
|
153 | - $where = array ( |
|
150 | + $this->db_model->build_search('cdr_refill_search'); |
|
151 | + $account_data = $this->session->userdata("accountinfo"); |
|
152 | + $this->db_model->build_search('customer_cdr_list_search'); |
|
153 | + $where = array( |
|
154 | 154 | "accountid" => $account_data ["id"] |
155 | 155 | ); |
156 | 156 | if ($flag) { |
157 | - $query = $this->db_model->select ( "*", "payments", $where, "payment_date", "DESC", $limit, $start ); |
|
157 | + $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", $limit, $start); |
|
158 | 158 | } else { |
159 | - $query = $this->db_model->countQuery ( "*", "payments", $where ); |
|
159 | + $query = $this->db_model->countQuery("*", "payments", $where); |
|
160 | 160 | } |
161 | 161 | return $query; |
162 | 162 | } |
163 | 163 | function get_refill_list($flag, $start, $limit, $export = false) { |
164 | - $this->db_model->build_search ( 'cdr_refill_search' ); |
|
165 | - $accountinfo = $this->session->userdata ( 'accountinfo' ); |
|
164 | + $this->db_model->build_search('cdr_refill_search'); |
|
165 | + $accountinfo = $this->session->userdata('accountinfo'); |
|
166 | 166 | $where ['payment_by'] = $accountinfo ['type'] == 1 ? $accountinfo ['id'] : - 1; |
167 | 167 | if ($flag) { |
168 | 168 | if ($export) |
169 | - $query = $this->db_model->select ( "*", "payments", $where, "payment_date", "DESC", "", "" ); |
|
169 | + $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", "", ""); |
|
170 | 170 | else |
171 | - $query = $this->db_model->select ( "*", "payments", $where, "payment_date", "DESC", $limit, $start ); |
|
171 | + $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", $limit, $start); |
|
172 | 172 | } else { |
173 | - $query = $this->db_model->countQuery ( "*", "payments", $where ); |
|
173 | + $query = $this->db_model->countQuery("*", "payments", $where); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | return $query; |
@@ -179,17 +179,17 @@ discard block |
||
179 | 179 | * *************** |
180 | 180 | */ |
181 | 181 | function getreseller_commission_list($flag, $start, $limit) { |
182 | - $this->db_model->build_search ( 'reseller_commission_search' ); |
|
183 | - if ($this->session->userdata ( 'logintype' ) == 1 || $this->session->userdata ( 'logintype' ) == 5) { |
|
182 | + $this->db_model->build_search('reseller_commission_search'); |
|
183 | + if ($this->session->userdata('logintype') == 1 || $this->session->userdata('logintype') == 5) { |
|
184 | 184 | $accountinfo = $this->session->userdata ['accountinfo']; |
185 | 185 | $reseller_id = $accountinfo ["id"]; |
186 | 186 | } else { |
187 | 187 | $reseller_id = "0"; |
188 | 188 | } |
189 | 189 | if ($flag) { |
190 | - $query = $this->db_model->select_by_in ( "*", "commission", "", "date", "DESC", $limit, $start, "", "reseller_id", $reseller_id ); |
|
190 | + $query = $this->db_model->select_by_in("*", "commission", "", "date", "DESC", $limit, $start, "", "reseller_id", $reseller_id); |
|
191 | 191 | } else { |
192 | - $query = $this->db_model->countQuery_by_in ( "*", "commission", "", "reseller_id", $reseller_id ); |
|
192 | + $query = $this->db_model->countQuery_by_in("*", "commission", "", "reseller_id", $reseller_id); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | return $query; |
@@ -201,26 +201,26 @@ discard block |
||
201 | 201 | * ********** |
202 | 202 | */ |
203 | 203 | function getcharges_list($flag, $start = 0, $limit = 0) { |
204 | - $accountinfo = $this->session->userdata ( 'accountinfo' ); |
|
204 | + $accountinfo = $this->session->userdata('accountinfo'); |
|
205 | 205 | $reseller_id = $accountinfo ['id']; |
206 | 206 | if ($accountinfo ['type'] == 1) { |
207 | 207 | $where ['reseller_id'] = $reseller_id; |
208 | 208 | } else { |
209 | 209 | $where ['reseller_id'] = 0; |
210 | 210 | } |
211 | - if ($this->session->userdata ( 'advance_search' ) != 1) { |
|
212 | - $where ['created_date >='] = gmdate ( "Y-m-01 00:00:01" ); |
|
213 | - $where ['created_date <='] = gmdate ( "Y-m-d 23:59:59" ); |
|
211 | + if ($this->session->userdata('advance_search') != 1) { |
|
212 | + $where ['created_date >='] = gmdate("Y-m-01 00:00:01"); |
|
213 | + $where ['created_date <='] = gmdate("Y-m-d 23:59:59"); |
|
214 | 214 | } |
215 | - $this->db_model->build_search ( 'charges_list_search' ); |
|
216 | - $this->db->where ( $where ); |
|
215 | + $this->db_model->build_search('charges_list_search'); |
|
216 | + $this->db->where($where); |
|
217 | 217 | $whr = "( invoiceid =0 OR invoiceid in ( select id from invoices where confirm = 1) )"; |
218 | - $this->db->where ( $whr ); |
|
219 | - $this->db->where ( 'item_type <>', 'STANDARD' ); |
|
218 | + $this->db->where($whr); |
|
219 | + $this->db->where('item_type <>', 'STANDARD'); |
|
220 | 220 | if ($flag) { |
221 | - $query = $this->db_model->select ( '*', "invoice_details", "", "id", "DESC", $limit, $start ); |
|
221 | + $query = $this->db_model->select('*', "invoice_details", "", "id", "DESC", $limit, $start); |
|
222 | 222 | } else { |
223 | - $query = $this->db_model->countQuery ( "*", "invoice_details", "" ); |
|
223 | + $query = $this->db_model->countQuery("*", "invoice_details", ""); |
|
224 | 224 | } |
225 | 225 | return $query; |
226 | 226 | } |
@@ -233,30 +233,30 @@ discard block |
||
233 | 233 | * This function using for customer edit |
234 | 234 | */ |
235 | 235 | function get_customer_charge_list($flag, $accountid, $start = 0, $limit = 0) { |
236 | - $this->db_model->build_search ( 'charges_list_search' ); |
|
237 | - $accountinfo = $this->session->userdata ( 'accountinfo' ); |
|
236 | + $this->db_model->build_search('charges_list_search'); |
|
237 | + $accountinfo = $this->session->userdata('accountinfo'); |
|
238 | 238 | $reseller_id = $accountinfo ['type'] == 1 ? $accountinfo ['id'] : 0; |
239 | 239 | $where ['reseller_id'] = $reseller_id; |
240 | 240 | $where ['accountid'] = $accountid; |
241 | - if ($this->session->userdata ( 'advance_search' ) != 1) { |
|
242 | - $where ['created_date >='] = gmdate ( "Y-m-1 00:00:00" ); |
|
243 | - $where ['created_date <='] = gmdate ( "Y-m-d 23:59:59" ); |
|
241 | + if ($this->session->userdata('advance_search') != 1) { |
|
242 | + $where ['created_date >='] = gmdate("Y-m-1 00:00:00"); |
|
243 | + $where ['created_date <='] = gmdate("Y-m-d 23:59:59"); |
|
244 | 244 | } |
245 | 245 | if ($flag) { |
246 | - $query = $this->db_model->select ( "*", "invoice_details", $where, "id", "DESC", $limit, $start ); |
|
246 | + $query = $this->db_model->select("*", "invoice_details", $where, "id", "DESC", $limit, $start); |
|
247 | 247 | } else { |
248 | - $query = $this->db_model->countQuery ( "*", "invoice_details", $where ); |
|
248 | + $query = $this->db_model->countQuery("*", "invoice_details", $where); |
|
249 | 249 | } |
250 | 250 | return $query; |
251 | 251 | } |
252 | 252 | function get_customer_refillreport($flag, $accountid, $start = 0, $limit = 0) { |
253 | - $where = array ( |
|
253 | + $where = array( |
|
254 | 254 | "accountid" => $accountid |
255 | 255 | ); |
256 | 256 | if ($flag) { |
257 | - $query = $this->db_model->select ( "*", "payments", $where, "payment_date", "DESC", $limit, $start ); |
|
257 | + $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", $limit, $start); |
|
258 | 258 | } else { |
259 | - $query = $this->db_model->countQuery ( "*", "payments", $where ); |
|
259 | + $query = $this->db_model->countQuery("*", "payments", $where); |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | return $query; |
@@ -53,8 +53,9 @@ discard block |
||
53 | 53 | $this->db->order_by ( "callstart desc" ); |
54 | 54 | } |
55 | 55 | if ($flag) { |
56 | - if (! $export) |
|
57 | - $this->db->limit ( $limit, $start ); |
|
56 | + if (! $export) { |
|
57 | + $this->db->limit ( $limit, $start ); |
|
58 | + } |
|
58 | 59 | // Add is_recording for enabled recording. |
59 | 60 | $this->db->select ( 'callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype,trunk_id,uniqueid' ); |
60 | 61 | } else { |
@@ -82,8 +83,9 @@ discard block |
||
82 | 83 | $this->db->order_by ( "callstart desc" ); |
83 | 84 | } |
84 | 85 | if ($flag) { |
85 | - if (! $export) |
|
86 | - $this->db->limit ( $limit, $start ); |
|
86 | + if (! $export) { |
|
87 | + $this->db->limit ( $limit, $start ); |
|
88 | + } |
|
87 | 89 | $this->db->select ( 'callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype' ); |
88 | 90 | } else { |
89 | 91 | $this->db->select ( 'count(*) as count,sum(billseconds) as billseconds,sum(debit) as total_debit,sum(cost) as total_cost,group_concat(distinct(pricelist_id)) as pricelist_ids' ); |
@@ -114,8 +116,9 @@ discard block |
||
114 | 116 | $this->db->order_by ( "callstart desc" ); |
115 | 117 | } |
116 | 118 | if ($flag) { |
117 | - if (! $export) |
|
118 | - $this->db->limit ( $limit, $start ); |
|
119 | + if (! $export) { |
|
120 | + $this->db->limit ( $limit, $start ); |
|
121 | + } |
|
119 | 122 | $this->db->select ( 'callstart,callerid,callednum,pattern,notes,billseconds,provider_call_cost,disposition,provider_id,cost' ); |
120 | 123 | } else { |
121 | 124 | $this->db->select ( 'count(*) as count,sum(billseconds) as billseconds,sum(cost) as total_cost' ); |
@@ -165,10 +168,11 @@ discard block |
||
165 | 168 | $accountinfo = $this->session->userdata ( 'accountinfo' ); |
166 | 169 | $where ['payment_by'] = $accountinfo ['type'] == 1 ? $accountinfo ['id'] : - 1; |
167 | 170 | if ($flag) { |
168 | - if ($export) |
|
169 | - $query = $this->db_model->select ( "*", "payments", $where, "payment_date", "DESC", "", "" ); |
|
170 | - else |
|
171 | - $query = $this->db_model->select ( "*", "payments", $where, "payment_date", "DESC", $limit, $start ); |
|
171 | + if ($export) { |
|
172 | + $query = $this->db_model->select ( "*", "payments", $where, "payment_date", "DESC", "", "" ); |
|
173 | + } else { |
|
174 | + $query = $this->db_model->select ( "*", "payments", $where, "payment_date", "DESC", $limit, $start ); |
|
175 | + } |
|
172 | 176 | } else { |
173 | 177 | $query = $this->db_model->countQuery ( "*", "payments", $where ); |
174 | 178 | } |
@@ -1109,8 +1109,8 @@ |
||
1109 | 1109 | echo json_encode ( $json_data ); |
1110 | 1110 | } |
1111 | 1111 | /** |
1112 | - * ******************************************************** |
|
1113 | - */ |
|
1112 | + * ******************************************************** |
|
1113 | + */ |
|
1114 | 1114 | } |
1115 | 1115 | ?> |
1116 | 1116 |
@@ -23,30 +23,30 @@ discard block |
||
23 | 23 | // ############################################################################## |
24 | 24 | class Reports extends MX_Controller { |
25 | 25 | function Reports() { |
26 | - parent::__construct (); |
|
26 | + parent::__construct(); |
|
27 | 27 | |
28 | - $this->load->helper ( 'template_inheritance' ); |
|
28 | + $this->load->helper('template_inheritance'); |
|
29 | 29 | |
30 | - $this->load->library ( 'session' ); |
|
31 | - $this->load->library ( "reports_form" ); |
|
32 | - $this->load->library ( 'astpp/form' ); |
|
33 | - $this->load->model ( 'reports_model' ); |
|
34 | - $this->load->library ( 'fpdf' ); |
|
35 | - $this->load->library ( 'pdf' ); |
|
36 | - $this->fpdf = new PDF ( 'P', 'pt' ); |
|
37 | - $this->fpdf->initialize ( 'P', 'mm', 'A4' ); |
|
30 | + $this->load->library('session'); |
|
31 | + $this->load->library("reports_form"); |
|
32 | + $this->load->library('astpp/form'); |
|
33 | + $this->load->model('reports_model'); |
|
34 | + $this->load->library('fpdf'); |
|
35 | + $this->load->library('pdf'); |
|
36 | + $this->fpdf = new PDF('P', 'pt'); |
|
37 | + $this->fpdf->initialize('P', 'mm', 'A4'); |
|
38 | 38 | |
39 | - if ($this->session->userdata ( 'user_login' ) == FALSE) |
|
40 | - redirect ( base_url () . '/astpp/login' ); |
|
39 | + if ($this->session->userdata('user_login') == FALSE) |
|
40 | + redirect(base_url().'/astpp/login'); |
|
41 | 41 | } |
42 | 42 | function customerReport() { |
43 | - $data ['page_title'] = gettext ( 'Customer CDRs Report' ); |
|
43 | + $data ['page_title'] = gettext('Customer CDRs Report'); |
|
44 | 44 | $data ['search_flag'] = true; |
45 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
46 | - $data ['grid_fields'] = $this->reports_form->build_report_list_for_customer (); |
|
47 | - $data ["grid_buttons"] = $this->reports_form->build_grid_customer (); |
|
48 | - $data ['form_search'] = $this->form->build_serach_form ( $this->reports_form->get_customer_cdr_form () ); |
|
49 | - $this->load->view ( 'view_cdr_customer_list', $data ); |
|
45 | + $this->session->set_userdata('advance_search', 0); |
|
46 | + $data ['grid_fields'] = $this->reports_form->build_report_list_for_customer(); |
|
47 | + $data ["grid_buttons"] = $this->reports_form->build_grid_customer(); |
|
48 | + $data ['form_search'] = $this->form->build_serach_form($this->reports_form->get_customer_cdr_form()); |
|
49 | + $this->load->view('view_cdr_customer_list', $data); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /* |
@@ -56,86 +56,86 @@ discard block |
||
56 | 56 | * **** |
57 | 57 | */ |
58 | 58 | function customerReport_json() { |
59 | - $count_res = $this->reports_model->getcustomer_cdrs ( false, "", "" ); |
|
60 | - $accountinfo = $this->session->userdata ( 'accountinfo' ); |
|
61 | - $count_all = ( array ) $count_res->first_row (); |
|
62 | - $paging_data = $this->form->load_grid_config ( $count_all ['count'], $_GET ['rp'], $_GET ['page'] ); |
|
59 | + $count_res = $this->reports_model->getcustomer_cdrs(false, "", ""); |
|
60 | + $accountinfo = $this->session->userdata('accountinfo'); |
|
61 | + $count_all = (array)$count_res->first_row(); |
|
62 | + $paging_data = $this->form->load_grid_config($count_all ['count'], $_GET ['rp'], $_GET ['page']); |
|
63 | 63 | $json_data = $paging_data ["json_paging"]; |
64 | - $query = $this->reports_model->getcustomer_cdrs ( true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
|
65 | - if ($query->num_rows () > 0) { |
|
64 | + $query = $this->reports_model->getcustomer_cdrs(true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"]); |
|
65 | + if ($query->num_rows() > 0) { |
|
66 | 66 | // Initialization of Rategroup and Trunk Array |
67 | - $pricelist_arr = array (); |
|
68 | - $trunk_arr = array (); |
|
67 | + $pricelist_arr = array(); |
|
68 | + $trunk_arr = array(); |
|
69 | 69 | // Get search information from session. |
70 | - $search_arr = $this->session->userdata ( 'customer_cdr_list_search' ); |
|
71 | - $show_seconds = (! empty ( $search_arr ['search_in'] )) ? $search_arr ['search_in'] : 'minutes'; |
|
72 | - $query = $query->result_array (); |
|
70 | + $search_arr = $this->session->userdata('customer_cdr_list_search'); |
|
71 | + $show_seconds = ( ! empty ($search_arr ['search_in'])) ? $search_arr ['search_in'] : 'minutes'; |
|
72 | + $query = $query->result_array(); |
|
73 | 73 | |
74 | - $where = "id IN (" . $count_all ['pricelist_ids'] . ")"; |
|
75 | - $this->db->where ( $where ); |
|
76 | - $this->db->select ( 'id,name' ); |
|
77 | - $pricelist_res = $this->db->get ( 'pricelists' ); |
|
78 | - $pricelist_res = $pricelist_res->result_array (); |
|
79 | - foreach ( $pricelist_res as $value ) { |
|
74 | + $where = "id IN (".$count_all ['pricelist_ids'].")"; |
|
75 | + $this->db->where($where); |
|
76 | + $this->db->select('id,name'); |
|
77 | + $pricelist_res = $this->db->get('pricelists'); |
|
78 | + $pricelist_res = $pricelist_res->result_array(); |
|
79 | + foreach ($pricelist_res as $value) { |
|
80 | 80 | $pricelist_arr [$value ['id']] = $value ['name']; |
81 | 81 | } |
82 | - $where = "id IN (" . $count_all ['trunk_ids'] . ")"; |
|
83 | - $this->db->where ( $where ); |
|
84 | - $this->db->select ( 'id,name' ); |
|
85 | - $trunk_res = $this->db->get ( 'trunks' ); |
|
86 | - $trunk_res = $trunk_res->result_array (); |
|
87 | - foreach ( $trunk_res as $value ) { |
|
82 | + $where = "id IN (".$count_all ['trunk_ids'].")"; |
|
83 | + $this->db->where($where); |
|
84 | + $this->db->select('id,name'); |
|
85 | + $trunk_res = $this->db->get('trunks'); |
|
86 | + $trunk_res = $trunk_res->result_array(); |
|
87 | + foreach ($trunk_res as $value) { |
|
88 | 88 | $trunk_arr [$value ['id']] = $value ['name']; |
89 | 89 | } |
90 | - $where = "id IN (" . $count_all ['accounts_ids'] . ")"; |
|
91 | - $this->db->where ( $where ); |
|
92 | - $this->db->select ( 'id,number,first_name,last_name' ); |
|
93 | - $account_res = $this->db->get ( 'accounts' ); |
|
94 | - foreach ( $account_res->result_array () as $value ) { |
|
95 | - $account_arr [$value ['id']] = $value ['first_name'] . " " . $value ['last_name'] . ' (' . $value ['number'] . ')'; |
|
90 | + $where = "id IN (".$count_all ['accounts_ids'].")"; |
|
91 | + $this->db->where($where); |
|
92 | + $this->db->select('id,number,first_name,last_name'); |
|
93 | + $account_res = $this->db->get('accounts'); |
|
94 | + foreach ($account_res->result_array() as $value) { |
|
95 | + $account_arr [$value ['id']] = $value ['first_name']." ".$value ['last_name'].' ('.$value ['number'].')'; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | // Get Decimal points,system currency and user currency. |
99 | - $currency_info = $this->common->get_currency_info (); |
|
100 | - foreach ( $query as $value ) { |
|
101 | - $duration = ($show_seconds == 'minutes') ? ($value ['billseconds'] > 0) ? sprintf ( '%02d', $value ['billseconds'] / 60 ) . ":" . sprintf ( '%02d', $value ['billseconds'] % 60 ) : "00:00" : $value ['billseconds']; |
|
102 | - $account = isset ( $account_arr [$value ['accountid']] ) ? $account_arr [$value ['accountid']] : 'Anonymous'; |
|
99 | + $currency_info = $this->common->get_currency_info(); |
|
100 | + foreach ($query as $value) { |
|
101 | + $duration = ($show_seconds == 'minutes') ? ($value ['billseconds'] > 0) ? sprintf ('%02d', $value ['billseconds'] / 60).":".sprintf('%02d', $value ['billseconds'] % 60) : "00:00" : $value ['billseconds']; |
|
102 | + $account = isset ($account_arr [$value ['accountid']]) ? $account_arr [$value ['accountid']] : 'Anonymous'; |
|
103 | 103 | $uid = $value ['uniqueid']; |
104 | 104 | if ($accountinfo ['type'] == 1) { |
105 | - $json_data ['rows'] [] = array ( |
|
106 | - 'cell' => array ( |
|
107 | - $this->common->convert_GMT_to ( '', '', $value ['callstart'] ), |
|
105 | + $json_data ['rows'] [] = array( |
|
106 | + 'cell' => array( |
|
107 | + $this->common->convert_GMT_to('', '', $value ['callstart']), |
|
108 | 108 | $value ['callerid'], |
109 | 109 | $value ['callednum'], |
110 | - filter_var ( $value ['pattern'], FILTER_SANITIZE_NUMBER_INT ), |
|
110 | + filter_var($value ['pattern'], FILTER_SANITIZE_NUMBER_INT), |
|
111 | 111 | $value ['notes'], |
112 | 112 | $duration, |
113 | - $this->common->calculate_currency_manually ( $currency_info, $value ['debit'], false ), |
|
114 | - $this->common->calculate_currency_manually ( $currency_info, $value ['cost'], false ), |
|
113 | + $this->common->calculate_currency_manually($currency_info, $value ['debit'], false), |
|
114 | + $this->common->calculate_currency_manually($currency_info, $value ['cost'], false), |
|
115 | 115 | $value ['disposition'], |
116 | 116 | $account, |
117 | 117 | // isset($trunk_arr[$value['trunk_id']]) ? $trunk_arr[$value['trunk_id']] : '', |
118 | - isset ( $pricelist_arr [$value ['pricelist_id']] ) ? $pricelist_arr [$value ['pricelist_id']] : '', |
|
118 | + isset ($pricelist_arr [$value ['pricelist_id']]) ? $pricelist_arr [$value ['pricelist_id']] : '', |
|
119 | 119 | $value ['calltype'] |
120 | 120 | ) |
121 | 121 | // $recording, |
122 | 122 | |
123 | 123 | ); |
124 | 124 | } else { |
125 | - $json_data ['rows'] [] = array ( |
|
126 | - 'cell' => array ( |
|
127 | - $this->common->convert_GMT_to ( '', '', $value ['callstart'] ), |
|
125 | + $json_data ['rows'] [] = array( |
|
126 | + 'cell' => array( |
|
127 | + $this->common->convert_GMT_to('', '', $value ['callstart']), |
|
128 | 128 | $value ['callerid'], |
129 | 129 | $value ['callednum'], |
130 | - filter_var ( $value ['pattern'], FILTER_SANITIZE_NUMBER_INT ), |
|
130 | + filter_var($value ['pattern'], FILTER_SANITIZE_NUMBER_INT), |
|
131 | 131 | $value ['notes'], |
132 | 132 | $duration, |
133 | - $this->common->calculate_currency_manually ( $currency_info, $value ['debit'], false ), |
|
134 | - $this->common->calculate_currency_manually ( $currency_info, $value ['cost'], false ), |
|
133 | + $this->common->calculate_currency_manually($currency_info, $value ['debit'], false), |
|
134 | + $this->common->calculate_currency_manually($currency_info, $value ['cost'], false), |
|
135 | 135 | $value ['disposition'], |
136 | 136 | $account, |
137 | - isset ( $trunk_arr [$value ['trunk_id']] ) ? $trunk_arr [$value ['trunk_id']] : '', |
|
138 | - isset ( $pricelist_arr [$value ['pricelist_id']] ) ? $pricelist_arr [$value ['pricelist_id']] : '', |
|
137 | + isset ($trunk_arr [$value ['trunk_id']]) ? $trunk_arr [$value ['trunk_id']] : '', |
|
138 | + isset ($pricelist_arr [$value ['pricelist_id']]) ? $pricelist_arr [$value ['pricelist_id']] : '', |
|
139 | 139 | $value ['calltype'] |
140 | 140 | ) |
141 | 141 | // $recording, |
@@ -143,9 +143,9 @@ discard block |
||
143 | 143 | ); |
144 | 144 | } |
145 | 145 | } |
146 | - $duration = ($show_seconds == 'minutes') ? ($count_all ['billseconds'] > 0) ? floor ( $count_all ['billseconds'] / 60 ) . ":" . sprintf ( '%02d', $count_all ['billseconds'] % 60 ) : "00:00" : $count_all ['billseconds']; |
|
147 | - $json_data ['rows'] [] = array ( |
|
148 | - "cell" => array ( |
|
146 | + $duration = ($show_seconds == 'minutes') ? ($count_all ['billseconds'] > 0) ? floor ($count_all ['billseconds'] / 60).":".sprintf('%02d', $count_all ['billseconds'] % 60) : "00:00" : $count_all ['billseconds']; |
|
147 | + $json_data ['rows'] [] = array( |
|
148 | + "cell" => array( |
|
149 | 149 | "<b>Grand Total</b>", |
150 | 150 | "", |
151 | 151 | "", |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | "", |
154 | 154 | "<b>$duration</b>", |
155 | 155 | // $count_all['total_debit'], |
156 | - "<b>" . $this->common->calculate_currency_manually ( $currency_info, $count_all ['total_debit'], false ) . "</b>", |
|
157 | - "<b>" . $this->common->calculate_currency_manually ( $currency_info, $count_all ['total_cost'], false ) . "</b>", |
|
156 | + "<b>".$this->common->calculate_currency_manually($currency_info, $count_all ['total_debit'], false)."</b>", |
|
157 | + "<b>".$this->common->calculate_currency_manually($currency_info, $count_all ['total_cost'], false)."</b>", |
|
158 | 158 | "", |
159 | 159 | "", |
160 | 160 | "", |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | ) |
167 | 167 | ); |
168 | 168 | } |
169 | - echo json_encode ( $json_data ); |
|
169 | + echo json_encode($json_data); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | /* |
@@ -176,35 +176,35 @@ discard block |
||
176 | 176 | * **** |
177 | 177 | */ |
178 | 178 | function customerReport_recording_download($file_name) { |
179 | - $file_name = getcwd () . "/recording/" . $file_name; |
|
180 | - header ( 'Content-Description: File Transfer' ); |
|
181 | - header ( 'Content-Type: application/octet-stream' ); |
|
182 | - header ( 'Content-Disposition: attachment; filename=' . basename ( $file_name ) ); |
|
183 | - header ( 'Content-Transfer-Encoding: binary' ); |
|
184 | - header ( 'Expires: 0' ); |
|
185 | - header ( 'Cache-Control: must-revalidate' ); |
|
186 | - header ( 'Pragma: public' ); |
|
187 | - ob_clean (); |
|
188 | - flush (); |
|
189 | - readfile ( $file_name ); |
|
179 | + $file_name = getcwd()."/recording/".$file_name; |
|
180 | + header('Content-Description: File Transfer'); |
|
181 | + header('Content-Type: application/octet-stream'); |
|
182 | + header('Content-Disposition: attachment; filename='.basename($file_name)); |
|
183 | + header('Content-Transfer-Encoding: binary'); |
|
184 | + header('Expires: 0'); |
|
185 | + header('Cache-Control: must-revalidate'); |
|
186 | + header('Pragma: public'); |
|
187 | + ob_clean(); |
|
188 | + flush(); |
|
189 | + readfile($file_name); |
|
190 | 190 | exit (); |
191 | 191 | } |
192 | 192 | function customerReport_search() { |
193 | - $ajax_search = $this->input->post ( 'ajax_search', 0 ); |
|
194 | - if ($this->input->post ( 'advance_search', TRUE ) == 1) { |
|
195 | - $this->session->set_userdata ( 'advance_search', $this->input->post ( 'advance_search' ) ); |
|
196 | - $action = $this->input->post (); |
|
197 | - unset ( $action ['action'] ); |
|
198 | - unset ( $action ['advance_search'] ); |
|
199 | - $this->session->set_userdata ( 'customer_cdr_list_search', $action ); |
|
193 | + $ajax_search = $this->input->post('ajax_search', 0); |
|
194 | + if ($this->input->post('advance_search', TRUE) == 1) { |
|
195 | + $this->session->set_userdata('advance_search', $this->input->post('advance_search')); |
|
196 | + $action = $this->input->post(); |
|
197 | + unset ($action ['action']); |
|
198 | + unset ($action ['advance_search']); |
|
199 | + $this->session->set_userdata('customer_cdr_list_search', $action); |
|
200 | 200 | } |
201 | 201 | if (@$ajax_search != 1) { |
202 | - redirect ( base_url () . 'reports/customerReport/' ); |
|
202 | + redirect(base_url().'reports/customerReport/'); |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | function customerReport_clearsearchfilter() { |
206 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
207 | - $this->session->set_userdata ( 'customer_cdr_list_search', "" ); |
|
206 | + $this->session->set_userdata('advance_search', 0); |
|
207 | + $this->session->set_userdata('customer_cdr_list_search', ""); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
@@ -212,92 +212,92 @@ discard block |
||
212 | 212 | * For Customer CDRs export |
213 | 213 | */ |
214 | 214 | function customerReport_export() { |
215 | - $account_info = $accountinfo = $this->session->userdata ( 'accountinfo' ); |
|
215 | + $account_info = $accountinfo = $this->session->userdata('accountinfo'); |
|
216 | 216 | $currency_id = $account_info ['currency_id']; |
217 | - $currency = $this->common->get_field_name ( 'currency', 'currency', $currency_id ); |
|
218 | - $count_res = $this->reports_model->getcustomer_cdrs ( false, "", "" ); |
|
219 | - $count_all = ( array ) $count_res->first_row (); |
|
220 | - ob_clean (); |
|
217 | + $currency = $this->common->get_field_name('currency', 'currency', $currency_id); |
|
218 | + $count_res = $this->reports_model->getcustomer_cdrs(false, "", ""); |
|
219 | + $count_all = (array)$count_res->first_row(); |
|
220 | + ob_clean(); |
|
221 | 221 | if ($count_all ['count'] > 0) { |
222 | 222 | // Initialization of Rategroup and Trunk Array |
223 | - $pricelist_arr = array (); |
|
224 | - $trunk_arr = array (); |
|
225 | - $account_arr = array (); |
|
226 | - $query = $this->reports_model->getcustomer_cdrs ( true, '', '', true ); |
|
223 | + $pricelist_arr = array(); |
|
224 | + $trunk_arr = array(); |
|
225 | + $account_arr = array(); |
|
226 | + $query = $this->reports_model->getcustomer_cdrs(true, '', '', true); |
|
227 | 227 | // Get Decimal points,system currency and user currency. |
228 | - $currency_info = $this->common->get_currency_info (); |
|
228 | + $currency_info = $this->common->get_currency_info(); |
|
229 | 229 | // Get search information from session. |
230 | - $search_arr = $this->session->userdata ( 'customer_cdr_list_search' ); |
|
231 | - $show_seconds = (! empty ( $search_arr ['search_in'] )) ? $search_arr ['search_in'] : 'minutes'; |
|
232 | - $where = "id IN (" . $count_all ['pricelist_ids'] . ")"; |
|
233 | - $this->db->where ( $where ); |
|
234 | - $this->db->select ( 'id,name' ); |
|
235 | - $pricelist_res = $this->db->get ( 'pricelists' ); |
|
236 | - $pricelist_res = $pricelist_res->result_array (); |
|
237 | - foreach ( $pricelist_res as $value ) { |
|
230 | + $search_arr = $this->session->userdata('customer_cdr_list_search'); |
|
231 | + $show_seconds = ( ! empty ($search_arr ['search_in'])) ? $search_arr ['search_in'] : 'minutes'; |
|
232 | + $where = "id IN (".$count_all ['pricelist_ids'].")"; |
|
233 | + $this->db->where($where); |
|
234 | + $this->db->select('id,name'); |
|
235 | + $pricelist_res = $this->db->get('pricelists'); |
|
236 | + $pricelist_res = $pricelist_res->result_array(); |
|
237 | + foreach ($pricelist_res as $value) { |
|
238 | 238 | $pricelist_arr [$value ['id']] = $value ['name']; |
239 | 239 | } |
240 | - $where = "id IN (" . $count_all ['accounts_ids'] . ")"; |
|
241 | - $this->db->where ( $where ); |
|
242 | - $this->db->select ( 'id,number,first_name,last_name' ); |
|
243 | - $account_res = $this->db->get ( 'accounts' ); |
|
244 | - foreach ( $account_res->result_array () as $value ) { |
|
245 | - $account_arr [$value ['id']] = $value ['first_name'] . " " . $value ['last_name'] . ' (' . $value ['number'] . ')'; |
|
240 | + $where = "id IN (".$count_all ['accounts_ids'].")"; |
|
241 | + $this->db->where($where); |
|
242 | + $this->db->select('id,number,first_name,last_name'); |
|
243 | + $account_res = $this->db->get('accounts'); |
|
244 | + foreach ($account_res->result_array() as $value) { |
|
245 | + $account_arr [$value ['id']] = $value ['first_name']." ".$value ['last_name'].' ('.$value ['number'].')'; |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | if ($accountinfo ['type'] != 1) { |
249 | - $customer_array [] = array ( |
|
250 | - gettext ( "Date" ), |
|
251 | - gettext ( "Caller ID" ), |
|
252 | - gettext ( "Called Number" ), |
|
253 | - gettext ( "Code" ), |
|
254 | - gettext ( "Destination" ), |
|
255 | - gettext ( "Duration" ), |
|
256 | - gettext ( "Debit" ) . "(" . $currency . ")", |
|
257 | - gettext ( "Cost" ) . "(" . $currency . ")", |
|
258 | - gettext ( "Disposition" ), |
|
259 | - gettext ( "Account" ), |
|
260 | - gettext ( "Trunk" ), |
|
261 | - gettext ( "Rate Group" ), |
|
262 | - gettext ( "Call Type" ) |
|
249 | + $customer_array [] = array( |
|
250 | + gettext("Date"), |
|
251 | + gettext("Caller ID"), |
|
252 | + gettext("Called Number"), |
|
253 | + gettext("Code"), |
|
254 | + gettext("Destination"), |
|
255 | + gettext("Duration"), |
|
256 | + gettext("Debit")."(".$currency.")", |
|
257 | + gettext("Cost")."(".$currency.")", |
|
258 | + gettext("Disposition"), |
|
259 | + gettext("Account"), |
|
260 | + gettext("Trunk"), |
|
261 | + gettext("Rate Group"), |
|
262 | + gettext("Call Type") |
|
263 | 263 | ); |
264 | - $where = "id IN (" . $count_all ['trunk_ids'] . ")"; |
|
265 | - $this->db->where ( $where ); |
|
266 | - $this->db->select ( 'id,name' ); |
|
267 | - $trunk_res = $this->db->get ( 'trunks' ); |
|
268 | - $trunk_res = $trunk_res->result_array (); |
|
269 | - foreach ( $trunk_res as $value ) { |
|
264 | + $where = "id IN (".$count_all ['trunk_ids'].")"; |
|
265 | + $this->db->where($where); |
|
266 | + $this->db->select('id,name'); |
|
267 | + $trunk_res = $this->db->get('trunks'); |
|
268 | + $trunk_res = $trunk_res->result_array(); |
|
269 | + foreach ($trunk_res as $value) { |
|
270 | 270 | $trunk_arr [$value ['id']] = $value ['name']; |
271 | 271 | } |
272 | - foreach ( $query->result_array () as $value ) { |
|
273 | - $duration = ($show_seconds == 'minutes') ? ($value ['billseconds'] > 0) ? floor ( $value ['billseconds'] / 60 ) . ":" . sprintf ( '%02d', $value ['billseconds'] % 60 ) : "00:00" : $value ['billseconds']; |
|
274 | - $account = isset ( $account_arr [$value ['accountid']] ) ? $account_arr [$value ['accountid']] : 'Anonymous'; |
|
275 | - $customer_array [] = array ( |
|
276 | - $this->common->convert_GMT_to ( '', '', $value ['callstart'] ), |
|
272 | + foreach ($query->result_array() as $value) { |
|
273 | + $duration = ($show_seconds == 'minutes') ? ($value ['billseconds'] > 0) ? floor ($value ['billseconds'] / 60).":".sprintf('%02d', $value ['billseconds'] % 60) : "00:00" : $value ['billseconds']; |
|
274 | + $account = isset ($account_arr [$value ['accountid']]) ? $account_arr [$value ['accountid']] : 'Anonymous'; |
|
275 | + $customer_array [] = array( |
|
276 | + $this->common->convert_GMT_to('', '', $value ['callstart']), |
|
277 | 277 | $value ['callerid'], |
278 | 278 | $value ['callednum'], |
279 | - filter_var ( $value ['pattern'], FILTER_SANITIZE_NUMBER_INT ), |
|
279 | + filter_var($value ['pattern'], FILTER_SANITIZE_NUMBER_INT), |
|
280 | 280 | $value ['notes'], |
281 | 281 | $duration, |
282 | - $this->common->calculate_currency_manually ( $currency_info, $value ['debit'], false, false ), |
|
283 | - $this->common->calculate_currency_manually ( $currency_info, $value ['cost'], false, false ), |
|
282 | + $this->common->calculate_currency_manually($currency_info, $value ['debit'], false, false), |
|
283 | + $this->common->calculate_currency_manually($currency_info, $value ['cost'], false, false), |
|
284 | 284 | $value ['disposition'], |
285 | 285 | $account, |
286 | - isset ( $trunk_arr [$value ['trunk_id']] ) ? $trunk_arr [$value ['trunk_id']] : '', |
|
287 | - isset ( $pricelist_arr [$value ['pricelist_id']] ) ? $pricelist_arr [$value ['pricelist_id']] : '', |
|
286 | + isset ($trunk_arr [$value ['trunk_id']]) ? $trunk_arr [$value ['trunk_id']] : '', |
|
287 | + isset ($pricelist_arr [$value ['pricelist_id']]) ? $pricelist_arr [$value ['pricelist_id']] : '', |
|
288 | 288 | $value ['calltype'] |
289 | 289 | ); |
290 | 290 | } |
291 | - $duration = ($show_seconds == 'minutes') ? ($count_all ['billseconds'] > 0) ? floor ( $count_all ['billseconds'] / 60 ) . ":" . sprintf ( '%02d', $count_all ['billseconds'] % 60 ) : "00:00" : $count_all ['billseconds']; |
|
292 | - $customer_array [] = array ( |
|
291 | + $duration = ($show_seconds == 'minutes') ? ($count_all ['billseconds'] > 0) ? floor ($count_all ['billseconds'] / 60).":".sprintf('%02d', $count_all ['billseconds'] % 60) : "00:00" : $count_all ['billseconds']; |
|
292 | + $customer_array [] = array( |
|
293 | 293 | "Grand Total", |
294 | 294 | "", |
295 | 295 | "", |
296 | 296 | "", |
297 | 297 | "", |
298 | 298 | $duration, |
299 | - $this->common->calculate_currency_manually ( $currency_info, $count_all ['total_debit'], false, false ), |
|
300 | - $this->common->calculate_currency_manually ( $currency_info, $count_all ['total_cost'], false, false ), |
|
299 | + $this->common->calculate_currency_manually($currency_info, $count_all ['total_debit'], false, false), |
|
300 | + $this->common->calculate_currency_manually($currency_info, $count_all ['total_cost'], false, false), |
|
301 | 301 | "", |
302 | 302 | "", |
303 | 303 | "", |
@@ -308,48 +308,48 @@ discard block |
||
308 | 308 | "" |
309 | 309 | ); |
310 | 310 | } else { |
311 | - $customer_array [] = array ( |
|
312 | - gettext ( "Date" ), |
|
313 | - gettext ( "CallerID" ), |
|
314 | - gettext ( "Called Number" ), |
|
315 | - gettext ( "Code" ), |
|
316 | - gettext ( "Destination" ), |
|
317 | - gettext ( "Duration" ), |
|
318 | - gettext ( "Debit" ) . "(" . $currency . ")", |
|
319 | - gettext ( "Cost" ) . "(" . $currency . ")", |
|
320 | - gettext ( "Disposition" ), |
|
321 | - gettext ( "Account" ), |
|
322 | - gettext ( "Rate Group" ), |
|
323 | - gettext ( "Call Type" ) |
|
311 | + $customer_array [] = array( |
|
312 | + gettext("Date"), |
|
313 | + gettext("CallerID"), |
|
314 | + gettext("Called Number"), |
|
315 | + gettext("Code"), |
|
316 | + gettext("Destination"), |
|
317 | + gettext("Duration"), |
|
318 | + gettext("Debit")."(".$currency.")", |
|
319 | + gettext("Cost")."(".$currency.")", |
|
320 | + gettext("Disposition"), |
|
321 | + gettext("Account"), |
|
322 | + gettext("Rate Group"), |
|
323 | + gettext("Call Type") |
|
324 | 324 | ); |
325 | - foreach ( $query->result_array () as $value ) { |
|
326 | - $duration = ($show_seconds == 'minutes') ? ($value ['billseconds'] > 0) ? floor ( $value ['billseconds'] / 60 ) . ":" . sprintf ( '%02d', $value ['billseconds'] % 60 ) : "00:00" : $value ['billseconds']; |
|
327 | - $account = isset ( $account_arr [$value ['accountid']] ) ? $account_arr [$value ['accountid']] : 'Anonymous'; |
|
328 | - $customer_array [] = array ( |
|
329 | - $this->common->convert_GMT_to ( '', '', $value ['callstart'] ), |
|
325 | + foreach ($query->result_array() as $value) { |
|
326 | + $duration = ($show_seconds == 'minutes') ? ($value ['billseconds'] > 0) ? floor ($value ['billseconds'] / 60).":".sprintf('%02d', $value ['billseconds'] % 60) : "00:00" : $value ['billseconds']; |
|
327 | + $account = isset ($account_arr [$value ['accountid']]) ? $account_arr [$value ['accountid']] : 'Anonymous'; |
|
328 | + $customer_array [] = array( |
|
329 | + $this->common->convert_GMT_to('', '', $value ['callstart']), |
|
330 | 330 | $value ['callerid'], |
331 | 331 | $value ['callednum'], |
332 | - filter_var ( $value ['pattern'], FILTER_SANITIZE_NUMBER_INT ), |
|
332 | + filter_var($value ['pattern'], FILTER_SANITIZE_NUMBER_INT), |
|
333 | 333 | $value ['notes'], |
334 | 334 | $duration, |
335 | - $this->common->calculate_currency_manually ( $currency_info, $value ['debit'], false, false ), |
|
336 | - $this->common->calculate_currency_manually ( $currency_info, $value ['cost'], false, false ), |
|
335 | + $this->common->calculate_currency_manually($currency_info, $value ['debit'], false, false), |
|
336 | + $this->common->calculate_currency_manually($currency_info, $value ['cost'], false, false), |
|
337 | 337 | $value ['disposition'], |
338 | 338 | $account, |
339 | - isset ( $pricelist_arr [$value ['pricelist_id']] ) ? $pricelist_arr [$value ['pricelist_id']] : '', |
|
339 | + isset ($pricelist_arr [$value ['pricelist_id']]) ? $pricelist_arr [$value ['pricelist_id']] : '', |
|
340 | 340 | $value ['calltype'] |
341 | 341 | ); |
342 | 342 | } |
343 | - $duration = ($show_seconds == 'minutes') ? ($count_all ['billseconds'] > 0) ? floor ( $count_all ['billseconds'] / 60 ) . ":" . sprintf ( '%02d', $count_all ['billseconds'] % 60 ) : "00:00" : $count_all ['billseconds']; |
|
344 | - $customer_array [] = array ( |
|
343 | + $duration = ($show_seconds == 'minutes') ? ($count_all ['billseconds'] > 0) ? floor ($count_all ['billseconds'] / 60).":".sprintf('%02d', $count_all ['billseconds'] % 60) : "00:00" : $count_all ['billseconds']; |
|
344 | + $customer_array [] = array( |
|
345 | 345 | "Grand Total", |
346 | 346 | "", |
347 | 347 | "", |
348 | 348 | "", |
349 | 349 | "", |
350 | 350 | $duration, |
351 | - $this->common->calculate_currency_manually ( $currency_info, $count_all ['total_debit'], false, false ), |
|
352 | - $this->common->calculate_currency_manually ( $currency_info, $count_all ['total_cost'], false, false ), |
|
351 | + $this->common->calculate_currency_manually($currency_info, $count_all ['total_debit'], false, false), |
|
352 | + $this->common->calculate_currency_manually($currency_info, $count_all ['total_cost'], false, false), |
|
353 | 353 | "", |
354 | 354 | "", |
355 | 355 | "", |
@@ -360,37 +360,37 @@ discard block |
||
360 | 360 | ); |
361 | 361 | } |
362 | 362 | } |
363 | - $this->load->helper ( 'csv' ); |
|
364 | - if (isset ( $customer_array )) { |
|
365 | - array_to_csv ( $customer_array, 'Customer_CDR_' . date ( "Y-m-d" ) . '.csv' ); |
|
363 | + $this->load->helper('csv'); |
|
364 | + if (isset ($customer_array)) { |
|
365 | + array_to_csv($customer_array, 'Customer_CDR_'.date("Y-m-d").'.csv'); |
|
366 | 366 | } else { |
367 | - $customer_array [] = array ( |
|
368 | - gettext ( "Date" ), |
|
369 | - gettext ( "Caller ID" ), |
|
370 | - gettext ( "Called Number" ), |
|
371 | - gettext ( "Code" ), |
|
372 | - gettext ( "Destination" ), |
|
373 | - gettext ( "Duration" ), |
|
374 | - gettext ( "Debit" ) . "(" . $currency . ")", |
|
375 | - gettext ( "Cost" ) . "(" . $currency . ")", |
|
376 | - gettext ( "Disposition" ), |
|
377 | - gettext ( "Account" ), |
|
378 | - gettext ( "Rate Group" ), |
|
379 | - gettext ( "Call Type" ) |
|
367 | + $customer_array [] = array( |
|
368 | + gettext("Date"), |
|
369 | + gettext("Caller ID"), |
|
370 | + gettext("Called Number"), |
|
371 | + gettext("Code"), |
|
372 | + gettext("Destination"), |
|
373 | + gettext("Duration"), |
|
374 | + gettext("Debit")."(".$currency.")", |
|
375 | + gettext("Cost")."(".$currency.")", |
|
376 | + gettext("Disposition"), |
|
377 | + gettext("Account"), |
|
378 | + gettext("Rate Group"), |
|
379 | + gettext("Call Type") |
|
380 | 380 | ); |
381 | - array_to_csv ( $customer_array, 'Customer_CDR_' . date ( "Y-m-d" ) . '.csv' ); |
|
381 | + array_to_csv($customer_array, 'Customer_CDR_'.date("Y-m-d").'.csv'); |
|
382 | 382 | } |
383 | 383 | } |
384 | 384 | |
385 | 385 | /* * *************************** */ |
386 | 386 | function resellerReport() { |
387 | - $data ['page_title'] = gettext ( 'Resellers CDRs Report' ); |
|
387 | + $data ['page_title'] = gettext('Resellers CDRs Report'); |
|
388 | 388 | $data ['search_flag'] = true; |
389 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
390 | - $data ['grid_fields'] = $this->reports_form->build_report_list_for_reseller (); |
|
391 | - $data ["grid_buttons"] = $this->reports_form->build_grid_buttons_reseller (); |
|
392 | - $data ['form_search'] = $this->form->build_serach_form ( $this->reports_form->get_reseller_cdr_form () ); |
|
393 | - $this->load->view ( 'view_cdr_reseller_list', $data ); |
|
389 | + $this->session->set_userdata('advance_search', 0); |
|
390 | + $data ['grid_fields'] = $this->reports_form->build_report_list_for_reseller(); |
|
391 | + $data ["grid_buttons"] = $this->reports_form->build_grid_buttons_reseller(); |
|
392 | + $data ['form_search'] = $this->form->build_serach_form($this->reports_form->get_reseller_cdr_form()); |
|
393 | + $this->load->view('view_cdr_reseller_list', $data); |
|
394 | 394 | } |
395 | 395 | |
396 | 396 | /** |
@@ -400,27 +400,27 @@ discard block |
||
400 | 400 | function resellerReport_json() { |
401 | 401 | |
402 | 402 | // Get Total Count,Total debit,Total cost information |
403 | - $count_res = $this->reports_model->getreseller_cdrs ( false, "", "" ); |
|
404 | - $count_all = ( array ) $count_res->first_row (); |
|
405 | - $paging_data = $this->form->load_grid_config ( $count_all ['count'], $_GET ['rp'], $_GET ['page'] ); |
|
403 | + $count_res = $this->reports_model->getreseller_cdrs(false, "", ""); |
|
404 | + $count_all = (array)$count_res->first_row(); |
|
405 | + $paging_data = $this->form->load_grid_config($count_all ['count'], $_GET ['rp'], $_GET ['page']); |
|
406 | 406 | $json_data = $paging_data ["json_paging"]; |
407 | - $query = $this->reports_model->getreseller_cdrs ( true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
|
408 | - $grid_fields = json_decode ( $this->reports_form->build_report_list_for_reseller () ); |
|
409 | - $json_data ['rows'] = $this->form->build_grid ( $query, $grid_fields ); |
|
407 | + $query = $this->reports_model->getreseller_cdrs(true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"]); |
|
408 | + $grid_fields = json_decode($this->reports_form->build_report_list_for_reseller()); |
|
409 | + $json_data ['rows'] = $this->form->build_grid($query, $grid_fields); |
|
410 | 410 | if ($count_all ['count'] > 0) { |
411 | - $search_arr = $this->session->userdata ( 'reseller_cdr_list_search' ); |
|
412 | - $show_seconds = (! empty ( $search_arr ['search_in'] )) ? $search_arr ['search_in'] : 'minutes'; |
|
413 | - $duration = ($show_seconds == 'minutes') ? ($count_all ['billseconds'] > 0) ? sprintf ( '%02d', $count_all ['billseconds'] / 60 ) . ":" . sprintf ( '%02d', $count_all ['billseconds'] % 60 ) : "00:00" : sprintf ( '%02d', $count_all ['billseconds'] ); |
|
414 | - $json_data ['rows'] [] = array ( |
|
415 | - "cell" => array ( |
|
411 | + $search_arr = $this->session->userdata('reseller_cdr_list_search'); |
|
412 | + $show_seconds = ( ! empty ($search_arr ['search_in'])) ? $search_arr ['search_in'] : 'minutes'; |
|
413 | + $duration = ($show_seconds == 'minutes') ? ($count_all ['billseconds'] > 0) ? sprintf ('%02d', $count_all ['billseconds'] / 60).":".sprintf('%02d', $count_all ['billseconds'] % 60) : "00:00" : sprintf('%02d', $count_all ['billseconds']); |
|
414 | + $json_data ['rows'] [] = array( |
|
415 | + "cell" => array( |
|
416 | 416 | "<b>Grand Total</b>", |
417 | 417 | "", |
418 | 418 | "", |
419 | 419 | "", |
420 | 420 | "", |
421 | 421 | "<b>$duration</b>", |
422 | - "<b>" . $this->common_model->calculate_currency ( $count_all ['total_debit'], '', '', true, false ) . "</b>", |
|
423 | - "<b>" . $this->common_model->calculate_currency ( $count_all ['total_cost'], '', '', true, false ) . "</b>", |
|
422 | + "<b>".$this->common_model->calculate_currency($count_all ['total_debit'], '', '', true, false)."</b>", |
|
423 | + "<b>".$this->common_model->calculate_currency($count_all ['total_cost'], '', '', true, false)."</b>", |
|
424 | 424 | "", |
425 | 425 | "", |
426 | 426 | "", |
@@ -432,91 +432,91 @@ discard block |
||
432 | 432 | ) |
433 | 433 | ); |
434 | 434 | } |
435 | - echo json_encode ( $json_data ); |
|
435 | + echo json_encode($json_data); |
|
436 | 436 | } |
437 | 437 | function resellerReport_search() { |
438 | - $ajax_search = $this->input->post ( 'ajax_search', 0 ); |
|
439 | - if ($this->input->post ( 'advance_search', TRUE ) == 1) { |
|
440 | - $this->session->set_userdata ( 'advance_search', $this->input->post ( 'advance_search' ) ); |
|
441 | - $action = $this->input->post (); |
|
442 | - unset ( $action ['action'] ); |
|
443 | - unset ( $action ['advance_search'] ); |
|
444 | - $this->session->set_userdata ( 'reseller_cdr_list_search', $action ); |
|
438 | + $ajax_search = $this->input->post('ajax_search', 0); |
|
439 | + if ($this->input->post('advance_search', TRUE) == 1) { |
|
440 | + $this->session->set_userdata('advance_search', $this->input->post('advance_search')); |
|
441 | + $action = $this->input->post(); |
|
442 | + unset ($action ['action']); |
|
443 | + unset ($action ['advance_search']); |
|
444 | + $this->session->set_userdata('reseller_cdr_list_search', $action); |
|
445 | 445 | } |
446 | 446 | if (@$ajax_search != 1) { |
447 | - redirect ( base_url () . 'reports/resellerReport/' ); |
|
447 | + redirect(base_url().'reports/resellerReport/'); |
|
448 | 448 | } |
449 | 449 | } |
450 | 450 | function resellerReport_clearsearchfilter() { |
451 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
452 | - $this->session->set_userdata ( 'account_search', "" ); |
|
451 | + $this->session->set_userdata('advance_search', 0); |
|
452 | + $this->session->set_userdata('account_search', ""); |
|
453 | 453 | } |
454 | 454 | function resellerReport_export() { |
455 | 455 | // Get All count related information. |
456 | - $account_info = $accountinfo = $this->session->userdata ( 'accountinfo' ); |
|
456 | + $account_info = $accountinfo = $this->session->userdata('accountinfo'); |
|
457 | 457 | $currency_id = $account_info ['currency_id']; |
458 | - $currency = $this->common->get_field_name ( 'currency', 'currency', $currency_id ); |
|
459 | - $count_res = $this->reports_model->getreseller_cdrs ( false, "", "" ); |
|
460 | - $count_all = ( array ) $count_res->first_row (); |
|
461 | - ob_clean (); |
|
462 | - $reseller_array [] = array ( |
|
463 | - gettext ( "Date" ), |
|
464 | - gettext ( "Caller ID" ), |
|
465 | - gettext ( "Called Number" ), |
|
466 | - gettext ( "Code" ), |
|
467 | - gettext ( "Destination" ), |
|
468 | - gettext ( "Duration" ), |
|
469 | - gettext ( "Debit" ) . "(" . $currency . ")", |
|
470 | - gettext ( "Cost" ) . "(" . $currency . ")", |
|
471 | - gettext ( "Disposition" ), |
|
472 | - gettext ( "Account" ), |
|
473 | - gettext ( "Rate Group" ), |
|
474 | - gettext ( "Call Type" ) |
|
458 | + $currency = $this->common->get_field_name('currency', 'currency', $currency_id); |
|
459 | + $count_res = $this->reports_model->getreseller_cdrs(false, "", ""); |
|
460 | + $count_all = (array)$count_res->first_row(); |
|
461 | + ob_clean(); |
|
462 | + $reseller_array [] = array( |
|
463 | + gettext("Date"), |
|
464 | + gettext("Caller ID"), |
|
465 | + gettext("Called Number"), |
|
466 | + gettext("Code"), |
|
467 | + gettext("Destination"), |
|
468 | + gettext("Duration"), |
|
469 | + gettext("Debit")."(".$currency.")", |
|
470 | + gettext("Cost")."(".$currency.")", |
|
471 | + gettext("Disposition"), |
|
472 | + gettext("Account"), |
|
473 | + gettext("Rate Group"), |
|
474 | + gettext("Call Type") |
|
475 | 475 | ); |
476 | 476 | if ($count_all ['count'] > 0) { |
477 | 477 | // Initialization of Rategroup array |
478 | - $pricelist_arr = array (); |
|
479 | - $query = $this->reports_model->getreseller_cdrs ( true, '', '', true ); |
|
478 | + $pricelist_arr = array(); |
|
479 | + $query = $this->reports_model->getreseller_cdrs(true, '', '', true); |
|
480 | 480 | // Get Decimal points,system currency and user currency. |
481 | - $currency_info = $this->common->get_currency_info (); |
|
481 | + $currency_info = $this->common->get_currency_info(); |
|
482 | 482 | // Get search information from session. |
483 | - $search_arr = $this->session->userdata ( 'reseller_cdr_list_search' ); |
|
484 | - $show_seconds = (! empty ( $search_arr ['search_in'] )) ? $search_arr ['search_in'] : 'minutes'; |
|
485 | - $where = "id IN (" . $count_all ['pricelist_ids'] . ")"; |
|
486 | - $this->db->where ( $where ); |
|
487 | - $this->db->select ( 'id,name' ); |
|
488 | - $pricelist_res = $this->db->get ( 'pricelists' ); |
|
489 | - $pricelist_res = $pricelist_res->result_array (); |
|
490 | - foreach ( $pricelist_res as $value ) { |
|
483 | + $search_arr = $this->session->userdata('reseller_cdr_list_search'); |
|
484 | + $show_seconds = ( ! empty ($search_arr ['search_in'])) ? $search_arr ['search_in'] : 'minutes'; |
|
485 | + $where = "id IN (".$count_all ['pricelist_ids'].")"; |
|
486 | + $this->db->where($where); |
|
487 | + $this->db->select('id,name'); |
|
488 | + $pricelist_res = $this->db->get('pricelists'); |
|
489 | + $pricelist_res = $pricelist_res->result_array(); |
|
490 | + foreach ($pricelist_res as $value) { |
|
491 | 491 | $pricelist_arr [$value ['id']] = $value ['name']; |
492 | 492 | } |
493 | - foreach ( $query->result_array () as $value ) { |
|
494 | - $duration = ($show_seconds == 'minutes') ? ($value ['billseconds'] > 0) ? sprintf ( '%02d', $value ['billseconds'] / 60 ) . ":" . sprintf ( '%02d', $value ['billseconds'] % 60 ) : "00:00" : $value ['billseconds']; |
|
495 | - $reseller_array [] = array ( |
|
496 | - $this->common->convert_GMT_to ( '', '', $value ['callstart'] ), |
|
493 | + foreach ($query->result_array() as $value) { |
|
494 | + $duration = ($show_seconds == 'minutes') ? ($value ['billseconds'] > 0) ? sprintf ('%02d', $value ['billseconds'] / 60).":".sprintf('%02d', $value ['billseconds'] % 60) : "00:00" : $value ['billseconds']; |
|
495 | + $reseller_array [] = array( |
|
496 | + $this->common->convert_GMT_to('', '', $value ['callstart']), |
|
497 | 497 | $value ['callerid'], |
498 | 498 | $value ['callednum'], |
499 | - filter_var ( $value ['pattern'], FILTER_SANITIZE_NUMBER_INT ), |
|
499 | + filter_var($value ['pattern'], FILTER_SANITIZE_NUMBER_INT), |
|
500 | 500 | $value ['notes'], |
501 | 501 | $duration, |
502 | - $this->common->calculate_currency_manually ( $currency_info, $value ['debit'], false, false ), |
|
503 | - $this->common->calculate_currency_manually ( $currency_info, $value ['cost'], false, false ), |
|
502 | + $this->common->calculate_currency_manually($currency_info, $value ['debit'], false, false), |
|
503 | + $this->common->calculate_currency_manually($currency_info, $value ['cost'], false, false), |
|
504 | 504 | $value ['disposition'], |
505 | - $this->common->build_concat_string ( "first_name,last_name,number", "accounts", $value ['accountid'] ), |
|
506 | - isset ( $pricelist_arr [$value ['pricelist_id']] ) ? $pricelist_arr [$value ['pricelist_id']] : '', |
|
505 | + $this->common->build_concat_string("first_name,last_name,number", "accounts", $value ['accountid']), |
|
506 | + isset ($pricelist_arr [$value ['pricelist_id']]) ? $pricelist_arr [$value ['pricelist_id']] : '', |
|
507 | 507 | $value ['calltype'] |
508 | 508 | ); |
509 | 509 | } |
510 | - $duration = ($show_seconds == 'minutes') ? ($count_all ['billseconds'] > 0) ? floor ( $count_all ['billseconds'] / 60 ) . ":" . sprintf ( '%02d', $count_all ['billseconds'] % 60 ) : "00:00" : $count_all ['billseconds']; |
|
511 | - $reseller_array [] = array ( |
|
510 | + $duration = ($show_seconds == 'minutes') ? ($count_all ['billseconds'] > 0) ? floor ($count_all ['billseconds'] / 60).":".sprintf('%02d', $count_all ['billseconds'] % 60) : "00:00" : $count_all ['billseconds']; |
|
511 | + $reseller_array [] = array( |
|
512 | 512 | "Grand Total", |
513 | 513 | "", |
514 | 514 | "", |
515 | 515 | "", |
516 | 516 | "", |
517 | 517 | $duration, |
518 | - $this->common->calculate_currency_manually ( $currency_info, $count_all ['total_debit'], false, false ), |
|
519 | - $this->common->calculate_currency_manually ( $currency_info, $count_all ['total_cost'], false, false ), |
|
518 | + $this->common->calculate_currency_manually($currency_info, $count_all ['total_debit'], false, false), |
|
519 | + $this->common->calculate_currency_manually($currency_info, $count_all ['total_cost'], false, false), |
|
520 | 520 | "", |
521 | 521 | "", |
522 | 522 | "", |
@@ -527,120 +527,120 @@ discard block |
||
527 | 527 | "" |
528 | 528 | ); |
529 | 529 | } |
530 | - $this->load->helper ( 'csv' ); |
|
531 | - array_to_csv ( $reseller_array, 'Reseller_CDR_' . date ( "Y-m-d" ) . '.csv' ); |
|
530 | + $this->load->helper('csv'); |
|
531 | + array_to_csv($reseller_array, 'Reseller_CDR_'.date("Y-m-d").'.csv'); |
|
532 | 532 | } |
533 | 533 | function providerReport() { |
534 | - $data ['page_title'] = gettext ( 'Provider CDRs Report' ); |
|
534 | + $data ['page_title'] = gettext('Provider CDRs Report'); |
|
535 | 535 | $data ['search_flag'] = true; |
536 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
537 | - $data ['grid_fields'] = $this->reports_form->build_report_list_for_provider (); |
|
538 | - $data ["grid_buttons"] = $this->reports_form->build_grid_buttons_provider (); |
|
539 | - $data ['form_search'] = $this->form->build_serach_form ( $this->reports_form->get_provider_cdr_form () ); |
|
540 | - $this->load->view ( 'view_cdr_provider_list', $data ); |
|
536 | + $this->session->set_userdata('advance_search', 0); |
|
537 | + $data ['grid_fields'] = $this->reports_form->build_report_list_for_provider(); |
|
538 | + $data ["grid_buttons"] = $this->reports_form->build_grid_buttons_provider(); |
|
539 | + $data ['form_search'] = $this->form->build_serach_form($this->reports_form->get_provider_cdr_form()); |
|
540 | + $this->load->view('view_cdr_provider_list', $data); |
|
541 | 541 | } |
542 | 542 | function providerReport_json() { |
543 | 543 | // Get All count related information. |
544 | - $count_res = $this->reports_model->getprovider_cdrs ( false, "", "" ); |
|
545 | - $count_all = ( array ) $count_res->first_row (); |
|
546 | - $paging_data = $this->form->load_grid_config ( $count_all ['count'], $_GET ['rp'], $_GET ['page'] ); |
|
544 | + $count_res = $this->reports_model->getprovider_cdrs(false, "", ""); |
|
545 | + $count_all = (array)$count_res->first_row(); |
|
546 | + $paging_data = $this->form->load_grid_config($count_all ['count'], $_GET ['rp'], $_GET ['page']); |
|
547 | 547 | $json_data = $paging_data ["json_paging"]; |
548 | 548 | |
549 | - $query = $this->reports_model->getprovider_cdrs ( true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
|
550 | - $grid_fields = json_decode ( $this->reports_form->build_report_list_for_provider () ); |
|
551 | - $json_data ['rows'] = $this->form->build_grid ( $query, $grid_fields ); |
|
549 | + $query = $this->reports_model->getprovider_cdrs(true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"]); |
|
550 | + $grid_fields = json_decode($this->reports_form->build_report_list_for_provider()); |
|
551 | + $json_data ['rows'] = $this->form->build_grid($query, $grid_fields); |
|
552 | 552 | if ($count_all ['count'] > 0) { |
553 | - $search_arr = $this->session->userdata ( 'provider_cdr_list_search' ); |
|
554 | - $show_seconds = (! empty ( $search_arr ['search_in'] )) ? $search_arr ['search_in'] : 'minutes'; |
|
555 | - $duration = ($show_seconds == 'minutes') ? ($count_all ['billseconds'] > 0) ? floor ( $count_all ['billseconds'] / 60 ) . ":" . sprintf ( "%02d", $count_all ['billseconds'] % 60 ) : "00:00" : $count_all ['billseconds']; |
|
556 | - $json_data ['rows'] [] = array ( |
|
557 | - "cell" => array ( |
|
553 | + $search_arr = $this->session->userdata('provider_cdr_list_search'); |
|
554 | + $show_seconds = ( ! empty ($search_arr ['search_in'])) ? $search_arr ['search_in'] : 'minutes'; |
|
555 | + $duration = ($show_seconds == 'minutes') ? ($count_all ['billseconds'] > 0) ? floor ($count_all ['billseconds'] / 60).":".sprintf("%02d", $count_all ['billseconds'] % 60) : "00:00" : $count_all ['billseconds']; |
|
556 | + $json_data ['rows'] [] = array( |
|
557 | + "cell" => array( |
|
558 | 558 | "<b>Grand Total</b>", |
559 | 559 | "", |
560 | 560 | "", |
561 | 561 | "", |
562 | 562 | "", |
563 | 563 | "<b>$duration</b>", |
564 | - "<b>" . $this->common_model->calculate_currency ( $count_all ['total_cost'], '', '', true, false ) . "</b>", |
|
564 | + "<b>".$this->common_model->calculate_currency($count_all ['total_cost'], '', '', true, false)."</b>", |
|
565 | 565 | "", |
566 | 566 | "" |
567 | 567 | ) |
568 | 568 | ); |
569 | 569 | } |
570 | - echo json_encode ( $json_data ); |
|
570 | + echo json_encode($json_data); |
|
571 | 571 | } |
572 | 572 | function providerReport_search() { |
573 | - $ajax_search = $this->input->post ( 'ajax_search', 0 ); |
|
574 | - if ($this->input->post ( 'advance_search', TRUE ) == 1) { |
|
575 | - $this->session->set_userdata ( 'advance_search', $this->input->post ( 'advance_search' ) ); |
|
576 | - $action = $this->input->post (); |
|
577 | - unset ( $action ['action'] ); |
|
578 | - unset ( $action ['advance_search'] ); |
|
579 | - $this->session->set_userdata ( 'provider_cdr_list_search', $action ); |
|
573 | + $ajax_search = $this->input->post('ajax_search', 0); |
|
574 | + if ($this->input->post('advance_search', TRUE) == 1) { |
|
575 | + $this->session->set_userdata('advance_search', $this->input->post('advance_search')); |
|
576 | + $action = $this->input->post(); |
|
577 | + unset ($action ['action']); |
|
578 | + unset ($action ['advance_search']); |
|
579 | + $this->session->set_userdata('provider_cdr_list_search', $action); |
|
580 | 580 | } |
581 | 581 | if (@$ajax_search != 1) { |
582 | - redirect ( base_url () . 'reports/providerReport/' ); |
|
582 | + redirect(base_url().'reports/providerReport/'); |
|
583 | 583 | } |
584 | 584 | } |
585 | 585 | function providerReport_clearsearchfilter() { |
586 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
587 | - $this->session->set_userdata ( 'account_search', "" ); |
|
586 | + $this->session->set_userdata('advance_search', 0); |
|
587 | + $this->session->set_userdata('account_search', ""); |
|
588 | 588 | } |
589 | 589 | function providerReport_export() { |
590 | 590 | /* |
591 | 591 | * ASTPP 3.0 |
592 | 592 | * Get All count information as well All total information |
593 | 593 | */ |
594 | - $account_info = $accountinfo = $this->session->userdata ( 'accountinfo' ); |
|
594 | + $account_info = $accountinfo = $this->session->userdata('accountinfo'); |
|
595 | 595 | $currency_id = $account_info ['currency_id']; |
596 | - $currency = $this->common->get_field_name ( 'currency', 'currency', $currency_id ); |
|
597 | - $count_res = $this->reports_model->getprovider_cdrs ( false, "", "" ); |
|
598 | - $count_all = ( array ) $count_res->first_row (); |
|
599 | - ob_clean (); |
|
600 | - $provider_array [] = array ( |
|
601 | - gettext ( "Date" ), |
|
602 | - gettext ( "Caller ID" ), |
|
603 | - gettext ( "Called Number" ), |
|
604 | - gettext ( "Code" ), |
|
605 | - gettext ( "Destination" ), |
|
606 | - gettext ( "Duration" ), |
|
607 | - gettext ( "Cost" ) . "(" . $currency . ")", |
|
608 | - gettext ( "Disposition" ), |
|
609 | - gettext ( "Account" ) |
|
596 | + $currency = $this->common->get_field_name('currency', 'currency', $currency_id); |
|
597 | + $count_res = $this->reports_model->getprovider_cdrs(false, "", ""); |
|
598 | + $count_all = (array)$count_res->first_row(); |
|
599 | + ob_clean(); |
|
600 | + $provider_array [] = array( |
|
601 | + gettext("Date"), |
|
602 | + gettext("Caller ID"), |
|
603 | + gettext("Called Number"), |
|
604 | + gettext("Code"), |
|
605 | + gettext("Destination"), |
|
606 | + gettext("Duration"), |
|
607 | + gettext("Cost")."(".$currency.")", |
|
608 | + gettext("Disposition"), |
|
609 | + gettext("Account") |
|
610 | 610 | ); |
611 | 611 | if ($count_all ['count'] > 0) { |
612 | - $query = $this->reports_model->getprovider_cdrs ( true, '', '', true ); |
|
612 | + $query = $this->reports_model->getprovider_cdrs(true, '', '', true); |
|
613 | 613 | // Get Decimal points,system currency and user currency. |
614 | - $currency_info = $this->common->get_currency_info (); |
|
614 | + $currency_info = $this->common->get_currency_info(); |
|
615 | 615 | // Get search information from session. |
616 | - $search_arr = $this->session->userdata ( 'provider_cdr_list_search' ); |
|
617 | - $show_seconds = (! empty ( $search_arr ['search_in'] )) ? $search_arr ['search_in'] : 'minutes'; |
|
618 | - foreach ( $query->result_array () as $value ) { |
|
616 | + $search_arr = $this->session->userdata('provider_cdr_list_search'); |
|
617 | + $show_seconds = ( ! empty ($search_arr ['search_in'])) ? $search_arr ['search_in'] : 'minutes'; |
|
618 | + foreach ($query->result_array() as $value) { |
|
619 | 619 | // echo"<pre>";print_r($value);exit; |
620 | - $duration = ($show_seconds == 'minutes') ? ($value ['billseconds'] > 0) ? floor ( $value ['billseconds'] / 60 ) . ":" . sprintf ( "%02d", $value ['billseconds'] % 60 ) : "00:00" : $value ['billseconds']; |
|
621 | - $account_arr = $this->db_model->getSelect ( '*', 'accounts', array ( |
|
620 | + $duration = ($show_seconds == 'minutes') ? ($value ['billseconds'] > 0) ? floor ($value ['billseconds'] / 60).":".sprintf("%02d", $value ['billseconds'] % 60) : "00:00" : $value ['billseconds']; |
|
621 | + $account_arr = $this->db_model->getSelect('*', 'accounts', array( |
|
622 | 622 | 'id' => $value ['provider_id'] |
623 | - ) ); |
|
624 | - if ($account_arr->num_rows () > 0) { |
|
625 | - $account_array = $account_arr->result_array (); |
|
626 | - $account = $account_array [0] ['first_name'] . " " . $account_array [0] ['last_name'] . ' (' . $account_array [0] ['number'] . ')'; |
|
623 | + )); |
|
624 | + if ($account_arr->num_rows() > 0) { |
|
625 | + $account_array = $account_arr->result_array(); |
|
626 | + $account = $account_array [0] ['first_name']." ".$account_array [0] ['last_name'].' ('.$account_array [0] ['number'].')'; |
|
627 | 627 | } else { |
628 | 628 | $account = "Anonymous"; |
629 | 629 | } |
630 | - $provider_array [] = array ( |
|
631 | - $this->common->convert_GMT_to ( '', '', $value ['callstart'] ), |
|
630 | + $provider_array [] = array( |
|
631 | + $this->common->convert_GMT_to('', '', $value ['callstart']), |
|
632 | 632 | $value ['callerid'], |
633 | 633 | $value ['callednum'], |
634 | - filter_var ( $value ['pattern'], FILTER_SANITIZE_NUMBER_INT ), |
|
634 | + filter_var($value ['pattern'], FILTER_SANITIZE_NUMBER_INT), |
|
635 | 635 | $value ['notes'], |
636 | 636 | $duration, |
637 | - $this->common->calculate_currency_manually ( $currency_info, $value ['cost'], false, false ), |
|
637 | + $this->common->calculate_currency_manually($currency_info, $value ['cost'], false, false), |
|
638 | 638 | $value ['disposition'], |
639 | 639 | $account |
640 | 640 | ); |
641 | 641 | } |
642 | - $duration = ($show_seconds == 'minutes') ? ($count_all ['billseconds'] > 0) ? floor ( $count_all ['billseconds'] / 60 ) . ":" . sprintf ( "%02d", $count_all ['billseconds'] % 60 ) : "00:00" : $count_all ['billseconds']; |
|
643 | - $provider_array [] = array ( |
|
642 | + $duration = ($show_seconds == 'minutes') ? ($count_all ['billseconds'] > 0) ? floor ($count_all ['billseconds'] / 60).":".sprintf("%02d", $count_all ['billseconds'] % 60) : "00:00" : $count_all ['billseconds']; |
|
643 | + $provider_array [] = array( |
|
644 | 644 | "Grand Total", |
645 | 645 | "", |
646 | 646 | "", |
@@ -648,7 +648,7 @@ discard block |
||
648 | 648 | "", |
649 | 649 | $duration, |
650 | 650 | // $this->common->calculate_currency_manually($currency_info, $count_all['total_debit']), |
651 | - $this->common->calculate_currency_manually ( $currency_info, $count_all ['total_cost'], false, false ), |
|
651 | + $this->common->calculate_currency_manually($currency_info, $count_all ['total_cost'], false, false), |
|
652 | 652 | "", |
653 | 653 | "", |
654 | 654 | "", |
@@ -660,8 +660,8 @@ discard block |
||
660 | 660 | ); |
661 | 661 | } |
662 | 662 | // echo "<pre>";print_r($provider_array);exit; |
663 | - $this->load->helper ( 'csv' ); |
|
664 | - array_to_csv ( $provider_array, 'Provider_CDR_' . date ( "Y-m-d" ) . '.csv' ); |
|
663 | + $this->load->helper('csv'); |
|
664 | + array_to_csv($provider_array, 'Provider_CDR_'.date("Y-m-d").'.csv'); |
|
665 | 665 | } |
666 | 666 | |
667 | 667 | /* |
@@ -671,40 +671,40 @@ discard block |
||
671 | 671 | * **** |
672 | 672 | */ |
673 | 673 | function user_refillreport() { |
674 | - $json_data = array (); |
|
675 | - $count_all = $this->reports_model->getuser_refill_list ( false, "", "" ); |
|
676 | - $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
|
674 | + $json_data = array(); |
|
675 | + $count_all = $this->reports_model->getuser_refill_list(false, "", ""); |
|
676 | + $paging_data = $this->form->load_grid_config($count_all, $_GET ['rp'], $_GET ['page']); |
|
677 | 677 | $json_data = $paging_data ["json_paging"]; |
678 | 678 | |
679 | - $query = $this->reports_model->getuser_refill_list ( true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
|
680 | - $grid_fields = json_decode ( $this->reports_form->build_refill_report_for_user () ); |
|
681 | - $json_data ['rows'] = $this->form->build_grid ( $query, $grid_fields ); |
|
679 | + $query = $this->reports_model->getuser_refill_list(true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"]); |
|
680 | + $grid_fields = json_decode($this->reports_form->build_refill_report_for_user()); |
|
681 | + $json_data ['rows'] = $this->form->build_grid($query, $grid_fields); |
|
682 | 682 | |
683 | - echo json_encode ( $json_data ); |
|
683 | + echo json_encode($json_data); |
|
684 | 684 | } |
685 | 685 | function user_refillreport_search() { |
686 | - $ajax_search = $this->input->post ( 'ajax_search', 0 ); |
|
687 | - if ($this->input->post ( 'advance_search', TRUE ) == 1) { |
|
688 | - $this->session->set_userdata ( 'advance_search', $this->input->post ( 'advance_search' ) ); |
|
689 | - $action = $this->input->post (); |
|
690 | - unset ( $action ['action'] ); |
|
691 | - unset ( $action ['advance_search'] ); |
|
692 | - $this->session->set_userdata ( 'cdr_refill_search', $action ); |
|
686 | + $ajax_search = $this->input->post('ajax_search', 0); |
|
687 | + if ($this->input->post('advance_search', TRUE) == 1) { |
|
688 | + $this->session->set_userdata('advance_search', $this->input->post('advance_search')); |
|
689 | + $action = $this->input->post(); |
|
690 | + unset ($action ['action']); |
|
691 | + unset ($action ['advance_search']); |
|
692 | + $this->session->set_userdata('cdr_refill_search', $action); |
|
693 | 693 | } |
694 | 694 | if (@$ajax_search != 1) { |
695 | - redirect ( base_url () . 'user/user_cdrs_report/' ); |
|
695 | + redirect(base_url().'user/user_cdrs_report/'); |
|
696 | 696 | } |
697 | 697 | } |
698 | 698 | function user_refillreport_clearsearchfilter() { |
699 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
700 | - $this->session->set_userdata ( 'account_search', "" ); |
|
699 | + $this->session->set_userdata('advance_search', 0); |
|
700 | + $this->session->set_userdata('account_search', ""); |
|
701 | 701 | } |
702 | 702 | |
703 | 703 | /* * ************************** */ |
704 | 704 | function customer_cdrreport($accountid, $accounttype) { |
705 | - $instant_search = $this->session->userdata ( 'left_panel_search_' . $accounttype . '_cdrs' ); |
|
706 | - $instant_search_currency = $this->common_model->add_calculate_currency ( $instant_search, "", '', true, false ); |
|
707 | - $like_str = ! empty ( $instant_search ) ? "(callstart like '%$instant_search%' |
|
705 | + $instant_search = $this->session->userdata('left_panel_search_'.$accounttype.'_cdrs'); |
|
706 | + $instant_search_currency = $this->common_model->add_calculate_currency($instant_search, "", '', true, false); |
|
707 | + $like_str = ! empty ($instant_search) ? "(callstart like '%$instant_search%' |
|
708 | 708 | OR callerid like '%$instant_search%' |
709 | 709 | OR callednum like '%$instant_search%' |
710 | 710 | OR notes like '%$instant_search%' |
@@ -714,18 +714,18 @@ discard block |
||
714 | 714 | OR cost like '%$instant_search_currency%' |
715 | 715 | )" : null; |
716 | 716 | |
717 | - $json_data = array (); |
|
718 | - if (! empty ( $like_str )) |
|
719 | - $this->db->where ( $like_str ); |
|
720 | - $count_all = $this->reports_model->users_cdrs_list ( false, $accountid, $accounttype, "", "" ); |
|
721 | - $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
|
717 | + $json_data = array(); |
|
718 | + if ( ! empty ($like_str)) |
|
719 | + $this->db->where($like_str); |
|
720 | + $count_all = $this->reports_model->users_cdrs_list(false, $accountid, $accounttype, "", ""); |
|
721 | + $paging_data = $this->form->load_grid_config($count_all, $_GET ['rp'], $_GET ['page']); |
|
722 | 722 | $json_data = $paging_data ["json_paging"]; |
723 | - if (! empty ( $like_str )) |
|
724 | - $this->db->where ( $like_str ); |
|
725 | - $query = $this->reports_model->users_cdrs_list ( true, $accountid, $accounttype, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
|
726 | - $grid_fields = json_decode ( $this->reports_form->build_report_list_for_user ( $accounttype ) ); |
|
727 | - $json_data ['rows'] = $this->form->build_grid ( $query, $grid_fields ); |
|
728 | - echo json_encode ( $json_data ); |
|
723 | + if ( ! empty ($like_str)) |
|
724 | + $this->db->where($like_str); |
|
725 | + $query = $this->reports_model->users_cdrs_list(true, $accountid, $accounttype, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"]); |
|
726 | + $grid_fields = json_decode($this->reports_form->build_report_list_for_user($accounttype)); |
|
727 | + $json_data ['rows'] = $this->form->build_grid($query, $grid_fields); |
|
728 | + echo json_encode($json_data); |
|
729 | 729 | } |
730 | 730 | |
731 | 731 | /* |
@@ -735,82 +735,82 @@ discard block |
||
735 | 735 | * **** |
736 | 736 | */ |
737 | 737 | function refillreport() { |
738 | - $data ['page_title'] = gettext ( 'Refill Report' ); |
|
738 | + $data ['page_title'] = gettext('Refill Report'); |
|
739 | 739 | $data ['search_flag'] = true; |
740 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
741 | - $data ['grid_buttons'] = $this->reports_form->build_refillreport_buttons (); |
|
742 | - $data ['grid_fields'] = $this->reports_form->build_refill_report_for_admin (); |
|
743 | - $data ['form_search'] = $this->form->build_serach_form ( $this->reports_form->build_search_refill_report_for_admin () ); |
|
744 | - $this->load->view ( 'view_refill_report', $data ); |
|
740 | + $this->session->set_userdata('advance_search', 0); |
|
741 | + $data ['grid_buttons'] = $this->reports_form->build_refillreport_buttons(); |
|
742 | + $data ['grid_fields'] = $this->reports_form->build_refill_report_for_admin(); |
|
743 | + $data ['form_search'] = $this->form->build_serach_form($this->reports_form->build_search_refill_report_for_admin()); |
|
744 | + $this->load->view('view_refill_report', $data); |
|
745 | 745 | } |
746 | 746 | function refillreport_json() { |
747 | - $json_data = array (); |
|
748 | - $count_all = $this->reports_model->get_refill_list ( false, "", "" ); |
|
749 | - $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
|
747 | + $json_data = array(); |
|
748 | + $count_all = $this->reports_model->get_refill_list(false, "", ""); |
|
749 | + $paging_data = $this->form->load_grid_config($count_all, $_GET ['rp'], $_GET ['page']); |
|
750 | 750 | $json_data = $paging_data ["json_paging"]; |
751 | - $query = $this->reports_model->get_refill_list ( true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
|
752 | - $grid_fields = json_decode ( $this->reports_form->build_refill_report_for_admin () ); |
|
753 | - $json_data ['rows'] = $this->form->build_grid ( $query, $grid_fields ); |
|
754 | - echo json_encode ( $json_data ); |
|
751 | + $query = $this->reports_model->get_refill_list(true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"]); |
|
752 | + $grid_fields = json_decode($this->reports_form->build_refill_report_for_admin()); |
|
753 | + $json_data ['rows'] = $this->form->build_grid($query, $grid_fields); |
|
754 | + echo json_encode($json_data); |
|
755 | 755 | } |
756 | 756 | function refillreport_export() { |
757 | - $account_info = $accountinfo = $this->session->userdata ( 'accountinfo' ); |
|
757 | + $account_info = $accountinfo = $this->session->userdata('accountinfo'); |
|
758 | 758 | $currency_id = $account_info ['currency_id']; |
759 | 759 | $reseller_id = $accountinfo ['reseller_id'] > 0 ? $accountinfo ['reseller_id'] : 0; |
760 | - $account_arr = array (); |
|
761 | - $currency_info = $this->common->get_currency_info (); |
|
762 | - $currency = $this->common->get_field_name ( 'currency', 'currency', $currency_id ); |
|
763 | - ob_clean (); |
|
764 | - $customer_array [] = array ( |
|
765 | - gettext ( "Date" ), |
|
766 | - gettext ( "Account" ), |
|
767 | - gettext ( "Amount" ) . "(" . $currency . ")", |
|
768 | - gettext ( "Refill By" ), |
|
769 | - gettext ( "Note" ) |
|
760 | + $account_arr = array(); |
|
761 | + $currency_info = $this->common->get_currency_info(); |
|
762 | + $currency = $this->common->get_field_name('currency', 'currency', $currency_id); |
|
763 | + ob_clean(); |
|
764 | + $customer_array [] = array( |
|
765 | + gettext("Date"), |
|
766 | + gettext("Account"), |
|
767 | + gettext("Amount")."(".$currency.")", |
|
768 | + gettext("Refill By"), |
|
769 | + gettext("Note") |
|
770 | 770 | ); |
771 | - $query = $this->reports_model->get_refill_list ( true, "", "", true ); |
|
772 | - $this->db->select ( "concat(first_name,' ',last_name,' ','(',number,')') as first_name,id", false ); |
|
773 | - $this->db->where ( 'reseller_id', $reseller_id ); |
|
774 | - $this->db->where_not_in ( 'type', array ( |
|
771 | + $query = $this->reports_model->get_refill_list(true, "", "", true); |
|
772 | + $this->db->select("concat(first_name,' ',last_name,' ','(',number,')') as first_name,id", false); |
|
773 | + $this->db->where('reseller_id', $reseller_id); |
|
774 | + $this->db->where_not_in('type', array( |
|
775 | 775 | "-1,2,4" |
776 | - ) ); |
|
777 | - $account_res = $this->db->get ( 'accounts' ); |
|
778 | - if ($account_res->num_rows () > 0) { |
|
779 | - $account_res = $account_res->result_array (); |
|
780 | - foreach ( $account_res as $key => $value ) { |
|
776 | + )); |
|
777 | + $account_res = $this->db->get('accounts'); |
|
778 | + if ($account_res->num_rows() > 0) { |
|
779 | + $account_res = $account_res->result_array(); |
|
780 | + foreach ($account_res as $key => $value) { |
|
781 | 781 | $account_arr [$value ['id']] = $value ['first_name']; |
782 | 782 | } |
783 | 783 | } |
784 | - if ($query->num_rows () > 0) { |
|
785 | - foreach ( $query->result_array () as $row ) { |
|
786 | - $customer_array [] = array ( |
|
784 | + if ($query->num_rows() > 0) { |
|
785 | + foreach ($query->result_array() as $row) { |
|
786 | + $customer_array [] = array( |
|
787 | 787 | $row ['payment_date'], |
788 | - isset ( $account_arr [$row ['accountid']] ) ? $account_arr [$row ['accountid']] : 'Anonymous', |
|
789 | - number_format ( ( float ) (($row ['credit'] * $currency_info ['user_currency'] ['currencyrate']) / $currency_info ['base_currency'] ['currencyrate']), $currency_info ['decimalpoints'], ".", "" ), |
|
790 | - $this->common->get_refill_by ( "", "", $row ['payment_by'] ), |
|
788 | + isset ($account_arr [$row ['accountid']]) ? $account_arr [$row ['accountid']] : 'Anonymous', |
|
789 | + number_format((float)(($row ['credit'] * $currency_info ['user_currency'] ['currencyrate']) / $currency_info ['base_currency'] ['currencyrate']), $currency_info ['decimalpoints'], ".", ""), |
|
790 | + $this->common->get_refill_by("", "", $row ['payment_by']), |
|
791 | 791 | $row ['notes'] |
792 | 792 | ); |
793 | 793 | } |
794 | 794 | } |
795 | - $this->load->helper ( 'csv' ); |
|
796 | - array_to_csv ( $customer_array, 'Refill_Report_' . date ( "Y-m-d" ) . '.csv' ); |
|
795 | + $this->load->helper('csv'); |
|
796 | + array_to_csv($customer_array, 'Refill_Report_'.date("Y-m-d").'.csv'); |
|
797 | 797 | } |
798 | 798 | function customer_refillreport_search() { |
799 | - $ajax_search = $this->input->post ( 'ajax_search', 0 ); |
|
800 | - if ($this->input->post ( 'advance_search', TRUE ) == 1) { |
|
801 | - $this->session->set_userdata ( 'advance_search', $this->input->post ( 'advance_search' ) ); |
|
802 | - $action = $this->input->post (); |
|
803 | - unset ( $action ['action'] ); |
|
804 | - unset ( $action ['advance_search'] ); |
|
805 | - $this->session->set_userdata ( 'cdr_refill_search', $action ); |
|
799 | + $ajax_search = $this->input->post('ajax_search', 0); |
|
800 | + if ($this->input->post('advance_search', TRUE) == 1) { |
|
801 | + $this->session->set_userdata('advance_search', $this->input->post('advance_search')); |
|
802 | + $action = $this->input->post(); |
|
803 | + unset ($action ['action']); |
|
804 | + unset ($action ['advance_search']); |
|
805 | + $this->session->set_userdata('cdr_refill_search', $action); |
|
806 | 806 | } |
807 | 807 | if (@$ajax_search != 1) { |
808 | - redirect ( base_url () . 'user/user_cdrs_report/' ); |
|
808 | + redirect(base_url().'user/user_cdrs_report/'); |
|
809 | 809 | } |
810 | 810 | } |
811 | 811 | function customer_refillreport_clearsearchfilter() { |
812 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
813 | - $this->session->set_userdata ( 'account_search', "" ); |
|
812 | + $this->session->set_userdata('advance_search', 0); |
|
813 | + $this->session->set_userdata('account_search', ""); |
|
814 | 814 | } |
815 | 815 | |
816 | 816 | /** |
@@ -820,64 +820,64 @@ discard block |
||
820 | 820 | * ****** |
821 | 821 | */ |
822 | 822 | function charges_history() { |
823 | - $data ['page_title'] = gettext ( 'Charges History' ); |
|
823 | + $data ['page_title'] = gettext('Charges History'); |
|
824 | 824 | $data ['search_flag'] = true; |
825 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
826 | - $data ['grid_fields'] = $this->reports_form->build_charge_list_for_admin (); |
|
827 | - $data ['form_search'] = $this->form->build_serach_form ( $this->reports_form->get_charges_search_form () ); |
|
828 | - $this->load->view ( 'view_charges_list', $data ); |
|
825 | + $this->session->set_userdata('advance_search', 0); |
|
826 | + $data ['grid_fields'] = $this->reports_form->build_charge_list_for_admin(); |
|
827 | + $data ['form_search'] = $this->form->build_serach_form($this->reports_form->get_charges_search_form()); |
|
828 | + $this->load->view('view_charges_list', $data); |
|
829 | 829 | } |
830 | 830 | function charges_history_json() { |
831 | - $json_data = array (); |
|
832 | - $count_all = $this->reports_model->getcharges_list ( false ); |
|
833 | - $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
|
831 | + $json_data = array(); |
|
832 | + $count_all = $this->reports_model->getcharges_list(false); |
|
833 | + $paging_data = $this->form->load_grid_config($count_all, $_GET ['rp'], $_GET ['page']); |
|
834 | 834 | $json_data = $paging_data ["json_paging"]; |
835 | - $query = $this->reports_model->getcharges_list ( true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
|
836 | - $result = $query->result_array (); |
|
837 | - $query1 = $this->reports_model->getcharges_list ( true, '', '' ); |
|
838 | - $res = $query1->result_array (); |
|
835 | + $query = $this->reports_model->getcharges_list(true, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"]); |
|
836 | + $result = $query->result_array(); |
|
837 | + $query1 = $this->reports_model->getcharges_list(true, '', ''); |
|
838 | + $res = $query1->result_array(); |
|
839 | 839 | $debit = 0; |
840 | 840 | $credit = 0; |
841 | 841 | $before_balance = 0; |
842 | 842 | $after_balance = 0; |
843 | 843 | $i = 0; |
844 | - foreach ( $result as $key => $value ) { |
|
845 | - $date = $this->common->convert_GMT_to ( '', '', $value ['created_date'] ); |
|
846 | - $cust_type = $this->common->get_field_name ( 'posttoexternal', 'accounts', $value ['accountid'] ); |
|
847 | - $invoice_prefix = $entity_type = $this->common->get_field_name ( 'invoice_prefix', 'invoices', array ( |
|
844 | + foreach ($result as $key => $value) { |
|
845 | + $date = $this->common->convert_GMT_to('', '', $value ['created_date']); |
|
846 | + $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value ['accountid']); |
|
847 | + $invoice_prefix = $entity_type = $this->common->get_field_name('invoice_prefix', 'invoices', array( |
|
848 | 848 | 'id' => $value ['invoiceid'] |
849 | - ) ); |
|
850 | - $invoiceid = $entity_type = $this->common->get_field_name ( 'invoiceid', 'invoices', array ( |
|
849 | + )); |
|
850 | + $invoiceid = $entity_type = $this->common->get_field_name('invoiceid', 'invoices', array( |
|
851 | 851 | 'id' => $value ['invoiceid'] |
852 | - ) ); |
|
853 | - $invoice_num = $invoice_prefix . $invoiceid; |
|
854 | - $account = $this->common->get_field_name_coma_new ( 'first_name,last_name,number', 'accounts', $value ['accountid'] ); |
|
855 | - $reseller = $this->common->reseller_select_value ( 'first_name,last_name,number', 'accounts', $value ['reseller_id'] ); |
|
852 | + )); |
|
853 | + $invoice_num = $invoice_prefix.$invoiceid; |
|
854 | + $account = $this->common->get_field_name_coma_new('first_name,last_name,number', 'accounts', $value ['accountid']); |
|
855 | + $reseller = $this->common->reseller_select_value('first_name,last_name,number', 'accounts', $value ['reseller_id']); |
|
856 | 856 | $item_type = $value ['item_type']; |
857 | 857 | if ($value ['before_balance'] == '-') { |
858 | 858 | $before_balance = '-'; |
859 | 859 | } else { |
860 | - $before_balance = $this->common->convert_to_currency ( '', '', $value ['before_balance'] ); |
|
860 | + $before_balance = $this->common->convert_to_currency('', '', $value ['before_balance']); |
|
861 | 861 | } |
862 | 862 | if ($value ['debit'] == '-') { |
863 | 863 | $debit = '-'; |
864 | 864 | } else { |
865 | - $debit = $this->common->convert_to_currency ( '', '', $value ['debit'] ); |
|
865 | + $debit = $this->common->convert_to_currency('', '', $value ['debit']); |
|
866 | 866 | } |
867 | - $credit = $this->common->convert_to_currency ( '', '', $value ['credit'] ); |
|
867 | + $credit = $this->common->convert_to_currency('', '', $value ['credit']); |
|
868 | 868 | if ($cust_type == 0 && $value ['item_type'] == 'INVPAY') { |
869 | - $credit = '(-) ' . $credit; |
|
869 | + $credit = '(-) '.$credit; |
|
870 | 870 | } |
871 | 871 | if ($value ['after_balance'] == '-') { |
872 | 872 | $after_balance = '-'; |
873 | 873 | } else { |
874 | - $after_balance = $this->common->convert_to_currency ( '', '', $value ['after_balance'] ); |
|
874 | + $after_balance = $this->common->convert_to_currency('', '', $value ['after_balance']); |
|
875 | 875 | } |
876 | 876 | $description = $value ['description']; |
877 | - $cust_type = $this->common->get_field_name ( 'posttoexternal', 'accounts', $value ['accountid'] ); |
|
878 | - if ($this->session->userdata ( 'logintype' ) == 1) { |
|
879 | - $json_data ['rows'] [] = array ( |
|
880 | - 'cell' => array ( |
|
877 | + $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value ['accountid']); |
|
878 | + if ($this->session->userdata('logintype') == 1) { |
|
879 | + $json_data ['rows'] [] = array( |
|
880 | + 'cell' => array( |
|
881 | 881 | $date, |
882 | 882 | $invoice_num, |
883 | 883 | $account, |
@@ -891,8 +891,8 @@ discard block |
||
891 | 891 | ) |
892 | 892 | ); |
893 | 893 | } else { |
894 | - $json_data ['rows'] [] = array ( |
|
895 | - 'cell' => array ( |
|
894 | + $json_data ['rows'] [] = array( |
|
895 | + 'cell' => array( |
|
896 | 896 | $date, |
897 | 897 | $invoice_num, |
898 | 898 | $account, |
@@ -908,57 +908,57 @@ discard block |
||
908 | 908 | } |
909 | 909 | $debit_sum = 0; |
910 | 910 | $credit_sum = 0; |
911 | - foreach ( $res as $value ) { |
|
912 | - $cust_type = $this->common->get_field_name ( 'posttoexternal', 'accounts', $value ['accountid'] ); |
|
913 | - $cust_type = $this->common->get_field_name ( 'posttoexternal', 'accounts', $value ['accountid'] ); |
|
911 | + foreach ($res as $value) { |
|
912 | + $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value ['accountid']); |
|
913 | + $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value ['accountid']); |
|
914 | 914 | $debit_sum += $value ['debit']; |
915 | 915 | $credit_sum += $value ['credit']; |
916 | 916 | $before_balance += $value ['before_balance']; |
917 | 917 | $after_balance += $value ['after_balance']; |
918 | 918 | } |
919 | - if ($this->session->userdata ( 'logintype' ) == 1) { |
|
920 | - $json_data ['rows'] [$count_all] ['cell'] = array ( |
|
919 | + if ($this->session->userdata('logintype') == 1) { |
|
920 | + $json_data ['rows'] [$count_all] ['cell'] = array( |
|
921 | 921 | '<b>Total</b>', |
922 | 922 | '-', |
923 | 923 | '-', |
924 | 924 | '-', |
925 | 925 | '-', |
926 | - '<b>' . $this->common->convert_to_currency ( '', '', $debit_sum ) . '</b>', |
|
927 | - '<b>' . $this->common->convert_to_currency ( '', '', $credit_sum ) . '</b>', |
|
926 | + '<b>'.$this->common->convert_to_currency('', '', $debit_sum).'</b>', |
|
927 | + '<b>'.$this->common->convert_to_currency('', '', $credit_sum).'</b>', |
|
928 | 928 | '-', |
929 | 929 | '-' |
930 | 930 | ); |
931 | 931 | } else { |
932 | - $json_data ['rows'] [$count_all] ['cell'] = array ( |
|
932 | + $json_data ['rows'] [$count_all] ['cell'] = array( |
|
933 | 933 | '<b>Total</b>', |
934 | 934 | '-', |
935 | 935 | '-', |
936 | 936 | '-', |
937 | 937 | '-', |
938 | - '<b>' . $this->common->convert_to_currency ( '', '', $debit_sum ) . '</b>', |
|
939 | - '<b>' . $this->common->convert_to_currency ( '', '', $credit_sum ) . '</b>', |
|
938 | + '<b>'.$this->common->convert_to_currency('', '', $debit_sum).'</b>', |
|
939 | + '<b>'.$this->common->convert_to_currency('', '', $credit_sum).'</b>', |
|
940 | 940 | '-', |
941 | 941 | '-' |
942 | 942 | ); |
943 | 943 | } |
944 | - echo json_encode ( $json_data ); |
|
944 | + echo json_encode($json_data); |
|
945 | 945 | } |
946 | 946 | function charges_history_search() { |
947 | - $ajax_search = $this->input->post ( 'ajax_search', 0 ); |
|
948 | - if ($this->input->post ( 'advance_search', TRUE ) == 1) { |
|
949 | - $this->session->set_userdata ( 'advance_search', $this->input->post ( 'advance_search' ) ); |
|
950 | - $action = $this->input->post (); |
|
951 | - unset ( $action ['action'] ); |
|
952 | - unset ( $action ['advance_search'] ); |
|
953 | - $this->session->set_userdata ( 'charges_list_search', $action ); |
|
947 | + $ajax_search = $this->input->post('ajax_search', 0); |
|
948 | + if ($this->input->post('advance_search', TRUE) == 1) { |
|
949 | + $this->session->set_userdata('advance_search', $this->input->post('advance_search')); |
|
950 | + $action = $this->input->post(); |
|
951 | + unset ($action ['action']); |
|
952 | + unset ($action ['advance_search']); |
|
953 | + $this->session->set_userdata('charges_list_search', $action); |
|
954 | 954 | } |
955 | 955 | if (@$ajax_search != 1) { |
956 | - redirect ( base_url () . 'accounts/admin_list/' ); |
|
956 | + redirect(base_url().'accounts/admin_list/'); |
|
957 | 957 | } |
958 | 958 | } |
959 | 959 | function charges_history_clearsearchfilter() { |
960 | - $this->session->set_userdata ( 'advance_search', 0 ); |
|
961 | - $this->session->set_userdata ( 'charges_list_search', "" ); |
|
960 | + $this->session->set_userdata('advance_search', 0); |
|
961 | + $this->session->set_userdata('charges_list_search', ""); |
|
962 | 962 | } |
963 | 963 | /* * ******************************** */ |
964 | 964 | /* |
@@ -966,68 +966,68 @@ discard block |
||
966 | 966 | * This function using for customer edit |
967 | 967 | */ |
968 | 968 | function customer_charge_history($accountid, $accounttype) { |
969 | - $json_data = array (); |
|
970 | - $instant_search = $this->session->userdata ( 'left_panel_search_' . $accounttype . '_charges' ); |
|
971 | - $like_str = ! empty ( $instant_search ) ? "(created_date like '%$instant_search%' |
|
969 | + $json_data = array(); |
|
970 | + $instant_search = $this->session->userdata('left_panel_search_'.$accounttype.'_charges'); |
|
971 | + $like_str = ! empty ($instant_search) ? "(created_date like '%$instant_search%' |
|
972 | 972 | OR item_type like '%$instant_search%' |
973 | 973 | OR 'debit' like '%$instant_search%' |
974 | 974 | OR 'credit' like '%$instant_search%' |
975 | 975 | OR 'description' like '%$instant_search%')" : null; |
976 | - if (! empty ( $like_str )) |
|
977 | - $this->db->where ( $like_str ); |
|
978 | - $count_all = $this->reports_model->get_customer_charge_list ( false, $accountid ); |
|
976 | + if ( ! empty ($like_str)) |
|
977 | + $this->db->where($like_str); |
|
978 | + $count_all = $this->reports_model->get_customer_charge_list(false, $accountid); |
|
979 | 979 | |
980 | - $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
|
980 | + $paging_data = $this->form->load_grid_config($count_all, $_GET ['rp'], $_GET ['page']); |
|
981 | 981 | $json_data = $paging_data ["json_paging"]; |
982 | - if (! empty ( $like_str )) |
|
983 | - $this->db->where ( $like_str ); |
|
984 | - $query = $this->reports_model->get_customer_charge_list ( true, $accountid, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
|
985 | - $result = $query->result_array (); |
|
986 | - $query1 = $this->reports_model->get_customer_charge_list ( true, $accountid, '', '' ); |
|
987 | - $res = $query1->result_array (); |
|
982 | + if ( ! empty ($like_str)) |
|
983 | + $this->db->where($like_str); |
|
984 | + $query = $this->reports_model->get_customer_charge_list(true, $accountid, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"]); |
|
985 | + $result = $query->result_array(); |
|
986 | + $query1 = $this->reports_model->get_customer_charge_list(true, $accountid, '', ''); |
|
987 | + $res = $query1->result_array(); |
|
988 | 988 | |
989 | 989 | $debit = 0; |
990 | 990 | $credit = 0; |
991 | 991 | $before_balance = 0; |
992 | 992 | $after_balance = 0; |
993 | 993 | $i = 0; |
994 | - foreach ( $result as $key => $value ) { |
|
995 | - $date = $this->common->convert_GMT_to ( '', '', $value ['created_date'] ); |
|
996 | - $cust_type = $this->common->get_field_name ( 'posttoexternal', 'accounts', $value ['accountid'] ); |
|
997 | - $invoice_prefix = $entity_type = $this->common->get_field_name ( 'invoice_prefix', 'invoices', array ( |
|
994 | + foreach ($result as $key => $value) { |
|
995 | + $date = $this->common->convert_GMT_to('', '', $value ['created_date']); |
|
996 | + $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value ['accountid']); |
|
997 | + $invoice_prefix = $entity_type = $this->common->get_field_name('invoice_prefix', 'invoices', array( |
|
998 | 998 | 'id' => $value ['invoiceid'] |
999 | - ) ); |
|
1000 | - $invoiceid = $entity_type = $this->common->get_field_name ( 'invoiceid', 'invoices', array ( |
|
999 | + )); |
|
1000 | + $invoiceid = $entity_type = $this->common->get_field_name('invoiceid', 'invoices', array( |
|
1001 | 1001 | 'id' => $value ['invoiceid'] |
1002 | - ) ); |
|
1003 | - $invoice_num = $invoice_prefix . $invoiceid; |
|
1004 | - $account = $this->common->get_field_name_coma_new ( 'first_name,last_name,number', 'accounts', $value ['accountid'] ); |
|
1005 | - $reseller = $this->common->reseller_select_value ( 'first_name,last_name,number', 'accounts', $value ['reseller_id'] ); |
|
1002 | + )); |
|
1003 | + $invoice_num = $invoice_prefix.$invoiceid; |
|
1004 | + $account = $this->common->get_field_name_coma_new('first_name,last_name,number', 'accounts', $value ['accountid']); |
|
1005 | + $reseller = $this->common->reseller_select_value('first_name,last_name,number', 'accounts', $value ['reseller_id']); |
|
1006 | 1006 | $item_type = $value ['item_type']; |
1007 | 1007 | if ($value ['before_balance'] == '-') { |
1008 | 1008 | $before_balance = '-'; |
1009 | 1009 | } else { |
1010 | - $before_balance = $this->common->convert_to_currency ( '', '', $value ['before_balance'] ); |
|
1010 | + $before_balance = $this->common->convert_to_currency('', '', $value ['before_balance']); |
|
1011 | 1011 | } |
1012 | 1012 | if ($value ['debit'] == '-') { |
1013 | 1013 | $debit = '-'; |
1014 | 1014 | } else { |
1015 | - $debit = $this->common->convert_to_currency ( '', '', $value ['debit'] ); |
|
1015 | + $debit = $this->common->convert_to_currency('', '', $value ['debit']); |
|
1016 | 1016 | } |
1017 | - $credit = $this->common->convert_to_currency ( '', '', $value ['credit'] ); |
|
1017 | + $credit = $this->common->convert_to_currency('', '', $value ['credit']); |
|
1018 | 1018 | if ($cust_type == 0 && $value ['item_type'] == 'INVPAY') { |
1019 | - $credit = '(-) ' . $credit; |
|
1019 | + $credit = '(-) '.$credit; |
|
1020 | 1020 | } |
1021 | 1021 | if ($value ['after_balance'] == '-') { |
1022 | 1022 | $after_balance = '-'; |
1023 | 1023 | } else { |
1024 | - $after_balance = $this->common->convert_to_currency ( '', '', $value ['after_balance'] ); |
|
1024 | + $after_balance = $this->common->convert_to_currency('', '', $value ['after_balance']); |
|
1025 | 1025 | } |
1026 | 1026 | $description = $value ['description']; |
1027 | - $cust_type = $this->common->get_field_name ( 'posttoexternal', 'accounts', $value ['accountid'] ); |
|
1028 | - if ($this->session->userdata ( 'logintype' ) == 1) { |
|
1029 | - $json_data ['rows'] [] = array ( |
|
1030 | - 'cell' => array ( |
|
1027 | + $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value ['accountid']); |
|
1028 | + if ($this->session->userdata('logintype') == 1) { |
|
1029 | + $json_data ['rows'] [] = array( |
|
1030 | + 'cell' => array( |
|
1031 | 1031 | $date, |
1032 | 1032 | $invoice_num, |
1033 | 1033 | $item_type, |
@@ -1039,8 +1039,8 @@ discard block |
||
1039 | 1039 | ) |
1040 | 1040 | ); |
1041 | 1041 | } else { |
1042 | - $json_data ['rows'] [] = array ( |
|
1043 | - 'cell' => array ( |
|
1042 | + $json_data ['rows'] [] = array( |
|
1043 | + 'cell' => array( |
|
1044 | 1044 | $date, |
1045 | 1045 | $invoice_num, |
1046 | 1046 | $item_type, |
@@ -1055,58 +1055,58 @@ discard block |
||
1055 | 1055 | } |
1056 | 1056 | $debit_sum = 0; |
1057 | 1057 | $credit_sum = 0; |
1058 | - foreach ( $res as $value ) { |
|
1059 | - $cust_type = $this->common->get_field_name ( 'posttoexternal', 'accounts', $value ['accountid'] ); |
|
1060 | - $cust_type = $this->common->get_field_name ( 'posttoexternal', 'accounts', $value ['accountid'] ); |
|
1058 | + foreach ($res as $value) { |
|
1059 | + $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value ['accountid']); |
|
1060 | + $cust_type = $this->common->get_field_name('posttoexternal', 'accounts', $value ['accountid']); |
|
1061 | 1061 | $debit_sum += $value ['debit']; |
1062 | 1062 | $credit_sum += $value ['credit']; |
1063 | 1063 | $before_balance += $value ['before_balance']; |
1064 | 1064 | $after_balance += $value ['after_balance']; |
1065 | 1065 | } |
1066 | - if ($this->session->userdata ( 'logintype' ) == 1) { |
|
1067 | - $json_data ['rows'] [$count_all] ['cell'] = array ( |
|
1066 | + if ($this->session->userdata('logintype') == 1) { |
|
1067 | + $json_data ['rows'] [$count_all] ['cell'] = array( |
|
1068 | 1068 | '<b>Total</b>', |
1069 | 1069 | '-', |
1070 | 1070 | '-', |
1071 | 1071 | '-', |
1072 | - '<b>' . $this->common->convert_to_currency ( '', '', $debit_sum ) . '</b>', |
|
1073 | - '<b>' . $this->common->convert_to_currency ( '', '', $credit_sum ) . '</b>', |
|
1072 | + '<b>'.$this->common->convert_to_currency('', '', $debit_sum).'</b>', |
|
1073 | + '<b>'.$this->common->convert_to_currency('', '', $credit_sum).'</b>', |
|
1074 | 1074 | '-', |
1075 | 1075 | '-' |
1076 | 1076 | ); |
1077 | 1077 | } else { |
1078 | - $json_data ['rows'] [$count_all] ['cell'] = array ( |
|
1078 | + $json_data ['rows'] [$count_all] ['cell'] = array( |
|
1079 | 1079 | '<b>Total</b>', |
1080 | 1080 | '-', |
1081 | 1081 | '-', |
1082 | 1082 | '-', |
1083 | - '<b>' . $this->common->convert_to_currency ( '', '', $debit_sum ) . '</b>', |
|
1084 | - '<b>' . $this->common->convert_to_currency ( '', '', $credit_sum ) . '</b>', |
|
1083 | + '<b>'.$this->common->convert_to_currency('', '', $debit_sum).'</b>', |
|
1084 | + '<b>'.$this->common->convert_to_currency('', '', $credit_sum).'</b>', |
|
1085 | 1085 | '-', |
1086 | 1086 | '-' |
1087 | 1087 | ); |
1088 | 1088 | } |
1089 | - echo json_encode ( $json_data ); |
|
1089 | + echo json_encode($json_data); |
|
1090 | 1090 | } |
1091 | 1091 | function customer_refillreport($accountid, $accounttype) { |
1092 | - $json_data = array (); |
|
1093 | - $instant_search = $this->session->userdata ( 'left_panel_search_' . $accounttype . '_refill' ); |
|
1094 | - $like_str = ! empty ( $instant_search ) ? "(payment_date like '%$instant_search%' |
|
1092 | + $json_data = array(); |
|
1093 | + $instant_search = $this->session->userdata('left_panel_search_'.$accounttype.'_refill'); |
|
1094 | + $like_str = ! empty ($instant_search) ? "(payment_date like '%$instant_search%' |
|
1095 | 1095 | OR credit like '%$instant_search%' |
1096 | 1096 | OR payment_by like '%$instant_search%' |
1097 | 1097 | OR notes like '%$instant_search%' |
1098 | 1098 | )" : null; |
1099 | - if (! empty ( $like_str )) |
|
1100 | - $this->db->where ( $like_str ); |
|
1101 | - $count_all = $this->reports_model->get_customer_refillreport ( false, $accountid ); |
|
1102 | - $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
|
1099 | + if ( ! empty ($like_str)) |
|
1100 | + $this->db->where($like_str); |
|
1101 | + $count_all = $this->reports_model->get_customer_refillreport(false, $accountid); |
|
1102 | + $paging_data = $this->form->load_grid_config($count_all, $_GET ['rp'], $_GET ['page']); |
|
1103 | 1103 | $json_data = $paging_data ["json_paging"]; |
1104 | - if (! empty ( $like_str )) |
|
1105 | - $this->db->where ( $like_str ); |
|
1106 | - $query = $this->reports_model->get_customer_refillreport ( true, $accountid, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
|
1107 | - $grid_fields = json_decode ( $this->reports_form->build_refillreport_for_customer () ); |
|
1108 | - $json_data ['rows'] = $this->form->build_grid ( $query, $grid_fields ); |
|
1109 | - echo json_encode ( $json_data ); |
|
1104 | + if ( ! empty ($like_str)) |
|
1105 | + $this->db->where($like_str); |
|
1106 | + $query = $this->reports_model->get_customer_refillreport(true, $accountid, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"]); |
|
1107 | + $grid_fields = json_decode($this->reports_form->build_refillreport_for_customer()); |
|
1108 | + $json_data ['rows'] = $this->form->build_grid($query, $grid_fields); |
|
1109 | + echo json_encode($json_data); |
|
1110 | 1110 | } |
1111 | 1111 | /** |
1112 | 1112 | * ******************************************************** |
@@ -36,8 +36,9 @@ discard block |
||
36 | 36 | $this->fpdf = new PDF ( 'P', 'pt' ); |
37 | 37 | $this->fpdf->initialize ( 'P', 'mm', 'A4' ); |
38 | 38 | |
39 | - if ($this->session->userdata ( 'user_login' ) == FALSE) |
|
40 | - redirect ( base_url () . '/astpp/login' ); |
|
39 | + if ($this->session->userdata ( 'user_login' ) == FALSE) { |
|
40 | + redirect ( base_url () . '/astpp/login' ); |
|
41 | + } |
|
41 | 42 | } |
42 | 43 | function customerReport() { |
43 | 44 | $data ['page_title'] = gettext ( 'Customer CDRs Report' ); |
@@ -715,13 +716,15 @@ discard block |
||
715 | 716 | )" : null; |
716 | 717 | |
717 | 718 | $json_data = array (); |
718 | - if (! empty ( $like_str )) |
|
719 | - $this->db->where ( $like_str ); |
|
719 | + if (! empty ( $like_str )) { |
|
720 | + $this->db->where ( $like_str ); |
|
721 | + } |
|
720 | 722 | $count_all = $this->reports_model->users_cdrs_list ( false, $accountid, $accounttype, "", "" ); |
721 | 723 | $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
722 | 724 | $json_data = $paging_data ["json_paging"]; |
723 | - if (! empty ( $like_str )) |
|
724 | - $this->db->where ( $like_str ); |
|
725 | + if (! empty ( $like_str )) { |
|
726 | + $this->db->where ( $like_str ); |
|
727 | + } |
|
725 | 728 | $query = $this->reports_model->users_cdrs_list ( true, $accountid, $accounttype, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
726 | 729 | $grid_fields = json_decode ( $this->reports_form->build_report_list_for_user ( $accounttype ) ); |
727 | 730 | $json_data ['rows'] = $this->form->build_grid ( $query, $grid_fields ); |
@@ -973,14 +976,16 @@ discard block |
||
973 | 976 | OR 'debit' like '%$instant_search%' |
974 | 977 | OR 'credit' like '%$instant_search%' |
975 | 978 | OR 'description' like '%$instant_search%')" : null; |
976 | - if (! empty ( $like_str )) |
|
977 | - $this->db->where ( $like_str ); |
|
979 | + if (! empty ( $like_str )) { |
|
980 | + $this->db->where ( $like_str ); |
|
981 | + } |
|
978 | 982 | $count_all = $this->reports_model->get_customer_charge_list ( false, $accountid ); |
979 | 983 | |
980 | 984 | $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
981 | 985 | $json_data = $paging_data ["json_paging"]; |
982 | - if (! empty ( $like_str )) |
|
983 | - $this->db->where ( $like_str ); |
|
986 | + if (! empty ( $like_str )) { |
|
987 | + $this->db->where ( $like_str ); |
|
988 | + } |
|
984 | 989 | $query = $this->reports_model->get_customer_charge_list ( true, $accountid, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
985 | 990 | $result = $query->result_array (); |
986 | 991 | $query1 = $this->reports_model->get_customer_charge_list ( true, $accountid, '', '' ); |
@@ -1096,13 +1101,15 @@ discard block |
||
1096 | 1101 | OR payment_by like '%$instant_search%' |
1097 | 1102 | OR notes like '%$instant_search%' |
1098 | 1103 | )" : null; |
1099 | - if (! empty ( $like_str )) |
|
1100 | - $this->db->where ( $like_str ); |
|
1104 | + if (! empty ( $like_str )) { |
|
1105 | + $this->db->where ( $like_str ); |
|
1106 | + } |
|
1101 | 1107 | $count_all = $this->reports_model->get_customer_refillreport ( false, $accountid ); |
1102 | 1108 | $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
1103 | 1109 | $json_data = $paging_data ["json_paging"]; |
1104 | - if (! empty ( $like_str )) |
|
1105 | - $this->db->where ( $like_str ); |
|
1110 | + if (! empty ( $like_str )) { |
|
1111 | + $this->db->where ( $like_str ); |
|
1112 | + } |
|
1106 | 1113 | $query = $this->reports_model->get_customer_refillreport ( true, $accountid, $paging_data ["paging"] ["start"], $paging_data ["paging"] ["page_no"] ); |
1107 | 1114 | $grid_fields = json_decode ( $this->reports_form->build_refillreport_for_customer () ); |
1108 | 1115 | $json_data ['rows'] = $this->form->build_grid ( $query, $grid_fields ); |