Inheritance: extends CI_Controller
 /**
  * get all activ discount
  * @return array discount
  */
 public function getDiscount()
 {
     $locale = \MY_Controller::getCurrentLocale();
     $time = time();
     $sql = "select *, mod_shop_discounts.id as ids, mod_shop_discounts.id as id\n                from mod_shop_discounts\n                left join mod_shop_discounts_i18n on mod_shop_discounts_i18n.id = mod_shop_discounts.id and mod_shop_discounts_i18n.locale = '{$locale}'\n                where (max_apply > count_apply \n                        or max_apply is null \n                        or (max_apply is null and count_apply is null)\n                        or (count_apply is null and max_apply > 0))\n                      and \n                      (date_begin < '{$time}' and date_end > '{$time}' \n                          or date_begin < '{$time}' and date_end is Null \n                           or date_begin is Null and date_end is Null\n                           or date_begin < '{$time}' and date_end = '0'\n                           or date_begin is null and date_end = '0')\n                      and \n                       active = 1";
     return $this->db->query($sql)->result_array();
 }
Example #2
0
 function __construct()
 {
     parent::__construct();
     $this->load->model('queue_model');
     $this->load->library('rest');
     Requests::register_autoloader();
 }
Example #3
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('index_model', 'index_model', TRUE);
     $this->load->model('upload_model', 'upload_model', TRUE);
     $this->data['pelajaran_result'] = $this->index_model->get_pelajaran();
 }
Example #4
0
 public function __construct()
 {
     parent::__construct();
     $this->module = 'dashboard';
     $this->cname = 'dashboard';
     $this->load->model('mdl_grafik', 'mg');
 }
 function __construct()
 {
     parent::__construct();
     $this->no_cache();
     $this->load->model('user_modelsupllier');
     $this->load->library('session');
 }
Example #6
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('usuario_model');
     $this->load->model('paginador_model');
     $this->load->library('pagination');
 }
Example #7
0
 public function __construct()
 {
     parent::__construct();
     $log_details = new stdClass();
     stdlog($log_details);
     unset($log_details);
 }
Example #8
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model(array('MOrder', 'MCustomer', 'MWorkflow_log', 'MLocation'));
     $this->load->helper(array('money_helper'));
     $this->load->library(array('form_validation', 'filter_orders', 'order_split'));
 }
 /**
  * 
  */
 public function __construct()
 {
     parent::__construct();
     $this->load->model("usuario_model", "_usuario_model");
     $this->load->model("usuario2_model", "_usuario2_model");
     $this->load->model("usuario_region_model", "_usuario_region_model");
 }
Example #10
0
 public function __construct()
 {
     parent::__construct();
     $this->load->database();
     $this->load->helper('url');
     $this->load->library('session');
 }
Example #11
0
 function __construct()
 {
     parent::__construct();
     $this->session->set_userdata("link_id", "index");
     $this->session->set_userdata("linkSub", "visit_management");
     $this->session->set_userdata("linkTitle", "Visit Purpose Management");
 }
Example #12
0
 public function __construct()
 {
     parent::__construct();
     $admin_info = $this->session->userdata('admin_session');
     $params['admin_info'] = $admin_info;
     $this->load->vars($params);
 }
 function __construct()
 {
     parent::__construct();
     $this->load->model('penukaran_point_member_model');
     $this->load->model('setting_penukaran_point_model');
     $this->offset = isset($_POST['start']) ? $this->db->escape_str($this->input->post('start', TRUE)) : 0;
     $this->limit = isset($_POST['limit']) ? $this->db->escape_str($this->input->post('limit', TRUE)) : $this->config->item("length_records");
     $this->search = isset($_POST['query']) ? $this->db->escape_str($this->input->post('query', TRUE)) : '';
     $this->kdMember = isset($_POST['kd_member']) ? $this->db->escape_str($this->input->post('kd_member', TRUE)) : FALSE;
     $this->jumlahPointTukar = isset($_POST['jumlah_point_ditukar']) ? $this->db->escape_str($this->input->post('jumlah_point_ditukar', TRUE)) : FALSE;
     $this->pointMember = isset($_POST['point_member']) ? $this->db->escape_str($this->input->post('point_member', TRUE)) : FALSE;
     $this->tanggal = date('Y-m-d H:i:s');
     $this->keterangan = 'keterangan';
     $this->createdBy = $this->session->userdata('username');
     $this->createdDate = date('Y-m-d H:i:s');
     $this->updatedBy = $this->session->userdata('username');
     $this->updatedDate = date('Y-m-d H:i:s');
     $this->data = isset($_POST['data']) ? json_decode($this->input->post('data', TRUE)) : array();
     //generate no bukti
     $current_date = date('Ym');
     $no_ret = 'TP' . $current_date . '-';
     $sequence = $this->penukaran_point_member_model->get_kode_sequence($no_ret, 3);
     $this->noBukti = $no_ret . $sequence;
     //end of generate no bukti
 }
Example #14
0
 public function __construct()
 {
     parent::__construct();
     $this->load->model('house_model');
     $this->load->model('financials_model');
     $this->load->model('projects_model');
 }
