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 save_edit() { $pageID = 3; Authen::AllowPage($pageID, $this->session->userdata('role')); $picture = ''; $ok = true; $config['upload_path'] = setting::$PATE_TRIANEE; $config['allowed_types'] = 'gif|jpg|png'; $config['max_size'] = '2048'; $config['max_width'] = '0'; $config['max_height'] = '0'; $config['encrypt_name'] = TRUE; $config['remove_spaces'] = TRUE; $this->load->library('upload', $config); if ($this->upload->do_upload('picture')) { $data = $this->upload->data(); $picture = $data['file_name']; } else { $picture = ''; } $this->load->model('register/user_m', 'user_m'); $this->user_m->context['picture'] = $picture; $this->user_m->context['adminID'] = $this->session->userdata('ID'); $ok = $this->user_m->editTrianee(); if ($ok) { //load template // $this->template->set_template('admin'); // $this->template->write('title', setting::$WINDOW_TITLE); // $this->template->write_view('content', 'register/user_index'); // $this->template->render(); redirect('/register/user'); exit; } else { echo 'error insert '; exit; } }
function admin_delete() { $pageID = 1; Authen::AllowPage($pageID, $this->session->userdata('role')); if (!$this->uri->segment(4)) { redirect('/register/admin/', 'refresh'); exit; } $id = $this->uri->segment(4); $this->load->model('register/admin_m', 'admin_m'); $this->admin_m->del_admin($id); redirect('/register/admin'); }
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); } } } } } } } }