@@ -33,8 +33,9 @@ discard block |
||
| 33 | 33 | $this->load->model ( 'email_model' ); |
| 34 | 34 | $this->load->library ( 'csvreader' ); |
| 35 | 35 | $this->load->library ( 'astpp/email_lib' ); |
| 36 | - if ($this->session->userdata ( 'user_login' ) == FALSE) |
|
| 37 | - redirect ( base_url () . '/astpp/login' ); |
|
| 36 | + if ($this->session->userdata ( 'user_login' ) == FALSE) { |
|
| 37 | + redirect ( base_url () . '/astpp/login' ); |
|
| 38 | + } |
|
| 38 | 39 | } |
| 39 | 40 | function email_edit($edit_id = '') { |
| 40 | 41 | $data ['page_title'] = gettext ( 'Edit Email List' ); |
@@ -268,8 +269,9 @@ discard block |
||
| 268 | 269 | } |
| 269 | 270 | function email_mass() { |
| 270 | 271 | $account_data = $this->session->userdata ( "accountinfo" ); |
| 271 | - if ($account_data ['type'] == '1' || $account_data ['type'] == 0 || $account_data ['type'] == 3) |
|
| 272 | - redirect ( base_url () . '/astpp/dashboard/' ); |
|
| 272 | + if ($account_data ['type'] == '1' || $account_data ['type'] == 0 || $account_data ['type'] == 3) { |
|
| 273 | + redirect ( base_url () . '/astpp/dashboard/' ); |
|
| 274 | + } |
|
| 273 | 275 | $data ['username'] = $this->session->userdata ( 'user_name' ); |
| 274 | 276 | $data ['page_title'] = gettext ( 'Email Mass' ); |
| 275 | 277 | $data ['form'] = $this->form->build_form ( $this->email_form->build_list_for_email_client_area (), '' ); |
@@ -21,8 +21,9 @@ |
||
| 21 | 21 | // You should have received a copy of the GNU Affero General Public License |
| 22 | 22 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 23 | 23 | // ############################################################################## |
| 24 | -if (! defined ( 'BASEPATH' )) |
|
| 24 | +if (! defined ( 'BASEPATH' )) { |
|
| 25 | 25 | exit ( 'No direct script access allowed' ); |
| 26 | +} |
|
| 26 | 27 | class Email_form { |
| 27 | 28 | function __construct($library_name = '') { |
| 28 | 29 | $this->CI = & get_instance (); |
@@ -31,8 +31,9 @@ |
||
| 31 | 31 | $this->load->library ( 'astpp/form' ); |
| 32 | 32 | $this->load->model ( 'taxes_model' ); |
| 33 | 33 | |
| 34 | - if ($this->session->userdata ( 'user_login' ) == FALSE) |
|
| 35 | - redirect ( base_url () . '/astpp/login' ); |
|
| 34 | + if ($this->session->userdata ( 'user_login' ) == FALSE) { |
|
| 35 | + redirect ( base_url () . '/astpp/login' ); |
|
| 36 | + } |
|
| 36 | 37 | } |
| 37 | 38 | function taxes_add() { |
| 38 | 39 | $data ['username'] = $this->session->userdata ( 'user_name' ); |
@@ -20,8 +20,9 @@ |
||
| 20 | 20 | // You should have received a copy of the GNU Affero General Public License |
| 21 | 21 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | 22 | // ############################################################################## |
| 23 | -if (! defined ( 'BASEPATH' )) |
|
| 23 | +if (! defined ( 'BASEPATH' )) { |
|
| 24 | 24 | exit ( 'No direct script access allowed' ); |
| 25 | +} |
|
| 25 | 26 | class Taxes_form { |
| 26 | 27 | function __construct() { |
| 27 | 28 | $this->CI = & get_instance (); |
@@ -32,8 +32,9 @@ discard block |
||
| 32 | 32 | $this->load->library ( 'astpp/form' ); |
| 33 | 33 | $this->load->model ( 'charges_model' ); |
| 34 | 34 | |
| 35 | - if ($this->session->userdata ( 'user_login' ) == FALSE) |
|
| 36 | - redirect ( base_url () . '/astpp/login' ); |
|
| 35 | + if ($this->session->userdata ( 'user_login' ) == FALSE) { |
|
| 36 | + redirect ( base_url () . '/astpp/login' ); |
|
| 37 | + } |
|
| 37 | 38 | } |
| 38 | 39 | function periodiccharges_add() { |
| 39 | 40 | $data ['username'] = $this->session->userdata ( 'user_name' ); |
@@ -203,13 +204,15 @@ discard block |
||
| 203 | 204 | OR charges.charge like '%$instant_search%' |
| 204 | 205 | OR charges.charge like '%$instant_search%' |
| 205 | 206 | )" : null; |
| 206 | - if (! empty ( $like_str )) |
|
| 207 | - $this->db->where ( $like_str ); |
|
| 207 | + if (! empty ( $like_str )) { |
|
| 208 | + $this->db->where ( $like_str ); |
|
| 209 | + } |
|
| 208 | 210 | $count_all = $this->db_model->getCountWithJion ( $table, $select, $where, $jionTable, $jionCondition, $type ); |
| 209 | 211 | $paging_data = $this->form->load_grid_config ( $count_all, $_GET ['rp'], $_GET ['page'] ); |
| 210 | 212 | $json_data = $paging_data ["json_paging"]; |
| 211 | - if (! empty ( $like_str )) |
|
| 212 | - $this->db->where ( $like_str ); |
|
| 213 | + if (! empty ( $like_str )) { |
|
| 214 | + $this->db->where ( $like_str ); |
|
| 215 | + } |
|
| 213 | 216 | $account_charge_list = $this->db_model->getAllJionQuery ( $table, $select, $where, $jionTable, $jionCondition, $type, $paging_data ["paging"] ["page_no"], $paging_data ["paging"] ["start"], $order_by, $order_type, "" ); |
| 214 | 217 | $grid_fields = json_decode ( $this->charges_form->build_charges_list_for_customer ( $accountid, $accounttype ) ); |
| 215 | 218 | $json_data ['rows'] = $this->form->build_grid ( $account_charge_list, $grid_fields ); |
@@ -21,8 +21,9 @@ |
||
| 21 | 21 | // You should have received a copy of the GNU Affero General Public License |
| 22 | 22 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 23 | 23 | // ############################################################################## |
| 24 | -if (! defined ( 'BASEPATH' )) |
|
| 24 | +if (! defined ( 'BASEPATH' )) { |
|
| 25 | 25 | exit ( 'No direct script access allowed' ); |
| 26 | +} |
|
| 26 | 27 | class Charges_form { |
| 27 | 28 | function __construct($library_name = '') { |
| 28 | 29 | $this->CI = & get_instance (); |
@@ -33,8 +33,9 @@ |
||
| 33 | 33 | $this->load->library ( 'freeswitch_lib' ); |
| 34 | 34 | $this->load->model ( 'freeswitch_model' ); |
| 35 | 35 | |
| 36 | - if ($this->session->userdata ( 'user_login' ) == FALSE) |
|
| 37 | - redirect ( base_url () . '/astpp/login' ); |
|
| 36 | + if ($this->session->userdata ( 'user_login' ) == FALSE) { |
|
| 37 | + redirect ( base_url () . '/astpp/login' ); |
|
| 38 | + } |
|
| 38 | 39 | } |
| 39 | 40 | function fssipdevices_add($type = "") { |
| 40 | 41 | $data ['username'] = $this->session->userdata ( 'user_name' ); |
@@ -21,8 +21,9 @@ |
||
| 21 | 21 | // You should have received a copy of the GNU Affero General Public License |
| 22 | 22 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 23 | 23 | // ############################################################################## |
| 24 | -if (! defined ( 'BASEPATH' )) |
|
| 24 | +if (! defined ( 'BASEPATH' )) { |
|
| 25 | 25 | exit ( 'No direct script access allowed' ); |
| 26 | +} |
|
| 26 | 27 | class Freeswitch_form { |
| 27 | 28 | function __construct() { |
| 28 | 29 | $this->CI = & get_instance (); |
@@ -53,8 +53,9 @@ discard block |
||
| 53 | 53 | $this->db->order_by ( "callstart desc" ); |
| 54 | 54 | } |
| 55 | 55 | if ($flag) { |
| 56 | - if (! $export) |
|
| 57 | - $this->db->limit ( $limit, $start ); |
|
| 56 | + if (! $export) { |
|
| 57 | + $this->db->limit ( $limit, $start ); |
|
| 58 | + } |
|
| 58 | 59 | // Add is_recording for enabled recording. |
| 59 | 60 | $this->db->select ( 'callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype,trunk_id,uniqueid' ); |
| 60 | 61 | } else { |
@@ -82,8 +83,9 @@ discard block |
||
| 82 | 83 | $this->db->order_by ( "callstart desc" ); |
| 83 | 84 | } |
| 84 | 85 | if ($flag) { |
| 85 | - if (! $export) |
|
| 86 | - $this->db->limit ( $limit, $start ); |
|
| 86 | + if (! $export) { |
|
| 87 | + $this->db->limit ( $limit, $start ); |
|
| 88 | + } |
|
| 87 | 89 | $this->db->select ( 'callstart,callerid,callednum,pattern,notes,billseconds,disposition,debit,cost,accountid,pricelist_id,calltype' ); |
| 88 | 90 | } else { |
| 89 | 91 | $this->db->select ( 'count(*) as count,sum(billseconds) as billseconds,sum(debit) as total_debit,sum(cost) as total_cost,group_concat(distinct(pricelist_id)) as pricelist_ids' ); |
@@ -114,8 +116,9 @@ discard block |
||
| 114 | 116 | $this->db->order_by ( "callstart desc" ); |
| 115 | 117 | } |
| 116 | 118 | if ($flag) { |
| 117 | - if (! $export) |
|
| 118 | - $this->db->limit ( $limit, $start ); |
|
| 119 | + if (! $export) { |
|
| 120 | + $this->db->limit ( $limit, $start ); |
|
| 121 | + } |
|
| 119 | 122 | $this->db->select ( 'callstart,callerid,callednum,pattern,notes,billseconds,provider_call_cost,disposition,provider_id,cost' ); |
| 120 | 123 | } else { |
| 121 | 124 | $this->db->select ( 'count(*) as count,sum(billseconds) as billseconds,sum(cost) as total_cost' ); |
@@ -165,10 +168,11 @@ discard block |
||
| 165 | 168 | $accountinfo = $this->session->userdata ( 'accountinfo' ); |
| 166 | 169 | $where ['payment_by'] = $accountinfo ['type'] == 1 ? $accountinfo ['id'] : - 1; |
| 167 | 170 | if ($flag) { |
| 168 | - if ($export) |
|
| 169 | - $query = $this->db_model->select ( "*", "payments", $where, "payment_date", "DESC", "", "" ); |
|
| 170 | - else |
|
| 171 | - $query = $this->db_model->select ( "*", "payments", $where, "payment_date", "DESC", $limit, $start ); |
|
| 171 | + if ($export) { |
|
| 172 | + $query = $this->db_model->select ( "*", "payments", $where, "payment_date", "DESC", "", "" ); |
|
| 173 | + } else { |
|
| 174 | + $query = $this->db_model->select ( "*", "payments", $where, "payment_date", "DESC", $limit, $start ); |
|
| 175 | + } |
|
| 172 | 176 | } else { |
| 173 | 177 | $query = $this->db_model->countQuery ( "*", "payments", $where ); |
| 174 | 178 | } |