load->model( $models ); $this->load->library( $libraries ); } public function getEmployeehours( $month, $year ) { $employeehours = Employeehour::getEmployeehours( $month, $year ); $this->json( $employeehours ); } public function getHourtypes() { $hourtypes = Hourtype::all(); $this->json( $hourtypes ); } public function saveEmployeehour() { //TODO: validatie inbouwen $data = $this->input->post(); $employeehourID = $data['id']; unset( $data['id'] ); $data['hourdate'] = date2mysql( $data['hourdate'] ); $employeehourID = Employeehour::saveEmployeehour( $employeehourID, $data ); $this->json( ['employeehourID' => $employeehourID] ); } public function removeEmployeehour( $employeehourID ) { //TODO:check op delete Employeehour::whereId( $employeehourID )->delete(); $this->json( ['result' => TRUE] ); } }