@@ -1,4 +1,6 @@ |
||
| 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 | $_doctypes = array( |
| 4 | 6 | 'xhtml11' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">', |
@@ -46,14 +46,15 @@ discard block |
||
| 46 | 46 | $this->db->where($where); |
| 47 | 47 | if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
| 48 | 48 | $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
| 49 | - }else{ |
|
| 49 | + } else{ |
|
| 50 | 50 | $this->db->order_by("callstart desc"); |
| 51 | 51 | } |
| 52 | 52 | if ($flag) { |
| 53 | - if (!$export) |
|
| 54 | - $this->db->limit($limit, $start); |
|
| 53 | + if (!$export) { |
|
| 54 | + $this->db->limit($limit, $start); |
|
| 55 | + } |
|
| 55 | 56 | $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype,is_recording,trunk_id,uniqueid'); |
| 56 | - }else { |
|
| 57 | + } else { |
|
| 57 | 58 | $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(debit) as total_debit,sum(cost) as total_cost,group_concat(distinct(pricelist_id)) as pricelist_ids,group_concat(distinct(trunk_id)) as trunk_ids,group_concat(distinct(accountid)) as accounts_ids'); |
| 58 | 59 | } |
| 59 | 60 | $result = $this->db->get('cdrs'); |
@@ -74,12 +75,13 @@ discard block |
||
| 74 | 75 | $this->db->where($where); |
| 75 | 76 | if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
| 76 | 77 | $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
| 77 | - }else{ |
|
| 78 | + } else{ |
|
| 78 | 79 | $this->db->order_by("callstart desc"); |
| 79 | 80 | } |
| 80 | 81 | if ($flag) { |
| 81 | - if (!$export) |
|
| 82 | - $this->db->limit($limit, $start); |
|
| 82 | + if (!$export) { |
|
| 83 | + $this->db->limit($limit, $start); |
|
| 84 | + } |
|
| 83 | 85 | $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype'); |
| 84 | 86 | } else { |
| 85 | 87 | $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(debit) as total_debit,sum(cost) as total_cost,group_concat(distinct(pricelist_id)) as pricelist_ids'); |
@@ -105,14 +107,15 @@ discard block |
||
| 105 | 107 | $this->db->where($where); |
| 106 | 108 | if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
| 107 | 109 | $this->db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
| 108 | - }else{ |
|
| 110 | + } else{ |
|
| 109 | 111 | $this->db->order_by("callstart desc"); |
| 110 | 112 | } |
| 111 | 113 | if ($flag) { |
| 112 | - if (!$export) |
|
| 113 | - $this->db->limit($limit, $start); |
|
| 114 | + if (!$export) { |
|
| 115 | + $this->db->limit($limit, $start); |
|
| 116 | + } |
|
| 114 | 117 | $this->db->select('callstart,callerid,callednum,pattern,notes,billseconds,provider_call_cost,disposition,provider_id,cost'); |
| 115 | - }else { |
|
| 118 | + } else { |
|
| 116 | 119 | $this->db->select('count(*) as count,sum(billseconds) as billseconds,sum(cost) as total_cost'); |
| 117 | 120 | } |
| 118 | 121 | $result = $this->db->get('cdrs'); |
@@ -159,10 +162,11 @@ discard block |
||
| 159 | 162 | $accountinfo = $this->session->userdata('accountinfo'); |
| 160 | 163 | $where['payment_by']=$accountinfo['type']==1 ? $accountinfo['id']:-1; |
| 161 | 164 | if ($flag) { |
| 162 | - if($export) |
|
| 163 | - $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC","",""); |
|
| 164 | - else |
|
| 165 | - $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", $limit, $start); |
|
| 165 | + if($export) { |
|
| 166 | + $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC","",""); |
|
| 167 | + } else { |
|
| 168 | + $query = $this->db_model->select("*", "payments", $where, "payment_date", "DESC", $limit, $start); |
|
| 169 | + } |
|
| 166 | 170 | } else { |
| 167 | 171 | $query = $this->db_model->countQuery("*", "payments", $where); |
| 168 | 172 | } |
@@ -38,8 +38,9 @@ discard block |
||
| 38 | 38 | $this->fpdf = new PDF('P', 'pt'); |
| 39 | 39 | $this->fpdf->initialize('P', 'mm', 'A4'); |
| 40 | 40 | |
| 41 | - if ($this->session->userdata('user_login') == FALSE) |
|
| 42 | - redirect(base_url() . '/astpp/login'); |
|
| 41 | + if ($this->session->userdata('user_login') == FALSE) { |
|
| 42 | + redirect(base_url() . '/astpp/login'); |
|
| 43 | + } |
|
| 43 | 44 | } |
| 44 | 45 | |
| 45 | 46 | function customerReport() { |
@@ -272,7 +273,7 @@ discard block |
||
| 272 | 273 | "", |
| 273 | 274 | "", |
| 274 | 275 | ); |
| 275 | - }else{ |
|
| 276 | + } else{ |
|
| 276 | 277 | $customer_array[] = array("Date", "CallerID", "Called Number", "Code", "Destination", "Duration", "Debit($currency)", "Cost($currency)", "Disposition", "Account","Rate Group", "Call Type"); |
| 277 | 278 | foreach ($query->result_array() as $value) { |
| 278 | 279 | $duration = ($show_seconds == 'minutes') ? ($value['billseconds'] > 0 ) ? |
@@ -642,13 +643,15 @@ discard block |
||
| 642 | 643 | :null; |
| 643 | 644 | |
| 644 | 645 | $json_data = array(); |
| 645 | - if(!empty($like_str)) |
|
| 646 | - $this->db->where($like_str); |
|
| 646 | + if(!empty($like_str)) { |
|
| 647 | + $this->db->where($like_str); |
|
| 648 | + } |
|
| 647 | 649 | $count_all = $this->reports_model->users_cdrs_list(false, $accountid, $accounttype, "", ""); |
| 648 | 650 | $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
| 649 | 651 | $json_data = $paging_data["json_paging"]; |
| 650 | - if(!empty($like_str)) |
|
| 651 | - $this->db->where($like_str); |
|
| 652 | + if(!empty($like_str)) { |
|
| 653 | + $this->db->where($like_str); |
|
| 654 | + } |
|
| 652 | 655 | $query = $this->reports_model->users_cdrs_list(true, $accountid, $accounttype, $paging_data["paging"]["start"], $paging_data["paging"]["page_no"]); |
| 653 | 656 | $grid_fields = json_decode($this->reports_form->build_report_list_for_user($accounttype)); |
| 654 | 657 | $json_data['rows'] = $this->form->build_grid($query, $grid_fields); |
@@ -806,7 +809,7 @@ discard block |
||
| 806 | 809 | $after_balance, |
| 807 | 810 | $description, |
| 808 | 811 | )); |
| 809 | - }else{ |
|
| 812 | + } else{ |
|
| 810 | 813 | $json_data['rows'][] = array('cell' => array( |
| 811 | 814 | $date, |
| 812 | 815 | $invoice_num, |
@@ -833,7 +836,7 @@ discard block |
||
| 833 | 836 | } |
| 834 | 837 | if ($this->session->userdata('logintype') == 1) { |
| 835 | 838 | $json_data['rows'][$count_all]['cell']=array('<b>Total</b>','-','-','-','-','<b>'.$this->common->convert_to_currency('','',$debit_sum).'</b>','<b>'.$this->common->convert_to_currency('','',$credit_sum).'</b>','-','-'); |
| 836 | - }else{ |
|
| 839 | + } else{ |
|
| 837 | 840 | $json_data['rows'][$count_all]['cell']=array('<b>Total</b>','-','-','-','-','<b>'.$this->common->convert_to_currency('','',$debit_sum).'</b>','<b>'.$this->common->convert_to_currency('','',$credit_sum).'</b>','-','-'); |
| 838 | 841 | |
| 839 | 842 | } |
@@ -870,14 +873,16 @@ discard block |
||
| 870 | 873 | OR 'credit' like '%$instant_search%' |
| 871 | 874 | OR 'description' like '%$instant_search%')" |
| 872 | 875 | :null; |
| 873 | - if(!empty($like_str)) |
|
| 874 | - $this->db->where($like_str); |
|
| 876 | + if(!empty($like_str)) { |
|
| 877 | + $this->db->where($like_str); |
|
| 878 | + } |
|
| 875 | 879 | $count_all = $this->reports_model->get_customer_charge_list(false,$accountid); |
| 876 | 880 | |
| 877 | 881 | $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
| 878 | 882 | $json_data = $paging_data["json_paging"]; |
| 879 | - if(!empty($like_str)) |
|
| 880 | - $this->db->where($like_str); |
|
| 883 | + if(!empty($like_str)) { |
|
| 884 | + $this->db->where($like_str); |
|
| 885 | + } |
|
| 881 | 886 | $query = $this->reports_model->get_customer_charge_list(true,$accountid,$paging_data["paging"]["start"], $paging_data["paging"]["page_no"]); |
| 882 | 887 | $result= $query->result_array(); |
| 883 | 888 | $query1 = $this->reports_model->get_customer_charge_list(true,$accountid,'',''); |
@@ -929,7 +934,7 @@ discard block |
||
| 929 | 934 | $after_balance, |
| 930 | 935 | $description, |
| 931 | 936 | )); |
| 932 | - }else{ |
|
| 937 | + } else{ |
|
| 933 | 938 | $json_data['rows'][] = array('cell' => array( |
| 934 | 939 | $date, |
| 935 | 940 | $invoice_num, |
@@ -955,7 +960,7 @@ discard block |
||
| 955 | 960 | } |
| 956 | 961 | if ($this->session->userdata('logintype') == 1) { |
| 957 | 962 | $json_data['rows'][$count_all]['cell']=array('<b>Total</b>','-','-','-','<b>'.$this->common->convert_to_currency('','',$debit_sum).'</b>','<b>'.$this->common->convert_to_currency('','',$credit_sum).'</b>','-','-'); |
| 958 | - }else{ |
|
| 963 | + } else{ |
|
| 959 | 964 | $json_data['rows'][$count_all]['cell']=array('<b>Total</b>','-','-','-','<b>'.$this->common->convert_to_currency('','',$debit_sum).'</b>','<b>'.$this->common->convert_to_currency('','',$credit_sum).'</b>','-','-'); |
| 960 | 965 | |
| 961 | 966 | } |
@@ -971,13 +976,15 @@ discard block |
||
| 971 | 976 | OR notes like '%$instant_search%' |
| 972 | 977 | )" |
| 973 | 978 | :null; |
| 974 | - if(!empty($like_str)) |
|
| 975 | - $this->db->where($like_str); |
|
| 979 | + if(!empty($like_str)) { |
|
| 980 | + $this->db->where($like_str); |
|
| 981 | + } |
|
| 976 | 982 | $count_all = $this->reports_model->get_customer_refillreport(false,$accountid); |
| 977 | 983 | $paging_data = $this->form->load_grid_config($count_all, $_GET['rp'], $_GET['page']); |
| 978 | 984 | $json_data = $paging_data["json_paging"]; |
| 979 | - if(!empty($like_str)) |
|
| 980 | - $this->db->where($like_str); |
|
| 985 | + if(!empty($like_str)) { |
|
| 986 | + $this->db->where($like_str); |
|
| 987 | + } |
|
| 981 | 988 | $query = $this->reports_model->get_customer_refillreport(true,$accountid,$paging_data["paging"]["start"], $paging_data["paging"]["page_no"]); |
| 982 | 989 | $grid_fields = json_decode($this->reports_form->build_refillreport_for_customer()); |
| 983 | 990 | $json_data['rows'] = $this->form->build_grid($query, $grid_fields); |
@@ -20,8 +20,9 @@ discard block |
||
| 20 | 20 | # You should have received a copy of the GNU Affero General Public License |
| 21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | 22 | ############################################################################### |
| 23 | -if (!defined('BASEPATH'))
|
|
| 24 | - exit('No direct script access allowed');
|
|
| 23 | +if (!defined('BASEPATH')) { |
|
| 24 | + exit('No direct script access allowed'); |
|
| 25 | +} |
|
| 25 | 26 | |
| 26 | 27 | class Reports_form {
|
| 27 | 28 | function __construct() {
|
@@ -56,8 +57,7 @@ discard block |
||
| 56 | 57 | array('Call Type', 'calltype', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_calltype'),
|
| 57 | 58 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''),
|
| 58 | 59 | array('', 'HIDDEN', 'advance_search', '1', '', '', ''));
|
| 59 | - } |
|
| 60 | - else |
|
| 60 | + } else |
|
| 61 | 61 | {
|
| 62 | 62 | $form['forms'] = array("", array('id' => "cdr_customer_search"));
|
| 63 | 63 | $form['Search'] = array( |
@@ -190,8 +190,7 @@ discard block |
||
| 190 | 190 | $recording, |
| 191 | 191 | )); |
| 192 | 192 | |
| 193 | - } |
|
| 194 | - else{
|
|
| 193 | + } else{
|
|
| 195 | 194 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo');
|
| 196 | 195 | $currency_id=$account_info['currency_id']; |
| 197 | 196 | $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id);
|
@@ -348,7 +347,7 @@ discard block |
||
| 348 | 347 | $account_data = $this->CI->session->userdata("accountinfo");
|
| 349 | 348 | $loginid = $account_data['id']; |
| 350 | 349 | |
| 351 | - }else{
|
|
| 350 | + } else{
|
|
| 352 | 351 | $loginid = "0"; |
| 353 | 352 | } |
| 354 | 353 | if($logintype==0 || $logintype==3){
|
@@ -535,7 +534,7 @@ discard block |
||
| 535 | 534 | array("After Balance<br/>($currency)", "120", "after_balance", "after_balance", "after_balance", "convert_to_currency","","true","right"),
|
| 536 | 535 | array(gettext("Description"), "300", "description", "", "", "","","true","center"),
|
| 537 | 536 | )); |
| 538 | - }else{
|
|
| 537 | + } else{
|
|
| 539 | 538 | $grid_field_arr = json_encode(array( |
| 540 | 539 | array("Created Date", "120", "created_date", "", "", "","","true","center"),
|
| 541 | 540 | array("Invoice Number", "120", "created_date", "", "", "","","true","center"),
|
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $this->opensips_db->limit($limit,$start); |
| 39 | 39 | if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
| 40 | 40 | $this->opensips_db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
| 41 | - }else{ |
|
| 41 | + } else{ |
|
| 42 | 42 | $this->opensips_db->order_by('username','asc'); |
| 43 | 43 | } |
| 44 | 44 | $query = $this->opensips_db->get("subscriber"); |
@@ -62,8 +62,9 @@ discard block |
||
| 62 | 62 | OR effective_caller_id_number like '%$instant_search%' |
| 63 | 63 | )" |
| 64 | 64 | :null; |
| 65 | - if(!empty($like_str)) |
|
| 66 | - $this->opensips_db->where($like_str); |
|
| 65 | + if(!empty($like_str)) { |
|
| 66 | + $this->opensips_db->where($like_str); |
|
| 67 | + } |
|
| 67 | 68 | $this->opensips_db->where($where); |
| 68 | 69 | if ($flag) { |
| 69 | 70 | $this->opensips_db->limit($limit,$start); |
@@ -72,15 +73,13 @@ discard block |
||
| 72 | 73 | if($result->num_rows() > 0){ |
| 73 | 74 | if($flag){ |
| 74 | 75 | return $result; |
| 75 | - } |
|
| 76 | - else{ |
|
| 76 | + } else{ |
|
| 77 | 77 | return $result->num_rows(); |
| 78 | 78 | } |
| 79 | - }else{ |
|
| 79 | + } else{ |
|
| 80 | 80 | if($flag){ |
| 81 | 81 | $result=(object)array('num_rows'=>0); |
| 82 | - } |
|
| 83 | - else{ |
|
| 82 | + } else{ |
|
| 84 | 83 | $result=0; |
| 85 | 84 | } |
| 86 | 85 | return $result; |
@@ -93,7 +92,7 @@ discard block |
||
| 93 | 92 | $this->opensips_db->limit( $limit,$start); |
| 94 | 93 | if (isset($_GET['sortname']) && $_GET['sortname'] != 'undefined'){ |
| 95 | 94 | $this->opensips_db->order_by($_GET['sortname'], ($_GET['sortorder']=='undefined')?'desc':$_GET['sortorder']); |
| 96 | - }else{ |
|
| 95 | + } else{ |
|
| 97 | 96 | $this->opensips_db->order_by('setid','asc'); |
| 98 | 97 | } |
| 99 | 98 | $query = $this->opensips_db->get("dispatcher"); |
@@ -33,8 +33,9 @@ discard block |
||
| 33 | 33 | $db_config = Common_model::$global_config['system_config']; |
| 34 | 34 | $opensipdsn = "mysql://" . $db_config['opensips_dbuser'] . ":" . $db_config['opensips_dbpass'] . "@" . $db_config['opensips_dbhost'] . "/" . $db_config['opensips_dbname'] . "?char_set=utf8&dbcollat=utf8_general_ci&cache_on=true&cachedir="; |
| 35 | 35 | $this->opensips_db = $this->load->database($opensipdsn, true); |
| 36 | - if ($this->session->userdata('user_login') == FALSE) |
|
| 37 | - redirect(base_url() . '/astpp/login'); |
|
| 36 | + if ($this->session->userdata('user_login') == FALSE) { |
|
| 37 | + redirect(base_url() . '/astpp/login'); |
|
| 38 | + } |
|
| 38 | 39 | } |
| 39 | 40 | |
| 40 | 41 | function opensips_add() { |
@@ -92,7 +93,7 @@ discard block |
||
| 92 | 93 | $this->opensips_model->edit_opensipsdevices($add_array, $add_array['id']); |
| 93 | 94 | echo json_encode(array("SUCCESS"=> " OpenSips updated successfully!")); |
| 94 | 95 | exit; |
| 95 | - }else{ |
|
| 96 | + } else{ |
|
| 96 | 97 | echo json_encode($auth_flag); |
| 97 | 98 | exit; |
| 98 | 99 | } |
@@ -109,7 +110,7 @@ discard block |
||
| 109 | 110 | $this->opensips_model->add_opensipsdevices($add_array); |
| 110 | 111 | echo json_encode(array("SUCCESS"=> "OpenSips added successfully!")); |
| 111 | 112 | exit; |
| 112 | - }else{ |
|
| 113 | + } else{ |
|
| 113 | 114 | echo json_encode($auth_flag); |
| 114 | 115 | exit; |
| 115 | 116 | } |
@@ -131,10 +132,10 @@ discard block |
||
| 131 | 132 | $auth_flag = $auth_flag->num_rows(); |
| 132 | 133 | if($auth_flag == 0){ |
| 133 | 134 | return "TRUE"; |
| 134 | - }else{ |
|
| 135 | + } else{ |
|
| 135 | 136 | return array("username_error"=>"Duplicate Email Address Found Email Must Be Unique."); |
| 136 | 137 | } |
| 137 | - }else{ |
|
| 138 | + } else{ |
|
| 138 | 139 | return array("username_error"=>"User name is required field."); |
| 139 | 140 | } |
| 140 | 141 | return "0"; |
@@ -155,13 +156,13 @@ discard block |
||
| 155 | 156 | echo json_encode(array("SUCCESS"=> "Opensips Updated Successfully!")); |
| 156 | 157 | exit; |
| 157 | 158 | } |
| 158 | - }else{ |
|
| 159 | + } else{ |
|
| 159 | 160 | $data['page_title'] = 'Add Opensips'; |
| 160 | 161 | if ($this->form_validation->run() == FALSE) { |
| 161 | 162 | $data['validation_errors'] = validation_errors(); |
| 162 | 163 | echo $data['validation_errors']; |
| 163 | 164 | exit; |
| 164 | - }else{ |
|
| 165 | + } else{ |
|
| 165 | 166 | $this->opensips_model->add_opensipsdevices($array_add); |
| 166 | 167 | echo json_encode(array("SUCCESS"=> "Opensips Added Successfully!")); |
| 167 | 168 | exit; |
@@ -184,13 +185,13 @@ discard block |
||
| 184 | 185 | echo json_encode(array("SUCCESS"=> "OpenSips Updated Successfully!")); |
| 185 | 186 | exit; |
| 186 | 187 | } |
| 187 | - }else{ |
|
| 188 | + } else{ |
|
| 188 | 189 | $data['page_title'] = 'Add Opensips'; |
| 189 | 190 | if ($this->form_validation->run() == FALSE) { |
| 190 | 191 | $data['validation_errors'] = validation_errors(); |
| 191 | 192 | echo $data['validation_errors']; |
| 192 | 193 | exit; |
| 193 | - }else{ |
|
| 194 | + } else{ |
|
| 194 | 195 | $this->opensips_model->add_opensipsdevices($add_array); |
| 195 | 196 | echo json_encode(array("SUCCESS"=> "OpenSips Added Successfully!")); |
| 196 | 197 | exit; |
@@ -35,8 +35,9 @@ discard block |
||
| 35 | 35 | $this->load->model('email_model'); |
| 36 | 36 | $this->load->library('csvreader'); |
| 37 | 37 | $this->load->library('astpp/email_lib'); |
| 38 | - if ($this->session->userdata('user_login') == FALSE) |
|
| 39 | - redirect(base_url() . '/astpp/login'); |
|
| 38 | + if ($this->session->userdata('user_login') == FALSE) { |
|
| 39 | + redirect(base_url() . '/astpp/login'); |
|
| 40 | + } |
|
| 40 | 41 | } |
| 41 | 42 | |
| 42 | 43 | function email_edit($edit_id = '') { |
@@ -246,8 +247,9 @@ discard block |
||
| 246 | 247 | } |
| 247 | 248 | function email_mass() { |
| 248 | 249 | $account_data = $this->session->userdata("accountinfo"); |
| 249 | - if ($account_data['type'] == '1' || $account_data['type']== 0 || $account_data['type']==3) |
|
| 250 | - redirect(base_url() . '/astpp/dashboard/'); |
|
| 250 | + if ($account_data['type'] == '1' || $account_data['type']== 0 || $account_data['type']==3) { |
|
| 251 | + redirect(base_url() . '/astpp/dashboard/'); |
|
| 252 | + } |
|
| 251 | 253 | $data['username'] = $this->session->userdata('user_name'); |
| 252 | 254 | $data['page_title'] = 'Email Mass'; |
| 253 | 255 | $data['form'] = $this->form->build_form($this->email_form->build_list_for_email_client_area(), ''); |
@@ -291,8 +293,7 @@ discard block |
||
| 291 | 293 | $path =$dir_path.$actual_file_name; |
| 292 | 294 | if (move_uploaded_file($uploadedFile1,$path)) { |
| 293 | 295 | $this->session->set_flashdata('astpp_errormsg', 'files added successfully!'); |
| 294 | - } |
|
| 295 | - else{ |
|
| 296 | + } else{ |
|
| 296 | 297 | $this->session->set_flashdata('astpp_errormsg', 'Please try again !'); |
| 297 | 298 | } |
| 298 | 299 | } |
@@ -315,8 +316,7 @@ discard block |
||
| 315 | 316 | if($add_array['temp'] == ''){ |
| 316 | 317 | $subject = ''; |
| 317 | 318 | $body =''; |
| 318 | - } |
|
| 319 | - else{ |
|
| 319 | + } else{ |
|
| 320 | 320 | $where = array('id' => $add_array['temp']); |
| 321 | 321 | $account = $this->db_model->getSelect("subject,template", "default_templates", $where); |
| 322 | 322 | $account_data =$account->result_array(); |
@@ -22,8 +22,9 @@ discard block |
||
| 22 | 22 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 23 | 23 | ############################################################################### |
| 24 | 24 | |
| 25 | -if (!defined('BASEPATH'))
|
|
| 26 | - exit('No direct script access allowed');
|
|
| 25 | +if (!defined('BASEPATH')) { |
|
| 26 | + exit('No direct script access allowed'); |
|
| 27 | +} |
|
| 27 | 28 | |
| 28 | 29 | class Email_form {
|
| 29 | 30 | function __construct($library_name = '') {
|
@@ -153,7 +154,7 @@ discard block |
||
| 153 | 154 | $account_data = $this->CI->session->userdata("accountinfo");
|
| 154 | 155 | $loginid = $account_data['id']; |
| 155 | 156 | |
| 156 | - }else{
|
|
| 157 | + } else{
|
|
| 157 | 158 | $loginid = "0"; |
| 158 | 159 | } |
| 159 | 160 | $form['forms'] = array(base_url() . 'email/email_client_area/', array('id' => 'commission_form', 'method' => 'POST', 'name' => 'commission_form'));
|
@@ -35,8 +35,9 @@ discard block |
||
| 35 | 35 | $this->load->library('freeswitch_lib'); |
| 36 | 36 | $this->load->model('freeswitch_model'); |
| 37 | 37 | |
| 38 | - if ($this->session->userdata('user_login') == FALSE) |
|
| 39 | - redirect(base_url() . '/astpp/login'); |
|
| 38 | + if ($this->session->userdata('user_login') == FALSE) { |
|
| 39 | + redirect(base_url() . '/astpp/login'); |
|
| 40 | + } |
|
| 40 | 41 | } |
| 41 | 42 | |
| 42 | 43 | function fssipdevices_add($type = "") { |
@@ -61,7 +62,7 @@ discard block |
||
| 61 | 62 | if($account_data['type'] == '-1' || $account_data['type'] == '1') |
| 62 | 63 | { |
| 63 | 64 | $this->load->view('view_freeswitch_add_edit', $data); |
| 64 | - }else{ |
|
| 65 | + } else{ |
|
| 65 | 66 | $this->load->view('view_freeswitch_customer_add_edit', $data); |
| 66 | 67 | } |
| 67 | 68 | } |
@@ -75,7 +76,7 @@ discard block |
||
| 75 | 76 | { |
| 76 | 77 | $data['form'] = $this->form->build_form($this->freeswitch_form->get_freeswith_form_fields($edit_id), $account); |
| 77 | 78 | $this->load->view('view_freeswitch_add_edit', $data); |
| 78 | - }else{ |
|
| 79 | + } else{ |
|
| 79 | 80 | $data['form'] = $this->form->build_form($this->freeswitch_form->get_freeswith_form_fields($edit_id), $account); |
| 80 | 81 | $this->load->view('view_freeswitch_customer_add_edit', $data); |
| 81 | 82 | } |
@@ -91,7 +92,7 @@ discard block |
||
| 91 | 92 | { |
| 92 | 93 | $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($accountid,$edit_id), $account); |
| 93 | 94 | $this->load->view('view_freeswitch_add_edit', $data); |
| 94 | - }else{ |
|
| 95 | + } else{ |
|
| 95 | 96 | |
| 96 | 97 | $data['form'] = $this->form->build_form($this->freeswitch_form->fsdevice_form_fields_for_customer($accountid,$edit_id), $account); |
| 97 | 98 | $this->load->view('view_freeswitch_customer_add_edit', $data); |
@@ -214,7 +215,7 @@ discard block |
||
| 214 | 215 | echo json_encode(array("SUCCESS"=> "SIP Device Updated Successfully!")); |
| 215 | 216 | exit; |
| 216 | 217 | } |
| 217 | - }else{ |
|
| 218 | + } else{ |
|
| 218 | 219 | $data['page_title'] = 'Create Freeswitch SIP Devices'; |
| 219 | 220 | if ($this->form_validation->run() == FALSE) { |
| 220 | 221 | $data['validation_errors'] = validation_errors(); |
@@ -489,7 +490,7 @@ discard block |
||
| 489 | 490 | $gateway_data["status"] = isset($query_value["status"])?$query_value["status"]:""; |
| 490 | 491 | if ($gateway_key != "gateway_data") { |
| 491 | 492 | $gateway_data[$gateway_key] = $gatewau_val; |
| 492 | - }else if($gateway_key == "status") { |
|
| 493 | + } else if($gateway_key == "status") { |
|
| 493 | 494 | $gateway_data[$gateway_key] = $gatewau_val; |
| 494 | 495 | } |
| 495 | 496 | /** |
@@ -512,7 +513,7 @@ discard block |
||
| 512 | 513 | **/ |
| 513 | 514 | if(!empty($gateway_data['dialplan_variable']) && $gateway_data['dialplan_variable'] != ''){ |
| 514 | 515 | $gateway_result['dialplan_variable'] = $gateway_data['dialplan_variable']; |
| 515 | - }else{ |
|
| 516 | + } else{ |
|
| 516 | 517 | $gateway_result['dialplan_variable'] = ''; |
| 517 | 518 | } |
| 518 | 519 | /**********************************************************************************************/ |
@@ -545,7 +546,7 @@ discard block |
||
| 545 | 546 | /*********************************************************************/ |
| 546 | 547 | else if($key == "status") { |
| 547 | 548 | $insert_arr[$key] = $gateway_data["status"]; |
| 548 | - } else { |
|
| 549 | + } else { |
|
| 549 | 550 | if ($key != "id") { |
| 550 | 551 | $gateway_arr[$key] = $gateway_value; |
| 551 | 552 | } |
@@ -707,16 +708,13 @@ discard block |
||
| 707 | 708 | if($button_name == "start") |
| 708 | 709 | { |
| 709 | 710 | $cmd = "api sofia profile " . trim($query[0]['name']) ." start"; |
| 710 | - } |
|
| 711 | - elseif($button_name == "stop") |
|
| 711 | + } elseif($button_name == "stop") |
|
| 712 | 712 | { |
| 713 | 713 | $cmd= "api sofia profile stop"; |
| 714 | - } |
|
| 715 | - elseif($button_name == "reload") |
|
| 714 | + } elseif($button_name == "reload") |
|
| 716 | 715 | { |
| 717 | 716 | $cmd = "api reloadxml"; |
| 718 | - } |
|
| 719 | - elseif($button_name == "rescan") |
|
| 717 | + } elseif($button_name == "rescan") |
|
| 720 | 718 | { |
| 721 | 719 | $cmd = "api sofia profile " . trim($query[0]['name']) . " rescan"; |
| 722 | 720 | } |
@@ -769,8 +767,7 @@ discard block |
||
| 769 | 767 | /**====================================================================*/ |
| 770 | 768 | $insert = $this->db->insert("sip_profiles", $sipprofile_data); |
| 771 | 769 | |
| 772 | - } |
|
| 773 | - else { |
|
| 770 | + } else { |
|
| 774 | 771 | $this->session->set_flashdata('astpp_notification', 'Duplicate SIP IP OR Port found it must be unique!'); |
| 775 | 772 | redirect(base_url() . 'freeswitch/fssipprofile_add/'); |
| 776 | 773 | } |
@@ -850,7 +847,7 @@ discard block |
||
| 850 | 847 | $update = $this->db->update("sip_profiles", $insert_arr, array('id' => $edit_id)); |
| 851 | 848 | if($sipprofile_data['type_settings']=="add_setting"){ |
| 852 | 849 | $this->session->set_flashdata('astpp_errormsg',$data['sip_name']. " SIP Setting Added Successfully!"); |
| 853 | - }else{ |
|
| 850 | + } else{ |
|
| 854 | 851 | $this->session->set_flashdata('astpp_errormsg',$data['sip_name']. " SIP Setting Updated Successfully!"); |
| 855 | 852 | |
| 856 | 853 | } |