Esempio n. 1
0
<?php

/*
	[Destoon B2B System] Copyright (c) 2008-2015 www.destoon.com
	This is NOT a freeware, use is subject to license.txt
*/
defined('DT_ADMIN') or exit('Access Denied');
$menus = array(array('添加任务', '?file=' . $file . '&action=add'), array('计划任务', '?file=' . $file));
$do = new cron();
switch ($action) {
    case 'add':
        if ($submit) {
            if ($do->pass($post)) {
                $do->add($post);
                dmsg('添加成功', $forward);
            } else {
                msg($do->errmsg);
            }
        } else {
            $type = $title = $name = $run = $hour = $mint = $status = $note = '';
            $minute = 30;
            include tpl('cron_edit');
        }
        break;
    case 'edit':
        $itemid or msg();
        $do->itemid = $itemid;
        $r = $do->get_one();
        $r or msg('任务不存在');
        !$r['type'] or msg('内置任务不可修改');
        if ($submit) {