Diversen nav opmerkingen

This commit is contained in:
2018-05-03 19:54:32 +02:00
parent 6bc0b37f06
commit 860c5db95a
18 changed files with 405 additions and 143 deletions
@@ -5,8 +5,8 @@
* Date: 21/04/2018
* Time: 20:08
*/
//include_once('../application/models/eloquent/Employeetarget.php');
//include_once('../application/models/eloquent/Employeetarget.php');
class EmployeeTargetController extends MY_Controller {
@@ -30,5 +30,26 @@ class EmployeeTargetController extends MY_Controller {
$this->json( $employeeTargets );
}
public function saveEmployeeTarget()
{
$employeeTargetValidation = new EmployeeTargetValidation();
if ( ! $employeeTargetValidation->getValidationResult() )
return $this->json( [
'success' => FALSE, 'messages' => $employeeTargetValidation->getErrorMessages()] );
$target = $this->input->post();
$targetID = $target['id'];
unset( $target['id'] );
$target['endmonth'] = $target['endmonth'] ? $target['endmonth'] : NULL;
$target['endyear'] = $target['endyear'] ? $target['endyear'] : NULL;
$targetID = Employeetarget::saveTarget( $targetID, $target );
$this->json( ['success' => TRUE, 'targetID' => $targetID] );
}
}