public function verwijderAction($id) { // find id of selected appointments $afspraak = Afspraak::find($id); // check if id exists if (!$afspraak) { echo "afspraak bestaat niet"; die; } // delete appointment from the table $result = $afspraak->delete(); $this->response->redirect('admin/overzicht'); if (!$result) { print_r($afspraak->getMessages()); } }
public function overzichtAction() { Tag::setTitle("Mijn afspraken"); // use session variable $user = $this->session->get('auth'); $rol = $user['rol']; $id = $user['id']; // display appointments where id equals session id from logged user $afspraak = Afspraak::find(["klant_id = '" . $id . "'\n "]); if ($rol != "user") { $this->response->redirect("account/index"); } $this->view->setVar('afspraak', $afspraak); }