@@ -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 | |
| 26 | 27 | class Refill_coupon_form { |
| 27 | 28 | function __construct($library_name = '') { |
@@ -20,18 +20,18 @@ 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')) |
|
| 23 | +if ( ! defined('BASEPATH')) |
|
| 24 | 24 | exit('No direct script access allowed'); |
| 25 | 25 | |
| 26 | 26 | class Refill_coupon_form { |
| 27 | 27 | function __construct($library_name = '') { |
| 28 | 28 | $this->CI = & get_instance(); |
| 29 | 29 | } |
| 30 | - function get_refill_coupon_form_fields(){ |
|
| 31 | - $form['forms'] = array(base_url() . 'refill_coupon/refill_coupon_save/',array("id" => "refill_coupon_form", "name" => "refill_coupon_form")); |
|
| 30 | + function get_refill_coupon_form_fields() { |
|
| 31 | + $form['forms'] = array(base_url().'refill_coupon/refill_coupon_save/', array("id" => "refill_coupon_form", "name" => "refill_coupon_form")); |
|
| 32 | 32 | $form['Coupon Information'] = array( |
| 33 | - array('Description', 'INPUT', array('name' => 'description', 'size' => '20', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', 'Please Enter account number'), |
|
| 34 | - array('Start prefix', 'INPUT', array('name' => 'prefix', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''), |
|
| 33 | + array('Description', 'INPUT', array('name' => 'description', 'size' => '20', 'class' => "text field medium"), 'trim|xss_clean', 'tOOL TIP', 'Please Enter account number'), |
|
| 34 | + array('Start prefix', 'INPUT', array('name' => 'prefix', 'size' => '20', 'class' => "text field medium"), 'trim|required|numeric|xss_clean', 'tOOL TIP', ''), |
|
| 35 | 35 | array('Quantity', 'INPUT', array('name' => 'count', 'size' => '20', 'maxlength' => '5', 'class' => "text field medium"), 'trim|required|is_numeric|greater_than[0]|xss_clean', 'tOOL TIP', 'Please Enter account number'), |
| 36 | 36 | array('Amount', 'INPUT', array('name' => 'amount', 'size' => '20', 'class' => "text field medium"), 'trim|required|is_numeric|greater_than[0]|xss_clean', 'tOOL TIP', 'Please Enter account number'), |
| 37 | 37 | ); |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | function build_grid_buttons_refill_coupon() { |
| 44 | 44 | $buttons_json = json_encode(array( |
| 45 | - array(gettext("Create"),"btn btn-line-warning btn","fa fa-plus-circle fa-lg", "button_action", "/refill_coupon/refill_coupon_add/","popup"), |
|
| 46 | - array(gettext("Export"),"btn btn-xing" ," fa fa-download fa-lg", "button_action", "/refill_coupon/refill_coupon_export/", 'single'), |
|
| 45 | + array(gettext("Create"), "btn btn-line-warning btn", "fa fa-plus-circle fa-lg", "button_action", "/refill_coupon/refill_coupon_add/", "popup"), |
|
| 46 | + array(gettext("Export"), "btn btn-xing", " fa fa-download fa-lg", "button_action", "/refill_coupon/refill_coupon_export/", 'single'), |
|
| 47 | 47 | )); |
| 48 | 48 | return $buttons_json; |
| 49 | 49 | } |
@@ -53,14 +53,14 @@ discard block |
||
| 53 | 53 | return $buttons_json; |
| 54 | 54 | } |
| 55 | 55 | function get_refill_coupon_search_form() { |
| 56 | - $accountinfo=$this->CI->session->userdata('accountinfo'); |
|
| 57 | - $reseller_id=$accountinfo['type']== 1 ?$accountinfo['id'] : 0 ; |
|
| 56 | + $accountinfo = $this->CI->session->userdata('accountinfo'); |
|
| 57 | + $reseller_id = $accountinfo['type'] == 1 ? $accountinfo['id'] : 0; |
|
| 58 | 58 | $form['forms'] = array("", array('id' => "refill_coupon_list_search")); |
| 59 | 59 | $form['Search'] = array( |
| 60 | 60 | array('Coupon Number', 'INPUT', array('name' => 'number[number]', '', 'id' => 'number', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'number[number-string]', '', '', '', 'search_string_type', ''), |
| 61 | - array('Description', 'INPUT', array('name' => 'description[description]', '', 'id' => 'description', 'size' => '15','class' => "text field "), '', 'tOOL TIP', '1', 'description[description-string]', '', '', '', 'search_string_type', ''), |
|
| 62 | - array('Account', '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" => $reseller_id,"type"=>"GLOBAL")), |
|
| 63 | - array('Amount', 'INPUT', array('name' => 'amount[amount]', '', 'id' => 'amount', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'amount[amount-integer]', '', '', '', 'search_int_type', ''), |
|
| 61 | + array('Description', 'INPUT', array('name' => 'description[description]', '', 'id' => 'description', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'description[description-string]', '', '', '', 'search_string_type', ''), |
|
| 62 | + array('Account', '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" => $reseller_id, "type"=>"GLOBAL")), |
|
| 63 | + array('Amount', 'INPUT', array('name' => 'amount[amount]', '', 'id' => 'amount', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'amount[amount-integer]', '', '', '', 'search_int_type', ''), |
|
| 64 | 64 | array('Used?', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_refill_coupon_status', '', ''), |
| 65 | 65 | |
| 66 | 66 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $form['Search Refill Coupon'] = array( |
| 78 | 78 | array('Coupon Number', 'INPUT', array('name' => 'number[number]', '', 'id' => 'number', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'number[number-string]', '', '', '', 'search_string_type', ''), |
| 79 | 79 | array('Description', 'INPUT', array('name' => 'description[description]', '', 'id' => 'description', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'description[description-string]', '', '', '', 'search_string_type', ''), |
| 80 | - array('Amount', 'INPUT', array('name' => 'amount[amount]', '', 'id' => 'amount', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'amount[amount-integer]', '', '', '', 'search_int_type', ''), |
|
| 80 | + array('Amount', 'INPUT', array('name' => 'amount[amount]', '', 'id' => 'amount', 'size' => '15', 'class' => "text field "), '', 'tOOL TIP', '1', 'amount[amount-integer]', '', '', '', 'search_int_type', ''), |
|
| 81 | 81 | array('Status', 'status', 'SELECT', '', '', 'tOOL TIP', 'Please Enter account number', '', '', '', 'set_refill_coupon_status', '', ''), |
| 82 | 82 | array('', 'HIDDEN', 'ajax_search', '1', '', '', ''), |
| 83 | 83 | array('', 'HIDDEN', 'advance_search', '1', '', '', ''), |
@@ -89,17 +89,17 @@ discard block |
||
| 89 | 89 | function build_refill_coupon_grid() { |
| 90 | 90 | |
| 91 | 91 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
| 92 | - $currency_id=$account_info['currency_id']; |
|
| 93 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
| 92 | + $currency_id = $account_info['currency_id']; |
|
| 93 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
| 94 | 94 | |
| 95 | 95 | $grid_field_arr = json_encode(array( |
| 96 | - array(gettext("Coupon Number"), "150", "number", "", "", "","","true","center"), |
|
| 97 | - array(gettext("Description"), "165", "description", "", "", "","","true","center"), |
|
| 98 | - array(gettext("Account"), "165", "account_id", "first_name,last_name,number", "accounts", "build_concat_string","","true","center"), |
|
| 99 | - array("Amount($currency)", "150", "amount", "amount", "amount", "convert_to_currency","","true","right"), |
|
| 100 | - array(gettext("Created Date"), "200", "creation_date", "", "", "","","true","center"), |
|
| 101 | - array(gettext("Used?"),"135","status",'status','status','get_refill_coupon_used',"","true","center"), |
|
| 102 | - array(gettext("Used Date"), "180", "firstused", "firstused", "firstused", "firstused_check","","true","center"), |
|
| 96 | + array(gettext("Coupon Number"), "150", "number", "", "", "", "", "true", "center"), |
|
| 97 | + array(gettext("Description"), "165", "description", "", "", "", "", "true", "center"), |
|
| 98 | + array(gettext("Account"), "165", "account_id", "first_name,last_name,number", "accounts", "build_concat_string", "", "true", "center"), |
|
| 99 | + array("Amount($currency)", "150", "amount", "amount", "amount", "convert_to_currency", "", "true", "right"), |
|
| 100 | + array(gettext("Created Date"), "200", "creation_date", "", "", "", "", "true", "center"), |
|
| 101 | + array(gettext("Used?"), "135", "status", 'status', 'status', 'get_refill_coupon_used', "", "true", "center"), |
|
| 102 | + array(gettext("Used Date"), "180", "firstused", "firstused", "firstused", "firstused_check", "", "true", "center"), |
|
| 103 | 103 | array("Action", "120", "", "", "", array( |
| 104 | 104 | "DELETE" => array("url" => "refill_coupon/refill_coupon_list_delete/", "mode" => "single") |
| 105 | 105 | )) |
@@ -108,14 +108,14 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | function build_user_refill_coupon_grid() { |
| 110 | 110 | $account_info = $accountinfo = $this->CI->session->userdata('accountinfo'); |
| 111 | - $currency_id=$account_info['currency_id']; |
|
| 112 | - $currency=$this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
| 111 | + $currency_id = $account_info['currency_id']; |
|
| 112 | + $currency = $this->CI->common->get_field_name('currency', 'currency', $currency_id); |
|
| 113 | 113 | $grid_field_arr = json_encode(array( |
| 114 | - array("Coupon Number", "230", "number", "", "", "","","true","center"), |
|
| 115 | - array("Description", "210", "description", "", "", "","","true","center"), |
|
| 116 | - array("Amount($currency)", "190", "amount", "amount", "amount", "convert_to_currency","","true","right"), |
|
| 117 | - array("Created Date", "250", "creation_date", "", "", "","","true","center"), |
|
| 118 | - array("Used Date", "250", "firstused", "firstused", "firstused", "firstused_check","","true","center"), |
|
| 114 | + array("Coupon Number", "230", "number", "", "", "", "", "true", "center"), |
|
| 115 | + array("Description", "210", "description", "", "", "", "", "true", "center"), |
|
| 116 | + array("Amount($currency)", "190", "amount", "amount", "amount", "convert_to_currency", "", "true", "right"), |
|
| 117 | + array("Created Date", "250", "creation_date", "", "", "", "", "true", "center"), |
|
| 118 | + array("Used Date", "250", "firstused", "firstused", "firstused", "firstused_check", "", "true", "center"), |
|
| 119 | 119 | )); |
| 120 | 120 | return $grid_field_arr; |
| 121 | 121 | } |
@@ -40,7 +40,10 @@ |
||
| 40 | 40 | <select class="form-control" name="host_id" id="host_id"> |
| 41 | 41 | <?php |
| 42 | 42 | foreach($fs_data as $name) { ?> |
| 43 | - <option value="<?= $name['id'] ?>"<?php if(isset($host_id) && ($name['id'] == $host_id))echo 'selected';?>><?= $name['freeswitch_host'] ?></option> |
|
| 43 | + <option value="<?= $name['id'] ?>"<?php if(isset($host_id) && ($name['id'] == $host_id)) { |
|
| 44 | + echo 'selected'; |
|
| 45 | +} |
|
| 46 | +?>><?= $name['freeswitch_host'] ?></option> |
|
| 44 | 47 | <?php |
| 45 | 48 | } ?> |
| 46 | 49 | </select> |
@@ -39,8 +39,8 @@ |
||
| 39 | 39 | <div class="col-md-2"> |
| 40 | 40 | <select class="form-control" name="host_id" id="host_id"> |
| 41 | 41 | <?php |
| 42 | - foreach($fs_data as $name) { ?> |
|
| 43 | - <option value="<?= $name['id'] ?>"<?php if(isset($host_id) && ($name['id'] == $host_id))echo 'selected';?>><?= $name['freeswitch_host'] ?></option> |
|
| 42 | + foreach ($fs_data as $name) { ?> |
|
| 43 | + <option value="<?= $name['id'] ?>"<?php if (isset($host_id) && ($name['id'] == $host_id))echo 'selected'; ?>><?= $name['freeswitch_host'] ?></option> |
|
| 44 | 44 | <?php |
| 45 | 45 | } ?> |
| 46 | 46 | </select> |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | if ($xml == "") |
| 32 | 32 | xml_not_found(); |
| 33 | 33 | echo $xml; |
| 34 | -}else { |
|
| 34 | +} else { |
|
| 35 | 35 | xml_not_found(); |
| 36 | 36 | } |
| 37 | 37 | $logger->log("*************************** Directory Ends **********************************"); |
@@ -28,10 +28,11 @@ |
||
| 28 | 28 | |
| 29 | 29 | if (isset($_REQUEST['user']) && isset($_REQUEST['domain'])) { |
| 30 | 30 | $xml = load_directory($logger, $db); |
| 31 | - if ($xml == "") |
|
| 32 | - xml_not_found(); |
|
| 31 | + if ($xml == "") { |
|
| 32 | + xml_not_found(); |
|
| 33 | + } |
|
| 33 | 34 | echo $xml; |
| 34 | -}else { |
|
| 35 | +} else { |
|
| 35 | 36 | xml_not_found(); |
| 36 | 37 | } |
| 37 | 38 | $logger->log("*************************** Directory Ends **********************************"); |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | <div class="col-md-4 col-md-offset-4"> <span class="login_error"> |
| 39 | 39 | <?php if (isset($astpp_notification)){ ?> |
| 40 | 40 | Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active. |
| 41 | - <?php }else{ |
|
| 41 | + <?php } else{ |
|
| 42 | 42 | echo " "; |
| 43 | 43 | } ?> |
| 44 | 44 | </span></div> <br/> |
@@ -35,9 +35,9 @@ |
||
| 35 | 35 | <div class="row"> |
| 36 | 36 | |
| 37 | 37 | <div class="col-md-4 col-md-offset-4"> <span class="login_error"> |
| 38 | - <?php if (isset($astpp_notification)){ ?> |
|
| 38 | + <?php if (isset($astpp_notification)) { ?> |
|
| 39 | 39 | Login unsuccessful. Please make sure you entered the correct username and password, and that your account is active. |
| 40 | - <?php }else{ |
|
| 40 | + <?php } else { |
|
| 41 | 41 | echo " "; |
| 42 | 42 | } |
| 43 | 43 | $astpp_err_msg = $this->session->flashdata('astpp_signupmsg'); |
@@ -208,7 +208,7 @@ |
||
| 208 | 208 | <?php |
| 209 | 209 | if($account_data['logo'] != ''){ |
| 210 | 210 | $logo=$account_data['file']; |
| 211 | - }else{ |
|
| 211 | + } else{ |
|
| 212 | 212 | $logo=$account_data['logo']; |
| 213 | 213 | } |
| 214 | 214 | if($logo != ''){ |
@@ -198,13 +198,13 @@ |
||
| 198 | 198 | </div> |
| 199 | 199 | </div> |
| 200 | 200 | <?php |
| 201 | - if($account_data['logo'] != ''){ |
|
| 202 | - $logo=$account_data['file']; |
|
| 203 | - }else{ |
|
| 204 | - $logo=$account_data['logo']; |
|
| 201 | + if ($account_data['logo'] != '') { |
|
| 202 | + $logo = $account_data['file']; |
|
| 203 | + } else { |
|
| 204 | + $logo = $account_data['logo']; |
|
| 205 | 205 | } |
| 206 | - if($logo != ''){ |
|
| 207 | - $file_name= base_url()."upload/$logo"; |
|
| 206 | + if ($logo != '') { |
|
| 207 | + $file_name = base_url()."upload/$logo"; |
|
| 208 | 208 | ?> |
| 209 | 209 | |
| 210 | 210 | <div class='col-md-12 no-padding'> |
@@ -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 | |
| 26 | 27 | class Refill_coupon_form { |
| 27 | 28 | function __construct($library_name = '') { |
@@ -20,7 +20,7 @@ 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')) |
|
| 23 | +if ( ! defined('BASEPATH')) |
|
| 24 | 24 | exit('No direct script access allowed'); |
| 25 | 25 | |
| 26 | 26 | class Permission { |
@@ -30,31 +30,31 @@ discard block |
||
| 30 | 30 | $this->CI->load->library('session'); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - function get_module_access($user_type){ |
|
| 33 | + function get_module_access($user_type) { |
|
| 34 | 34 | $where = array("userlevelid"=>$user_type); |
| 35 | - $modules_arr = $this->CI->db_model->getSelect("module_permissions","userlevels",$where); |
|
| 36 | - if($modules_arr->num_rows > 0){ |
|
| 35 | + $modules_arr = $this->CI->db_model->getSelect("module_permissions", "userlevels", $where); |
|
| 36 | + if ($modules_arr->num_rows > 0) { |
|
| 37 | 37 | $modules_arr = $modules_arr->result_array(); |
| 38 | 38 | $modules_arr = $modules_arr[0]['module_permissions']; |
| 39 | 39 | |
| 40 | - $menu_arr = $this->CI->db_model->select("*","menu_modules","id IN ($modules_arr)","priority","asc","","",""); |
|
| 40 | + $menu_arr = $this->CI->db_model->select("*", "menu_modules", "id IN ($modules_arr)", "priority", "asc", "", "", ""); |
|
| 41 | 41 | $menu_list = array(); |
| 42 | 42 | $permited_modules = array(); |
| 43 | 43 | $modules_seq_arr = array(); |
| 44 | - $modules_seq_arr = explode(",",$modules_arr); |
|
| 45 | - $label_arr=array(); |
|
| 46 | - foreach($menu_arr->result_array() as $menu_key =>$menu_value){ |
|
| 47 | - if(!isset($label_arr[$menu_value['menu_label']]) && $menu_value['menu_label'] != 'Configuration'){ |
|
| 48 | - $label_arr[$menu_value['menu_label']]=$menu_value['menu_label']; |
|
| 49 | - $menu_value["menu_image"] = ($menu_value["menu_image"] == "")?"Home.png":$menu_value["menu_image"]; |
|
| 44 | + $modules_seq_arr = explode(",", $modules_arr); |
|
| 45 | + $label_arr = array(); |
|
| 46 | + foreach ($menu_arr->result_array() as $menu_key =>$menu_value) { |
|
| 47 | + if ( ! isset($label_arr[$menu_value['menu_label']]) && $menu_value['menu_label'] != 'Configuration') { |
|
| 48 | + $label_arr[$menu_value['menu_label']] = $menu_value['menu_label']; |
|
| 49 | + $menu_value["menu_image"] = ($menu_value["menu_image"] == "") ? "Home.png" : $menu_value["menu_image"]; |
|
| 50 | 50 | $menu_list[$menu_value["menu_title"]][$menu_value["menu_subtitle"]][] = array("menu_label" =>trim($menu_value["menu_label"]), |
| 51 | - "module_url"=>trim($menu_value["module_url"]),"module"=>trim($menu_value["module_name"]), |
|
| 51 | + "module_url"=>trim($menu_value["module_url"]), "module"=>trim($menu_value["module_name"]), |
|
| 52 | 52 | "menu_image"=>trim($menu_value["menu_image"])); |
| 53 | 53 | } |
| 54 | 54 | $permited_modules[] = trim($menu_value["module_name"]); |
| 55 | 55 | } |
| 56 | - $this->CI->session->set_userdata('permited_modules',serialize($permited_modules)); |
|
| 57 | - $this->CI->session->set_userdata('menuinfo',serialize($menu_list)); |
|
| 56 | + $this->CI->session->set_userdata('permited_modules', serialize($permited_modules)); |
|
| 57 | + $this->CI->session->set_userdata('menuinfo', serialize($menu_list)); |
|
| 58 | 58 | return true; |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -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 | |
| 26 | 27 | class Refill_coupon_form { |
| 27 | 28 | function __construct($library_name = '') { |
@@ -21,13 +21,13 @@ discard block |
||
| 21 | 21 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | 22 | ############################################################################### |
| 23 | 23 | |
| 24 | -if (!defined('BASEPATH')) |
|
| 24 | +if ( ! defined('BASEPATH')) |
|
| 25 | 25 | exit('No direct script access allowed'); |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * Dynamically build forms for display |
| 29 | 29 | */ |
| 30 | -class Locale{ |
|
| 30 | +class Locale { |
|
| 31 | 31 | |
| 32 | 32 | function __construct($library_name = '') { |
| 33 | 33 | |
@@ -38,23 +38,23 @@ discard block |
||
| 38 | 38 | $this->CI->load->driver('cache'); |
| 39 | 39 | $this->set_lang(); |
| 40 | 40 | } |
| 41 | - function set_lang($lang=FALSE){ |
|
| 41 | + function set_lang($lang = FALSE) { |
|
| 42 | 42 | |
| 43 | - $current_locale=$this->CI->session->userdata('user_language'); |
|
| 44 | - if(empty($current_locale)){ |
|
| 45 | - $current_locale= 'en_US'; |
|
| 43 | + $current_locale = $this->CI->session->userdata('user_language'); |
|
| 44 | + if (empty($current_locale)) { |
|
| 45 | + $current_locale = 'en_US'; |
|
| 46 | 46 | } |
| 47 | 47 | putenv("LANG=$current_locale"); |
| 48 | 48 | setlocale(LC_ALL, $current_locale.".UTF-8"); |
| 49 | - setlocale(LC_MESSAGES,$current_locale); |
|
| 49 | + setlocale(LC_MESSAGES, $current_locale); |
|
| 50 | 50 | setlocale(LC_TIME, $current_locale); |
| 51 | - setlocale(LC_CTYPE,$current_locale); |
|
| 52 | - $domain='messages'; |
|
| 53 | - $uri_segment=''; |
|
| 51 | + setlocale(LC_CTYPE, $current_locale); |
|
| 52 | + $domain = 'messages'; |
|
| 53 | + $uri_segment = ''; |
|
| 54 | 54 | $uri_segment = $this->CI->uri->segments; |
| 55 | - if(isset($uri_segment[1])){ |
|
| 55 | + if (isset($uri_segment[1])) { |
|
| 56 | 56 | $filename = getcwd().'/application/modules/user/language/'.$lang.'/LC_MESSAGES/messages.mo'; |
| 57 | - bindtextdomain(WEBSITE_DOMAIN,getcwd().'/application/modules/'.$uri_segment[1].'/language/'); |
|
| 57 | + bindtextdomain(WEBSITE_DOMAIN, getcwd().'/application/modules/'.$uri_segment[1].'/language/'); |
|
| 58 | 58 | } |
| 59 | 59 | bind_textdomain_codeset(WEBSITE_DOMAIN, 'UTF-8'); |
| 60 | 60 | textdomain(WEBSITE_DOMAIN); |
@@ -25,8 +25,9 @@ |
||
| 25 | 25 | function __construct() |
| 26 | 26 | { |
| 27 | 27 | parent::__construct(); |
| 28 | - if(!defined( 'CRON' ) ) |
|
| 29 | - exit(); |
|
| 28 | + if(!defined( 'CRON' ) ) { |
|
| 29 | + exit(); |
|
| 30 | + } |
|
| 30 | 31 | $this->load->model("db_model"); |
| 31 | 32 | $this->load->library("astpp/common"); |
| 32 | 33 | } |
@@ -25,21 +25,21 @@ |
||
| 25 | 25 | function __construct() |
| 26 | 26 | { |
| 27 | 27 | parent::__construct(); |
| 28 | - if(!defined( 'CRON' ) ) |
|
| 28 | + if ( ! defined('CRON')) |
|
| 29 | 29 | exit(); |
| 30 | 30 | $this->load->model("db_model"); |
| 31 | 31 | $this->load->library("astpp/email_lib"); |
| 32 | 32 | } |
| 33 | - function broadcast_email(){ |
|
| 33 | + function broadcast_email() { |
|
| 34 | 34 | |
| 35 | 35 | $where = array("status"=>"1"); |
| 36 | 36 | $query = $this->db_model->getSelect("*", "mail_details", $where); |
| 37 | - if($query->num_rows >0){ |
|
| 37 | + if ($query->num_rows > 0) { |
|
| 38 | 38 | $account_data = $query->result_array(); |
| 39 | - foreach($account_data as $data_key =>$account_value){ |
|
| 40 | - $account_value['history_id']=$account_value['id']; |
|
| 39 | + foreach ($account_data as $data_key =>$account_value) { |
|
| 40 | + $account_value['history_id'] = $account_value['id']; |
|
| 41 | 41 | unset($account_value['id']); |
| 42 | - $this->email_lib->send_email('',$account_value,'',$account_value['attachment'],1,0,1); |
|
| 42 | + $this->email_lib->send_email('', $account_value, '', $account_value['attachment'], 1, 0, 1); |
|
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | } |
@@ -25,8 +25,9 @@ |
||
| 25 | 25 | function __construct() |
| 26 | 26 | { |
| 27 | 27 | parent::__construct(); |
| 28 | - if(!defined( 'CRON' ) ) |
|
| 29 | - exit(); |
|
| 28 | + if(!defined( 'CRON' ) ) { |
|
| 29 | + exit(); |
|
| 30 | + } |
|
| 30 | 31 | $this->load->model("db_model"); |
| 31 | 32 | $this->load->library("astpp/common"); |
| 32 | 33 | } |
@@ -25,19 +25,19 @@ |
||
| 25 | 25 | function __construct() |
| 26 | 26 | { |
| 27 | 27 | parent::__construct(); |
| 28 | - if(!defined( 'CRON' ) ) |
|
| 28 | + if ( ! defined('CRON')) |
|
| 29 | 29 | exit(); |
| 30 | 30 | $this->load->model("db_model"); |
| 31 | 31 | $this->load->library("astpp/common"); |
| 32 | 32 | } |
| 33 | - function low_creditlimit(){ |
|
| 34 | - $where = array("posttoexternal"=>1,"deleted" => "0","status"=>"0"); |
|
| 33 | + function low_creditlimit() { |
|
| 34 | + $where = array("posttoexternal"=>1, "deleted" => "0", "status"=>"0"); |
|
| 35 | 35 | $query = $this->db_model->getSelect("*", "accounts", $where); |
| 36 | - if($query->num_rows >0){ |
|
| 36 | + if ($query->num_rows > 0) { |
|
| 37 | 37 | $account_data = $query->result_array(); |
| 38 | - foreach($account_data as $data_key =>$account_value){ |
|
| 39 | - if(($account_value["balance"]) >= $account_value["credit_limit"]){ |
|
| 40 | - $this->common->mail_to_users("email_low_balance",$account_value); |
|
| 38 | + foreach ($account_data as $data_key =>$account_value) { |
|
| 39 | + if (($account_value["balance"]) >= $account_value["credit_limit"]) { |
|
| 40 | + $this->common->mail_to_users("email_low_balance", $account_value); |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | } |