1: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2:
3: 4: 5: 6: 7: 8: 9: 10:
11: class Employee extends CI_Controller {
12:
13: 14: 15: 16: 17: 18: 19: 20:
21: public function index()
22: {
23: $this->load->model('Model_article');
24: $dashVars = $this->db->query('SELECT (SELECT count(data_id) FROM xenon_data) as dCount, (SELECT count(refe_id) FROM xenon_reference) as rCount, (SELECT count(*) FROM xenon_index) as iCount, (SELECT count(*) FROM xenon_licence) as uCount, (SELECT count(*) FROM xenon_merchant) as mCount')->row();
25: $this->load->view('head');
26: $this->load->view('employee/dashboard',array('dashVars'=>$dashVars));
27: $this->load->view('foot');
28: }
29:
30: 31: 32: 33: 34: 35: 36: 37:
38: public function show(){
39: is_admin(true);
40: $this->load->model('Model_employee');
41: $this->load->view('head');
42: $this->load->view('employee/list');
43: $this->load->view('foot');
44: }
45:
46: 47: 48: 49: 50: 51: 52: 53: 54: 55:
56: public function edit($enc_id){
57: is_admin(true);
58: $this->load->model('Model_employee');
59: $this->load->model('Model_article');
60: $this->Model_employee->edit_selected_articles(base64_decode(urldecode($enc_id)));
61: $this->Model_employee->update_employee(base64_decode(urldecode($enc_id)));
62: $this->load->view('head');
63: $this->load->view('employee/edit',array('employee'=>$this->Model_employee->pick($enc_id)));
64: $this->load->view('foot');
65: }
66:
67: 68: 69: 70: 71: 72: 73: 74: 75:
76: public function logout(){
77: $this->session->unset_userdata('empl_id');
78: $this->session->unset_userdata('empl_dname');
79: $this->session->unset_userdata('empl_email');
80: $this->session->unset_userdata('empl_perm');
81: $this->session->unset_userdata('role_assigned');
82: $this->session->unset_userdata('role_perm');
83: redirect('home');
84: }
85:
86: 87: 88: 89: 90: 91: 92: 93: 94:
95: public function add(){
96: is_admin(true);
97: $this->load->model('Model_employee');
98: $this->load->model('Model_article');
99: $this->Model_employee->add_selected_articles();
100: $head = $this->Model_employee->add_employee();
101: $this->load->view('head',$head);
102: $this->load->view('employee/add');
103: $this->load->view('foot');
104: }
105: }