Example #15
0
 public function __construct()
 {
     parent::__construct();
     $this->module = 'stok_bahan';
     $this->cname = $this->module . '/input';
     $this->load->model('mdl_input', 'mp');
 }
Example #16
0
 function __construct()
 {
     parent::__construct();
     $this->_check_permissions();
     $this->form_validation->set_error_delimiters('<p class="help-block">', '</p>');
     $this->data['folder_name'] = 'admin/gateways/';
 }
 function __construct()
 {
     parent::__construct();
     //session_start();
     $this->lang->load("title", "english");
     $this->load->helper('breadcrumb_helper');
 }
Example #18
0
 public function __construct()
 {
     parent::__construct();
     $this->load->helper("url");
     $this->load->helper('mail_helper');
     $this->load->model("mcontact");
 }
Example #19
0
 public function __construct()
 {
     parent::__construct();
     // logger
     $this->session->set_userdata(array('log_FILE' => __FILE__));
     $this->data['title'] = 'Request Product Managements';
 }
Example #20
0
 function __construct()
 {
     parent::__construct();
     $this->load->model('ProjectModel');
     $this->load->model('ProfileModel');
     //$this->load->model('LoggerModel');
 }
 public function __construct()
 {
     parent::__construct();
     $this->load->model('attendance_model');
     $this->load->helper('form');
     $this->load->library('validation');
 }
Example #22
0
 function __construct()
 {
     parent::__construct();
     $this->config->set_item('replacer', array('building' => null, 'tradesmen' => array('/tradesmen|Tradies')));
     $this->config->set_item('exclude', array('index', 'browse'));
     $this->config->set_item('exclude_segment', array());
 }
Example #23
0
 public function __construct()
 {
     parent::__construct();
     // logger
     $this->session->set_userdata(array('log_FILE' => __FILE__));
     $this->load->model('customer_m');
 }
 function __construct()
 {
     parent::__construct();
     $this->load->model('Applications_model');
     $this->load->library('User_Agent');
     $this->load->library('form_validation');
     $this->load->helper('common');
     $this->load->helper('pdf_helper');
     $this->load->helper('csv_helper');
     $this->load->config('messages');
     $this->data['welcome'] = $this;
     $this->allowedImageExt = array('gif', 'png', 'jpeg', 'jpg');
     //$this->load->library('User_Agent');//--regex class to get user agent --//
     //-- get browser http_user_agent info in array --//
     //   $this->result = get_browser(null, true);
     $this->result = User_Agent::getinfo();
     //--regex class to get user agent --//
     //---------------------//
     $this->load->library('session');
     $per = $this->check_per();
     if (!$per) {
         redirect(base_url() . 'layout/permission_error');
     }
     $s = $this->session->all_userdata();
     $this->user = $s[0]->username;
     $this->uid = $s[0]->id;
     $this->role_id = $s[0]->role_id;
 }
Example #25
0
 function __construct()
 {
     parent::__construct();
     // only login users can access Account controller
     $this->load->model('contents/video_model', 'video');
     $this->verify_auth();
 }
Example #26
0
 public function __construct()
 {
     parent::__construct();
     is_logged_in();
     $this->load->model('users_model');
     $this->load->model('common_model');
 }
Example #27
0
 public function __construct()
 {
     parent::__construct();
     // logger
     $this->session->set_userdata(array('log_FILE' => __FILE__));
     $this->data['title'] = 'Ready To Be Shipped';
 }
 function __construct()
 {
     parent::__construct();
     $access = FALSE;
     if ($this->client) {
         $this->view_data['invoice_access'] = FALSE;
         foreach ($this->view_data['menu'] as $key => $value) {
             if ($value->link == "cinvoices") {
                 $this->view_data['invoice_access'] = TRUE;
             }
             if ($value->link == "cprojects") {
                 $access = TRUE;
             }
         }
         if (!$access && !empty($this->view_data['menu'][0])) {
             redirect($this->view_data['menu'][0]->link);
         } elseif (empty($this->view_data['menu'][0])) {
             $this->view_data['error'] = "true";
             $this->session->set_flashdata('message', 'error: You have no access to any modules!');
             redirect('login');
         }
     } elseif ($this->user) {
         redirect('projects');
     } else {
         redirect('login');
     }
     $this->view_data['submenu'] = array($this->lang->line('application_my_projects') => 'cprojects');
     function submenu($id)
     {
         return array($this->lang->line('application_back') => 'cprojects', $this->lang->line('application_overview') => 'cprojects/view/' . $id, $this->lang->line('application_media') => 'cprojects/media/' . $id);
     }
 }
 function __construct()
 {
     parent::__construct(array('hod', 'est_ar', 'exam_dr', 'dt', 'dsw'));
     //to remove the circulars whose last date occurs
     $this->load->model('information/search_edit_circular_model', '', TRUE);
     $this->search_edit_circular_model->remove();
 }
 public function __construct()
 {
     parent::__construct();
     $this->name = 'entries';
     $this->model = 'Entry';
     $this->load->model($this->model);
 }