*/ if ($cancel) { $action = ''; $fk_projet = ''; $date_start = ''; $date_end = ''; $date = ''; $comments = ''; $vatrate = ''; $value_unit = ''; $qty = 1; $fk_c_type_fees = -1; } if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $id > 0 && $user->rights->expensereport->supprimer) { $object = new ExpenseReport($db); $result = $object->delete($id, $user); if ($result >= 0) { header("Location: index.php"); exit; } else { setEventMessages($object->error, $object->errors, 'errors'); } } if ($action == 'add' && $user->rights->expensereport->creer) { $object = new ExpenseReport($db); $object->date_debut = $date_start; $object->date_fin = $date_end; $object->fk_statut = 1; $object->fk_c_paiement = GETPOST('fk_c_paiement', 'int'); $object->fk_user_validator = GETPOST('fk_user_validator', 'int'); $object->note_public = GETPOST('note_public');