Ejemplo n.º 1
0
    get_token();
    $smarty->assign('navlabel', "set_menu");
    $smarty->assign('parent_manu', get_parent_menu());
    $smarty->display('weixin/admin_weixin_menu_add.htm');
} elseif ($act == 'add_menu_save') {
    check_token();
    $setsqlarr['parentid'] = intval($_POST['parentid']);
    $setsqlarr['title'] = trim($_POST['title']);
    $setsqlarr['key'] = trim($_POST['key']);
    $setsqlarr['type'] = trim($_POST['type']);
    $setsqlarr['url'] = trim($_POST['url']);
    $setsqlarr['status'] = intval($_POST['status']);
    $setsqlarr['menu_order'] = intval($_POST['menu_order']);
    !inserttable(table('weixin_menu'), $setsqlarr) ? adminmsg("保存失败!", 0) : "";
    $link[0]['text'] = "返回列表";
    $link[0]['href'] = '?act=set_menu';
    adminmsg("添加成功!", 2, $link);
} elseif ($act == 'binding_list') {
    get_token();
    $smarty->assign('navlabel', "binding_list");
    $smarty->assign('userlist', get_binding_list());
    $smarty->display('weixin/admin_binding_list.htm');
} elseif ($act == 'del_binding') {
    check_token();
    $uid = $_REQUEST['uid'];
    if ($num = del_binding($uid)) {
        adminmsg("解绑成功!共解绑" . $num . "个会员", 2);
    } else {
        adminmsg("解绑失败!", 1);
    }
}
Ejemplo n.º 2
0
    $setsqlarr['menu_order'] = intval($_POST['menu_order']);
    !$db->inserttable(table('weixin_menu'), $setsqlarr) ? adminmsg("保存失败!", 0) : "";
    $link[0]['text'] = "返回列表";
    $link[0]['href'] = '?act=set_menu';
    write_log("添加微信菜单", $_SESSION['admin_name'], 3);
    adminmsg("添加成功!", 2, $link);
} elseif ($act == 'binding_list') {
    get_token();
    require_once QISHI_ROOT_PATH . 'include/page.class.php';
    $perpage = 10;
    $total_sql = "SELECT COUNT(*) AS num from " . table('members') . " WHERE weixin_openid!='' ";
    $total_val = $db->get_total($total_sql);
    $page = new page(array('total' => $total_val, 'perpage' => $perpage, 'getarray' => $_GET));
    $currenpage = $page->nowindex;
    $offset = ($currenpage - 1) * $perpage;
    $smarty->assign('userlist', get_binding_list($offset, $perpage));
    $smarty->assign('page', $page->show(3));
    $smarty->assign('navlabel', "binding_list");
    $smarty->display('weixin/admin_binding_list.htm');
} elseif ($act == 'del_binding') {
    check_token();
    $uid = $_REQUEST['uid'];
    if ($num = del_binding($uid)) {
        write_log("解绑" . $num . "个会员", $_SESSION['admin_name'], 3);
        adminmsg("解绑成功!共解绑" . $num . "个会员", 2);
    } else {
        adminmsg("解绑失败!", 1);
    }
} elseif ($act == 'send_weixin_msglist') {
    get_token();
    require_once QISHI_ROOT_PATH . 'include/page.class.php';