<?php
if(!defined('IN_TM')) {exit('Access Denied');}
//框架
if($_SESSION["admin"]!="Silence"){
	//你还没有登陆或已经超时!
	include template('login.htm');
    exit;
}else{
	$a = getgpc('a');
	if($a == 'header'){
		include template('header.htm');
		exit;
	}elseif ($a == 'main'){
		include template('main.htm');
		exit;
	}elseif ($a == 'left'){
		$do = getgpc('do');$id = getgpc('id');
		if($do == 'config'){
			include template('config.htm');
			exit;
		}elseif($do == 'about'){
		
		}elseif($do == 'news'){
		
		}elseif($id){
			if($id == 1){
				$arr = array(
								array('name'=>'系统配置','url'=>'?action=config&do=config'),
								array('name'=>'验证码配置','url'=>'?action=config&do=seccode'),
								array('name'=>'模板管理','url'=>'?action=config&do=tpl'),
								array('name'=>'帐号管理','url'=>'?action=admin&do=list'),
								array('name'=>'添加帐号','url'=>'?action=admin&do=add')
				);
			}
			if($id == 2){
				$arr = array(
								array('name'=>'菜单管理','url'=>'?action=about&do=menu'),
								array('name'=>'增加单页','url'=>'?action=about&do=add'),
								array('name'=>'单页列表','url'=>'?action=about&do=list')
				);
			}
			if($id == 3){
				$arr = array(
								array('name'=>'增加新闻','url'=>'?action=news&do=add'),
								array('name'=>'新闻列表','url'=>'?action=news&do=list'),
								array('name'=>'新闻分类','url'=>'?action=news&do=fl')
				);
			}
			if($id == 4){
				$arr = array(
								array('name'=>'增加产品','url'=>'?action=shop&do=add'),
								array('name'=>'产品列表','url'=>'?action=shop&do=list'),
								array('name'=>'产品分类','url'=>'?action=shop&do=fl')
				);
			}
			if($id == 5){
				$arr = array(
								array('name'=>'发布职位','url'=>'?action=job&do=add'),
								array('name'=>'管理职位','url'=>'?action=job&do=list'),
								array('name'=>'简历列表','url'=>'?action=job&do=resumelist')
				);
			}
			if($id == 6){
				$arr = array(
								array('name'=>'增加广告','url'=>'?action=ads&do=add'),
								array('name'=>'管理广告','url'=>'?action=ads&do=list')
				);
			}
			if($id == 7){
				$arr = array(
								array('name'=>'留言管理','url'=>'?action=guestbook&do=list'),
								array('name'=>'订单管理','url'=>'?action=order&do=list'),
								array('name'=>'友情连接','url'=>'?action=link&do=list')
				);
			}
			$admin = $db->fetch_array($db->query("SELECT username, id FROM {$tablepre}admin WHERE username='{$_SESSION['adminuser']}'"));
			$u = $admin[id];
			include template('left.htm');
			exit;
		}else{
			include template('left.htm');
			exit;
		}		
	}elseif ($a == 'noteinfo'){
		$u = $_SESSION['adminuser'];
		include template('noteinfo.htm');
		exit;
	}elseif ($a == 'footer'){
		include template('footer.htm');
		exit;
	}else{
		$messageid = 9901;//未定义错误！
		include template('message.htm');
		exit;
	}
}
?>