本文整理汇总了PHP中quiz::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP quiz::delete方法的具体用法?PHP quiz::delete怎么用?PHP quiz::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quiz
的用法示例。
在下文中一共展示了quiz::delete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: json_encode
<?php
// +----------------------------------------------------------------------
// | Demila [ Beautiful Digital Content Trading System ]
// +----------------------------------------------------------------------
// | Copyright (c) 2015 http://demila.org All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Email author@demila.org
// +----------------------------------------------------------------------
define('USING_LANGUAGE', false);
require_once '../../../config.php';
require_once $config['root_path'] . '/core/functions.php';
include_once $config['system_core'] . "/initEngine.php";
admin_login();
if (isset($_POST['delete']) && isset($_POST['id']) && isset($_SESSION['user']['access']['quiz'])) {
require_once ROOT_PATH . "/apps/quiz/models/quiz.class.php";
$cms = new quiz();
$cms->delete(intval($_POST['id']));
die(json_encode(array_merge($_POST, array('status' => 'true'))));
} elseif (isset($_POST['deleteAnswer']) && isset($_POST['id']) && isset($_SESSION['user']['access']['quiz'])) {
require_once ROOT_PATH . "/apps/quiz/models/answers.class.php";
$cms = new answers();
$cms->delete(intval($_POST['id']));
die(json_encode(array_merge($_POST, array('status' => 'true'))));
}
echo json_encode(array_merge($_POST, array('status' => 'unknown error')));
die;