@@ -22,7 +22,7 @@ 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 | class Charges_form {
|
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | function get_charge_form_fields() {
|
| 34 | - $form['forms'] = array(base_url() . 'charges/periodiccharges_save/', array('id' => 'charges_form', 'method' => 'POST', 'name' => 'charges_form'));
|
|
| 34 | + $form['forms'] = array(base_url().'charges/periodiccharges_save/', array('id' => 'charges_form', 'method' => 'POST', 'name' => 'charges_form'));
|
|
| 35 | 35 | $form['Information'] = array( |
| 36 | 36 | array('', 'HIDDEN', array('name' => 'id'), '', '', '', ''),
|
| 37 | 37 | array('Name', 'INPUT', array('name' => 'description', 'size' => '20', 'class' => "text field medium"), 'trim|required|xss_clean', 'tOOL TIP', 'Please Enter account number'),
|
@@ -52,13 +52,13 @@ discard block |
||
| 52 | 52 | $account_data = $this->CI->session->userdata("accountinfo");
|
| 53 | 53 | $loginid = $account_data['id']; |
| 54 | 54 | |
| 55 | - }else{
|
|
| 55 | + } else {
|
|
| 56 | 56 | $loginid = "0"; |
| 57 | 57 | } |
| 58 | 58 | $form['forms'] = array("", array('id' => "charges_search"));
|
| 59 | 59 | $form['Search'] = array( |
| 60 | 60 | array('Name', 'INPUT', array('name' => 'description[description]', '', 'size' => '20', 'class' => "text field"), '', 'tOOL TIP', '1', 'description[description-string]', '', '', '', 'search_string_type', ''),
|
| 61 | - array('Rate Group', 'pricelist_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array('status'=>0,'reseller_id'=>$loginid)),
|
|
| 61 | + array('Rate Group', 'pricelist_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'name', 'pricelists', 'build_dropdown', 'where_arr', array('status'=>0, 'reseller_id'=>$loginid)),
|
|
| 62 | 62 | array('Amount', 'INPUT', array('name' => 'charge[charge]', 'value' => '', 'size' => '20', 'class' => "text field"), '', 'Tool tips info', '1', 'charge[charge-integer]', '', '', '', 'search_int_type', ''),
|
| 63 | 63 | array('Billing Cycle', 'sweep_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'sweep', 'sweeplist', 'build_dropdown', '', ''),
|
| 64 | 64 | array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_search_status'),
|
@@ -77,28 +77,28 @@ discard block |
||
| 77 | 77 | function build_charge_list_for_admin() {
|
| 78 | 78 | |
| 79 | 79 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
|
| 80 | - $currency_id=$account_info['currency_id']; |
|
| 81 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
|
|
| 80 | + $currency_id = $account_info['currency_id']; |
|
| 81 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
|
|
| 82 | 82 | |
| 83 | 83 | // array(display name, width, db_field_parent_table,feidname, db_field_child_table,function name); |
| 84 | - $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "","","false","center"),
|
|
| 84 | + $grid_field_arr = json_encode(array(array("<input type='checkbox' name='chkAll' class='ace checkall'/><label class='lbl'></label>", "30", "", "", "", "", "", "false", "center"),
|
|
| 85 | 85 | /** |
| 86 | 86 | ASTPP 3.0 |
| 87 | 87 | For DID edit on DID number |
| 88 | 88 | **/ |
| 89 | - array(gettext("Name"), "140", "description", "", "", "","EDITABLE","true","center"),
|
|
| 89 | + array(gettext("Name"), "140", "description", "", "", "", "EDITABLE", "true", "center"),
|
|
| 90 | 90 | /**************************************************/ |
| 91 | - array(gettext("Rate Group"), "140", "pricelist_id", "name", "pricelists", "get_field_name","","true","center"),
|
|
| 92 | - array("Amount($currency)", "125", "charge", "charge", "charge", "convert_to_currency","","true","right"),
|
|
| 93 | - array(gettext("Prorate"), "125", "pro_rate", "pro_rate", "charges", "get_prorate","","true","center"),
|
|
| 94 | - array(gettext("Billing Cycle"), "130", "sweep_id", "sweep", "sweeplist", "get_field_name","","true","center"),
|
|
| 91 | + array(gettext("Rate Group"), "140", "pricelist_id", "name", "pricelists", "get_field_name", "", "true", "center"),
|
|
| 92 | + array("Amount($currency)", "125", "charge", "charge", "charge", "convert_to_currency", "", "true", "right"),
|
|
| 93 | + array(gettext("Prorate"), "125", "pro_rate", "pro_rate", "charges", "get_prorate", "", "true", "center"),
|
|
| 94 | + array(gettext("Billing Cycle"), "130", "sweep_id", "sweep", "sweeplist", "get_field_name", "", "true", "center"),
|
|
| 95 | 95 | /** |
| 96 | 96 | ASTPP 3.0 |
| 97 | 97 | Show Creation date,last_modified date in reseller grid with admin login |
| 98 | 98 | **/ |
| 99 | - array(gettext("Status"), "125", "status", "status", "charges", "get_status","","true","center"),
|
|
| 100 | - array(gettext("Created Date"), "150", "creation_date", "", "", "","","true","center"),
|
|
| 101 | - array(gettext("Modified Date"), "150", "last_modified_date", "", "", "","","true","center"),
|
|
| 99 | + array(gettext("Status"), "125", "status", "status", "charges", "get_status", "", "true", "center"),
|
|
| 100 | + array(gettext("Created Date"), "150", "creation_date", "", "", "", "", "true", "center"),
|
|
| 101 | + array(gettext("Modified Date"), "150", "last_modified_date", "", "", "", "", "true", "center"),
|
|
| 102 | 102 | /************************************************/ |
| 103 | 103 | /* |
| 104 | 104 | ASTPP 3.0 |
@@ -114,8 +114,8 @@ discard block |
||
| 114 | 114 | /********************************************/ |
| 115 | 115 | |
| 116 | 116 | function build_grid_buttons() {
|
| 117 | - $buttons_json = json_encode(array(array("Create" , "btn btn-line-warning btn" , "fa fa-plus-circle fa-lg", "button_action", "/charges/periodiccharges_add/", "popup"),
|
|
| 118 | - array("Delete", "btn btn-line-danger","fa fa-times-circle fa-lg", "button_action", "/charges/periodiccharges_delete_multiple/")
|
|
| 117 | + $buttons_json = json_encode(array(array("Create", "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/charges/periodiccharges_add/", "popup"),
|
|
| 118 | + array("Delete", "btn btn-line-danger", "fa fa-times-circle fa-lg", "button_action", "/charges/periodiccharges_delete_multiple/")
|
|
| 119 | 119 | )); |
| 120 | 120 | return $buttons_json; |
| 121 | 121 | } |
@@ -123,15 +123,15 @@ discard block |
||
| 123 | 123 | function build_charges_list_for_customer($accountid, $accounttype) {
|
| 124 | 124 | |
| 125 | 125 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
|
| 126 | - $currency_id=$account_info['currency_id']; |
|
| 127 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
|
|
| 126 | + $currency_id = $account_info['currency_id']; |
|
| 127 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
|
|
| 128 | 128 | |
| 129 | - $grid_field_arr = json_encode(array(array("Name", "140", "description", "", "", "","","true","center"),
|
|
| 130 | - array("Amount($currency)", "140", "charge", "charge", "charge", "convert_to_currency","","true","right"),
|
|
| 131 | - array("Prorate", "125", "pro_rate", "pro_rate", "charges", "get_prorate","","true","center"),
|
|
| 132 | - array("Billing Cycle", "170", "sweep_id", "sweep", "sweeplist", "get_field_name","","true","center"),
|
|
| 133 | - array("Created Date", "150", "creation_date", "", "", "","","true","center"),
|
|
| 134 | - array("Modified Date", "150", "last_modified_date", "", "", "","","true","center"),
|
|
| 129 | + $grid_field_arr = json_encode(array(array("Name", "140", "description", "", "", "", "", "true", "center"),
|
|
| 130 | + array("Amount($currency)", "140", "charge", "charge", "charge", "convert_to_currency", "", "true", "right"),
|
|
| 131 | + array("Prorate", "125", "pro_rate", "pro_rate", "charges", "get_prorate", "", "true", "center"),
|
|
| 132 | + array("Billing Cycle", "170", "sweep_id", "sweep", "sweeplist", "get_field_name", "", "true", "center"),
|
|
| 133 | + array("Created Date", "150", "creation_date", "", "", "", "", "true", "center"),
|
|
| 134 | + array("Modified Date", "150", "last_modified_date", "", "", "", "", "true", "center"),
|
|
| 135 | 135 | array("Action", "150", "", "", "", array("DELETE" => array("url" => "accounts/".$accounttype."_subscription_action/delete/$accountid/$accounttype/", "mode" => "single")))
|
| 136 | 136 | )); |
| 137 | 137 | return $grid_field_arr; |
@@ -28,24 +28,24 @@ discard block |
||
| 28 | 28 | parent::__construct(); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - function get_resellersummary_report_list($flag, $start = 0, $limit = 0,$group_by, $select,$order, $export = false) { |
|
| 31 | + function get_resellersummary_report_list($flag, $start = 0, $limit = 0, $group_by, $select, $order, $export = false) { |
|
| 32 | 32 | |
| 33 | 33 | $this->db_model->build_search('summary_reseller_search'); |
| 34 | - $accountinfo=$this->session->userdata('accountinfo'); |
|
| 34 | + $accountinfo = $this->session->userdata('accountinfo'); |
|
| 35 | 35 | $reseller_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : 0; |
| 36 | - $where['reseller_id']=$reseller_id; |
|
| 36 | + $where['reseller_id'] = $reseller_id; |
|
| 37 | 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"; |
|
| 38 | + $where['callstart >='] = date('Y-m-d')." 00:00:00"; |
|
| 39 | + $where['callstart <='] = date('Y-m-d')." 23:59:59"; |
|
| 40 | 40 | } |
| 41 | 41 | $this->db->where($where); |
| 42 | - if(!empty($group_by)) |
|
| 42 | + if ( ! empty($group_by)) |
|
| 43 | 43 | $this->db->group_by($group_by); |
| 44 | 44 | if ($flag) { |
| 45 | 45 | if ($export) { |
| 46 | - $result = $this->db_model->select($select . ",COUNT(*) AS attempts, AVG(billseconds) AS acd,MAX(billseconds) AS mcd,SUM(billseconds) AS duration,SUM(CASE WHEN calltype !='free' THEN billseconds ELSE 0 END) as billable,SUM(CASE WHEN billseconds > 0 THEN 1 ELSE 0 END) as completed,SUM(debit) AS debit,SUM(cost) AS cost", "reseller_cdrs", '', $order, 'asc', '', '', ''); |
|
| 46 | + $result = $this->db_model->select($select.",COUNT(*) AS attempts, AVG(billseconds) AS acd,MAX(billseconds) AS mcd,SUM(billseconds) AS duration,SUM(CASE WHEN calltype !='free' THEN billseconds ELSE 0 END) as billable,SUM(CASE WHEN billseconds > 0 THEN 1 ELSE 0 END) as completed,SUM(debit) AS debit,SUM(cost) AS cost", "reseller_cdrs", '', $order, 'asc', '', '', ''); |
|
| 47 | 47 | } else { |
| 48 | - $result = $this->db_model->select($select . ",COUNT(*) AS attempts, AVG(billseconds) AS acd,MAX(billseconds) AS mcd,SUM(billseconds) AS duration,SUM(CASE WHEN calltype !='free' THEN billseconds ELSE 0 END) as billable,SUM(CASE WHEN billseconds > 0 THEN 1 ELSE 0 END) as completed,SUM(debit) AS debit,SUM(cost) AS cost", "reseller_cdrs", '', $order, 'asc', $limit, $start, ''); |
|
| 48 | + $result = $this->db_model->select($select.",COUNT(*) AS attempts, AVG(billseconds) AS acd,MAX(billseconds) AS mcd,SUM(billseconds) AS duration,SUM(CASE WHEN calltype !='free' THEN billseconds ELSE 0 END) as billable,SUM(CASE WHEN billseconds > 0 THEN 1 ELSE 0 END) as completed,SUM(debit) AS debit,SUM(cost) AS cost", "reseller_cdrs", '', $order, 'asc', $limit, $start, ''); |
|
| 49 | 49 | } |
| 50 | 50 | } else { |
| 51 | 51 | $result = $this->db_model->getSelect("count(*) as total_count", "reseller_cdrs", ''); |
@@ -58,21 +58,21 @@ discard block |
||
| 58 | 58 | return $result; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - function get_providersummary_report_list($flag, $start = 0, $limit = 0, $group_by, $select,$order, $export = false) { |
|
| 61 | + function get_providersummary_report_list($flag, $start = 0, $limit = 0, $group_by, $select, $order, $export = false) { |
|
| 62 | 62 | $this->db_model->build_search('summary_provider_search'); |
| 63 | - $where['provider_id >']=0; |
|
| 63 | + $where['provider_id >'] = 0; |
|
| 64 | 64 | if ($this->session->userdata('advance_search') != 1) { |
| 65 | - $where['callstart >=']=date('Y-m-d') . " 00:00:00"; |
|
| 66 | - $where['callstart <=']=date('Y-m-d') . " 23:59:59"; |
|
| 65 | + $where['callstart >='] = date('Y-m-d')." 00:00:00"; |
|
| 66 | + $where['callstart <='] = date('Y-m-d')." 23:59:59"; |
|
| 67 | 67 | } |
| 68 | 68 | $this->db->where($where); |
| 69 | - if(!empty($group_by)) |
|
| 69 | + if ( ! empty($group_by)) |
|
| 70 | 70 | $this->db->group_by($group_by); |
| 71 | 71 | if ($flag) { |
| 72 | 72 | if ($export) { |
| 73 | - $result = $this->db_model->select($select . ",COUNT(*) AS attempts, AVG(billseconds) AS acd,MAX(billseconds) AS mcd,SUM(billseconds) AS duration,SUM(CASE WHEN calltype !='free' THEN billseconds ELSE 0 END) as billable,SUM(CASE WHEN billseconds > 0 THEN 1 ELSE 0 END) as completed,SUM(cost) AS cost", "cdrs", '', $order, 'asc', '', '', ''); |
|
| 73 | + $result = $this->db_model->select($select.",COUNT(*) AS attempts, AVG(billseconds) AS acd,MAX(billseconds) AS mcd,SUM(billseconds) AS duration,SUM(CASE WHEN calltype !='free' THEN billseconds ELSE 0 END) as billable,SUM(CASE WHEN billseconds > 0 THEN 1 ELSE 0 END) as completed,SUM(cost) AS cost", "cdrs", '', $order, 'asc', '', '', ''); |
|
| 74 | 74 | } else { |
| 75 | - $result = $this->db_model->select($select . ",COUNT(*) AS attempts, AVG(billseconds) AS acd,MAX(billseconds) AS mcd,SUM(billseconds) AS duration,SUM(CASE WHEN calltype !='free' THEN billseconds ELSE 0 END) as billable,SUM(CASE WHEN billseconds > 0 THEN 1 ELSE 0 END) as completed,SUM(cost) AS cost", "cdrs", '', $order, 'asc', $limit, $start, ''); |
|
| 75 | + $result = $this->db_model->select($select.",COUNT(*) AS attempts, AVG(billseconds) AS acd,MAX(billseconds) AS mcd,SUM(billseconds) AS duration,SUM(CASE WHEN calltype !='free' THEN billseconds ELSE 0 END) as billable,SUM(CASE WHEN billseconds > 0 THEN 1 ELSE 0 END) as completed,SUM(cost) AS cost", "cdrs", '', $order, 'asc', $limit, $start, ''); |
|
| 76 | 76 | } |
| 77 | 77 | } else { |
| 78 | 78 | $result = $this->db_model->getSelect("count(*) as total_count", "cdrs", ''); |
@@ -85,24 +85,24 @@ discard block |
||
| 85 | 85 | return $result; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - function get_customersummary_report_list($flag, $start = 0, $limit = 0, $group_by, $select,$order, $export) { |
|
| 88 | + function get_customersummary_report_list($flag, $start = 0, $limit = 0, $group_by, $select, $order, $export) { |
|
| 89 | 89 | $this->db_model->build_search('summary_customer_search'); |
| 90 | - $accountinfo=$this->session->userdata('accountinfo'); |
|
| 90 | + $accountinfo = $this->session->userdata('accountinfo'); |
|
| 91 | 91 | $reseller_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : 0; |
| 92 | - $where['reseller_id']=$reseller_id; |
|
| 93 | - $where['type']=0; |
|
| 92 | + $where['reseller_id'] = $reseller_id; |
|
| 93 | + $where['type'] = 0; |
|
| 94 | 94 | if ($this->session->userdata('advance_search') != 1) { |
| 95 | - $where['callstart >=']=date('Y-m-d') . " 00:00:00"; |
|
| 96 | - $where['callstart <=']=date('Y-m-d') . " 23:59:59"; |
|
| 95 | + $where['callstart >='] = date('Y-m-d')." 00:00:00"; |
|
| 96 | + $where['callstart <='] = date('Y-m-d')." 23:59:59"; |
|
| 97 | 97 | } |
| 98 | 98 | $this->db->where($where); |
| 99 | - if(!empty($group_by)) |
|
| 99 | + if ( ! empty($group_by)) |
|
| 100 | 100 | $this->db->group_by($group_by); |
| 101 | 101 | if ($flag) { |
| 102 | 102 | if ($export) { |
| 103 | - $result = $this->db_model->select($select . ",COUNT(*) AS attempts, AVG(billseconds) AS acd,MAX(billseconds) AS mcd,SUM(billseconds) AS duration,SUM(CASE WHEN calltype !='free' THEN billseconds ELSE 0 END) as billable,SUM(CASE WHEN billseconds > 0 THEN 1 ELSE 0 END) as completed,SUM(debit) AS debit,SUM(cost) AS cost", "cdrs", '', $order, 'asc', '', '', ''); |
|
| 103 | + $result = $this->db_model->select($select.",COUNT(*) AS attempts, AVG(billseconds) AS acd,MAX(billseconds) AS mcd,SUM(billseconds) AS duration,SUM(CASE WHEN calltype !='free' THEN billseconds ELSE 0 END) as billable,SUM(CASE WHEN billseconds > 0 THEN 1 ELSE 0 END) as completed,SUM(debit) AS debit,SUM(cost) AS cost", "cdrs", '', $order, 'asc', '', '', ''); |
|
| 104 | 104 | } else { |
| 105 | - $result = $this->db_model->select($select . ",COUNT(*) AS attempts, AVG(billseconds) AS acd,MAX(billseconds) AS mcd,SUM(billseconds) AS duration,SUM(CASE WHEN calltype !='free' THEN billseconds ELSE 0 END) as billable,SUM(CASE WHEN billseconds > 0 THEN 1 ELSE 0 END) as completed,SUM(debit) AS debit,SUM(cost) AS cost", "cdrs", '', $order, 'asc', $limit, $start, ''); |
|
| 105 | + $result = $this->db_model->select($select.",COUNT(*) AS attempts, AVG(billseconds) AS acd,MAX(billseconds) AS mcd,SUM(billseconds) AS duration,SUM(CASE WHEN calltype !='free' THEN billseconds ELSE 0 END) as billable,SUM(CASE WHEN billseconds > 0 THEN 1 ELSE 0 END) as completed,SUM(debit) AS debit,SUM(cost) AS cost", "cdrs", '', $order, 'asc', $limit, $start, ''); |
|
| 106 | 106 | } |
| 107 | 107 | } else { |
| 108 | 108 | $result = $this->db_model->getSelect("count(*) as total_count", "cdrs", ''); |
@@ -327,14 +327,14 @@ discard block |
||
| 327 | 327 | unset($_POST['advance_search']); |
| 328 | 328 | $this->session->set_userdata('customersummary_reports_search', $this->input->post()); |
| 329 | 329 | } |
| 330 | - redirect(base_url() . 'summary/customer/'); |
|
| 330 | + redirect(base_url().'summary/customer/'); |
|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | function customer_clearsearchfilter() { |
| 334 | 334 | $this->session->set_userdata('advance_search', 0); |
| 335 | 335 | $this->session->set_userdata('customersummary_reports_search', ""); |
| 336 | 336 | $this->session->set_userdata('customersummary_reports_export', ""); |
| 337 | - redirect(base_url() . 'summary/customer/'); |
|
| 337 | + redirect(base_url().'summary/customer/'); |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | /** |
@@ -343,11 +343,11 @@ discard block |
||
| 343 | 343 | function summary_search_info($entity) { |
| 344 | 344 | $group_by_str = null; |
| 345 | 345 | $select_str = null; |
| 346 | - $group_by_time=null; |
|
| 346 | + $group_by_time = null; |
|
| 347 | 347 | $group_by_1 = null; |
| 348 | 348 | $group_by_2 = null; |
| 349 | 349 | $group_by_3 = null; |
| 350 | - $order_str=null; |
|
| 350 | + $order_str = null; |
|
| 351 | 351 | $custom_total_array = array(); |
| 352 | 352 | $custom_search = array(); |
| 353 | 353 | $export_select_str = null; |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | # along with this program. If not, see <http://www.gnu.org/licenses/> |
| 21 | 21 | ############################################################################ |
| 22 | 22 | |
| 23 | -if (!defined('BASEPATH'))
|
|
| 23 | +if ( ! defined('BASEPATH'))
|
|
| 24 | 24 | exit('No direct script access allowed');
|
| 25 | 25 | |
| 26 | 26 | class Summary_form {
|
@@ -33,9 +33,9 @@ discard block |
||
| 33 | 33 | $form['Search'] = array( |
| 34 | 34 | array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'),
|
| 35 | 35 | array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'),
|
| 36 | - array('Account', 'provider_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"3")),
|
|
| 36 | + array('Account', 'provider_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"3")),
|
|
| 37 | 37 | array('Trunk', 'trunk_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`status`=2, concat(name,"","^"),name) as name', 'trunks', 'build_dropdown_deleted', '', array("status" => "1")),
|
| 38 | - array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''),
|
|
| 38 | + array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''),
|
|
| 39 | 39 | array(' Code Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''),
|
| 40 | 40 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
|
| 41 | 41 | array('', 'HIDDEN', 'advance_search', '1', '', '', ''));
|
@@ -44,124 +44,124 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | return $form; |
| 46 | 46 | } |
| 47 | - function build_providersummary(){
|
|
| 47 | + function build_providersummary() {
|
|
| 48 | 48 | |
| 49 | 49 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
|
| 50 | -$currency_id=$account_info['currency_id']; |
|
| 51 | -$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
|
|
| 50 | +$currency_id = $account_info['currency_id']; |
|
| 51 | +$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
|
|
| 52 | 52 | |
| 53 | - $new_arr=array(); |
|
| 54 | - if($this->CI->session->userdata('advance_search')=='1'){
|
|
| 55 | - $search_array=$this->CI->session->userdata('providersummary_reports_search');
|
|
| 56 | - if(isset($search_array['time']) && !empty($search_array['time'])){
|
|
| 57 | - $new_arr[]=array($search_array['time'], "151", $search_array['time']."(callstart)", "", "", ""); |
|
| 53 | + $new_arr = array(); |
|
| 54 | + if ($this->CI->session->userdata('advance_search') == '1') {
|
|
| 55 | + $search_array = $this->CI->session->userdata('providersummary_reports_search');
|
|
| 56 | + if (isset($search_array['time']) && ! empty($search_array['time'])) {
|
|
| 57 | + $new_arr[] = array($search_array['time'], "151", $search_array['time']."(callstart)", "", "", ""); |
|
| 58 | 58 | } |
| 59 | - if(isset($search_array['groupby_1']) && !empty($search_array['groupby_1'])){
|
|
| 60 | - $first_column_groupby=$search_array['groupby_1']; |
|
| 61 | - if($first_column_groupby == 'provider_id'){
|
|
| 62 | - $new_arr[]=array("Account", "151", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string");
|
|
| 63 | - } elseif ($first_column_groupby =='pattern'){
|
|
| 64 | - $new_arr[]=array("Code", "65", "pattern", "pattern", "", "get_only_numeric_val");
|
|
| 65 | - $new_arr[]=array("Destination", "85", "notes", "", "", "");
|
|
| 66 | - } elseif($first_column_groupby =='trunk_id'){
|
|
| 67 | - $new_arr[]=array("Trunk", "151", "trunk_id", "name", "trunks", "get_field_name");
|
|
| 68 | - } elseif($first_column_groupby == 'package_id'){
|
|
| 69 | - $new_arr[]=array("Package", "151", "package_id", "first_name,last_name,number", "accounts", "build_concat_string");
|
|
| 59 | + if (isset($search_array['groupby_1']) && ! empty($search_array['groupby_1'])) {
|
|
| 60 | + $first_column_groupby = $search_array['groupby_1']; |
|
| 61 | + if ($first_column_groupby == 'provider_id') {
|
|
| 62 | + $new_arr[] = array("Account", "151", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string");
|
|
| 63 | + } elseif ($first_column_groupby == 'pattern') {
|
|
| 64 | + $new_arr[] = array("Code", "65", "pattern", "pattern", "", "get_only_numeric_val");
|
|
| 65 | + $new_arr[] = array("Destination", "85", "notes", "", "", "");
|
|
| 66 | + } elseif ($first_column_groupby == 'trunk_id') {
|
|
| 67 | + $new_arr[] = array("Trunk", "151", "trunk_id", "name", "trunks", "get_field_name");
|
|
| 68 | + } elseif ($first_column_groupby == 'package_id') {
|
|
| 69 | + $new_arr[] = array("Package", "151", "package_id", "first_name,last_name,number", "accounts", "build_concat_string");
|
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | - if(isset($search_array['groupby_2']) && !empty($search_array['groupby_2'])){
|
|
| 73 | - $third_column_groupby=$search_array['groupby_2']; |
|
| 74 | - if($third_column_groupby == 'provider_id'){
|
|
| 75 | - $new_arr[]=array("Account", "151", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string");
|
|
| 76 | - } elseif ($third_column_groupby =='pattern'){
|
|
| 77 | - $new_arr[]=array("Code", "65", "pattern", "pattern", "", "get_only_numeric_val");
|
|
| 78 | - $new_arr[]=array("Destination", "85", "notes", "", "", "");
|
|
| 79 | - } elseif($third_column_groupby=='trunk_id'){
|
|
| 80 | - $new_arr[]=array("Trunk", "151", "trunk_id", "name", "trunks", "get_field_name");
|
|
| 81 | - } elseif($third_column_groupby == 'package_id'){
|
|
| 82 | - $new_arr[]=array("Package", "151", "package_id", "first_name,last_name,number", "accounts", "build_concat_string");
|
|
| 72 | + if (isset($search_array['groupby_2']) && ! empty($search_array['groupby_2'])) {
|
|
| 73 | + $third_column_groupby = $search_array['groupby_2']; |
|
| 74 | + if ($third_column_groupby == 'provider_id') {
|
|
| 75 | + $new_arr[] = array("Account", "151", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string");
|
|
| 76 | + } elseif ($third_column_groupby == 'pattern') {
|
|
| 77 | + $new_arr[] = array("Code", "65", "pattern", "pattern", "", "get_only_numeric_val");
|
|
| 78 | + $new_arr[] = array("Destination", "85", "notes", "", "", "");
|
|
| 79 | + } elseif ($third_column_groupby == 'trunk_id') {
|
|
| 80 | + $new_arr[] = array("Trunk", "151", "trunk_id", "name", "trunks", "get_field_name");
|
|
| 81 | + } elseif ($third_column_groupby == 'package_id') {
|
|
| 82 | + $new_arr[] = array("Package", "151", "package_id", "first_name,last_name,number", "accounts", "build_concat_string");
|
|
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | - if(isset($search_array['groupby_3']) && !empty($search_array['groupby_3'])){
|
|
| 86 | - $fifth_column_groupby=$search_array['groupby_3']; |
|
| 87 | - if($fifth_column_groupby == 'provider_id'){
|
|
| 88 | - $new_arr[]=array("Account", "151", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string");
|
|
| 89 | - } elseif ($fifth_column_groupby =='pattern'){
|
|
| 90 | - $new_arr[]=array("Code", "65", "pattern", "pattern", "", "get_only_numeric_val");
|
|
| 91 | - $new_arr[]=array("Destination", "85", "notes", "", "", "");
|
|
| 92 | - } elseif($fifth_column_groupby == 'trunk_id'){
|
|
| 93 | - $new_arr[]=array("Trunk", "151", "trunk_id", "name", "trunks", "get_field_name");
|
|
| 94 | - } elseif($fifth_column_groupby == 'package_id'){
|
|
| 95 | - $new_arr[]=array("Package", "151", "package_id", "first_name,last_name,number", "accounts", "build_concat_string");
|
|
| 85 | + if (isset($search_array['groupby_3']) && ! empty($search_array['groupby_3'])) {
|
|
| 86 | + $fifth_column_groupby = $search_array['groupby_3']; |
|
| 87 | + if ($fifth_column_groupby == 'provider_id') {
|
|
| 88 | + $new_arr[] = array("Account", "151", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string");
|
|
| 89 | + } elseif ($fifth_column_groupby == 'pattern') {
|
|
| 90 | + $new_arr[] = array("Code", "65", "pattern", "pattern", "", "get_only_numeric_val");
|
|
| 91 | + $new_arr[] = array("Destination", "85", "notes", "", "", "");
|
|
| 92 | + } elseif ($fifth_column_groupby == 'trunk_id') {
|
|
| 93 | + $new_arr[] = array("Trunk", "151", "trunk_id", "name", "trunks", "get_field_name");
|
|
| 94 | + } elseif ($fifth_column_groupby == 'package_id') {
|
|
| 95 | + $new_arr[] = array("Package", "151", "package_id", "first_name,last_name,number", "accounts", "build_concat_string");
|
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | - if(empty($new_arr)) |
|
| 100 | - $new_arr[]=array("Account", "453", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string");
|
|
| 99 | + if (empty($new_arr)) |
|
| 100 | + $new_arr[] = array("Account", "453", "provider_id", "first_name,last_name,number", "accounts", "build_concat_string");
|
|
| 101 | 101 | $fixed_arr = array( |
| 102 | 102 | array("Attempted Calls", "130", "attempted_calls", "", "", ""),
|
| 103 | 103 | array("Completed Calls", "130", "description", "", "", ""),
|
| 104 | - array("Duration","85","billable",'','',''),
|
|
| 105 | - array("ASR","83","asr",'','',''),
|
|
| 106 | - array("ACD","83","acd ",'','',''),
|
|
| 107 | - array("MCD","83","mcd",'','',''),
|
|
| 108 | - array("Billable","102","billable",'','',''),
|
|
| 109 | - array("Cost($currency)","117","cost",'','',''),
|
|
| 104 | + array("Duration", "85", "billable", '', '', ''),
|
|
| 105 | + array("ASR", "83", "asr", '', '', ''),
|
|
| 106 | + array("ACD", "83", "acd ", '', '', ''),
|
|
| 107 | + array("MCD", "83", "mcd", '', '', ''),
|
|
| 108 | + array("Billable", "102", "billable", '', '', ''),
|
|
| 109 | + array("Cost($currency)", "117", "cost", '', '', ''),
|
|
| 110 | 110 | ); |
| 111 | - $grid_field_arr = json_encode(array_merge($new_arr,$fixed_arr)); |
|
| 111 | + $grid_field_arr = json_encode(array_merge($new_arr, $fixed_arr)); |
|
| 112 | 112 | return $grid_field_arr; |
| 113 | 113 | } |
| 114 | 114 | function build_grid_buttons_providersummary() {
|
| 115 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/summary/provider_export_csv/", 'single')));
|
|
| 115 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/summary/provider_export_csv/", 'single')));
|
|
| 116 | 116 | return $buttons_json; |
| 117 | 117 | } |
| 118 | 118 | function get_resellersummary_search_form() {
|
| 119 | - $form['forms'] = array("",array('id' => "resellersummary_search"));
|
|
| 119 | + $form['forms'] = array("", array('id' => "resellersummary_search"));
|
|
| 120 | 120 | $form['Search'] = array( |
| 121 | 121 | array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'),
|
| 122 | 122 | array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'),
|
| 123 | - array('Account', 'reseller_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"1")),
|
|
| 123 | + array('Account', 'reseller_id', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"1")),
|
|
| 124 | 124 | array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''),
|
| 125 | 125 | array('Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''),
|
| 126 | - array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),array('', 'HIDDEN', 'advance_search', '1', '', '', ''));
|
|
| 126 | + array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), array('', 'HIDDEN', 'advance_search', '1', '', '', ''));
|
|
| 127 | 127 | $form['button_search'] = array('name' => 'action', 'id' => "resellersummary_search_btn", 'content' => 'Search', 'value' => 'save', 'type' => 'button', 'class' => 'btn btn-line-parrot pull-right');
|
| 128 | 128 | $form['button_reset'] = array('name' => 'action', 'id' => "id_reset", 'content' => 'Clear', 'value' => 'cancel', 'type' => 'reset', 'class' => 'btn btn-line-sky pull-right margin-x-10');
|
| 129 | 129 | |
| 130 | 130 | return $form; |
| 131 | 131 | } |
| 132 | - function build_resellersummary($new_column_arr){
|
|
| 132 | + function build_resellersummary($new_column_arr) {
|
|
| 133 | 133 | |
| 134 | 134 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
|
| 135 | -$currency_id=$account_info['currency_id']; |
|
| 136 | -$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
|
|
| 135 | +$currency_id = $account_info['currency_id']; |
|
| 136 | +$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
|
|
| 137 | 137 | |
| 138 | -$column_arr=array( |
|
| 139 | - array("Attempted Calls", "120", "attempted_calls", "", "", "","","true","center"),
|
|
| 140 | - array("Completed Calls", "120", "description", "", "", "","","true","center"),
|
|
| 141 | - array("Duration","91","billable",'','','',"","true","center"),
|
|
| 142 | - array("ASR","78","asr",'','','',"","true","center"),
|
|
| 143 | - array("ACD","78","acd ",'','','',"","true","center"),
|
|
| 144 | - array("MCD","78","mcd",'','','',"","true","center"),
|
|
| 145 | - array("Billable","80","billable",'','','',"","true","center"),
|
|
| 146 | - array("Debit($currency)","100","cost",'','','',"","true","right"),
|
|
| 147 | - array("Cost($currency)","100","price",'','','',"","true","right"),
|
|
| 148 | - array("Profit($currency)", "100", "profit", "", "", "","","true","right"),
|
|
| 138 | +$column_arr = array( |
|
| 139 | + array("Attempted Calls", "120", "attempted_calls", "", "", "", "", "true", "center"),
|
|
| 140 | + array("Completed Calls", "120", "description", "", "", "", "", "true", "center"),
|
|
| 141 | + array("Duration", "91", "billable", '', '', '', "", "true", "center"),
|
|
| 142 | + array("ASR", "78", "asr", '', '', '', "", "true", "center"),
|
|
| 143 | + array("ACD", "78", "acd ", '', '', '', "", "true", "center"),
|
|
| 144 | + array("MCD", "78", "mcd", '', '', '', "", "true", "center"),
|
|
| 145 | + array("Billable", "80", "billable", '', '', '', "", "true", "center"),
|
|
| 146 | + array("Debit($currency)", "100", "cost", '', '', '', "", "true", "right"),
|
|
| 147 | + array("Cost($currency)", "100", "price", '', '', '', "", "true", "right"),
|
|
| 148 | + array("Profit($currency)", "100", "profit", "", "", "", "", "true", "right"),
|
|
| 149 | 149 | ); |
| 150 | - $grid_field_arr = json_encode(array_merge($new_column_arr,$column_arr)); |
|
| 150 | + $grid_field_arr = json_encode(array_merge($new_column_arr, $column_arr)); |
|
| 151 | 151 | return $grid_field_arr; |
| 152 | 152 | } |
| 153 | 153 | function build_grid_buttons_resellersummary() {
|
| 154 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/summary/reseller_export_csv/", 'single')));
|
|
| 154 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/summary/reseller_export_csv/", 'single')));
|
|
| 155 | 155 | return $buttons_json; |
| 156 | 156 | } |
| 157 | 157 | function get_customersummary_search_form() {
|
| 158 | 158 | |
| 159 | - $form['forms'] = array(base_url() . 'summary/customer_search',array('id' => "customersummary_search","name"=>"customersummary_search"));
|
|
| 159 | + $form['forms'] = array(base_url().'summary/customer_search', array('id' => "customersummary_search", "name"=>"customersummary_search"));
|
|
| 160 | 160 | $form['Search'] = array( |
| 161 | 161 | array('From Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_from_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'start_date[start_date-date]'),
|
| 162 | 162 | array('To Date', 'INPUT', array('name' => 'callstart[]', 'id' => 'customer_to_date', 'size' => '20', 'class' => "text field "), '', 'tOOL TIP', '', 'end_date[end_date-date]'),
|
| 163 | - array('Accounts', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0","type"=>"GLOBAL")),
|
|
| 164 | - array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''),
|
|
| 163 | + array('Accounts', 'accountid', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', 'id', 'IF(`deleted`=1,concat( first_name, " ", last_name, " ", "(", number, ")^" ),concat( first_name, " ", last_name, " ", "(", number, ")" )) as number', 'accounts', 'build_dropdown_deleted', 'where_arr', array("reseller_id" => "0", "type"=>"GLOBAL")),
|
|
| 164 | + array('Code ', 'INPUT', array('name' => 'pattern[pattern]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'pattern[pattern-string]', '', '', '', 'search_string_type', ''),
|
|
| 165 | 165 | array('Code Destination ', 'INPUT', array('name' => 'notes[notes]', 'value' => '', 'size' => '20', 'class' => "text field "), '', 'Tool tips info', '1', 'notes[notes-string]', '', '', '', 'search_string_type', ''),
|
| 166 | 166 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
|
| 167 | 167 | array('', 'HIDDEN', 'advance_search', '1', '', '', '')
|
@@ -176,29 +176,29 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | return $form; |
| 178 | 178 | } |
| 179 | - function build_customersummary($new_column_arr){
|
|
| 179 | + function build_customersummary($new_column_arr) {
|
|
| 180 | 180 | |
| 181 | 181 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
|
| 182 | -$currency_id=$account_info['currency_id']; |
|
| 183 | -$currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
|
|
| 182 | +$currency_id = $account_info['currency_id']; |
|
| 183 | +$currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id);
|
|
| 184 | 184 | |
| 185 | - $column_arr=array( |
|
| 186 | - array("Attempted Calls", "120", "attempted_calls", "", "", "","","true","center"),
|
|
| 187 | - array("Completed Calls", "120", "description", "", "", "","","true","center"),
|
|
| 188 | - array("Duration","95","billable",'','','',"","true","center"),
|
|
| 189 | - array("ASR","85","asr",'','','',"","true","center"),
|
|
| 190 | - array("ACD","85","acd ",'','','',"","true","center"),
|
|
| 191 | - array("MCD","85","mcd",'','','',"","true","center"),
|
|
| 192 | - array("Billable","90","billable",'','','',"","true","right"),
|
|
| 193 | - array("Debit($currency)","87","cost",'','','',"","true","right"),
|
|
| 194 | - array("Cost($currency)","85","price",'','','',"","true","right"),
|
|
| 195 | - array("Profit($currency)", "93", "profit", "", "", "","","true","right"),
|
|
| 185 | + $column_arr = array( |
|
| 186 | + array("Attempted Calls", "120", "attempted_calls", "", "", "", "", "true", "center"),
|
|
| 187 | + array("Completed Calls", "120", "description", "", "", "", "", "true", "center"),
|
|
| 188 | + array("Duration", "95", "billable", '', '', '', "", "true", "center"),
|
|
| 189 | + array("ASR", "85", "asr", '', '', '', "", "true", "center"),
|
|
| 190 | + array("ACD", "85", "acd ", '', '', '', "", "true", "center"),
|
|
| 191 | + array("MCD", "85", "mcd", '', '', '', "", "true", "center"),
|
|
| 192 | + array("Billable", "90", "billable", '', '', '', "", "true", "right"),
|
|
| 193 | + array("Debit($currency)", "87", "cost", '', '', '', "", "true", "right"),
|
|
| 194 | + array("Cost($currency)", "85", "price", '', '', '', "", "true", "right"),
|
|
| 195 | + array("Profit($currency)", "93", "profit", "", "", "", "", "true", "right"),
|
|
| 196 | 196 | ); |
| 197 | - $grid_field_arr = json_encode(array_merge($new_column_arr,$column_arr)); |
|
| 197 | + $grid_field_arr = json_encode(array_merge($new_column_arr, $column_arr)); |
|
| 198 | 198 | return $grid_field_arr; |
| 199 | 199 | } |
| 200 | 200 | function build_grid_buttons_customersummary() {
|
| 201 | - $buttons_json = json_encode(array(array("Export","btn btn-xing" ," fa fa-download fa-lg", "button_action", "/summary/customer_export_csv/", 'single')));
|
|
| 201 | + $buttons_json = json_encode(array(array("Export", "btn btn-xing", " fa fa-download fa-lg", "button_action", "/summary/customer_export_csv/", 'single')));
|
|
| 202 | 202 | return $buttons_json; |
| 203 | 203 | } |
| 204 | 204 | |
@@ -38,18 +38,18 @@ discard block |
||
| 38 | 38 | <legend><b>Search</b></legend> |
| 39 | 39 | <div class="col-md-4 no-padding"> |
| 40 | 40 | <label class="search_label col-md-12 no-padding">From Date</label> |
| 41 | - <input type="text" name="callstart[]" value="<?php echo isset($session_info['callstart'][0]) ? $session_info['callstart'][0] : date("Y-m-d") . " 00:00:00"; ?>" id="reseller_from_date" size="20" class="col-md-5 form-control text field " /> |
|
| 41 | + <input type="text" name="callstart[]" value="<?php echo isset($session_info['callstart'][0]) ? $session_info['callstart'][0] : date("Y-m-d")." 00:00:00"; ?>" id="reseller_from_date" size="20" class="col-md-5 form-control text field " /> |
|
| 42 | 42 | </div> |
| 43 | 43 | <div class="col-md-4 no-padding"> |
| 44 | 44 | <label class="search_label col-md-12 no-padding">To Date</label> |
| 45 | - <input type="text" name="callstart[]" value="<?php echo isset($session_info['callstart'][1]) ? $session_info['callstart'][1] : date("Y-m-d") . " 23:59:59"; ?>" id="reseller_to_date" size="20" class="col-md-5 form-control text field " /> |
|
| 45 | + <input type="text" name="callstart[]" value="<?php echo isset($session_info['callstart'][1]) ? $session_info['callstart'][1] : date("Y-m-d")." 23:59:59"; ?>" id="reseller_to_date" size="20" class="col-md-5 form-control text field " /> |
|
| 46 | 46 | </div> |
| 47 | 47 | <div class="col-md-4 no-padding"> |
| 48 | 48 | <label class="search_label col-md-12 no-padding">Account</label> |
| 49 | 49 | |
| 50 | 50 | <select name="accountid" class='col-md-5 form-control selectpicker' data-live-search='true'> |
| 51 | 51 | <option value=''>--Select--</option> |
| 52 | - <?php if (!empty($accountlist)) { |
|
| 52 | + <?php if ( ! empty($accountlist)) { |
|
| 53 | 53 | foreach ($accountlist as $key => $value) { |
| 54 | 54 | ?> |
| 55 | 55 | <optgroup label="<?php echo $key ?>"> |
@@ -71,13 +71,13 @@ discard block |
||
| 71 | 71 | </div> |
| 72 | 72 | <div class="col-md-4 no-padding"> |
| 73 | 73 | <label class="search_label col-md-12 no-padding">Code </label> |
| 74 | - <input type="text" name="pattern[pattern]" value="<?php echo (isset($session_info['pattern']) && isset($session_info['pattern']['pattern']) && !empty($session_info['pattern']['pattern'])) ? $session_info['pattern']['pattern'] : ''; ?>" size="20" maxlength="15" class="col-md-5 form-control text field "/> |
|
| 74 | + <input type="text" name="pattern[pattern]" value="<?php echo (isset($session_info['pattern']) && isset($session_info['pattern']['pattern']) && ! empty($session_info['pattern']['pattern'])) ? $session_info['pattern']['pattern'] : ''; ?>" size="20" maxlength="15" class="col-md-5 form-control text field "/> |
|
| 75 | 75 | <select name="pattern[pattern-string]" class='col-md-5 form-control selectpicker' style='margin-left:5px;' data-live-search='true'> |
| 76 | 76 | <?php |
| 77 | - if (!empty($search_string_type)) { |
|
| 77 | + if ( ! empty($search_string_type)) { |
|
| 78 | 78 | foreach ($search_string_type as $key => $value) { |
| 79 | 79 | $selected = null; |
| 80 | - if (isset($session_info['pattern']) && isset($session_info['pattern']['pattern']) && !empty($session_info['pattern']['pattern']) && $session_info['pattern']['pattern-string'] == $key) { |
|
| 80 | + if (isset($session_info['pattern']) && isset($session_info['pattern']['pattern']) && ! empty($session_info['pattern']['pattern']) && $session_info['pattern']['pattern-string'] == $key) { |
|
| 81 | 81 | $selected = "selected"; |
| 82 | 82 | } |
| 83 | 83 | ?> |
@@ -89,13 +89,13 @@ discard block |
||
| 89 | 89 | </div> |
| 90 | 90 | <div class="col-md-4 no-padding"> |
| 91 | 91 | <label class="search_label col-md-12 no-padding">Destination </label> |
| 92 | - <input type="text" name="notes[notes]" value="<?php echo (isset($session_info['notes']) && isset($session_info['notes']['notes']) && !empty($session_info['notes']['notes'])) ? $session_info['notes']['notes'] : ''; ?>" size="20" class="col-md-5 form-control text field " /> |
|
| 92 | + <input type="text" name="notes[notes]" value="<?php echo (isset($session_info['notes']) && isset($session_info['notes']['notes']) && ! empty($session_info['notes']['notes'])) ? $session_info['notes']['notes'] : ''; ?>" size="20" class="col-md-5 form-control text field " /> |
|
| 93 | 93 | <select name="notes[notes-string]" class='col-md-5 form-control selectpicker' style='margin-left:5px;' data-live-search='true'> |
| 94 | 94 | <?php |
| 95 | - if (!empty($search_string_type)) { |
|
| 95 | + if ( ! empty($search_string_type)) { |
|
| 96 | 96 | foreach ($search_string_type as $key => $value) { |
| 97 | 97 | $selected = null; |
| 98 | - if (isset($session_info['notes']) && isset($session_info['notes']['notes']) && !empty($session_info['notes']['notes']) && $session_info['notes']['notes-string'] == $key) { |
|
| 98 | + if (isset($session_info['notes']) && isset($session_info['notes']['notes']) && ! empty($session_info['notes']['notes']) && $session_info['notes']['notes-string'] == $key) { |
|
| 99 | 99 | $selected = "selected"; |
| 100 | 100 | } |
| 101 | 101 | ?> |
@@ -120,10 +120,10 @@ discard block |
||
| 120 | 120 | <label class="search_label col-md-12 no-padding">Group By #time</label> |
| 121 | 121 | <select name="time" class='col-md-5 form-control' style='margin-left:5px; selectpicker' data-live-search='true'> |
| 122 | 122 | <?php |
| 123 | - if (!empty($groupby_time)) { |
|
| 123 | + if ( ! empty($groupby_time)) { |
|
| 124 | 124 | foreach ($groupby_time as $key => $value) { |
| 125 | 125 | $selected = null; |
| 126 | - if (isset($session_info['time']) && !empty($session_info['time']) && $session_info['time'] == $key) { |
|
| 126 | + if (isset($session_info['time']) && ! empty($session_info['time']) && $session_info['time'] == $key) { |
|
| 127 | 127 | $selected = "selected"; |
| 128 | 128 | } |
| 129 | 129 | ?> |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | <label class="search_label col-md-12 no-padding">Group By #1</label> |
| 138 | 138 | <select name="groupby_1" class='col-md-5 form-control selectpicker' style='margin-left:5px;' data-live-search='true'> |
| 139 | 139 | <?php |
| 140 | - if (!empty($groupby_field)) { |
|
| 140 | + if ( ! empty($groupby_field)) { |
|
| 141 | 141 | foreach ($groupby_field as $key => $value) { |
| 142 | 142 | $selected = null; |
| 143 | - if (isset($session_info['groupby_1']) && !empty($session_info['groupby_1']) && $session_info['groupby_1'] == $key) { |
|
| 143 | + if (isset($session_info['groupby_1']) && ! empty($session_info['groupby_1']) && $session_info['groupby_1'] == $key) { |
|
| 144 | 144 | $selected = "selected"; |
| 145 | 145 | } |
| 146 | 146 | ?> |
@@ -154,10 +154,10 @@ discard block |
||
| 154 | 154 | <label class="search_label col-md-12 no-padding">Group By #2</label> |
| 155 | 155 | <select name="groupby_2" class='col-md-5 form-control selectpicker' style='margin-left:5px;' data-live-search='true'> |
| 156 | 156 | <?php |
| 157 | - if (!empty($groupby_field)) { |
|
| 157 | + if ( ! empty($groupby_field)) { |
|
| 158 | 158 | foreach ($groupby_field as $key => $value) { |
| 159 | 159 | $selected = null; |
| 160 | - if (isset($session_info['groupby_2']) && !empty($session_info['groupby_2']) && $session_info['groupby_2'] == $key) { |
|
| 160 | + if (isset($session_info['groupby_2']) && ! empty($session_info['groupby_2']) && $session_info['groupby_2'] == $key) { |
|
| 161 | 161 | $selected = "selected"; |
| 162 | 162 | } |
| 163 | 163 | ?> |
@@ -171,10 +171,10 @@ discard block |
||
| 171 | 171 | <label class="search_label col-md-12 no-padding">Group By #3</label> |
| 172 | 172 | <select name="groupby_3" class='col-md-5 form-control selectpicker' style='margin-left:5px;' data-live-search='true'> |
| 173 | 173 | <?php |
| 174 | - if (!empty($groupby_field)) { |
|
| 174 | + if ( ! empty($groupby_field)) { |
|
| 175 | 175 | foreach ($groupby_field as $key => $value) { |
| 176 | 176 | $selected = null; |
| 177 | - if (isset($session_info['groupby_3']) && !empty($session_info['groupby_3']) && $session_info['groupby_3'] == $key) { |
|
| 177 | + if (isset($session_info['groupby_3']) && ! empty($session_info['groupby_3']) && $session_info['groupby_3'] == $key) { |
|
| 178 | 178 | $selected = "selected"; |
| 179 | 179 | } |
| 180 | 180 | ?> |
@@ -193,10 +193,10 @@ discard block |
||
| 193 | 193 | <label class="search_label col-md-6" style="font-size:17px;text-align:right;">Display records in </label> |
| 194 | 194 | <select name="search_in" class='col-md-5 form-control selectpicker' style='background: #ddd; width: 23% !important;' data-live-search='true'> |
| 195 | 195 | <?php |
| 196 | -if (!empty($search_report)) { |
|
| 196 | +if ( ! empty($search_report)) { |
|
| 197 | 197 | foreach ($search_report as $key => $value) { |
| 198 | 198 | $selected = null; |
| 199 | - if (isset($session_info['search_in']) && isset($session_info['search_in']) && !empty($session_info['search_in']) && $session_info['search_in'] == $key) { |
|
| 199 | + if (isset($session_info['search_in']) && isset($session_info['search_in']) && ! empty($session_info['search_in']) && $session_info['search_in'] == $key) { |
|
| 200 | 200 | //echo $key;exit; |
| 201 | 201 | $selected = "selected"; |
| 202 | 202 | } |
@@ -38,18 +38,18 @@ discard block |
||
| 38 | 38 | <legend><b>Search</b></legend> |
| 39 | 39 | <div class="col-md-4 no-padding"> |
| 40 | 40 | <label class="search_label col-md-12 no-padding">From Date</label> |
| 41 | - <input type="text" name="callstart[]" value="<?php echo isset($session_info['callstart'][0]) ? $session_info['callstart'][0] : date("Y-m-d") . " 00:00:00"; ?>" id="customer_from_date" size="20" class="col-md-5 form-control text field " /> |
|
| 41 | + <input type="text" name="callstart[]" value="<?php echo isset($session_info['callstart'][0]) ? $session_info['callstart'][0] : date("Y-m-d")." 00:00:00"; ?>" id="customer_from_date" size="20" class="col-md-5 form-control text field " /> |
|
| 42 | 42 | </div> |
| 43 | 43 | <div class="col-md-4 no-padding"> |
| 44 | 44 | <label class="search_label col-md-12 no-padding">To Date</label> |
| 45 | - <input type="text" name="callstart[]" value="<?php echo isset($session_info['callstart'][1]) ? $session_info['callstart'][1] : date("Y-m-d") . " 23:59:59"; ?>" id="customer_to_date" size="20" class="col-md-5 form-control text field " /> |
|
| 45 | + <input type="text" name="callstart[]" value="<?php echo isset($session_info['callstart'][1]) ? $session_info['callstart'][1] : date("Y-m-d")." 23:59:59"; ?>" id="customer_to_date" size="20" class="col-md-5 form-control text field " /> |
|
| 46 | 46 | </div> |
| 47 | 47 | <div class="col-md-4 no-padding"> |
| 48 | 48 | <label class="search_label col-md-12 no-padding">Account</label> |
| 49 | 49 | |
| 50 | 50 | <select name="accountid" class='col-md-5 form-control selectpicker' data-live-search='true'> |
| 51 | 51 | <option value=''>--Select--</option> |
| 52 | - <?php if (!empty($accountlist)) { |
|
| 52 | + <?php if ( ! empty($accountlist)) { |
|
| 53 | 53 | foreach ($accountlist as $key => $value) { |
| 54 | 54 | ?> |
| 55 | 55 | <optgroup label="<?php echo $key ?>"> |
@@ -71,13 +71,13 @@ discard block |
||
| 71 | 71 | </div> |
| 72 | 72 | <div class="col-md-4 no-padding"> |
| 73 | 73 | <label class="search_label col-md-12 no-padding">Code </label> |
| 74 | - <input type="text" name="pattern[pattern]" value="<?php echo (isset($session_info['pattern']) && isset($session_info['pattern']['pattern']) && !empty($session_info['pattern']['pattern'])) ? $session_info['pattern']['pattern'] : ''; ?>" size="20" maxlength="15" class="col-md-5 form-control text field "/> |
|
| 74 | + <input type="text" name="pattern[pattern]" value="<?php echo (isset($session_info['pattern']) && isset($session_info['pattern']['pattern']) && ! empty($session_info['pattern']['pattern'])) ? $session_info['pattern']['pattern'] : ''; ?>" size="20" maxlength="15" class="col-md-5 form-control text field "/> |
|
| 75 | 75 | <select name="pattern[pattern-string]" class='col-md-5 form-control selectpicker' style='margin-left:5px;' data-live-search='true'> |
| 76 | 76 | <?php |
| 77 | - if (!empty($search_string_type)) { |
|
| 77 | + if ( ! empty($search_string_type)) { |
|
| 78 | 78 | foreach ($search_string_type as $key => $value) { |
| 79 | 79 | $selected = null; |
| 80 | - if (isset($session_info['pattern']) && isset($session_info['pattern']['pattern']) && !empty($session_info['pattern']['pattern']) && $session_info['pattern']['pattern-string'] == $key) { |
|
| 80 | + if (isset($session_info['pattern']) && isset($session_info['pattern']['pattern']) && ! empty($session_info['pattern']['pattern']) && $session_info['pattern']['pattern-string'] == $key) { |
|
| 81 | 81 | $selected = "selected"; |
| 82 | 82 | } |
| 83 | 83 | ?> |
@@ -89,13 +89,13 @@ discard block |
||
| 89 | 89 | </div> |
| 90 | 90 | <div class="col-md-4 no-padding"> |
| 91 | 91 | <label class="search_label col-md-12 no-padding">Destination </label> |
| 92 | - <input type="text" name="notes[notes]" value="<?php echo (isset($session_info['notes']) && isset($session_info['notes']['notes']) && !empty($session_info['notes']['notes'])) ? $session_info['notes']['notes'] : ''; ?>" size="20" class="col-md-5 form-control text field " /> |
|
| 92 | + <input type="text" name="notes[notes]" value="<?php echo (isset($session_info['notes']) && isset($session_info['notes']['notes']) && ! empty($session_info['notes']['notes'])) ? $session_info['notes']['notes'] : ''; ?>" size="20" class="col-md-5 form-control text field " /> |
|
| 93 | 93 | <select name="notes[notes-string]" class='col-md-5 form-control selectpicker' style='margin-left:5px;' data-live-search='true'> |
| 94 | 94 | <?php |
| 95 | - if (!empty($search_string_type)) { |
|
| 95 | + if ( ! empty($search_string_type)) { |
|
| 96 | 96 | foreach ($search_string_type as $key => $value) { |
| 97 | 97 | $selected = null; |
| 98 | - if (isset($session_info['notes']) && isset($session_info['notes']['notes']) && !empty($session_info['notes']['notes']) && $session_info['notes']['notes-string'] == $key) { |
|
| 98 | + if (isset($session_info['notes']) && isset($session_info['notes']['notes']) && ! empty($session_info['notes']['notes']) && $session_info['notes']['notes-string'] == $key) { |
|
| 99 | 99 | $selected = "selected"; |
| 100 | 100 | } |
| 101 | 101 | ?> |
@@ -120,10 +120,10 @@ discard block |
||
| 120 | 120 | <label class="search_label col-md-12 no-padding">Group By #Time</label> |
| 121 | 121 | <select name="time" class='col-md-5 form-control selectpicker' style='margin-left:5px;' data-live-search='true'> |
| 122 | 122 | <?php |
| 123 | - if (!empty($groupby_time)) { |
|
| 123 | + if ( ! empty($groupby_time)) { |
|
| 124 | 124 | foreach ($groupby_time as $key => $value) { |
| 125 | 125 | $selected = null; |
| 126 | - if (isset($session_info['time']) && !empty($session_info['time']) && $session_info['time'] == $key) { |
|
| 126 | + if (isset($session_info['time']) && ! empty($session_info['time']) && $session_info['time'] == $key) { |
|
| 127 | 127 | $selected = "selected"; |
| 128 | 128 | } |
| 129 | 129 | ?> |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | <label class="search_label col-md-12 no-padding">Group By #1</label> |
| 138 | 138 | <select name="groupby_1" class='col-md-5 form-control selectpicker' style='margin-left:5px;' data-live-search='true'> |
| 139 | 139 | <?php |
| 140 | - if (!empty($groupby_field)) { |
|
| 140 | + if ( ! empty($groupby_field)) { |
|
| 141 | 141 | foreach ($groupby_field as $key => $value) { |
| 142 | 142 | $selected = null; |
| 143 | - if (isset($session_info['groupby_1']) && !empty($session_info['groupby_1']) && $session_info['groupby_1'] == $key) { |
|
| 143 | + if (isset($session_info['groupby_1']) && ! empty($session_info['groupby_1']) && $session_info['groupby_1'] == $key) { |
|
| 144 | 144 | $selected = "selected"; |
| 145 | 145 | } |
| 146 | 146 | ?> |
@@ -154,10 +154,10 @@ discard block |
||
| 154 | 154 | <label class="search_label col-md-12 no-padding">Group By #2</label> |
| 155 | 155 | <select name="groupby_2" class='col-md-5 form-control selectpicker' style='margin-left:5px;' data-live-search='true'> |
| 156 | 156 | <?php |
| 157 | - if (!empty($groupby_field)) { |
|
| 157 | + if ( ! empty($groupby_field)) { |
|
| 158 | 158 | foreach ($groupby_field as $key => $value) { |
| 159 | 159 | $selected = null; |
| 160 | - if (isset($session_info['groupby_2']) && !empty($session_info['groupby_2']) && $session_info['groupby_2'] == $key) { |
|
| 160 | + if (isset($session_info['groupby_2']) && ! empty($session_info['groupby_2']) && $session_info['groupby_2'] == $key) { |
|
| 161 | 161 | $selected = "selected"; |
| 162 | 162 | } |
| 163 | 163 | ?> |
@@ -171,10 +171,10 @@ discard block |
||
| 171 | 171 | <label class="search_label col-md-12 no-padding">Group By #3</label> |
| 172 | 172 | <select name="groupby_3" class='col-md-5 form-control selectpicker' style='margin-left:5px;' data-live-search='true'> |
| 173 | 173 | <?php |
| 174 | - if (!empty($groupby_field)) { |
|
| 174 | + if ( ! empty($groupby_field)) { |
|
| 175 | 175 | foreach ($groupby_field as $key => $value) { |
| 176 | 176 | $selected = null; |
| 177 | - if (isset($session_info['groupby_3']) && !empty($session_info['groupby_3']) && $session_info['groupby_3'] == $key) { |
|
| 177 | + if (isset($session_info['groupby_3']) && ! empty($session_info['groupby_3']) && $session_info['groupby_3'] == $key) { |
|
| 178 | 178 | $selected = "selected"; |
| 179 | 179 | } |
| 180 | 180 | ?> |
@@ -193,10 +193,10 @@ discard block |
||
| 193 | 193 | <label class="search_label col-md-6" style="font-size:17px;text-align:right;">Display records in </label> |
| 194 | 194 | <select name="search_in" class='col-md-5 form-control selectpicker' style='background: #ddd; width: 23% !important;' data-live-search='true'> |
| 195 | 195 | <?php |
| 196 | -if (!empty($search_report)) { |
|
| 196 | +if ( ! empty($search_report)) { |
|
| 197 | 197 | foreach ($search_report as $key => $value) { |
| 198 | 198 | $selected = null; |
| 199 | - if (isset($session_info['search_in']) && isset($session_info['search_in']) && !empty($session_info['search_in']) && $session_info['search_in'] == $key) { |
|
| 199 | + if (isset($session_info['search_in']) && isset($session_info['search_in']) && ! empty($session_info['search_in']) && $session_info['search_in'] == $key) { |
|
| 200 | 200 | //echo $key;exit; |
| 201 | 201 | $selected = "selected"; |
| 202 | 202 | } |
@@ -38,18 +38,18 @@ discard block |
||
| 38 | 38 | <legend><b>Search</b></legend> |
| 39 | 39 | <div class="col-md-4 no-padding"> |
| 40 | 40 | <label class="search_label col-md-12 no-padding">From Date</label> |
| 41 | - <input type="text" name="callstart[]" value="<?php echo isset($session_info['callstart'][0]) ? $session_info['callstart'][0] : date("Y-m-d") . " 00:00:00"; ?>" id="provider_from_date" size="20" class="col-md-5 form-control text field " /> |
|
| 41 | + <input type="text" name="callstart[]" value="<?php echo isset($session_info['callstart'][0]) ? $session_info['callstart'][0] : date("Y-m-d")." 00:00:00"; ?>" id="provider_from_date" size="20" class="col-md-5 form-control text field " /> |
|
| 42 | 42 | </div> |
| 43 | 43 | <div class="col-md-4 no-padding"> |
| 44 | 44 | <label class="search_label col-md-12 no-padding">To Date</label> |
| 45 | - <input type="text" name="callstart[]" value="<?php echo isset($session_info['callstart'][1]) ? $session_info['callstart'][1] : date("Y-m-d") . " 23:59:59"; ?>" id="provider_to_date" size="20" class="col-md-5 form-control text field " /> |
|
| 45 | + <input type="text" name="callstart[]" value="<?php echo isset($session_info['callstart'][1]) ? $session_info['callstart'][1] : date("Y-m-d")." 23:59:59"; ?>" id="provider_to_date" size="20" class="col-md-5 form-control text field " /> |
|
| 46 | 46 | </div> |
| 47 | 47 | <div class="col-md-4 no-padding"> |
| 48 | 48 | <label class="search_label col-md-12 no-padding">Account</label> |
| 49 | 49 | |
| 50 | 50 | <select name="provider_id" class='col-md-5 form-control selectpicker' data-live-search='true'> |
| 51 | 51 | <option value=''>--Select--</option> |
| 52 | - <?php if (!empty($accountlist)) { |
|
| 52 | + <?php if ( ! empty($accountlist)) { |
|
| 53 | 53 | foreach ($accountlist as $key => $value) { |
| 54 | 54 | ?> |
| 55 | 55 | <optgroup label="<?php echo $key ?>"> |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | <select name="trunk_id" class='col-md-5 form-control selectpicker' data-live-search='true'> |
| 75 | 75 | <option value=''>--Select--</option> |
| 76 | 76 | <?php |
| 77 | - if (!empty($trunklist)) { |
|
| 77 | + if ( ! empty($trunklist)) { |
|
| 78 | 78 | foreach ($trunklist as $key => $value) { |
| 79 | 79 | $selected = null; |
| 80 | 80 | if (isset($session_info['trunk_id']) && $session_info['trunk_id'] > 0 && $key == $session_info['trunk_id']) { |
@@ -88,13 +88,13 @@ discard block |
||
| 88 | 88 | </div> |
| 89 | 89 | <div class="col-md-4 no-padding"> |
| 90 | 90 | <label class="search_label col-md-12 no-padding">Code </label> |
| 91 | - <input type="text" name="pattern[pattern]" value="<?php echo (isset($session_info['pattern']) && isset($session_info['pattern']['pattern']) && !empty($session_info['pattern']['pattern'])) ? $session_info['pattern']['pattern'] : ''; ?>" size="20" maxlength="15" class="col-md-5 form-control text field "/> |
|
| 91 | + <input type="text" name="pattern[pattern]" value="<?php echo (isset($session_info['pattern']) && isset($session_info['pattern']['pattern']) && ! empty($session_info['pattern']['pattern'])) ? $session_info['pattern']['pattern'] : ''; ?>" size="20" maxlength="15" class="col-md-5 form-control text field "/> |
|
| 92 | 92 | <select name="pattern[pattern-string]" class='col-md-5 form-control selectpicker' style='margin-left:5px;' data-live-search='true'> |
| 93 | 93 | <?php |
| 94 | - if (!empty($search_string_type)) { |
|
| 94 | + if ( ! empty($search_string_type)) { |
|
| 95 | 95 | foreach ($search_string_type as $key => $value) { |
| 96 | 96 | $selected = null; |
| 97 | - if (isset($session_info['pattern']) && isset($session_info['pattern']['pattern']) && !empty($session_info['pattern']['pattern']) && $session_info['pattern']['pattern-string'] == $key) { |
|
| 97 | + if (isset($session_info['pattern']) && isset($session_info['pattern']['pattern']) && ! empty($session_info['pattern']['pattern']) && $session_info['pattern']['pattern-string'] == $key) { |
|
| 98 | 98 | $selected = "selected"; |
| 99 | 99 | } |
| 100 | 100 | ?> |
@@ -106,13 +106,13 @@ discard block |
||
| 106 | 106 | </div> |
| 107 | 107 | <div class="col-md-4 no-padding"> |
| 108 | 108 | <label class="search_label col-md-12 no-padding">Destination </label> |
| 109 | - <input type="text" name="notes[notes]" value="<?php echo (isset($session_info['notes']) && isset($session_info['notes']['notes']) && !empty($session_info['notes']['notes'])) ? $session_info['notes']['notes'] : ''; ?>" size="20" class="col-md-5 form-control text field " /> |
|
| 109 | + <input type="text" name="notes[notes]" value="<?php echo (isset($session_info['notes']) && isset($session_info['notes']['notes']) && ! empty($session_info['notes']['notes'])) ? $session_info['notes']['notes'] : ''; ?>" size="20" class="col-md-5 form-control text field " /> |
|
| 110 | 110 | <select name="notes[notes-string]" class='col-md-5 form-control selectpicker' style='margin-left:5px;' data-live-search='true'> |
| 111 | 111 | <?php |
| 112 | - if (!empty($search_string_type)) { |
|
| 112 | + if ( ! empty($search_string_type)) { |
|
| 113 | 113 | foreach ($search_string_type as $key => $value) { |
| 114 | 114 | $selected = null; |
| 115 | - if (isset($session_info['notes']) && isset($session_info['notes']['notes']) && !empty($session_info['notes']['notes']) && $session_info['notes']['notes-string'] == $key) { |
|
| 115 | + if (isset($session_info['notes']) && isset($session_info['notes']['notes']) && ! empty($session_info['notes']['notes']) && $session_info['notes']['notes-string'] == $key) { |
|
| 116 | 116 | $selected = "selected"; |
| 117 | 117 | } |
| 118 | 118 | ?> |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | <label class="search_label col-md-12 no-padding">Group By #time</label> |
| 138 | 138 | <select name="time" class='col-md-5 form-control selectpicker' style='margin-left:5px;'data-live-search='true'> |
| 139 | 139 | <?php |
| 140 | - if (!empty($groupby_time)) { |
|
| 140 | + if ( ! empty($groupby_time)) { |
|
| 141 | 141 | foreach ($groupby_time as $key => $value) { |
| 142 | 142 | $selected = null; |
| 143 | - if (isset($session_info['time']) && !empty($session_info['time']) && $session_info['time'] == $key) { |
|
| 143 | + if (isset($session_info['time']) && ! empty($session_info['time']) && $session_info['time'] == $key) { |
|
| 144 | 144 | $selected = "selected"; |
| 145 | 145 | } |
| 146 | 146 | ?> |
@@ -154,10 +154,10 @@ discard block |
||
| 154 | 154 | <label class="search_label col-md-12 no-padding">Group By #1</label> |
| 155 | 155 | <select name="groupby_1" class='col-md-5 form-control selectpicker' style='margin-left:5px;' data-live-search='true'> |
| 156 | 156 | <?php |
| 157 | - if (!empty($groupby_field)) { |
|
| 157 | + if ( ! empty($groupby_field)) { |
|
| 158 | 158 | foreach ($groupby_field as $key => $value) { |
| 159 | 159 | $selected = null; |
| 160 | - if (isset($session_info['groupby_1']) && !empty($session_info['groupby_1']) && $session_info['groupby_1'] == $key) { |
|
| 160 | + if (isset($session_info['groupby_1']) && ! empty($session_info['groupby_1']) && $session_info['groupby_1'] == $key) { |
|
| 161 | 161 | $selected = "selected"; |
| 162 | 162 | } |
| 163 | 163 | ?> |
@@ -171,10 +171,10 @@ discard block |
||
| 171 | 171 | <label class="search_label col-md-12 no-padding">Group By #2</label> |
| 172 | 172 | <select name="groupby_2" class='col-md-5 form-control selectpicker' style='margin-left:5px;' data-live-search='true'> |
| 173 | 173 | <?php |
| 174 | - if (!empty($groupby_field)) { |
|
| 174 | + if ( ! empty($groupby_field)) { |
|
| 175 | 175 | foreach ($groupby_field as $key => $value) { |
| 176 | 176 | $selected = null; |
| 177 | - if (isset($session_info['groupby_2']) && !empty($session_info['groupby_2']) && $session_info['groupby_2'] == $key) { |
|
| 177 | + if (isset($session_info['groupby_2']) && ! empty($session_info['groupby_2']) && $session_info['groupby_2'] == $key) { |
|
| 178 | 178 | $selected = "selected"; |
| 179 | 179 | } |
| 180 | 180 | ?> |
@@ -188,10 +188,10 @@ discard block |
||
| 188 | 188 | <label class="search_label col-md-12 no-padding">Group By #3</label> |
| 189 | 189 | <select name="groupby_3" class='col-md-5 form-control selectpicker' style='margin-left:5px;' data-live-search='true'> |
| 190 | 190 | <?php |
| 191 | - if (!empty($groupby_field)) { |
|
| 191 | + if ( ! empty($groupby_field)) { |
|
| 192 | 192 | foreach ($groupby_field as $key => $value) { |
| 193 | 193 | $selected = null; |
| 194 | - if (isset($session_info['groupby_3']) && !empty($session_info['groupby_3']) && $session_info['groupby_3'] == $key) { |
|
| 194 | + if (isset($session_info['groupby_3']) && ! empty($session_info['groupby_3']) && $session_info['groupby_3'] == $key) { |
|
| 195 | 195 | $selected = "selected"; |
| 196 | 196 | } |
| 197 | 197 | ?> |
@@ -210,10 +210,10 @@ discard block |
||
| 210 | 210 | <label class="search_label col-md-6" style="font-size:17px;text-align:right;">Display records in </label> |
| 211 | 211 | <select name="search_in" class='col-md-5 form-control selectpicker' style='background: #ddd; width: 23% !important;' data-live-search='true'> |
| 212 | 212 | <?php |
| 213 | -if (!empty($search_report)) { |
|
| 213 | +if ( ! empty($search_report)) { |
|
| 214 | 214 | foreach ($search_report as $key => $value) { |
| 215 | 215 | $selected = null; |
| 216 | - if (isset($session_info['search_in']) && isset($session_info['search_in']) && !empty($session_info['search_in']) && $session_info['search_in'] == $key) { |
|
| 216 | + if (isset($session_info['search_in']) && isset($session_info['search_in']) && ! empty($session_info['search_in']) && $session_info['search_in'] == $key) { |
|
| 217 | 217 | //echo $key;exit; |
| 218 | 218 | $selected = "selected"; |
| 219 | 219 | } |
@@ -51,9 +51,9 @@ discard block |
||
| 51 | 51 | $value[] = $value1['id']; |
| 52 | 52 | } |
| 53 | 53 | //$this->db->where_in('accountid', $value); |
| 54 | - if(!empty($value)){ |
|
| 54 | + if ( ! empty($value)) { |
|
| 55 | 55 | $this->db->where_in('accountid', $value); |
| 56 | - } else{ |
|
| 56 | + } else { |
|
| 57 | 57 | $this->db->where_in('accountid', '0'); |
| 58 | 58 | } |
| 59 | 59 | } |
@@ -62,10 +62,10 @@ discard block |
||
| 62 | 62 | ASTPP 3.0 |
| 63 | 63 | in customer login show ipmap (ACL) module |
| 64 | 64 | *******/ |
| 65 | - if( $accountinfo['type'] == '0'){ |
|
| 66 | - $where=array('accountid'=>$accountinfo['id']); |
|
| 67 | - }else{ |
|
| 68 | - $where=''; |
|
| 65 | + if ($accountinfo['type'] == '0') { |
|
| 66 | + $where = array('accountid'=>$accountinfo['id']); |
|
| 67 | + } else { |
|
| 68 | + $where = ''; |
|
| 69 | 69 | } |
| 70 | 70 | /**************************************************************************************************************/ |
| 71 | 71 | if ($flag) { |
@@ -93,11 +93,11 @@ discard block |
||
| 93 | 93 | in customer login show ipmap (ACL) module |
| 94 | 94 | *******/ |
| 95 | 95 | $account_data = $this->session->userdata("accountinfo"); |
| 96 | - if($account_data['type'] == '0'){ |
|
| 96 | + if ($account_data['type'] == '0') { |
|
| 97 | 97 | $add_array['accountid'] = $account_data['id']; |
| 98 | 98 | } |
| 99 | 99 | /*******************************************************************/ |
| 100 | - $data = array('created_date'=>gmdate('Y-m-d H:i:s'),'name' => $add_array['name'], 'ip' => $add_array['ip'], 'prefix' => $add_array['prefix'], 'accountid' => $add_array['accountid'],'status' => $add_array['status'] ,'context' => 'default'); |
|
| 100 | + $data = array('created_date'=>gmdate('Y-m-d H:i:s'), 'name' => $add_array['name'], 'ip' => $add_array['ip'], 'prefix' => $add_array['prefix'], 'accountid' => $add_array['accountid'], 'status' => $add_array['status'], 'context' => 'default'); |
|
| 101 | 101 | $this->db->insert("ip_map", $data); |
| 102 | 102 | return $this->db->insert_id(); |
| 103 | 103 | } |
@@ -108,11 +108,11 @@ discard block |
||
| 108 | 108 | in customer login show ipmap (ACL) module |
| 109 | 109 | *******/ |
| 110 | 110 | $account_data = $this->session->userdata("accountinfo"); |
| 111 | - if($account_data['type'] == '0'){ |
|
| 111 | + if ($account_data['type'] == '0') { |
|
| 112 | 112 | $add_array['accountid'] = $account_data['id']; |
| 113 | 113 | } |
| 114 | 114 | /************************************************************************************************/ |
| 115 | - $data = array('last_modified_date'=>gmdate('Y-m-d H:i:s'),'name' => $add_array['name'], 'ip' => $add_array['ip'], 'prefix' => $add_array['prefix'], 'accountid' => $add_array['accountid'],'status' => $add_array['status'] , 'context' => 'default'); |
|
| 115 | + $data = array('last_modified_date'=>gmdate('Y-m-d H:i:s'), 'name' => $add_array['name'], 'ip' => $add_array['ip'], 'prefix' => $add_array['prefix'], 'accountid' => $add_array['accountid'], 'status' => $add_array['status'], 'context' => 'default'); |
|
| 116 | 116 | $this->db->where("id", $id); |
| 117 | 117 | return $this->db->update("ip_map", $data); |
| 118 | 118 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $this->load->library('astpp/form'); |
| 33 | 33 | $this->load->model('ipmap_model'); |
| 34 | 34 | if ($this->session->userdata('user_login') == FALSE) |
| 35 | - redirect(base_url() . '/astpp/login'); |
|
| 35 | + redirect(base_url().'/astpp/login'); |
|
| 36 | 36 | } |
| 37 | 37 | function ipmap_add() { |
| 38 | 38 | $data['username'] = $this->session->userdata('user_name'); |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | ASTPP 3.0 |
| 53 | 53 | in customer login show ipmap (ACL) module |
| 54 | 54 | *****************************************/ |
| 55 | - $ip=explode("/",$value['ip']); |
|
| 55 | + $ip = explode("/", $value['ip']); |
|
| 56 | 56 | $edit_data = $value; |
| 57 | - $edit_data['ip']=$ip[0]; |
|
| 57 | + $edit_data['ip'] = $ip[0]; |
|
| 58 | 58 | } |
| 59 | 59 | /*************************************************************************************************/ |
| 60 | 60 | $data['form'] = $this->form->build_form($this->ipmap_form->get_ipmap_form_fields(), $edit_data); |
@@ -64,11 +64,11 @@ discard block |
||
| 64 | 64 | function ipmap_save() { |
| 65 | 65 | $add_array = $this->input->post(); |
| 66 | 66 | $ip = $add_array['ip']; |
| 67 | - if (strpos($ip,'/') !== false) { |
|
| 68 | - $add_array['ip']=$add_array['ip']; |
|
| 67 | + if (strpos($ip, '/') !== false) { |
|
| 68 | + $add_array['ip'] = $add_array['ip']; |
|
| 69 | 69 | } |
| 70 | - else{ |
|
| 71 | - $add_array['ip']=$add_array['ip'].'/32'; |
|
| 70 | + else { |
|
| 71 | + $add_array['ip'] = $add_array['ip'].'/32'; |
|
| 72 | 72 | } |
| 73 | 73 | $data['form'] = $this->form->build_form($this->ipmap_form->get_ipmap_form_fields(), $add_array); |
| 74 | 74 | if ($add_array['id'] != '') { |
@@ -78,13 +78,13 @@ discard block |
||
| 78 | 78 | echo $data['validation_errors']; |
| 79 | 79 | exit; |
| 80 | 80 | } else { |
| 81 | - $ip_free= $this->ipmap_model->edit_ipmap($add_array, $add_array['id']); |
|
| 81 | + $ip_free = $this->ipmap_model->edit_ipmap($add_array, $add_array['id']); |
|
| 82 | 82 | if ($ip_free) { |
| 83 | 83 | $this->load->library('freeswitch_lib'); |
| 84 | 84 | $this->load->module('freeswitch/freeswitch'); |
| 85 | 85 | $command = "api reloadacl"; |
| 86 | 86 | $response = $this->freeswitch_model->reload_freeswitch($command); |
| 87 | - $this->session->set_userdata('astpp_notification',$response); |
|
| 87 | + $this->session->set_userdata('astpp_notification', $response); |
|
| 88 | 88 | } |
| 89 | 89 | echo json_encode(array("SUCCESS"=> " IP Map updated successfully!")); |
| 90 | 90 | exit; |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $this->load->module('freeswitch/freeswitch'); |
| 103 | 103 | $command = "api reloadacl"; |
| 104 | 104 | $response = $this->freeswitch_model->reload_freeswitch($command); |
| 105 | - $this->session->set_userdata('astpp_notification',$response); |
|
| 105 | + $this->session->set_userdata('astpp_notification', $response); |
|
| 106 | 106 | } |
| 107 | 107 | echo json_encode(array("SUCCESS"=> " IP Map added successfully!")); |
| 108 | 108 | exit; |
@@ -110,24 +110,24 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | function ipmap_delete($id) { |
| 113 | - $ip_free=$this->ipmap_model-> remove_ipmap($id); |
|
| 113 | + $ip_free = $this->ipmap_model-> remove_ipmap($id); |
|
| 114 | 114 | if ($ip_free) { |
| 115 | 115 | $this->load->library('freeswitch_lib'); |
| 116 | 116 | $this->load->module('freeswitch/freeswitch'); |
| 117 | 117 | $command = "api reloadacl"; |
| 118 | 118 | $response = $this->freeswitch_model->reload_freeswitch($command); |
| 119 | - $this->session->set_userdata('astpp_notification',$response); |
|
| 119 | + $this->session->set_userdata('astpp_notification', $response); |
|
| 120 | 120 | } |
| 121 | 121 | $this->session->set_flashdata('astpp_notification', 'IP Map removed successfully!'); |
| 122 | 122 | /********************* |
| 123 | 123 | ASTPP 3.0 |
| 124 | 124 | in customer login show ipmap (ACL) module |
| 125 | 125 | *****************************************/ |
| 126 | - $accountdata=$this->session->userdata['accountinfo']; |
|
| 127 | - if($accountdata['type'] == '0'){ |
|
| 128 | - redirect(base_url() . 'user/user_ipmap_detail/'); |
|
| 129 | - }else{ |
|
| 130 | - redirect(base_url() . 'ipmap/ipmap_detail/'); |
|
| 126 | + $accountdata = $this->session->userdata['accountinfo']; |
|
| 127 | + if ($accountdata['type'] == '0') { |
|
| 128 | + redirect(base_url().'user/user_ipmap_detail/'); |
|
| 129 | + } else { |
|
| 130 | + redirect(base_url().'ipmap/ipmap_detail/'); |
|
| 131 | 131 | } |
| 132 | 132 | /*********************************************************************/ |
| 133 | 133 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $this->session->set_userdata('ipmap_list_search', $action); |
| 143 | 143 | } |
| 144 | 144 | if (@$ajax_search != 1) { |
| 145 | - redirect(base_url() . 'ipmap/ipmap_list/'); |
|
| 145 | + redirect(base_url().'ipmap/ipmap_list/'); |
|
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
@@ -173,35 +173,35 @@ discard block |
||
| 173 | 173 | $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
| 174 | 174 | $json_data = $paging_data["json_paging"]; |
| 175 | 175 | $query = $this->ipmap_model->ipmap_list(true, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]); |
| 176 | - $query =$query->result_array(); |
|
| 176 | + $query = $query->result_array(); |
|
| 177 | 177 | foreach ($query as $key => $value) { |
| 178 | - $ipmap_checkbox='<input type="checkbox" name="chkAll" id="'.$value['id'].'" class="ace chkRefNos" onclick="clickchkbox('.$value['id'].')" value=' .$value['id'].'><lable class="lbl"></lable>'; |
|
| 179 | - if($account_data['type'] == '0'){ |
|
| 180 | - $ret_url = '<a href="'. base_url() .'user/user_ipmap_edit/'.$value['id'].'" class="btn btn-royelblue btn-sm" rel="facebox" title="Edit"> <i class="fa fa-pencil-square-o fa-fw"></i></a> <a href="'. base_url() .'user/user_ipmap_delete/' . $value['id'].'" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();"> <i class="fa fa-trash fa-fw"></i></a>'; |
|
| 181 | - $account_name=''; |
|
| 178 | + $ipmap_checkbox = '<input type="checkbox" name="chkAll" id="'.$value['id'].'" class="ace chkRefNos" onclick="clickchkbox('.$value['id'].')" value='.$value['id'].'><lable class="lbl"></lable>'; |
|
| 179 | + if ($account_data['type'] == '0') { |
|
| 180 | + $ret_url = '<a href="'.base_url().'user/user_ipmap_edit/'.$value['id'].'" class="btn btn-royelblue btn-sm" rel="facebox" title="Edit"> <i class="fa fa-pencil-square-o fa-fw"></i></a> <a href="'.base_url().'user/user_ipmap_delete/'.$value['id'].'" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();"> <i class="fa fa-trash fa-fw"></i></a>'; |
|
| 181 | + $account_name = ''; |
|
| 182 | 182 | $json_data['rows'][] = array('cell' => array( |
| 183 | 183 | $ipmap_checkbox, |
| 184 | 184 | $value['name'], |
| 185 | 185 | $value['ip'], |
| 186 | 186 | $value['prefix'], |
| 187 | - $this->common->get_status('status', 'ip_map',$value), |
|
| 188 | - $this->common->convert_GMT_to('','',$value['created_date']), |
|
| 189 | - $this->common->convert_GMT_to('','',$value['last_modified_date']), |
|
| 187 | + $this->common->get_status('status', 'ip_map', $value), |
|
| 188 | + $this->common->convert_GMT_to('', '', $value['created_date']), |
|
| 189 | + $this->common->convert_GMT_to('', '', $value['last_modified_date']), |
|
| 190 | 190 | $ret_url, |
| 191 | 191 | |
| 192 | 192 | )); |
| 193 | - }else{ |
|
| 194 | - $ret_url = '<a href="'. base_url() .'ipmap/ipmap_edit/'.$value['id'].'" class="btn btn-royelblue btn-sm" rel="facebox" title="Edit"> <i class="fa fa-pencil-square-o fa-fw"></i></a> <a href="'. base_url() .'ipmap/ipmap_delete/' . $value['id'].'" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();"> <i class="fa fa-trash fa-fw"></i></a>'; |
|
| 195 | - $account_name =$this->common->build_concat_string("first_name,last_name,number", "accounts",$value['accountid']); |
|
| 193 | + } else { |
|
| 194 | + $ret_url = '<a href="'.base_url().'ipmap/ipmap_edit/'.$value['id'].'" class="btn btn-royelblue btn-sm" rel="facebox" title="Edit"> <i class="fa fa-pencil-square-o fa-fw"></i></a> <a href="'.base_url().'ipmap/ipmap_delete/'.$value['id'].'" class="btn btn-royelblue btn-sm" title="Delete" onClick="return get_alert_msg();"> <i class="fa fa-trash fa-fw"></i></a>'; |
|
| 195 | + $account_name = $this->common->build_concat_string("first_name,last_name,number", "accounts", $value['accountid']); |
|
| 196 | 196 | $json_data['rows'][] = array('cell' => array( |
| 197 | 197 | $ipmap_checkbox, |
| 198 | 198 | $account_name, |
| 199 | 199 | $value['name'], |
| 200 | 200 | $value['ip'], |
| 201 | 201 | $value['prefix'], |
| 202 | - $this->common->get_status('status', 'ip_map',$value), |
|
| 203 | - $this->common->convert_GMT_to('','',$value['created_date']), |
|
| 204 | - $this->common->convert_GMT_to('','',$value['last_modified_date']), |
|
| 202 | + $this->common->get_status('status', 'ip_map', $value), |
|
| 203 | + $this->common->convert_GMT_to('', '', $value['created_date']), |
|
| 204 | + $this->common->convert_GMT_to('', '', $value['last_modified_date']), |
|
| 205 | 205 | $ret_url, |
| 206 | 206 | |
| 207 | 207 | )); |