/wxcms/menuDelete.php?id='+id+'&gid='+gid; } } function doBack(){ window.location.href='${s.base}/wxcms/accountMenuGroup/paginationEntity.html'; } </script> </head> <?php if (isset($_GET['gid']) && $_GET['gid'] != '') { $menuGroup = new AccountMenuGroup(); $menuGroup = $menuGroup->queryById($_GET['gid']); $menu = new AccountMenu(); $sql = "select t1.*,t2.name as parentName \r\n\t\t\tfrom t_wxcms_account_menu t1 left join t_wxcms_account_menu t2\r\n\t\t\ton t1.parentId = t2.id where t1.gid = " . $_GET['gid']; $menuList = $menu->queryBySql($sql); } ?> <body class="bg"> <?php include "../static/top.php"; ?> <div class="content"> <div class="block-nav"> <?php include "../static/nav.php"; ?> </div> <div class="block-content" > <div class="block-content-nav">
<?php include_once '../common/include-file.php'; include_once '../wxapi/wxconsts.php'; include_once '../wxapi/WxApi.class.php'; $wxAccount = new Account(); $wxAccount = $wxAccount->getSingleAccount(); $appId = $wxAccount['appid']; $appSecret = $wxAccount['appsecret']; $gid = $_GET['gid']; $accountMenu = new AccountMenu(); $sql = ' select * from t_wxcms_account_menu where gid = ' . $gid . ' order by parentId , sort '; $querySet = $accountMenu->queryBySql($sql); $menuStr = prepareMenu($querySet); $rst = WxApi::create_menu($appId, $appSecret, $menuStr); if ($rst->errcode == 0) { $wxAccountGroup = new AccountMenuGroup(); $wxAccountGroup->updateById(array("id" => $gid, "enable" => 1)); header("Location:" . $CONTEXT_PATH . "/wxcms/success.php?type=1"); } else { header("Location:" . $CONTEXT_PATH . "/wxcms/failure.php?type=1&errcode=" . $rst->errcode); } function prepareMenu($querySet) { $menuArr = array(); $subMenuArr = array(); foreach ($querySet as $item) { if ($item['parentId'] == 0) { array_push($menuArr, $item); } else { if (empty($subMenuArr[$item['parentId']])) {
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <?php $CUR_NAE = 'menu'; ?> <?php include "../static/res.php"; ?> </head> <?php $gid = ''; $gid = $_GET['gid']; $menu = new AccountMenu(); $sql = 'select * from t_wxcms_account_menu where parentId = 0 and gid = ' . $gid; $parentMenuList = $menu->queryBySql($sql); ?> <body class="bg"> <?php include "../static/top.php"; ?> <div class="content"> <div class="block-nav"> <?php include "../static/nav.php"; ?> </div> <div class="block-content" >