<?php 
require "Run.php";
require "include/getmkurl.fun.php";
if($admin != 1 && $admin!=2){
 ehtml("干嘛？非法入侵啊！你没有权限知道不？！哼...");
 exit;
 }
$gro=$_GET['cid'];
	if($gro == NULL){
	$gro=0;
	}else{
	$gro = $gro;
	}
//获取相应网站栏目
	$sql = "SELECT cid,cn,url,xuhao,q,siteid,gro,top,bottom FROM class WHERE siteid='{$wapid}' AND gro='{$gro}'ORDER BY xuhao ASC";
    $classcon=mysql_query($sql);
	if($classcon && mysql_num_rows($classcon)>0){
	   $i          =       0; 
	while(list($cid,$cn,$urlid,$xuhao,$q,$siteid,$gro)=mysql_fetch_row($classcon)){
	   $url        =  'indexadmin.php?cid='.$cid;
	   $htmllist      .=  $q.'[<a href="admin/mod.php?mod=mod_q_web&cid='.$cid.'">插</a>.<a href="admin/mod_class.php?system=web&cid='.$cid.'">修</a>]<a href="?cid='.$cid.'">'.$cn.'</a>';
	    }
	$class_list = 1;
	}else{
	$class_list = 0;
	}		 
mysql_free_result($classcon);
//获取栏目信息
$sql="SELECT cid,cn,url,xuhao,q,siteid,gro,top,bottom FROM class WHERE siteid='{$wapid}' AND cid='{$_GET['cid']}'";
    $classcon=mysql_query($sql);
	list($cid,$cn,$url,$xuhao,$q,$siteid,$gro,$classtop,$classbottom) = mysql_fetch_row($classcon);
	if($_GET['cid'] == NULL || $_GET['cid'] == 0){
	   $sitetitle   =   $stitle;
	   $wapTop      =   $index_top;
	   $wapBottom   =   $index_bottom;
	   }else{
	   $sitetitle   =   $cn;
	   	  $wapTop   =   $classtop;
	   $wapBottom   =   $classbottom;
	   if(get_mkurl($url) != 'NULL' && $class_list == 0){
	   
	   $html = '<div class="content">提示！<br>
	            您好，此页面为模块栏目，浏览本页会显示模块内容，继续添加栏目会显示下级栏目。
	            [推荐修改为空白栏目后再添加下级栏目！]
	             </div>';
	        
			}
	    }
    mysql_free_result($classcon);
    $bottom = '<div class="subtitle">【<a href="admin/mod.php?mod=mod_b_web&cid='.$_GET['cid'].'">底部内容排版</a>】<br><a href="indexadmin_web.php?cid='.$gro.'">上级排版</a>|<a href="indexadmin_web.php?cid=0&">首页排版</a></div>';
    $html .= head($sitetitle);
	$html .='<style>.system_webpbtop a{color:#fff;font-size:16px;}</style>';
    $html .='<div class="system_webtop_a" style="height:40px;">';
	$html .= '<div class="system_webpbtop" style="position:fixed;background:#328cc9;color:#fff;width:100%;height:40px;line-height:40px;"><a href="admin/class.php?cid='.$_GET['cid'].'">添加本页栏目</a>
	<a href="../CssSelect.php?action=admin&cid='.$_GET['cid'].'">CSS编辑</a> 
	<a href="admin/autolist.php?cid='.$_GET['cid'].'">自动排版</a> 
	<a href="index.php?cid='.$_GET['cid'].'">预览</a></div></div>';
	$html .='<div class="subtitle">【<a href="admin/mod.php?mod=mod_t_web&cid='.$_GET['cid'].'">顶部内容排版</a>】</div>';
	$html .= $htmllist.$bottom.footer(1);
//输出
    echo UBB($html,$wapid);
mysql_close($link);	