<?php
include(dirname(dirname(__FILE__))."/./configs/config.php");
include(dirname(dirname(__FILE__))."/./configs/db_config.php");
include(dirname(dirname(__FILE__))."/./includes/function.php");
include("class.inc.php");
function encode($txt)
{
  $encode =mb_detect_encoding($txt , array('ASCII','UTF-8','GB2312','GBK','BIG5'));
  if($encode!="UTF-8")
    $txt=iconv($encode, "UTF-8", $txt);
  return $txt;
}
header("Content-type: text/vnd.wap.wml;charset=utf-8");
date_default_timezone_set('PRC');
session_start();
if($core_baropen==0 || (strtotime($core_opentime1) > (strtotime(date('H:i'))+$core_time*60*60) || strtotime($core_opentime2) < (strtotime(date('H:i'))+$core_time*60*60) && $core_opentime1!=$core_opentime2)){
  echo $core_closed;
  exit();}
if (!file_exists('../install/install.lock')){
  Header("Location: ../install/");
  exit();}
$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_name']=submitfilter(2,$_COOKIE['core_user_name']);
  $phpcolor->table=$core_mysql_prefix."user";
  $phpcolor->field="id,passwd";
  $phpcolor->where="username='".$_COOKIE['core_user_name']."'";
  $userv=$phpcolor->exist(1);
  if($_COOKIE["core_user_passwd"]!=md5($userv['passwd'].$core_scode))
  {
    echo "<wml><card>\n";
    echo "<p>\n";
    echo "请不要非法操作，您可以清除cookies后重新访问本站";
	echo "</p>\n";
	echo "</card></wml>";
	exit();
  }
  else
  {
    setcookie("core_user_name", $_COOKIE["core_user_name"], time()+$core_time*60*60+3600);
    setcookie("core_user_passwd", $_COOKIE["core_user_passwd"], time()+$core_time*60*60+3600);
  }
}
?>