public function reuploadProfileImage()
 {
     $employeeID = $this->uri->segment(3);
     // check first if the directory exists
     if (!file_exists("uploads/profileimages/" . $employeeID)) {
         mkdir("uploads/profileimages/" . $employeeID, 0777);
     }
     if (!empty($_FILES)) {
         $cnt = count($_FILES['file']['name']);
         for ($i = 0; $i < $cnt; $i++) {
             $tempFile = $_FILES['file']['tmp_name'];
             $fileName = $_FILES['file']['name'];
             $targetPath = getcwd() . '\\uploads\\profileimages\\' . $employeeID . '\\';
             $targetFile = $targetPath . $fileName;
             move_uploaded_file($tempFile, $targetFile);
             $ext = new SplFileInfo('uploads/profileimages/' . $employeeID . '/' . $fileName);
             $newFilename = 'profileImage.' . $ext->getExtension();
             // rename the uploaded image to the newFilename
             rename($targetFile, 'uploads/profileimages/' . $employeeID . '/' . $newFilename);
         }
     }
     // Create a history record that an employee image profile has been added/replaced
     $HC = new HistoryCreator();
     $HC->logEmployeeHistory($this->session->userPayroll['users_id'], $employeeID, "UPDATE PROFILE IMAGE");
 }