<?php
include("libs.php");
include(dirname(dirname(__FILE__))."/./configs/config.php");
include(dirname(dirname(__FILE__))."/./configs/db_config.php");
include(dirname(dirname(__FILE__))."/./includes/class.inc.php");
include(dirname(dirname(__FILE__))."/./includes/function.php");
header("Content-Type:text/html;charset=utf-8");
session_start();
date_default_timezone_set('PRC');
$phpcolor = new mysql();
$phpcolor->open($core_mysql_host,$core_mysql_user,$core_mysql_pw,$core_mysql_dbname);
if(isset($_COOKIE['core_user_name']) && $_COOKIE['core_user_rank']=="2")
{
  $phpcolor->table=$core_mysql_prefix."user";
  $phpcolor->field="passwd,rank";
  $phpcolor->where="username='".$_COOKIE['core_user_name']."'";
  $userv=$phpcolor->exist(1);
  if($_COOKIE["core_user_passwd"]!=md5($userv['passwd'].$core_scode) || $_COOKIE["core_user_rank"]!=$userv['rank'])
    Header("Location: login.php?action=quit");
  else
    $tpl -> assign("core_user_name", $_COOKIE["core_user_name"]);
}
else
{
  Header("Location: login.php?action=login");
  exit();
}
$phpcolor->table=$core_mysql_prefix."bar";
$phpcolor->field="*";
$phpcolor->where="state = '2'";
$baraudit = $phpcolor->exist(2);
$phpcolor->table=$core_mysql_prefix."topic";
$phpcolor->where="state = '3'";
$topic = $phpcolor->exist(2);
$phpcolor->table=$core_mysql_prefix."repost";
$repost = $phpcolor->exist(2);
$phpcolor->table=$core_mysql_prefix."user";
$user = $phpcolor->exist(2);
$phpcolor->table=$core_mysql_prefix."apply_sort";
$phpcolor->where="1=1";
$apply_sort = $phpcolor->exist(2);
$phpcolor->table=$core_mysql_prefix."apply_master";
$apply_master = $phpcolor->exist(2);
$phpcolor->table=$core_mysql_prefix."barmaudit";
$barmaudit = $phpcolor->exist(2);
$tpl -> assign("barmaudit",$barmaudit);
$tpl -> assign("baraudit",$baraudit);
$tpl -> assign("topic",$topic);
$tpl -> assign("repost",$repost);
$tpl -> assign("user",$user);
$tpl -> assign("apply_sort",$apply_sort);
$tpl -> assign("apply_master",$apply_master);
$tpl -> assign("script_filename",$_SERVER["SCRIPT_FILENAME"]);
$tpl -> assign("zend_version", zend_version());
$tpl -> assign("upload_max_filesize", get_cfg_var("upload_max_filesize"));
$tpl -> assign("serve_software", $_SERVER["SERVER_SOFTWARE"]);
$tpl -> assign("serve_port", $_SERVER["SERVER_PORT"]);
$tpl -> assign("server_ip", gethostbyname($_SERVER["SERVER_NAME"]));
$tpl -> assign("memory_limit", get_cfg_var("memory_limit"));
$tpl -> assign("php_version", PHP_VERSION);
$tpl -> display("main.htm");
?>