@@ -41,8 +41,9 @@ discard block |
||
41 | 41 | function __construct() |
42 | 42 | { |
43 | 43 | parent::__construct(); |
44 | - if ( ! defined('CRON')) |
|
45 | - exit(); |
|
44 | + if ( ! defined('CRON')) { |
|
45 | + exit(); |
|
46 | + } |
|
46 | 47 | } |
47 | 48 | |
48 | 49 | |
@@ -76,8 +77,9 @@ discard block |
||
76 | 77 | function generate_sitemap() |
77 | 78 | { |
78 | 79 | // Live Mode: |
79 | - if ( ! CRON_BETA_MODE) |
|
80 | - $cron_id = $this->cron->create('Sitemap (Google|Bing|Ask|Yahoo!)'); |
|
80 | + if ( ! CRON_BETA_MODE) { |
|
81 | + $cron_id = $this->cron->create('Sitemap (Google|Bing|Ask|Yahoo!)'); |
|
82 | + } |
|
81 | 83 | |
82 | 84 | // Example Code |
83 | 85 | |
@@ -89,8 +91,9 @@ discard block |
||
89 | 91 | // ... |
90 | 92 | |
91 | 93 | // Sandbox Mode: |
92 | - if (CRON_BETA_MODE) |
|
93 | - $this->sitemap->generate_xml(null, false); |
|
94 | + if (CRON_BETA_MODE) { |
|
95 | + $this->sitemap->generate_xml(null, false); |
|
96 | + } |
|
94 | 97 | |
95 | 98 | // Live Mode: |
96 | 99 | else { |
@@ -37,8 +37,7 @@ |
||
37 | 37 | if($opensips_flag == '1'){ |
38 | 38 | $where=array('username'=>$sipnumber); |
39 | 39 | $accountid_arr=$this->db_model->getSelect('accountid','sip_devices',$where); |
40 | - } |
|
41 | - else{ |
|
40 | + } else{ |
|
42 | 41 | $db_config = Common_model::$global_config['system_config']; |
43 | 42 | $opensipdsn = "mysql://" . $db_config['opensips_dbuser'] . ":" . $db_config['opensips_dbpass'] . "@" . $db_config['opensips_dbhost'] . "/" . $db_config['opensips_dbname'] . "?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir="; |
44 | 43 | $this->opensips_db = $this->load->database($opensipdsn, true); |
@@ -96,8 +96,9 @@ |
||
96 | 96 | curl_setopt($ch, CURLOPT_POSTFIELDS, $data); |
97 | 97 | |
98 | 98 | $response = curl_exec($ch); |
99 | - if(!$flag) |
|
100 | - redirect(base_url() . 'feedback/thanks'); |
|
99 | + if(!$flag) { |
|
100 | + redirect(base_url() . 'feedback/thanks'); |
|
101 | + } |
|
101 | 102 | |
102 | 103 | |
103 | 104 | } |
@@ -133,22 +133,25 @@ |
||
133 | 133 | if (($parent_id == $reseller_dids['reseller_id'] && $did_value['accountid'] > 0) || $reseller_dids['parent_id'] == 0) { |
134 | 134 | //Apply charges to resellers customers. |
135 | 135 | $lastdate = $this->calculate_charges($reseller_acc_data, $itemArr, $reseller_dids["monthlycost"], $fromdate, $todate, "1"); |
136 | - if ($lastdate) |
|
137 | - $this->db->update("reseller_pricing", array("charge_upto" => $lastdate), array("note" => $did_value["number"], "reseller_id" => $reseller_acc_data["id"])); |
|
136 | + if ($lastdate) { |
|
137 | + $this->db->update("reseller_pricing", array("charge_upto" => $lastdate), array("note" => $did_value["number"], "reseller_id" => $reseller_acc_data["id"])); |
|
138 | + } |
|
138 | 139 | } else { |
139 | 140 | //Apply charges to Resellers. |
140 | 141 | $lastdate = $this->calculate_charges($reseller_acc_data, $itemArr, $reseller_dids["monthlycost"], $fromdate, $todate, "1"); |
141 | - if ($lastdate) |
|
142 | - $this->db->update("reseller_pricing", array("charge_upto" => $lastdate), array("note" => $did_value["number"], "reseller_id" => $reseller_acc_data["id"])); |
|
142 | + if ($lastdate) { |
|
143 | + $this->db->update("reseller_pricing", array("charge_upto" => $lastdate), array("note" => $did_value["number"], "reseller_id" => $reseller_acc_data["id"])); |
|
144 | + } |
|
143 | 145 | } |
144 | 146 | $parent_id = $reseller_dids['parent_id']; |
145 | 147 | } |
146 | 148 | } |
147 | 149 | // else{ |
148 | 150 | $lastdate = $this->calculate_charges($AccountDATA, $itemArr, $did_value["monthlycost"], $fromdate, $todate, "1"); |
149 | - if ($lastdate) |
|
150 | - $this->db->update("dids", array("charge_upto" => $lastdate), array("id" => $did_value["id"], "accountid" => $AccountDATA["id"])); |
|
151 | -// } |
|
151 | + if ($lastdate) { |
|
152 | + $this->db->update("dids", array("charge_upto" => $lastdate), array("id" => $did_value["id"], "accountid" => $AccountDATA["id"])); |
|
153 | + } |
|
154 | + // } |
|
152 | 155 | } |
153 | 156 | } |
154 | 157 | } |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * CSVReader Class |
4 | 6 | * |
@@ -94,8 +96,9 @@ discard block |
||
94 | 96 | $field_key_value =$config_variable[$field_name_arr[$j]]; |
95 | 97 | $value= strip_slashes(trim($value)); |
96 | 98 | $value = preg_replace('#<script.*</script>#is', '', $value); |
97 | - if(isset($field_key_value) && !empty($field_key_value)) |
|
98 | - $content[$field_key_value] = strip_tags(filter_var($value, FILTER_SANITIZE_STRING)); |
|
99 | + if(isset($field_key_value) && !empty($field_key_value)) { |
|
100 | + $content[$field_key_value] = strip_tags(filter_var($value, FILTER_SANITIZE_STRING)); |
|
101 | + } |
|
99 | 102 | $j++; |
100 | 103 | } |
101 | 104 | } |
@@ -21,8 +21,9 @@ discard block |
||
21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | 22 | ############################################################################### |
23 | 23 | |
24 | -if ( ! defined('BASEPATH')) |
|
24 | +if ( ! defined('BASEPATH')) { |
|
25 | 25 | exit('No direct script access allowed'); |
26 | +} |
|
26 | 27 | |
27 | 28 | /** |
28 | 29 | * Dynamically build forms for display |
@@ -137,10 +138,11 @@ discard block |
||
137 | 138 | foreach ($form_fileds as $fieldkey => $fieldvalue) { |
138 | 139 | $form_contents .= '<li class="col-md-12">'; |
139 | 140 | if ($fieldvalue[1] == 'HIDDEN') { |
140 | - if (isset($this->CI->input->post)) |
|
141 | - $fieldvalue[2]['value'] = ( ! $this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
142 | - else |
|
143 | - $fieldvalue[2]['value'] = ($values) ? (isset($values[$fieldvalue[2]['name']]) ? $values[$fieldvalue[2]['name']] : '') : (isset($fieldvalue[2]['value']) ? $fieldvalue[2]['value'] : ''); |
|
141 | + if (isset($this->CI->input->post)) { |
|
142 | + $fieldvalue[2]['value'] = ( ! $this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
143 | + } else { |
|
144 | + $fieldvalue[2]['value'] = ($values) ? (isset($values[$fieldvalue[2]['name']]) ? $values[$fieldvalue[2]['name']] : '') : (isset($fieldvalue[2]['value']) ? $fieldvalue[2]['value'] : ''); |
|
145 | + } |
|
144 | 146 | $form_contents .= form_hidden($fieldvalue[2]['name'], $fieldvalue[2]['value']); |
145 | 147 | } else { |
146 | 148 | $validation_arr = array(); |
@@ -148,8 +150,7 @@ discard block |
||
148 | 150 | if ( ! empty($fieldvalue[3])) { |
149 | 151 | $validation_arr = explode("|", $fieldvalue[3]); |
150 | 152 | } |
151 | - } |
|
152 | - elseif ($fieldvalue[2] == 'SELECT') { |
|
153 | + } elseif ($fieldvalue[2] == 'SELECT') { |
|
153 | 154 | |
154 | 155 | if (is_array($fieldvalue[4])) { |
155 | 156 | $validation_arr = explode("|", $fieldvalue[4]['rules']); |
@@ -199,16 +200,16 @@ discard block |
||
199 | 200 | |
200 | 201 | if(isset($fieldvalue[1]['name'])){ |
201 | 202 | $fieldvalue_pass=$fieldvalue[1]['name']; |
202 | - }else{ |
|
203 | + } else{ |
|
203 | 204 | $fieldvalue_pass=$fieldvalue[1]; |
204 | 205 | } |
205 | 206 | |
206 | 207 | $this->CI->form_validation->set_rules($fieldvalue_pass, $fieldvalue[0], $fieldvalue[4]['rules']); |
207 | - }else{ |
|
208 | + } else{ |
|
208 | 209 | |
209 | 210 | if(isset($fieldvalue[1]['name'])){ |
210 | 211 | $fieldvalue_pass=$fieldvalue[1]['name']; |
211 | - }else{ |
|
212 | + } else{ |
|
212 | 213 | $fieldvalue_pass=$fieldvalue[1]; |
213 | 214 | } |
214 | 215 | |
@@ -244,10 +245,11 @@ discard block |
||
244 | 245 | /* For multi select code */ |
245 | 246 | $str = $fieldvalue[7] . "," . $fieldvalue[8]; |
246 | 247 | |
247 | - if (isset($this->CI->input->post)) |
|
248 | - $fieldvalue['value'] = (!$this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[1] : $this->CI->input->post($fieldvalue[1]); |
|
249 | - else |
|
250 | - $fieldvalue['value'] = ($values) ? @$values[$fieldvalue[1]] : @$fieldvalue[1]; |
|
248 | + if (isset($this->CI->input->post)) { |
|
249 | + $fieldvalue['value'] = (!$this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[1] : $this->CI->input->post($fieldvalue[1]); |
|
250 | + } else { |
|
251 | + $fieldvalue['value'] = ($values) ? @$values[$fieldvalue[1]] : @$fieldvalue[1]; |
|
252 | + } |
|
251 | 253 | |
252 | 254 | $drp_array = call_user_func_array(array($this->CI->db_model, $fieldvalue[10]), array($str, $fieldvalue[9], $fieldvalue[11], $fieldvalue[12])); |
253 | 255 | if ($fieldset_key === 'System Configuration Information') { |
@@ -264,9 +266,9 @@ discard block |
||
264 | 266 | } else if ($fieldvalue[1] == 'INPUT') { |
265 | 267 | |
266 | 268 | |
267 | - if (isset($this->CI->input->post)) |
|
268 | - $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? $fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
269 | - else{ |
|
269 | + if (isset($this->CI->input->post)) { |
|
270 | + $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? $fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
271 | + } else{ |
|
270 | 272 | $fieldvalue[2]['value'] = ($values) ? (isset($values[$fieldvalue[2]['name']]) ? $values[$fieldvalue[2]['name']] : ''):(isset($fieldvalue[2]['value']) ? $fieldvalue[2]['value'] :''); |
271 | 273 | } |
272 | 274 | $form_contents.= form_input($fieldvalue[2], 'readonly'); |
@@ -282,11 +284,11 @@ discard block |
||
282 | 284 | * Image upload from invoice configuration code. |
283 | 285 | */ |
284 | 286 | else if ($fieldvalue[1] == 'IMAGE') { |
285 | - if (isset($this->CI->input->post)) |
|
286 | - $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
287 | - |
|
288 | - else |
|
289 | - $fieldvalue[2]['value'] = ($values) ? @$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
287 | + if (isset($this->CI->input->post)) { |
|
288 | + $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
289 | + } else { |
|
290 | + $fieldvalue[2]['value'] = ($values) ? @$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
291 | + } |
|
290 | 292 | $fieldvalue[2]['style'] = isset($fieldvalue[2]['style']) ? $fieldvalue[2]['style'] : ""; |
291 | 293 | $form_contents.= form_image($fieldvalue[2], 'readonly',$fieldvalue[2]['style']); |
292 | 294 | $form_contents.=@$fieldvalue[6]; |
@@ -294,13 +296,12 @@ discard block |
||
294 | 296 | $form_contents.= '<div class="tooltips error_div pull-left no-padding" id="'.$fieldvalue[2]['name'].'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
295 | 297 | $form_contents.= '<span class="popup_error error no-padding" id="'.$fieldvalue[2]['name'].'_error"> |
296 | 298 | </span></div>'; |
297 | - } |
|
298 | - else if ($fieldvalue[1] == 'DEL_BUTTON') { |
|
299 | - if (isset($this->CI->input->post)) |
|
300 | - $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
301 | - |
|
302 | - else |
|
303 | - $fieldvalue[2]['value'] = ($values) ? @$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
299 | + } else if ($fieldvalue[1] == 'DEL_BUTTON') { |
|
300 | + if (isset($this->CI->input->post)) { |
|
301 | + $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
302 | + } else { |
|
303 | + $fieldvalue[2]['value'] = ($values) ? @$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
304 | + } |
|
304 | 305 | $fieldvalue[2]['style'] = isset($fieldvalue[2]['style']) ? $fieldvalue[2]['style'] : ""; |
305 | 306 | $form_contents.= form_img_delete($fieldvalue[2], 'readonly',$fieldvalue[2]['style']); |
306 | 307 | $form_contents.=@$fieldvalue[6]; |
@@ -311,10 +312,11 @@ discard block |
||
311 | 312 | } |
312 | 313 | /**********************************************************************************/ |
313 | 314 | else if ($fieldvalue[1] == 'PASSWORD') { |
314 | - if (isset($this->CI->input->post)) |
|
315 | - $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
316 | - else |
|
317 | - $fieldvalue[2]['value'] = ($values) ?@$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
315 | + if (isset($this->CI->input->post)) { |
|
316 | + $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
317 | + } else { |
|
318 | + $fieldvalue[2]['value'] = ($values) ?@$values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
319 | + } |
|
318 | 320 | $form_contents.= form_password($fieldvalue[2]); |
319 | 321 | $this->CI->form_validation->set_rules($fieldvalue[2]['name'], $fieldvalue[0], $fieldvalue[3]); |
320 | 322 | $form_contents.= '<div class="tooltips error_div pull-left no-padding" id="'.$fieldvalue[2]['name'].'_error_div" ><i style="color:#D95C5C; padding-left: 3px; padding-top: 10px;" class="fa fa-exclamation-triangle"></i>'; |
@@ -323,12 +325,12 @@ discard block |
||
323 | 325 | } else if ($fieldvalue[2] == 'CHECKBOX') { |
324 | 326 | $OptionArray = array(); |
325 | 327 | |
326 | - if(isset($fieldvalue[7]) && $fieldvalue[7] != '') |
|
327 | - $OptionArray = call_user_func_array(array($this->CI->common, $fieldvalue[7]), array($fieldvalue[6])); |
|
328 | + if(isset($fieldvalue[7]) && $fieldvalue[7] != '') { |
|
329 | + $OptionArray = call_user_func_array(array($this->CI->common, $fieldvalue[7]), array($fieldvalue[6])); |
|
330 | + } |
|
328 | 331 | if (isset($this->CI->input->post)){ |
329 | 332 | $fieldvalue[3]['value'] = (!$this->CI->input->post($fieldvalue[1])) ? @$fieldvalue[3]['value'] : $this->CI->input->post($fieldvalue[1]); |
330 | - } |
|
331 | - else |
|
333 | + } else |
|
332 | 334 | { |
333 | 335 | $fieldvalue[3]['value'] = ($values) ? (isset($values[$fieldvalue[1]]) && $values[$fieldvalue[1]] ? 1: 0) : @$fieldvalue[3]['value']; |
334 | 336 | } |
@@ -340,18 +342,18 @@ discard block |
||
340 | 342 | if(isset($fieldvalue[3]['table_name']) && $fieldvalue[3]['table_name'] != ""){ |
341 | 343 | |
342 | 344 | $form_contents.= form_checkbox($fieldvalue[1], $fieldvalue[3]['value'],$checked , $OptionArray); |
343 | - }else{ |
|
345 | + } else{ |
|
344 | 346 | $form_contents.= form_checkbox($fieldvalue[1], $fieldvalue[3]['value'],$checked ,$OptionArray); |
345 | 347 | } |
346 | 348 | } else if ($fieldvalue[1] == 'TEXTAREA') { |
347 | 349 | |
348 | - if (isset($this->CI->input->post)) |
|
349 | - $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
350 | - else |
|
351 | - $fieldvalue[2]['value'] = ($values) ? $values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
350 | + if (isset($this->CI->input->post)) { |
|
351 | + $fieldvalue[2]['value'] = (!$this->CI->input->post($fieldvalue[2]['name'])) ? @$fieldvalue[2]['value'] : $this->CI->input->post($fieldvalue[2]['name']); |
|
352 | + } else { |
|
353 | + $fieldvalue[2]['value'] = ($values) ? $values[$fieldvalue[2]['name']] : @$fieldvalue[2]['value']; |
|
354 | + } |
|
352 | 355 | $form_contents.= form_textarea($fieldvalue[2]); |
353 | - } |
|
354 | - else if ($fieldvalue[2] == 'RADIO') { |
|
356 | + } else if ($fieldvalue[2] == 'RADIO') { |
|
355 | 357 | |
356 | 358 | $form_contents.= form_radio($fieldvalue[1], $fieldvalue[3]['value'], $fieldvalue[3]['checked']); |
357 | 359 | } |
@@ -581,8 +583,9 @@ discard block |
||
581 | 583 | $json_data["json_paging"]['total'] = $config['total_rows']; |
582 | 584 | $perpage = $config['per_page']; |
583 | 585 | $start = ($page_no - 1) * $perpage; |
584 | - if ($start < 0) |
|
585 | - $start = 0; |
|
586 | + if ($start < 0) { |
|
587 | + $start = 0; |
|
588 | + } |
|
586 | 589 | $json_data["paging"]['start'] = $start; |
587 | 590 | $json_data["paging"]['page_no'] = $perpage; |
588 | 591 | return $json_data; |
@@ -611,7 +614,7 @@ discard block |
||
611 | 614 | if($field_arr[2]=="status"){ |
612 | 615 | $row['id'] = $row_id; |
613 | 616 | $jsn_tmp[$field_key] = call_user_func_array(array($this->CI->common, $field_arr[5]), array($field_arr[3], $field_arr[4], $row)); |
614 | - }else{ |
|
617 | + } else{ |
|
615 | 618 | $jsn_tmp[$field_key] = call_user_func_array(array($this->CI->common, $field_arr[5]), array($field_arr[3], $field_arr[4], $row[$field_arr[2]])); |
616 | 619 | } |
617 | 620 | |
@@ -636,13 +639,13 @@ discard block |
||
636 | 639 | $fieldstr = $this->CI->common->build_custome_edit_button($ActionArr[5]->EDIT,$row[$field_arr[2]],$row["id"]); |
637 | 640 | if($acctype != ''){ |
638 | 641 | $jsn_tmp[$field_key] = $fieldstr."<br/>".$acctype; |
639 | - }else{ |
|
642 | + } else{ |
|
640 | 643 | $jsn_tmp[$field_key] = $fieldstr; |
641 | 644 | } |
642 | 645 | |
643 | 646 | |
644 | 647 | /*********************************/ |
645 | - }else { |
|
648 | + } else { |
|
646 | 649 | $jsn_tmp[$field_key] = $row[$field_arr[2]]; |
647 | 650 | } |
648 | 651 | } else { |
@@ -676,15 +679,13 @@ discard block |
||
676 | 679 | */ |
677 | 680 | $jsn_tmp[$field_key] = $this->CI->common->get_action_buttons($field_arr[5], $row_id); |
678 | 681 | /****************************************************************************/ |
679 | - } |
|
680 | - elseif($field_arr[0] == gettext("Profile Action")) |
|
682 | + } elseif($field_arr[0] == gettext("Profile Action")) |
|
681 | 683 | { |
682 | 684 | if(isset($field_arr[5]) && isset($field_arr[5]->START) && isset($field_arr[5]->STOP) && isset($field_arr[5]->RELOAD) && isset($field_arr[5]->RESCAN)){ |
683 | 685 | } |
684 | 686 | $jsn_tmp[$field_key] = $this->CI->common->get_action_buttons($field_arr[5], $row["id"]); |
685 | 687 | |
686 | - } |
|
687 | - else { |
|
688 | + } else { |
|
688 | 689 | $className = (isset($field_arr['9']) && $field_arr['9'] != '')?$field_arr['9']:"chkRefNos"; |
689 | 690 | $jsn_tmp[$field_key] = '<input type="checkbox" name="chkAll" id=' . $row['id'] . ' class="ace '.$className.'" onclick="clickchkbox(' . $row['id'] . ')" value=' . $row['id'] . '><lable class="lbl"></lable>'; } |
690 | 691 | } |
@@ -713,7 +714,7 @@ discard block |
||
713 | 714 | if($field_arr[2]=="status"){ |
714 | 715 | $row['id'] = $row_id; |
715 | 716 | $jsn_tmp[$field_key] = call_user_func_array(array($this->CI->common, $field_arr[5]), array($field_arr[3], $field_arr[4], $row)); |
716 | - }else{ |
|
717 | + } else{ |
|
717 | 718 | $jsn_tmp[$field_key] = call_user_func_array(array($this->CI->common, $field_arr[5]), array($field_arr[3], $field_arr[4], $row[$field_arr[2]])); |
718 | 719 | } |
719 | 720 | /** |
@@ -731,14 +732,13 @@ discard block |
||
731 | 732 | } |
732 | 733 | $jsn_tmp[$field_key] = $this->CI->common->build_custome_edit_button($ActionArr[5]->EDIT,$row[$field_arr[2]],$row["id"]); |
733 | 734 | /*******************************/ |
734 | - }else { |
|
735 | + } else { |
|
735 | 736 | $jsn_tmp[$field_key] = isset($row[$field_arr[2]]) ? $row[$field_arr[2]] : ""; |
736 | 737 | } |
737 | 738 | } else { |
738 | 739 | if ($field_arr[0] == "Action") { |
739 | 740 | $jsn_tmp[$field_key] = $this->CI->common->get_action_buttons($field_arr[5], $row["id"]); |
740 | - } |
|
741 | - else { |
|
741 | + } else { |
|
742 | 742 | $jsn_tmp[$field_key] = '<input type="checkbox" name="chkAll" id=' . $row['id'] . ' class="ace chkRefNos" onclick="clickchkbox(' . $row['id'] . ')" value=' . $row['id'] . '><lable class="lbl"></lable>'; |
743 | 743 | } |
744 | 744 | } |
@@ -22,8 +22,9 @@ discard block |
||
22 | 22 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
23 | 23 | ############################################################################### |
24 | 24 | |
25 | -if ( ! defined('BASEPATH')) |
|
25 | +if ( ! defined('BASEPATH')) { |
|
26 | 26 | exit('No direct script access allowed'); |
27 | +} |
|
27 | 28 | |
28 | 29 | /** |
29 | 30 | * Dynamically build forms for display |
@@ -113,8 +114,9 @@ discard block |
||
113 | 114 | $flag = false; |
114 | 115 | $uname = $this->random_string($length); |
115 | 116 | $uname = strtolower($uname); |
116 | - if (isset($default)) |
|
117 | - $uname = $default.$uname; |
|
117 | + if (isset($default)) { |
|
118 | + $uname = $default.$uname; |
|
119 | + } |
|
118 | 120 | if ( ! in_array($uname, $number)) { |
119 | 121 | $where = array($field => $uname); |
120 | 122 | $acc_result = $this->CI->db_model->getSelect('Count(id) as count', $tablename, $where); |
@@ -243,8 +245,7 @@ discard block |
||
243 | 245 | $accountinfo = $this->CI->session->userdata('accountinfo'); |
244 | 246 | if ($did_info['accountid'] == 0 && $did_info['parent_id'] == 0) { |
245 | 247 | $status = 'Not in use'; |
246 | - } |
|
247 | - elseif ($accountinfo['type'] != 1) { |
|
248 | + } elseif ($accountinfo['type'] != 1) { |
|
248 | 249 | if ($did_info['accountid'] == 0 && $did_info['parent_id'] > 0) { |
249 | 250 | $status = 'Purchase by Reseller'; |
250 | 251 | } |
@@ -274,8 +275,7 @@ discard block |
||
274 | 275 | $did_info = (array)$this->CI->db->get('dids')->first_row(); |
275 | 276 | if ($did_info['accountid'] > 0 && $did_info['parent_id'] == $accountinfo['id']) { |
276 | 277 | $flag_status = "<a href='../did_list_release/".$did_info['id']."' title='Release' onClick='return get_reliase_msg();'><span class=' label label-sm label-inverse_blue arrowed_blue-in' title='release'>Release(C)<span></a>"; |
277 | - } |
|
278 | - else if ($accountinfo['type'] != 1 && $did_info['parent_id'] != $accountinfo['id']) { |
|
278 | + } else if ($accountinfo['type'] != 1 && $did_info['parent_id'] != $accountinfo['id']) { |
|
279 | 279 | $flag_status = "<a href='../did_list_release/".$did_info['id']."' title='Release' onClick='return get_reliase_msg();'><span class=' label label-sm label-inverse_blue arrowed_blue-in' title='release'>Release(R)</span></a>"; |
280 | 280 | } else { |
281 | 281 | $reseller_id = $accountinfo['type'] != 1 ? 0 : $accountinfo['id']; |
@@ -870,9 +870,9 @@ discard block |
||
870 | 870 | $rel = (isset($button_params->layout) && $button_params->layout != '')?"facebox_".$button_params->layout:"facebox"; |
871 | 871 | return '<a href="' . $link . '" class="btn btn-royelblue btn-sm" rel="'.$rel.'" title="Edit" ="small"><i class="fa fa-pencil-square-o fa-fw"></i></a> '; |
872 | 872 | |
873 | - }else if(strpos($link,'customer_edit') !== false){ |
|
873 | + } else if(strpos($link,'customer_edit') !== false){ |
|
874 | 874 | return '<a href="' . $link . '" class="btn btn-royelblue btn-sm" title="Edit"><i class="fa fa-pencil-square-o fa-fw"></i></a> '; |
875 | - }else { |
|
875 | + } else { |
|
876 | 876 | return '<a href="' . $link . '" class="btn btn-royelblue btn-sm" title="Edit"><i class="fa fa-pencil-square-o fa-fw"></i></a> '; |
877 | 877 | } |
878 | 878 | } |
@@ -913,14 +913,18 @@ discard block |
||
913 | 913 | $data= explode("/",$url); |
914 | 914 | $link = base_url() . $url . "" . $linkid; |
915 | 915 | foreach($data as $key=>$value){ |
916 | - if($value == 'price_delete') |
|
917 | - $flag = '1'; |
|
918 | - if($value == 'trunk_remove') |
|
919 | - $flag='2'; |
|
920 | - if($value == 'customer_delete' ||$value =='provider_delete') |
|
921 | - $flag='3'; |
|
922 | - if($value == 'reseller_delete') |
|
923 | - $flag='4'; |
|
916 | + if($value == 'price_delete') { |
|
917 | + $flag = '1'; |
|
918 | + } |
|
919 | + if($value == 'trunk_remove') { |
|
920 | + $flag='2'; |
|
921 | + } |
|
922 | + if($value == 'customer_delete' ||$value =='provider_delete') { |
|
923 | + $flag='3'; |
|
924 | + } |
|
925 | + if($value == 'reseller_delete') { |
|
926 | + $flag='4'; |
|
927 | + } |
|
924 | 928 | } |
925 | 929 | if($flag=='1'){ |
926 | 930 | $where=array('pricelist_id'=>$linkid,'deleted !=' =>'1'); |
@@ -930,8 +934,7 @@ discard block |
||
930 | 934 | if($rategroup_cnt > 0 || $customer_cnt > 0 ){ |
931 | 935 | |
932 | 936 | return '<a href="' . $link . '" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_message('.$rategroup_cnt.','.$customer_cnt.','.$linkid.',1);"><i class="fa fa-trash fa-fw"></i></a>'; |
933 | - } |
|
934 | - else{ |
|
937 | + } else{ |
|
935 | 938 | return '<a href="' . $link . '" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();"><i class="fa fa-trash fa-fw"></i></a>'; |
936 | 939 | } |
937 | 940 | } |
@@ -940,8 +943,7 @@ discard block |
||
940 | 943 | $trunk_cnt=$this->get_field_count('id','outbound_routes',$where); |
941 | 944 | if($trunk_cnt > 0){ |
942 | 945 | return '<a href="' . $link . '" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_message('.$trunk_cnt.',null,'.$linkid.',2);"><i class="fa fa-trash fa-fw"></i></a>'; |
943 | - } |
|
944 | - else{ |
|
946 | + } else{ |
|
945 | 947 | return '<a href="' . $link . '" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();"><i class="fa fa-trash fa-fw"></i></a>'; |
946 | 948 | } |
947 | 949 | } |
@@ -2045,7 +2047,7 @@ discard block |
||
2045 | 2047 | |
2046 | 2048 | $ACCOUNT_DESCRIPTION .= '<td style="width:20%;font-size: 12px;color:#525252;font-family:arial; line-height: 22px;text-align:right;">'.$this->currency_decimal($this->CI->common_model->calculate_currency($charge_res['debit'])).'</td>'; |
2047 | 2049 | $ACCOUNT_DESCRIPTION .= '</tr>'; |
2048 | - }else{ |
|
2050 | + } else{ |
|
2049 | 2051 | $cdrs_data = $this->CI->db_model->getSelect("sum(billseconds) as billseconds,count(*) as count", "cdrs", array("accountid" => $charge_res['accountid'],"calltype" => $charge_res['item_type'])); |
2050 | 2052 | $cdrs_result = $cdrs_data->result_array(); |
2051 | 2053 | if($cdrs_result[0]['count'] > 0 ){ |
@@ -2185,7 +2187,7 @@ discard block |
||
2185 | 2187 | $download_path = $invoicedata['invoice_prefix'].$invoicedata['invoiceid'].".pdf"; |
2186 | 2188 | |
2187 | 2189 | $this->CI->html2pdf->Output($download_path,"D"); |
2188 | - }else{ |
|
2190 | + } else{ |
|
2189 | 2191 | $current_dir = getcwd()."/invoices/"; |
2190 | 2192 | $dir_name = $accountdata["id"]; |
2191 | 2193 | if(!is_dir($current_dir.$dir_name)){ |
@@ -2208,16 +2210,17 @@ discard block |
||
2208 | 2210 | $select = "concat($cnt_str) as $select_params[2] "; |
2209 | 2211 | $drp_array = $this->CI->db_model->getSelect($select, $table, $where); |
2210 | 2212 | $drp_array = $drp_array->result(); |
2211 | - if (isset($drp_array[0])) |
|
2212 | - return $drp_array[0]->$select_params[2]; |
|
2213 | - else |
|
2214 | - return 'Admin'; |
|
2213 | + if (isset($drp_array[0])) { |
|
2214 | + return $drp_array[0]->$select_params[2]; |
|
2215 | + } else { |
|
2216 | + return 'Admin'; |
|
2217 | + } |
|
2215 | 2218 | } |
2216 | 2219 | |
2217 | 2220 | function get_subreseller_info($parent_id){ |
2218 | 2221 | if(!empty($parent_id)){ |
2219 | 2222 | $str=$parent_id.","; |
2220 | - }else{ |
|
2223 | + } else{ |
|
2221 | 2224 | $str=null; |
2222 | 2225 | } |
2223 | 2226 | $query = "select id from accounts where reseller_id = '$parent_id' AND deleted =0 AND type=1"; |
@@ -2235,7 +2238,7 @@ discard block |
||
2235 | 2238 | function get_parent_info($child_id,$parent_id){ |
2236 | 2239 | if(!empty($child_id)){ |
2237 | 2240 | $str=$child_id.","; |
2238 | - }else{ |
|
2241 | + } else{ |
|
2239 | 2242 | $str=null; |
2240 | 2243 | } |
2241 | 2244 | if($child_id > 0){ |
@@ -21,8 +21,9 @@ discard block |
||
21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | 22 | ############################################################################### |
23 | 23 | |
24 | -if (!defined('BASEPATH')) |
|
24 | +if (!defined('BASEPATH')) { |
|
25 | 25 | exit('No direct script access allowed'); |
26 | +} |
|
26 | 27 | |
27 | 28 | /** |
28 | 29 | * Dynamically build forms for display |
@@ -121,9 +122,9 @@ discard block |
||
121 | 122 | } |
122 | 123 | |
123 | 124 | function build_template($template_type,$detail,$detail_type='') { |
124 | - if(!is_array($template_type)) |
|
125 | - $this->get_template($template_type); |
|
126 | - else{ |
|
125 | + if(!is_array($template_type)) { |
|
126 | + $this->get_template($template_type); |
|
127 | + } else{ |
|
127 | 128 | $this->message=$template_type['message']; |
128 | 129 | $this->subject=$template_type['subject']; |
129 | 130 | $template_type=''; |
@@ -226,7 +227,9 @@ discard block |
||
226 | 227 | } |
227 | 228 | function get_smtp_details() |
228 | 229 | { |
229 | - if($this->smtp_port=='' || $this->smtp_host=='' || $this->smtp_user=='' || $this->smtp_pass=='')exit; |
|
230 | + if($this->smtp_port=='' || $this->smtp_host=='' || $this->smtp_user=='' || $this->smtp_pass=='') { |
|
231 | + exit; |
|
232 | + } |
|
230 | 233 | $config['protocol'] = "smtp"; |
231 | 234 | $config['smtp_host'] = $this->smtp_host; |
232 | 235 | $config['smtp_port'] = $this->smtp_port; |
@@ -243,14 +246,15 @@ discard block |
||
243 | 246 | if(!$this->email){ |
244 | 247 | if(!$resend){ |
245 | 248 | $this->build_template($template_type,$details,$detail_type); |
246 | - }else{ |
|
249 | + } else{ |
|
247 | 250 | $this->set_email_paramenters($details); |
248 | 251 | } |
249 | 252 | |
250 | - if(!$brodcast) |
|
251 | - $history_id=$this->mail_history($attachment); |
|
252 | - else |
|
253 | - $history_id=$details['history_id']; |
|
253 | + if(!$brodcast) { |
|
254 | + $history_id=$this->mail_history($attachment); |
|
255 | + } else { |
|
256 | + $history_id=$details['history_id']; |
|
257 | + } |
|
254 | 258 | if(isset($this->from) && $this->from!='' && isset($this->to) && $this->to!='' && !$mass_mail){ |
255 | 259 | if(!$this->smtp){ |
256 | 260 | $this->get_smtp_details(); |
@@ -287,14 +291,15 @@ discard block |
||
287 | 291 | |
288 | 292 | if(!$resend){ |
289 | 293 | $this->build_template($template_type,$details,$detail_type); |
290 | - }else{ |
|
294 | + } else{ |
|
291 | 295 | $this->set_email_paramenters($details); |
292 | 296 | } |
293 | 297 | |
294 | - if(!$brodcast) |
|
295 | - $history_id=$this->mail_history($attachment); |
|
296 | - else |
|
297 | - $history_id=$details['history_id']; |
|
298 | + if(!$brodcast) { |
|
299 | + $history_id=$this->mail_history($attachment); |
|
300 | + } else { |
|
301 | + $history_id=$details['history_id']; |
|
302 | + } |
|
298 | 303 | if(isset($this->from) && $this->from!='' && isset($this->to) && $this->to!='' && !$mass_mail){ |
299 | 304 | if(!$this->smtp){ |
300 | 305 | $this->get_smtp_details(); |
@@ -549,8 +549,12 @@ discard block |
||
549 | 549 | public function setRotation($angle, $xC = null, $yC = null) |
550 | 550 | { |
551 | 551 | // if no center, rotate around the current posiition |
552 | - if ($xC === null) $xC = $this->x; |
|
553 | - if ($yC === null) $yC = $this->y; |
|
552 | + if ($xC === null) { |
|
553 | + $xC = $this->x; |
|
554 | + } |
|
555 | + if ($yC === null) { |
|
556 | + $yC = $this->y; |
|
557 | + } |
|
554 | 558 | |
555 | 559 | // prepare the coordinate |
556 | 560 | $yC = ($this->h - $yC) * $this->k; |
@@ -592,8 +596,9 @@ discard block |
||
592 | 596 | */ |
593 | 597 | public function SetY($y, $resetx = true, $rtloff = false) |
594 | 598 | { |
595 | - if ($resetx) |
|
596 | - $this->x = $this->lMargin; |
|
599 | + if ($resetx) { |
|
600 | + $this->x = $this->lMargin; |
|
601 | + } |
|
597 | 602 | |
598 | 603 | $this->y = $y; |
599 | 604 | } |
@@ -726,9 +731,13 @@ discard block |
||
726 | 731 | $y4 = $y + $h; |
727 | 732 | |
728 | 733 | // get the Closing operator from the PDF Style |
729 | - if ($style == 'F') $op = 'f'; |
|
730 | - elseif ($style == 'FD' || $style == 'DF') $op = 'B'; |
|
731 | - else $op = 'S'; |
|
734 | + if ($style == 'F') { |
|
735 | + $op = 'f'; |
|
736 | + } elseif ($style == 'FD' || $style == 'DF') { |
|
737 | + $op = 'B'; |
|
738 | + } else { |
|
739 | + $op = 'S'; |
|
740 | + } |
|
732 | 741 | |
733 | 742 | // drawing |
734 | 743 | $this->_Point($x1, $y1, true); |
@@ -772,9 +781,13 @@ discard block |
||
772 | 781 | public function svgEllipse($x0, $y0, $rx, $ry, $style) |
773 | 782 | { |
774 | 783 | // get the Closing operator from the PDF Style |
775 | - if ($style == 'F') $op = 'f'; |
|
776 | - elseif ($style == 'FD' || $style == 'DF') $op = 'B'; |
|
777 | - else $op = 'S'; |
|
784 | + if ($style == 'F') { |
|
785 | + $op = 'f'; |
|
786 | + } elseif ($style == 'FD' || $style == 'DF') { |
|
787 | + $op = 'B'; |
|
788 | + } else { |
|
789 | + $op = 'S'; |
|
790 | + } |
|
778 | 791 | |
779 | 792 | // drawing |
780 | 793 | $this->_Arc($x0, $y0, $rx, $ry, 0, 2 * M_PI, true, true, true); |
@@ -791,9 +804,13 @@ discard block |
||
791 | 804 | public function svgPolygone($actions, $style) |
792 | 805 | { |
793 | 806 | // get the Closing operator from the PDF Style |
794 | - if ($style == 'F') $op = 'f'; |
|
795 | - elseif ($style == 'FD' || $style == 'DF') $op = 'B'; |
|
796 | - else $op = 'S'; |
|
807 | + if ($style == 'F') { |
|
808 | + $op = 'f'; |
|
809 | + } elseif ($style == 'FD' || $style == 'DF') { |
|
810 | + $op = 'B'; |
|
811 | + } else { |
|
812 | + $op = 'S'; |
|
813 | + } |
|
797 | 814 | |
798 | 815 | // To save the First action and the last point |
799 | 816 | $first = array('', 0, 0); |
@@ -1004,7 +1021,9 @@ discard block |
||
1004 | 1021 | $trans = false) |
1005 | 1022 | { |
1006 | 1023 | // if we want the no trigo direction : add 2PI to the begin angle, to invert the direction |
1007 | - if ( ! $direction) $angleBegin += M_PI * 2.; |
|
1024 | + if ( ! $direction) { |
|
1025 | + $angleBegin += M_PI * 2.; |
|
1026 | + } |
|
1008 | 1027 | |
1009 | 1028 | // cut in segment to convert in berize curv |
1010 | 1029 | $dt = ($angleEnd - $angleBegin) / self::ARC_NB_SEGMENT; |
@@ -1110,7 +1129,9 @@ discard block |
||
1110 | 1129 | $v['s1']['y'] = -$v['s1']['xr'] * sin($angle) + $v['s1']['yr'] * cos($angle); |
1111 | 1130 | $v['s1']['a1'] = atan2($v['y1'] - $v['s1']['y'], $v['x1'] - $v['s1']['x']); |
1112 | 1131 | $v['s1']['a2'] = atan2($v['y2'] - $v['s1']['y'], $v['x2'] - $v['s1']['x']); |
1113 | - if ($v['s1']['a1'] > $v['s1']['a2']) $v['s1']['a1'] -= 2 * M_PI; |
|
1132 | + if ($v['s1']['a1'] > $v['s1']['a2']) { |
|
1133 | + $v['s1']['a1'] -= 2 * M_PI; |
|
1134 | + } |
|
1114 | 1135 | |
1115 | 1136 | $v['s2'] = array(); |
1116 | 1137 | $v['s2']['t'] = -$v['s1']['t']; |
@@ -1122,7 +1143,9 @@ discard block |
||
1122 | 1143 | $v['s2']['y'] = -$v['s2']['xr'] * sin($angle) + $v['s2']['yr'] * cos($angle); |
1123 | 1144 | $v['s2']['a1'] = atan2($v['y1'] - $v['s2']['y'], $v['x1'] - $v['s2']['x']); |
1124 | 1145 | $v['s2']['a2'] = atan2($v['y2'] - $v['s2']['y'], $v['x2'] - $v['s2']['x']); |
1125 | - if ($v['s2']['a1'] > $v['s2']['a2']) $v['s2']['a1'] -= 2 * M_PI; |
|
1146 | + if ($v['s2']['a1'] > $v['s2']['a2']) { |
|
1147 | + $v['s2']['a1'] -= 2 * M_PI; |
|
1148 | + } |
|
1126 | 1149 | |
1127 | 1150 | if ( ! $l) { |
1128 | 1151 | if ($s) { |
@@ -1170,8 +1193,11 @@ discard block |
||
1170 | 1193 | { |
1171 | 1194 | // load the last Transfomation Matrix |
1172 | 1195 | $nb = count($this->_transf); |
1173 | - if ($nb) $m = $this->_transf[$nb - 1]; |
|
1174 | - else $m = array(1, 0, 0, 1, 0, 0); |
|
1196 | + if ($nb) { |
|
1197 | + $m = $this->_transf[$nb - 1]; |
|
1198 | + } else { |
|
1199 | + $m = array(1, 0, 0, 1, 0, 0); |
|
1200 | + } |
|
1175 | 1201 | |
1176 | 1202 | // apply the Transformation Matrix |
1177 | 1203 | list($x, $y) = array(($x * $m[0] + $y * $m[2] + $m[4]), ($x * $m[1] + $y * $m[3] + $m[5])); |
@@ -1195,11 +1221,16 @@ discard block |
||
1195 | 1221 | { |
1196 | 1222 | // get the last Transformation Matrix |
1197 | 1223 | $nb = count($this->_transf); |
1198 | - if ($nb) $m = $this->_transf[$nb - 1]; |
|
1199 | - else $m = array(1, 0, 0, 1, 0, 0); |
|
1224 | + if ($nb) { |
|
1225 | + $m = $this->_transf[$nb - 1]; |
|
1226 | + } else { |
|
1227 | + $m = array(1, 0, 0, 1, 0, 0); |
|
1228 | + } |
|
1200 | 1229 | |
1201 | 1230 | // if no transform, get the Identity Matrix |
1202 | - if ( ! $n) $n = array(1, 0, 0, 1, 0, 0); |
|
1231 | + if ( ! $n) { |
|
1232 | + $n = array(1, 0, 0, 1, 0, 0); |
|
1233 | + } |
|
1203 | 1234 | |
1204 | 1235 | // create the new Transformation Matrix |
1205 | 1236 | $this->_transf[] = array( |
@@ -1249,7 +1280,9 @@ discard block |
||
1249 | 1280 | $this->write1DBarcode($code, $type, $x, $y, $w, $h, '', $style, 'N'); |
1250 | 1281 | |
1251 | 1282 | // it Label => add the FontSize to the height |
1252 | - if ($labelFontsize) $h += ($labelFontsize); |
|
1283 | + if ($labelFontsize) { |
|
1284 | + $h += ($labelFontsize); |
|
1285 | + } |
|
1253 | 1286 | |
1254 | 1287 | // return the size of the barcode |
1255 | 1288 | return array($w, $h); |
@@ -1307,7 +1340,9 @@ discard block |
||
1307 | 1340 | |
1308 | 1341 | // Offset of the current level |
1309 | 1342 | $level = $this->outlines[$i]['l']; |
1310 | - if ($level > 0) $this->Cell($level * 8); |
|
1343 | + if ($level > 0) { |
|
1344 | + $this->Cell($level * 8); |
|
1345 | + } |
|
1311 | 1346 | |
1312 | 1347 | // Caption (cut to fit on the width page) |
1313 | 1348 | $str = $this->outlines[$i]['t']; |