Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
load->library('session');
$this->load->model('Login_model');
if($this->session->userdata('type')){
if($this->session->userdata('type') == 'user'){
$this->session->set_flashdata('flash_data', 'You don\'t have access!');
redirect('Admin');
}
}else{
redirect('login');
}
$id= $this->session->userdata('id');
$pass = $this->session->userdata('uniqueNumber');
$countPass = $this->db->where('id',$id)->where('password',md5($pass))->count_all_results('personalDetails');
if($countPass>0){
redirect('ChangePassword');
}
}
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/
* @see https://codeigniter.com/userguide3/general/urls.html
*/
public function index(){
$this->load->view('includes/officerHeader');
$this->load->view('officer/officerDashboard');
$this->load->view('includes/officerFooter');
}
public function changePassword(){
$this->load->view('includes/officerHeader');
$this->load->view('officer/changePassword');
$this->load->view('includes/officerFooter');
}
public function personalDetails(){
$this->load->view('includes/officerHeader');
$this->load->view('officer/personalDetails');
$this->load->view('includes/officerFooter');
}
public function educationalDetails(){
$this->load->view('includes/officerHeader');
$this->load->view('officer/educationalDetails');
$this->load->view('includes/officerFooter');
}
public function miltaryCourses(){
$this->load->view('includes/officerHeader');
$this->load->view('officer/miltaryCourses');
$this->load->view('includes/officerFooter');
}
public function previeProfile(){
$this->load->view('includes/officerHeader');
$this->load->view('officer/previeProfile');
$this->load->view('includes/officerFooter');
}
public function employmentDetails(){
$this->load->view('includes/officerHeader');
$this->load->view('officer/employmentDetails');
$this->load->view('includes/officerFooter');
}
public function miltaryExam(){
$this->load->view('includes/officerHeader');
$this->load->view('officer/miltaryExam');
$this->load->view('includes/officerFooter');
}
public function promotionDetails(){
$this->load->view('includes/officerHeader');
$this->load->view('officer/promotionDetails');
$this->load->view('includes/officerFooter');
}
public function editPersonalDetails(){
$id = $this->session->userdata('id');
$data = array(
'firstName'=>$this->input->post('firstName'),
'middleName'=>$this->input->post('middleName'),
'lastName'=>$this->input->post('lastName'),
'gender'=>$this->input->post('gender'),
'phoneNumber'=>$this->input->post('mobileNumber'),
'nida'=>$this->input->post('nida'),
'email'=>$this->input->post('email'),
'dateOfBirth'=>$this->input->post('dateOfBirth'),
'currentRankId'=>$this->input->post('currentRankId'),
'uniqueNumber'=>$this->input->post('uniqueNumber'),
);
$this->db->where('id',$id)->update('personalDetails',$data);
//update initial rank
$data2 = array(
'rankId'=>$this->input->post('currentRankId'),
'rankLevel'=>$this->Login_model->getRankLevel($this->input->post('currentRankId')),
);
$this->db->where('userId',$id);
$this->db->where('rankId',$this->input->post('previousRank'));
$this->db->update('officerRanks',$data2);
redirect('officer/personalDetails?saved');
}
public function addEploymentDetails(){
$data = array(
'userId'=>$this->input->post('userId'),
'employeeId'=>$this->input->post('employeeId'),
'rank'=>$this->input->post('rank'),
'region'=>$this->input->post('region'),
'district'=>$this->input->post('district'),
'baseName'=>$this->input->post('baseName'),
'startDate'=>$this->input->post('startDate'),
'position'=>$this->input->post('position'),
'date'=>date('Y-m-d'),
);
$this->db->insert('employmentDetails',$data);
redirect('officer/employmentDetails?id='.base64_encode($this->input->post('userId')));
}
public function editEploymentDetails(){
$data = array(
'employeeId'=>$this->input->post('employeeId'),
'rank'=>$this->input->post('rank'),
'region'=>$this->input->post('region'),
'district'=>$this->input->post('district'),
'baseName'=>$this->input->post('baseName'),
'startDate'=>$this->input->post('startDate'),
'position'=>$this->input->post('position'),
);
$this->db->where('id',base64_decode($_REQUEST['id']))->update('employmentDetails',$data);
redirect('officer/employmentDetails?id='.base64_encode($this->input->post('userId')));
}
public function deleteEmploymentDetails(){
$this->db->where('id',base64_decode($_REQUEST['id']))->delete('employmentDetails');
redirect($_SERVER['HTTP_REFERER']);
}
public function addEducationDetails(){
$data = array(
'userId'=>$this->input->post('userId'),
'level'=>$this->input->post('level'),
'institution'=>$this->input->post('institution'),
'programme'=>$this->input->post('programme'),
'startDate'=>$this->input->post('startDate'),
'endDate'=>$this->input->post('endDate'),
'country'=>$this->input->post('country'),
'date'=>date('Y-m-d'),
);
$this->db->insert('education',$data);
redirect('officer/educationalDetails?id='.base64_encode($this->input->post('userId')));
}
public function editEducationDetails(){
$data = array(
'level'=>$this->input->post('level'),
'institution'=>$this->input->post('institution'),
'programme'=>$this->input->post('programme'),
'startDate'=>$this->input->post('startDate'),
'endDate'=>$this->input->post('endDate'),
'country'=>$this->input->post('country'),
);
$this->db->where('id',base64_decode($_REQUEST['id']))->update('education',$data);
redirect('officer/educationalDetails?id='.base64_encode($this->input->post('userId')));
}
public function deleteEducationDetails(){
$this->db->where('id',base64_decode($_REQUEST['id']))->delete('education');
redirect($_SERVER['HTTP_REFERER']);
}
public function addCourseDetails(){
$exp = explode('|',$this->input->post('courseId'));
$data = array(
'userId'=>$this->input->post('userId'),
'institution'=>$this->input->post('institution'),
'courseId'=>$exp[0],
'rankId'=>$exp[1],
'intakeNumber'=>$this->input->post('intakeNumber'),
'examScore'=>$this->input->post('examScore'),
'date'=>date('Y-m-d'),
);
$this->db->insert('coursesAttended',$data);
redirect('officer/miltaryCourses?id='.base64_encode($this->input->post('userId')));
}
public function editCourseDetails(){
$exp = explode('|',$this->input->post('courseId'));
$data = array(
'institution'=>$this->input->post('institution'),
'courseId'=>$exp[0],
'rankId'=>$exp[1],
'intakeNumber'=>$this->input->post('intakeNumber'),
'examScore'=>$this->input->post('examScore'),
);
$this->db->where('id',base64_decode($_REQUEST['id']))->update('coursesAttended',$data);
redirect('officer/miltaryCourses?id='.base64_encode($this->input->post('userId')));
}
public function deleteCourseDetails(){
$this->db->where('id',base64_decode($_REQUEST['id']))->delete('coursesAttended');
redirect($_SERVER['HTTP_REFERER']);
}
public function editExamDetails(){
$exp = explode('|',$this->input->post('examId'));
$data = array(
'examId'=>$exp[0],
'rankId'=>$exp[1],
'examNumber'=>$this->input->post('examNumber'),
'results'=>$this->input->post('results'),
);
$this->db->where('id',base64_decode($_REQUEST['id']))->update('officerExams',$data);
redirect('officer/miltaryExam?id='.base64_encode($this->input->post('userId')));
}
public function addExamDetails(){
$exp = explode('|',$this->input->post('examId'));
$data = array(
'userId'=>$this->input->post('userId'),
'examId'=>$exp[0],
'rankId'=>$exp[1],
'examNumber'=>$this->input->post('examNumber'),
'results'=>$this->input->post('results'),
'date'=>date('Y-m-d'),
);
$this->db->insert('officerExams',$data);
redirect('officer/miltaryExam?id='.base64_encode($this->input->post('userId')));
}
public function deleteExamDetails(){
$this->db->where('id',base64_decode($_REQUEST['id']))->delete('officerExams');
redirect($_SERVER['HTTP_REFERER']);
}
public function resetPassword(){
$currentPassword = md5($this->input->post('password'));
$newPassword1 = $this->input->post('password1');
$newPassword2 = $this->input->post('password2');
$id = $this->session->userdata('id');
foreach($this->db->where('id',$id)->get('personalDetails')->result() as $row){
$current = $row->password;
}
//echo $newPassword1.' = '.$newPassword2; exit;
if($currentPassword != $current ){
redirect('officer/changePassword?currentError');
}elseif($newPassword1 != $newPassword2 ){
redirect('officer/changePassword?newError');
}else{
$data=array(
'password' => md5($newPassword1),
'password1'=>$newPassword1,
);
$this->db->where('id',$id);
$this->db->update('personalDetails',$data);
redirect('officer/changePassword?success');
}
}
}