private function getAuthen($selectResult) { $authen = new Authen(); while ($list = mysqli_fetch_assoc($selectResult)) { $authen->setAuthenId($list['athn_authen_status_id']); $authen->setAuthenName($list['athn_stat_name']); } // while return $authen; }
function index() { $pageID = 4; Authen::AllowPage($pageID, $this->session->userdata('role')); $this->load->model('register/course_m', 'course_m'); $this->course_m->context['filter'] = $_GET; $data = array(); if (!empty($_GET)) { if (!isset($_GET['course']) && trim($_GET['course']) == '' && !isset($_GET['month']) && trim($_GET['month']) == 0 && !isset($_GET['year']) && trim($_GET['year']) == 0 && !isset($_GET['ref1']) && trim($_GET['ref1']) == 0 && !isset($_GET['ref2']) && trim($_GET['ref2']) == 0) { $data['data'][] = array('course' => $this->course_m->getCourse(0), 'reg' => $this->course_m->getPaymentList(0), 'optional' => $this->course_m->getCourseOptionalsList(0), 'cntreg' => $this->course_m->getCountCourseRegister(0, 0), 'cntpaid' => $this->course_m->getCountCourseRegister(0, 1)); } else { $CourseList = $this->course_m->getCoursePayment(); if (!empty($CourseList)) { foreach ($CourseList as $row) { $data['data'][] = array('course' => $this->course_m->getCourse($row['courseID']), 'reg' => $this->course_m->getPaymentList($row['courseID']), 'optional' => $this->course_m->getCourseOptionalsList($row['courseID']), 'cntreg' => $this->course_m->getCountCourseRegister($row['courseID'], 0), 'cntpaid' => $this->course_m->getCountPaid($row['courseID'])); } } else { $data['data'][] = array('course' => $this->course_m->getCourse(0), 'reg' => $this->course_m->getPaymentList(0), 'optional' => $this->course_m->getCourseOptionalsList(0), 'cntreg' => $this->course_m->getCountCourseRegister(0, 0), 'cntpaid' => $this->course_m->getCountCourseRegister(0, 1)); } } } else { $data['data'][] = array('course' => $this->course_m->getCourse(0), 'reg' => $this->course_m->getPaymentList(0), 'optional' => $this->course_m->getCourseOptionalsList(0), 'cntreg' => $this->course_m->getCountCourseRegister(0, 0), 'cntpaid' => $this->course_m->getCountCourseRegister(0, 1)); } //print_r($data['data']); //exit; $data['course_list'] = $this->course_m->getCourseCode(); //load template $this->template->set_template('admin'); $this->template->write('title', setting::$WINDOW_TITLE); $this->template->write_view('content', 'register/payment_index', $data); $this->template->render(); }
function index() { $pageID = 6; Authen::AllowPage($pageID, $this->session->userdata('role')); $this->load->model('register/course_m', 'course_m'); //paging $limit = setting::$limit; $page = !$this->uri->segment(4) ? 1 : $this->uri->segment(4); $offset = (int) ($page * $limit - $limit); $courseID = 0; $this->course_m->context['limit'] = $limit; $this->course_m->context['page'] = $offset; $this->course_m->context['filter'] = $_GET; $qry = ''; if (!empty($_GET)) { if (!isset($_GET['course']) && trim($_GET['course']) == '' && !isset($_GET['month']) && trim($_GET['month']) == 0 && !isset($_GET['year']) && trim($_GET['year']) == 0) { $coursecode = ''; $this->course_m->context['courseID'] = $courseID; $res = $this->course_m->getCourseList(); } else { $coursecode = trim($_GET['course']); $this->course_m->context['coursecode'] = $coursecode; $this->course_m->context['month'] = $_GET['month']; $this->course_m->context['year'] = $_GET['year']; $arr = array('course' => $coursecode, 'month' => $_GET['month'], 'year' => $_GET['year']); $qry = '?' . http_build_query($arr); $res = $this->course_m->searchCourse(); } } else { $coursecode = ''; $this->course_m->context['courseID'] = $courseID; $res = $this->course_m->getCourseList(); } $total = $this->course_m->getCountCourseList(); $pages = util::paging($total, $limit, 'register/certificate/index/%s/' . $qry, 'Page', $page); $data = array(); $data['data'] = $res; $data['paging'] = $pages; $data['cntCourse'] = $total; $data['course_list'] = $this->course_m->getCourseCode(); //load template $this->template->set_template('admin'); $this->template->write('title', setting::$WINDOW_TITLE); $this->template->write_view('content', 'register/course_certificate', $data); $this->template->render(); }
function index() { $pageID = 7; Authen::AllowPage($pageID, $this->session->userdata('role')); //load template $this->load->model('register/mail_m', 'mail_m'); $this->load->model('register/course_m', 'course_m'); $res = $this->mail_m->getTemplate(); $data = array(); $data['course_list'] = $this->course_m->getAllCourses(); $data['template'] = $res; $this->template->set_template('admin'); $this->template->add_css('js/source/jquery.fancybox.css'); $this->template->add_js('js/lib/jquery.mousewheel-3.0.6.pack.js'); $this->template->add_js('js/source/jquery.fancybox.pack.js'); $this->template->add_js('js_validate/mail_index.js'); $this->template->write('title', setting::$WINDOW_TITLE); $this->template->write_view('content', 'register/mail_index', $data); $this->template->render(); }
function register() { $pageID = 8; Authen::AllowPage($pageID, $this->session->userdata('role')); $courseID = $this->input->post('courseid'); $this->load->model('register/course_m', 'course_m'); $this->load->model('register/report_m', 'report_m'); $courselist = $this->report_m->getActiveCourses(); $data['course_list'] = $courselist; if ($courseID !== false) { $this->report_m->context['courseID'] = $courseID; $course = $this->course_m->getCourseName($courseID); $res = $this->report_m->register(); $data['data'] = $res; $data['coursename'] = $course; $data['courseID'] = $courseID; } else { $data['data'] = false; } $this->load->view('register/report_register', $data); }
function member_doc() { Authen::memberAllow($this->session->userdata('isLogin')); $id = $this->session->userdata('traineeID'); $this->load->model('register/user_m', 'user_m'); $res = $this->user_m->get_user($id); if (count($res) !== 1) { redirect(setting::$BASE_URL); exit; } $mounth = date('m'); $this->load->model('register/course_m', 'course_m'); $course = $this->course_m->getRegisterCoursesByMonth($mounth); $list_course = $this->user_m->getCourseByUser($id, true); $data = array(); $data['course'] = $course; $data['list_course'] = $list_course; $this->template->set_template('member'); $this->template->write('title', setting::$WINDOW_TITLE); $this->template->write_view('content', 'member_doc', $data); $this->template->render(); }
function popup_reserve() { Authen::memberAllow($this->session->userdata('isLogin')); $id = $this->session->userdata('traineeID'); $this->load->model('register/user_m', 'user_m'); $res = $this->user_m->get_user_profile($id); $food = $this->user_m->getFoodType(); $data = array(); $data['data'] = $res[0]; $data['food'] = $food; $data['traineeID'] = $id; $data['courseID'] = $this->input->post('courseID'); $this->load->view('popup_reserve', $data); }
function logout() { $url = setting::$BASE_URL . '/register'; $auth = new Authen(); $auth->logout(); redirect($url); //header('location:'.$url); //exit; }
function applylist() { //authen $pageID = 2; Authen::AllowPage($pageID, $this->session->userdata('role')); $this->load->model('register/course_m', 'course_m'); $this->load->model('register/certificate_m', 'cert_m'); $type = $this->uri->segment(4); $id = $this->uri->segment(5); $cid = array('courseID' => $id); $res = $this->course_m->getCourse($id); $opt = $this->course_m->getCourseOptionalsList($id); $cntpaid = $this->course_m->getCountPaid($id); $change = $this->course_m->getChangeTraineeHistory($id); $reg = $this->course_m->getRegistrationList($id); $data = array(); $data['data'] = $res[0]; $data['optionallist'] = $opt; $data['countPaid'] = $cntpaid; $data['changelist'] = $change; $data['reglist'] = $reg; $data['course'] = $cid; $data['courseID'] = $id; if ($type == 'edit') { $this->template->set_template('admin'); $this->template->add_js('register/js/switchcontent.js'); $this->template->add_js('register/js/course_apply.js'); $this->template->write('title', setting::$WINDOW_TITLE); $this->template->write_view('content', 'register/pop_viewapply', $data); $this->template->render(); //$this->load->view('register/pop_viewapply', $data); } else { if ($type == 'show') { $this->template->set_template('admin'); $this->template->write('title', setting::$WINDOW_TITLE); $this->template->write_view('content', 'register/pop_print_name', $data); $this->template->render(); // $this->load->view('register/pop_print_name', $data); } else { if ($type == 'tag') { $this->cert_m->context['id'] = 2; $templateCert = $this->cert_m->getTemplateName(); $data['template_cert'] = $templateCert; $this->template->set_template('admin'); $this->template->write('title', setting::$WINDOW_TITLE); $this->template->write_view('content', 'register/pop_print_tag', $data); $this->template->render(); // $this->load->view('register/pop_print_tag', $data); } else { if ($type == 'certificate') { $this->cert_m->context['id'] = 1; $templateCert = $this->cert_m->getTemplateName(); $data['template_cert'] = $templateCert; $this->template->set_template('admin'); $this->template->write('title', setting::$WINDOW_TITLE); $this->template->write_view('content', 'register/pop_print_certificate', $data); $this->template->render(); //$this->load->view('register/pop_print_certificate', $data); } else { if ($type == 'namelist') { $this->load->view('register/pop_print_namelist', $data); } else { if ($type == 'certificatelist') { $this->load->view('register/pop_print_cerlist', $data); } else { if ($type == 'taglist') { $this->load->view('register/pop_print_taglist', $data); } } } } } } } }