Exemplo n.º 1
0
<?php

defined('IN_DESTOON') or exit('Access Denied');
$TYPE = get_type('vote', 1);
require MD_ROOT . '/vote.class.php';
$do = new vote();
$menus = array(array('添加投票', '?moduleid=' . $moduleid . '&file=' . $file . '&action=add'), array('投票列表', '?moduleid=' . $moduleid . '&file=' . $file), array('更新地址', '?moduleid=' . $moduleid . '&file=' . $file . '&action=update'), array('生成投票', '?moduleid=' . $moduleid . '&file=' . $file . '&action=html'), array('投票分类', 'javascript:Dwidget(\'?file=type&item=' . $file . '\', \'投票分类\');'), array('模块设置', '?moduleid=' . $moduleid . '&file=setting#' . $file));
if ($_catids || $_areaids) {
    require DT_ROOT . '/admin/admin_check.inc.php';
}
switch ($action) {
    case 'add':
        if ($submit) {
            if ($do->pass($post)) {
                $do->add($post);
                dmsg('添加成功', $forward);
            } else {
                msg($do->errmsg);
            }
        } else {
            foreach ($do->fields as $v) {
                isset(${$v}) or ${$v} = '';
            }
            $vote_min = 1;
            $vote_max = 3;
            $addtime = timetodate($DT_TIME);
            $menuid = 0;
            include tpl('vote_edit', $module);
        }
        break;
    case 'edit':