Overview

Packages

  • controller
  • models
  • None

Classes

  • Ajax
  • Article
  • Cache
  • Employee
  • Firefly
  • gmreader
  • gmsite
  • Home
  • Link
  • Merchant
  • Model_article
  • Model_cache
  • Model_employee
  • Model_firefly
  • Model_gmreader
  • Model_gmsite
  • Model_link
  • Model_merchant
  • Model_reference
  • Model_user
  • Reference
  • Setting
  • User

Functions

  • check_permission
  • data_status
  • data_status_select
  • dump_html_tree
  • employee_select
  • file_get_html
  • generate_page
  • gerenate_pager_from_table
  • get_desc_asc
  • get_url_support
  • is_admin
  • is_loggedin
  • link_extractor
  • merchant_status
  • reference_reverter
  • role_select
  • siteinfo
  • str_get_html
  • yes_no
  • yesno_select
  • Overview
  • Package
  • Class
  1: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2: 
  3: /**
  4:  * The Employee class is the controller used for managing employees, accounts and settings.
  5:  *
  6:  * @package   controller
  7:  * @version   0.01
  8:  * @since     2014-04-03
  9:  * @author    Rizwan Ali <riz@bitspro.com>
 10:  */
 11: class Employee extends CI_Controller {
 12: 
 13:     /**
 14:      * Dashboard for every type of user
 15:      *
 16:      * @return view
 17:      *
 18:      * @since   2014-04-03
 19:      * @author  Rizwan Ali <riz@bitspro.com>
 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:      * Lists all the employee currently working in backend
 32:      *
 33:      * @return view
 34:      *
 35:      * @since   2014-04-03
 36:      * @author  Rizwan Ali <riz@bitspro.com>
 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:      * Allow admin to update employee details and also assign them different articles
 48:      *
 49:      * @param $enc_id
 50:      *
 51:      * @return view
 52:      *
 53:      * @since   2014-04-03
 54:      * @author  Rizwan Ali <riz@bitspro.com>
 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:      * Logout the current user
 69:      *
 70:      *
 71:      * @return redirect
 72:      *
 73:      * @since   2014-04-03
 74:      * @author  Rizwan Ali <riz@bitspro.com>
 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:      * Adds a new employee to system and also assign them different articles
 88:      *
 89:      *
 90:      * @return view
 91:      *
 92:      * @since   2014-04-03
 93:      * @author  Rizwan Ali <riz@bitspro.com>
 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: }
API documentation generated by ApiGen