当前位置: 首页>>代码示例>>PHP>>正文


PHP Events::delete方法代码示例

本文整理汇总了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);
         }
     }
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:23,代码来源:EventsController.php

示例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;
开发者ID:MHakvoort,项目名称:origin,代码行数:31,代码来源:delete.php

示例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 ****/
/***********************/
开发者ID:jelek92,项目名称:echo,代码行数:31,代码来源:index.php


注:本文中的Events::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。