%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<?php defined('BASEPATH') OR exit('No direct script access allowed'); Class Manageusers extends CI_Controller { function __construct(){ parent::__construct(); $this->load->model(array('ManageUsers_Model','Common_Model')); if(! $this->session->userdata('adid')) redirect('admin/login'); } public function index(){ $data = array(); $header = array(); $data['roleArray'] = $this->Common_Model->getCommonIdArray('tbl_role_master'); $data['userdetails'] = $recordsArray = $this->Common_Model->getCommonQuery('tbl_admin'); $data['departmentArray'] = $this->Common_Model->getCommonIdArray('tbl_departments','*',array('status'=>'1')); $this->load->view('admin/_parts/header',$data); $this->load->view('admin/manageusers/index',$data); $this->load->view('admin/_parts/footer'); setHistory('Go to manage users'); } /* * Function : getuserdetails * For particular Record */ public function getuserdetails($uid = '') { $data['departmentDetails'] = $this->Common_Model->getCommonQuery('tbl_departments','*',array('status'=>'1')); if($_POST){ $this->form_validation->set_rules('first_name','First Name','required'); $this->form_validation->set_rules('username','User Name','required'); $this->form_validation->set_rules('email_id','Email Id','required'); $this->form_validation->set_rules('employee_id','Employee Id','required'); $this->form_validation->set_rules('contact_number','Contact Number','required'); if(empty($this->input->post('id'))){ $this->form_validation->set_rules('password','Password','required'); } $this->form_validation->set_rules('status','Status','required'); if($this->form_validation->run()) { $first_name = $this->input->post('first_name'); $last_name = $this->input->post('last_name'); $username = $this->input->post('username'); $email_id = $this->input->post('email_id'); $employee_id = $this->input->post('employee_id'); if(!empty($this->input->post('password'))){ $password = $this->input->post('password'); } $user_type = $this->input->post('user_type'); $contact_number = $this->input->post('contact_number'); $status = $this->input->post('status'); $department_id = $this->input->post('department_id'); $role_id = implode(',',$this->input->post('role_id')); $data=array( 'first_name'=>$first_name, 'last_name'=>$last_name, 'department_id'=>$department_id, 'userName'=>$username, 'email_id'=>$email_id, 'employee_id'=>$employee_id, 'role_id'=>$role_id, 'user_type'=>$user_type, 'contact_number'=>$contact_number, 'status'=>$status, 'is_deleted'=>'0', 'createdon'=>date('y-m-d H:i:s') ); if(!empty($this->input->post('password'))){ $data['password'] = $password; } if($this->input->post('id')){ $id = $this->input->post('id'); $this->Common_Model->updateinfo($tbl_name='tbl_admin',$data,'id',$id); setHistory('User info updated successfully'); } else { $this->Common_Model->saveinfo($tbl_name='tbl_admin',$data); setHistory('User info added successfully'); } redirect('admin/manageusers'); } else { $this->load->view('admin/manageusers/addrecord'); } } else { $data['roleArray'] = $this->Common_Model->getCommonIdArray('tbl_role_master'); $data['sd'] = $sd = $this->Common_Model->getSingleRecord('tbl_admin',' * ', array('id'=>$uid)); $this->load->view('admin/_parts/header',$data); $this->load->view('admin/manageusers/addrecord',$data); $this->load->view('admin/_parts/footer'); setHistory('Go to Add/Edit user info'); } } public function deleteuser($uid) { $this->Common_Model->deleterecords('tbl_admin',$uid); $this->session->set_flashdata('success', 'User data deleted'); setHistory('User data deleted'); redirect('admin/manageusers'); } public function getajaxrecord() { $school_id = $_POST['school_id']; if($school_id>0) { $data_records = $this->Common_Model->getCommonIdArray('tbl_departments','id,department_name',array('school_id'=>$school_id)); $response = array(); foreach($data_records as $row) { $response[$row['id']] = $row['department_name']; } $response['21'] = 'Others'; header('Content-type: application/json'); echo json_encode($response); } exit; } } ?>