Example #1
0
        if (!empty($menu)) {
            $menu['data'] = iunserializer(base64_decode($menu['data']));
            if (!empty($menu['data'])) {
                if (!empty($menu['data']['matchrule']['province'])) {
                    $menu['data']['matchrule']['province'] .= '省';
                }
                if (!empty($menu['data']['matchrule']['city'])) {
                    $menu['data']['matchrule']['city'] .= '市';
                }
                $params = $menu['data'];
                $params['title'] = $menu['title'];
                $params['type'] = $menu['type'];
            }
        }
    }
    $groups = mc_fans_groups();
    if (empty($groups)) {
        message($groups['message'], '', 'error');
    }
    template('platform/menu');
}
if ($do == 'remove') {
    $id = intval($_GPC['id']);
    $data = pdo_get('uni_account_menus', array('uniacid' => $_W['uniacid'], 'id' => $id));
    if (empty($data)) {
        message('菜单不存在或已经删除', referer(), 'error');
    }
    if ($data['type'] != 2) {
        $account = WeAccount::create($_W['acid']);
        $ret = $account->menuDelete($data['menuid']);
        if (is_error($ret)) {
Example #2
0
<?php

/**
 * [Weizan System] Copyright (c) 2014 012WZ.COM
 * Weizan is NOT a free software, it under the license terms, visited http://www.012wz.com/ for more details.
 */
defined('IN_IA') or exit('Access Denied');
uni_user_permission_check('mc_fangroup');
load()->model('mc');
$dos = array('post', 'display', 'del');
$do = !empty($_GPC['do']) && in_array($do, $dos) ? $do : 'display';
if ($do == 'display') {
    $groups = mc_fans_groups(true);
    if (empty($groups)) {
        message($groups['message'], '', 'error');
    }
}
if ($do == 'post') {
    $account = WeAccount::create($_W['acid']);
    if (!empty($_GPC['groupname'])) {
        foreach ($_GPC['groupname'] as $key => $value) {
            if (empty($value)) {
                continue;
            } else {
                $data = array('id' => $_GPC['groupid'][$key], 'name' => $value);
                $state = $account->editFansGroupname($data);
                if (is_error($state)) {
                    message($state['message'], url('mc/fangroup/'), 'error');
                }
            }
        }