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


PHP Schedule::delete方法代码示例

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

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

示例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();
}
开发者ID:sass-team,项目名称:sass-app,代码行数:31,代码来源:schedules.php

示例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');
 }
开发者ID:billyriantono,项目名称:ihrmis,代码行数:8,代码来源:attendance.php


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