Пример #1
0
<?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']])) {
Пример #2
0
<?php

include_once '../common/include-file.php';
$menu = new AccountMenu();
$data = array('gid' => $_POST['gid'], 'name' => $_POST['name'], 'parentid' => $_POST['parentid'], 'sort' => $_POST['sort'], 'mtype' => $_POST['mtype'], 'eventType' => $_POST['eventType'], 'inputcode' => $_POST['inputcode'], 'gid' => $_POST['gid'], 'msgId' => $_POST['msgId'], 'url' => $_POST['url']);
$menu->insert($data);
header("Location:" . $CONTEXT_PATH . "/wxcms/menuList.php?gid=" . $_POST['gid']);
Пример #3
0
<?php

include_once '../common/include-file.php';
$id = $_GET['id'];
$gid = $_GET['gid'];
$accountMenu = new AccountMenu();
$accountMenu->delete(" id = " . $id);
header("Location:" . $CONTEXT_PATH . "/wxcms/menuList.php?gid=" . $gid);
Пример #4
0
echo $CONTEXT_PATH;
?>
/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>
Пример #5
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<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>