Diversen nav opmerkingen
This commit is contained in:
@@ -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] );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user