<?php
/**
 * 金戈企业建站系统：后台主框架
 *
 *
 * @name 
 * @author 烟鬼 QQ:460874 Email:460874@qq.com
 * @version 0.1  $id  isadmin.php
 * @copyright Copyright (c) 2007 - 2008 烟鬼
 */
session_start();
require('../config.php');

	$root_name = $_POST['root_name'];
	$root_pass = $_POST['root_pass'];
	$root_name = trim($root_name);   //my_yz()函数在myfun.php中定义，主要功能是验证变量是否合法
	$root_pass = trim($root_pass);
	
	if (!filled_out($_POST)) 
	{
		echo '请完整填写表单';
		exit;
	}
	//判断严整码填写是否正确
	if ($_SESSION['randcode'] != $_POST['capt']) 
	{
		echo '验证码错误';
		exit;
	}
	if($root_name && $root_pass)
	{
		try
		{
			root_login($root_name,$root_pass);
			$_SESSION['root_name'] = $root_name;
		}
		catch (Exception $e)
		{
			echo '<meta http-equiv="Refresh" content="0; url=../error.php?error=rope" >';
			exit;
		}
	}
	
	/**
	 * check_root()方法在data.php 中定义。判断申请浏览当前页的是否是管理员
	 */
	if(!check_root())
	{
		echo '<meta http-equiv="Refresh" content="0; url=../error.php?error=nono" >';
		exit;
	}
	
	/**
	 * 取回基本设置的所有内容,并传给setassoc函数返回相关数组。web 是数据表名
	 */
	$row = root_all(web);
	if ($row) 
	{
	     $row = setassoc($row);
	}
{
?>
<!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=gb2312" />
<title><?php echo $row['w_title']?$row['w_title']:'金戈企业建站系统' ?>-后台管理</title>
</head>

<frameset rows="60,*" cols="*" frameborder="no" border="0" framespacing="0">
  <frame src="top.php" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" title="topFrame" />
  <frameset rows="*" cols="138,*" framespacing="0" frameborder="no" border="0">
    <frame src="left.php" name="leftFrame" scrolling="yes" noresize="noresize" id="leftFrame" title="leftFrame" />
    <frame src="center.php" name="mainFrame" id="mainFrame" title="mainFrame" />
  </frameset>
</frameset>
<noframes><body>
</body>
</noframes></html>
<?php
}
?>