/** Delete an event * @access public * @return void */ public function deleteAction() { if ($this->_request->isPost()) { $this->getFlash()->addMessage('No changes implemented.'); $id = (int) $this->_request->getPost('id'); $del = $this->_request->getPost('del'); if ($del == 'Yes' && $id > 0) { $where = 'ID = ' . $id; $this->_events->delete($where); $this->getFlash()->addMessage('Event information deleted! This cannot be undone.'); } $this->redirect('/admin/events/'); } else { $id = (int) $this->_request->getParam('id'); if ($id > 0) { $this->view->event = $this->_events->fetchRow('id =' . $id); } } }
if (isset($_SESSION['user'])) { $usr = new Users(); $usr = $usr->get($_SESSION['user']); if (!$usr) { header('HTTP/1.0 302 Found'); header("Location: index.php?map=login&page=index"); exit; } } if (!isset($_GET['id'])) { header('HTTP/1.0 302 Found'); header("Location: index.php?map=events&page=index"); exit; } $id = $_GET['id']; $events = new Events(); $event = $events->get($id); if (!$event) { header('HTTP/1.0 302 Found'); header("Location: index.php?map=events&page=index"); exit; } $events->delete($event['events_id']); ?> <script> $.notify("Evenement is succesvol verwijderd!", "success"); </script> <?php header('HTTP/1.0 302 Found'); header("Location: index.php?map=events&page=index"); exit;
if ($e->state != 'imported') { $to = $e->email; $subject = 'Unpublished event: "' . $e->title . '"'; $body = wordwrap($_POST['text']); $headers = "From: " . $options['general']['email']; mail($to, $subject, $body, $headers); } $e->state = "rejected"; $e->save(); $_SESSION['message'] = "Event rejected."; $f3->reroute("/admin"); }); $f3->route('POST /event/@id/delete', function ($f3) { admin_check(); readonly_check(); Events::delete(intval($f3->get('PARAMS.id'))); echo "Deleted"; }); /***********************/ /**** Posts in bulk ****/ /***********************/ $f3->route('POST /posts/purge', function ($f3) { admin_check(); readonly_check(); Feeds::purge(intval($_POST['months'])); $_SESSION['message'] = "Old posts purged."; $f3->reroute("/admin"); }); /***********************/ /**** Editing posts ****/ /***********************/