本文整理汇总了PHP中Events::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Events::delete方法的具体用法?PHP Events::delete怎么用?PHP Events::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Events
的用法示例。
在下文中一共展示了Events::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteAction
/** 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);
}
}
}
示例2: Users
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;
示例3: wordwrap
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 ****/
/***********************/