Esempio n. 1
0
<?php

defined('DT_ADMIN') or exit('Access Denied');
require MD_ROOT . '/address.class.php';
$do = new address();
$menus = array(array('地址列表', '?moduleid=' . $moduleid . '&file=' . $file));
switch ($action) {
    case 'edit':
        $itemid or msg();
        $do->itemid = $itemid;
        if ($submit) {
            if ($do->pass($post)) {
                $do->edit($post);
                dmsg('修改成功', $forward);
            } else {
                msg($do->errmsg);
            }
        } else {
            extract($do->get_one());
            include tpl('address_edit', $module);
        }
        break;
    case 'delete':
        $itemid or msg('请选择地址');
        $do->delete($itemid);
        dmsg('删除成功', $forward);
        break;
    default:
        $sfields = array('按条件', '姓名', '地址', '邮编', '手机', '电话', '会员', '备注');
        $dfields = array('address', 'truename', 'address', 'postcode', 'mobile', 'telephone', 'username', 'note');
        isset($fields) && isset($dfields[$fields]) or $fields = 0;