%PDF- %PDF-
Direktori : /home/ugotscom/www/boniface/Admin/application/modules/performance/controllers/ |
Current File : /home/ugotscom/www/boniface/Admin/application/modules/performance/controllers/Performance.php |
<?php class Performance extends CI_Controller{ function __construct(){ parent::__construct(); if(isset($_SESSION['username'])){ }else{ redirect('login'); } $this->load->library('datatables'); //load library ignited-dataTable $this->load->model('performance_model'); //load model crud_model } function index(){ $x['category']=$this->performance_model->get_category(); $data['branches']=$this->performance_model->get_branches(); $data['branch']=0; $data['totalno']=$this->performance_model->totalno(); $data['month']=date('m'); $data['content']='performance_view'; $this->load->view('common/layout',$data); $this->load->view('performance_view',$x); } function get_product_json() { //get product data and encode to be JSON object header('Content-Type: application/json'); echo $this->performance_model->get_all_product(); } function save(){ //insert record method $this->performance_model->insert_product(); redirect('performance'); } function update(){ //update record method $this->performance_model->update_product(); redirect('performance'); } function delete(){ //delete record method $this->performance_model->delete_product(); redirect('performance'); } public function edit($id) { $data['customer'] = $this->performance_model->get_customer($id); $data['content'] = $this->load->view('edit',$data); $this->load->view('common/layout',$data); } public function employeeperformance() { $month=$this->input->post('month'); $branch=$this->input->post('branch_id'); $x['category']=$this->performance_model->get_category(); $data['totalno']=$this->performance_model->totalnoall($month,$branch); $data['branches']=$this->performance_model->get_branches(); $data['month']=$month; $data['branch']=$branch; $data['content']='performance_view'; $this->load->view('common/layout',$data); $this->load->view('performance_view',$x); } public function view() { $x['category']=$this->performance_model->get_category(); $data['branches']=$this->performance_model->get_branches(); $data['content']='performance_view'; $this->load->view('common/layout',$data); $this->load->view('view',$x); } public function totalnoallchart($month,$branch){ $result = $this->performance_model->totalnoall($month,$branch); echo json_encode($result); } public function closedno($month,$branch){ $result = $this->performance_model->closedno($month,$branch); echo json_encode($result); } public function del() { $data['content'] = $this->load->view('delete'); $this->load->view('common/layout',$data); } }