本文整理汇总了PHP中Schedule::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Schedule::delete方法的具体用法?PHP Schedule::delete怎么用?PHP Schedule::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schedule
的用法示例。
在下文中一共展示了Schedule::delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: schedule_controller
function schedule_controller()
{
global $session, $route, $mysqli, $user;
$result = false;
require "Modules/schedule/schedule_model.php";
$schedule = new Schedule($mysqli, $user->get_timezone($session['userid']));
if ($route->format == 'html') {
if ($route->action == "view" && $session['write']) {
$result = view("Modules/schedule/Views/schedule_view.php", array());
}
if ($route->action == 'api') {
$result = view("Modules/schedule/Views/schedule_api.php", array());
}
}
if ($route->format == 'json') {
if ($route->action == 'list') {
if ($session['userid'] > 0 && $session['userid'] && $session['read']) {
$result = $schedule->get_list($session['userid']);
}
} elseif ($route->action == "create") {
if ($session['userid'] > 0 && $session['write']) {
$result = $schedule->create($session['userid']);
}
} else {
$scheduleid = (int) get('id');
if ($schedule->exist($scheduleid)) {
$scheduleget = $schedule->get($scheduleid);
// if public or belongs to user
if ($session['read'] && ($scheduleget['public'] || $session['userid'] > 0 && $scheduleget['userid'] == $session['userid'])) {
if ($route->action == "get") {
$result = $scheduleget;
}
if ($route->action == "expression") {
$result = $schedule->get_expression($scheduleid);
}
if ($route->action == "test") {
$result = $schedule->test_expression($scheduleid);
}
}
// if public
if (isset($session['write']) && $session['write'] && $session['userid'] > 0 && $scheduleget['userid'] == $session['userid']) {
if ($route->action == "delete") {
$result = $schedule->delete($scheduleid);
}
if ($route->action == 'set') {
$result = $schedule->set_fields($scheduleid, get('fields'));
}
}
} else {
$result = array('success' => false, 'message' => 'Schedule does not exist');
}
}
}
return array('content' => $result);
}
示例2: header
case rectype_findone:
case rectype_always:
case rectype_daily:
case rectype_weekly:
break;
// Everything else gets ignored
// Everything else gets ignored
default:
$_POST['record'] = 0;
}
// Cancelling a schedule?
if ($_POST['record'] == 0) {
// Cancel this schedule
if ($schedule && $schedule->recordid) {
// Delete the schedule
$schedule->delete();
// Redirect back to the schedule list
add_warning(t('The requested recording schedule has been deleted.'));
save_session_errors();
header('Location: ' . root_url . 'tv/schedules');
exit;
}
} else {
// Set things as the user requested
$schedule->profile = $_POST['profile'];
$schedule->recgroup = $_POST['recgroup'];
$schedule->storagegroup = $_POST['storagegroup'];
$schedule->playgroup = $_POST['playgroup'];
$schedule->autoexpire = $_POST['autoexpire'] ? 1 : 0;
$schedule->autocommflag = $_POST['autocommflag'] ? 1 : 0;
$schedule->autouserjob1 = $_POST['autouserjob1'] ? 1 : 0;
示例3: isset
try {
$tutors = TutorFetcher::retrieveActive();
$currentTerms = TermFetcher::retrieveCurrTerm();
$schedules = ScheduleFetcher::retrieveTutorsOnCurrentTerms();
if (isUrlRequestingAllSchedules($user)) {
$pageTitle = "All Schedules";
} else {
if (isBtnAddSchedulePrsd()) {
$pageTitle = "Add schedule";
$days = isset($_POST['day']) ? $_POST['day'] : null;
Schedule::add($_POST['tutorId'], $_POST['termId'], $days, $_POST['startsAt'], $_POST['endsAt']);
header('Location: ' . BASE_URL . 'staff/schedules/success');
exit;
} else {
if (isBtnDeletePrsd()) {
Schedule::delete($_POST['delScheduleIdModal']);
header('Location: ' . BASE_URL . 'staff/schedules/success');
exit;
} else {
if (isModificationSuccessful()) {
$pageTitle = "Schedule added - Success";
} else {
header('Location: ' . BASE_URL . 'error-404');
exit;
}
}
}
}
} catch (Exception $e) {
$errors[] = $e->getMessage();
}
示例4: Schedule
function schedules_delete($id = '', $page = '')
{
$s = new Schedule();
$s->get_by_id($id);
$s->delete();
Session::flash('msg', 'Schedule deleted!');
return Redirect::to('attendance/schedules/' . $page, 'refresh');
}