protected function add() { $item = new ClassSoldierDriveLicense(); $item->id_drive_category = ClassTools::getValue('form_drive_category'); $item->date_start = ClassTools::getValue('form_date_start'); $item->date_end = ClassTools::getValue('form_date_end'); $item->id_soldier = ClassTools::getValue('id_soldier'); $item->id_user = ClassAuth::getCurrentUserId(); // komunikaty bledu if (!$item->add()) { $this->alerts['danger'] = $item->errors; return; } // komunikat sukcesu $this->alerts['success'] = "Poprawnie dodano nową kategorię jazdy."; // czyszczeie zmiennych wyswietlania $this->tpl_values = ''; $_POST = array(); return; }