function redemption($status_id = NULL, $sub_category = NULL, $merchant = NULL) { if (!check_correct_login_type($this->main_group_id)) { redirect('/', 'refresh'); } $user_id = $this->ion_auth->user()->row()->id; if (isset($_POST) && !empty($_POST)) { if ($this->input->post('button_action') == "search_by_subcategory") { $sub_category = $this->input->post('sub_category'); $merchant = $this->input->post('merchant'); $redeem_search_month = $this->input->post('redeem_the_month'); $expire_search_month = $this->input->post('expire_the_month'); } } $redeem_month_list = limited_month_select(5, 1, '0', 'All Redemption Month'); $this->data['redeem_month_list'] = $redeem_month_list; $this->data['redeem_the_month'] = array('name' => 'redeem_the_month', 'id' => 'redeem_the_month'); $redeem_selected_month = empty($redeem_search_month) ? NULL : $redeem_search_month; $this->data['redeem_the_month_selected'] = $redeem_selected_month; $expire_month_list = limited_month_select(5, 1, '0', 'All Expire Month', 3); $this->data['expire_month_list'] = $expire_month_list; $this->data['expire_the_month'] = array('name' => 'expire_the_month', 'id' => 'expire_the_month'); $expire_selected_month = empty($expire_search_month) ? NULL : $expire_search_month; $this->data['expire_the_month_selected'] = $expire_selected_month; $this->data['redemption'] = $this->m_user->user_redemption($user_id, $status_id, $sub_category, $merchant, $redeem_selected_month, $expire_selected_month); if ($status_id != NULL) { $this->data['title'] = "Redemption : " . $this->m_custom->display_static_option($status_id); } else { $this->data['title'] = "Redemption"; } $sub_category_list = $this->m_user->user_redemption_sub_category_list($user_id, $status_id); $this->data['sub_category_list'] = $sub_category_list; $this->data['sub_category'] = array('name' => 'sub_category', 'id' => 'sub_category'); $this->data['sub_category_selected'] = empty($sub_category) ? "" : $sub_category; $merchant_list = $this->m_user->user_redemption_merchant_list($user_id, $status_id); $this->data['merchant_list'] = $merchant_list; $this->data['merchant'] = array('name' => 'merchant', 'id' => 'merchant'); $this->data['merchant_selected'] = empty($merchant) ? "" : $merchant; $this->data['voucher_active_count'] = 'Active Voucher (' . count($this->m_user->user_redemption($user_id, $this->config->item('voucher_active'), $sub_category, $merchant, $redeem_selected_month, $expire_selected_month)) . ')'; $this->data['voucher_used_count'] = 'Used Voucher (' . count($this->m_user->user_redemption($user_id, $this->config->item('voucher_used'), $sub_category, $merchant, $redeem_selected_month, $expire_selected_month)) . ')'; $this->data['voucher_expired_count'] = 'Expired Voucher (' . count($this->m_user->user_redemption($user_id, $this->config->item('voucher_expired'), $sub_category, $merchant, $redeem_selected_month, $expire_selected_month)) . ')'; $this->data['candie_url'] = base_url() . "user/candie_page"; $this->data['voucher_active_url'] = base_url() . "user/redemption/" . $this->config->item('voucher_active'); $this->data['voucher_used_url'] = base_url() . "user/redemption/" . $this->config->item('voucher_used'); $this->data['voucher_expired_url'] = base_url() . "user/redemption/" . $this->config->item('voucher_expired'); $this->data['message'] = $this->session->flashdata('message'); $this->data['page_path_name'] = 'user/redemption'; $this->load->view('template/index', $this->data); }
function payment_page() { if (check_correct_login_type($this->main_group_id)) { if (isset($_POST) && !empty($_POST)) { if ($this->input->post('button_action') == "search_history") { $search_month = $this->input->post('the_month'); } } $month_list = limited_month_select(5, 1); $this->data['month_list'] = $month_list; $this->data['the_month'] = array('name' => 'the_month', 'id' => 'the_month'); $selected_month = empty($search_month) ? date_for_db_search() : $search_month; $this->data['the_month_selected'] = $selected_month; $selected_month_text = $this->m_custom->explode_year_month($selected_month); $this->data['the_month_selected_text'] = $selected_month_text['month_year_text']; $month_last_date = $selected_month_text['month_last_date']; $this->data['previous_month_selected_text'] = $this->m_custom->explode_year_month(month_previous($month_last_date, 1)); $merchant_id = $this->ion_auth->user()->row()->id; $this->m_merchant->merchant_balance_update($merchant_id); $this->data['previous_end_month_balance'] = $this->m_merchant->merchant_check_balance($merchant_id, 1, month_previous($month_last_date)); $this->data['end_month_balance'] = $this->m_merchant->merchant_check_balance($merchant_id, 1, $month_last_date); $this->data['current_balance'] = $this->m_merchant->merchant_check_balance($merchant_id, 0, $month_last_date); $this->data['this_month_transaction'] = $this->m_merchant->merchant_this_month_transaction($merchant_id, $selected_month); $this->data['message'] = $this->session->flashdata('message'); $this->data['page_path_name'] = 'merchant/payment'; $this->load->view('template/index', $this->data); } else { redirect('/', 'refresh'); } }