<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP version 5                                                        |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2004 The PHP Group                                |
// +----------------------------------------------------------------------+
// | This source file is subject to version 3.0 of the PHP license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.php.net/license/3_0.txt.                                  |
// | If you did not receive a copy of the PHP license and are unable to   |
// | obtain it through the world-wide-web, please send a note to          |
// | license@php.net so we can mail you a copy immediately.               |
// +----------------------------------------------------------------------+
// | Authors: Original Author <author@example.com>                        |
// |          Your Name <you@example.com>                                 |
// +----------------------------------------------------------------------+
//
// $Id:$

function head($title,$css) {
	if($css == NULL){
	$css = css(CSS);
	}else{
	$css = css(CSS).$css;
	}
    $ver = VER;
    if ($_GET['cid'] == '0' || $_GET['cid'] == NULL) {
        $SEOTITLE = NULL;
    } else {
        $SEOTITLE = SEOTITLE;
    }
    $title = $title . $SEOTITLE;
    if ($GLOBALS['suofang'] == 'NO') {
        $meta = '<meta name="viewport" content="width=device-width; initial-scale=1.0; minimum-scale=1.0; maximum-scale=1.0">';
    } else {
        $meta = '';
    }
    if ($ver == 5) {
        $Str = '<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
' . $meta . '
<meta name="keywords" content="' . KEYWORDS . '" />
<meta name="description" content="' . SITECON . '" />
<meta name="author" content="' . SITE_NAME . ' " />
' . $css . '
<title>' . $title . '</title>
</head>
' . UBB(SYSTEM_TOP,WAPID);
    } elseif ($ver == 1) {
        $Str = '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html;" charset="utf-8" />' . $meta . '<title>' . $title . '</title></head>';
    } else {
        $Str = '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
' . $meta . '
<meta name="keywords" content="' . KEYWORDS . '" />
<meta name="description" content="' . SITECON . '" />
<meta name="author" content="' . SITE_NAME . ' " />
' . $css . '
<title>' . $title . '</title>
</head>' . UBB(SYSTEM_TOP,WAPID);
    }
    return $Str;
}
function topNavBar($left, $center, $right) {
    return '<table class="top_nav_bar"><tr><td class="left">' . $left . '</td><td class="center">' . $center . '</td><td class="right">' . $right . '</td></tr></table>';
}
function topNav($title, $left, $right) {
    if ($title == NULL) {
        $title = class_name($_GET['cid'], 'cn');
    }
    if ($left == NULL) {
        if ($id[1] != NULL) {
            $backurl = 'index.php?cid=' . $id[0];
        } elseif ($id[0] != NULL && $id[1] == NULL) {
            $backurl = 'index.php?cid=' . CLASSGRO;
        }
        $left = '<a href="' . $backurl . '">返回</a>';
    }
    if ($right == NULL) {
        $right = '<a href="index.php?">首页</a>';
    }
    $html.= '<style>
	.top_nav{
	left:0px;color:#fff;width:100%;position:fixed;text-align:center;height:40px;line-height:40px;
	background-color:#328cc9;
	background-image:url("/style/topNav_bg.png");
	background-image:-webkit-gradient(linear, left top, left bottom, from(#32cc8), to(#afc7d7)); 
	}
	.top_nav a{color:#fff;}
	.top_nav table{width:100%;}
	.top_nav table tr td.t_left{width:80px;}
	.top_nav table tr td.t_right{width:80px;}
	.top_nav_bar{height:40px;}
	</style>';
    $html.= '<div class="top_nav_bar"><div class="top_nav"><table border="0" cellpadding="0" cellspacing="0"><tr><td class="t_left">' . $left . '</td><td class="t_title">' . $title . '</td><td class="t_right">' . $right . '</td></tr></table></div></div>';
    return $html;
}


function footer($blo){
	if($blo == TRUE)
	{
		$bottom = UBB(SYSTEM_BOTTOM,WAPID);
	}else{
		$bottom = SYSTEM_BOTTOM;
	}
	$time = getmtime() - START_TIME;
	$include = INCLUDE_TIME -  START_TIME;
	$system = SYSTEM_TIME -  START_TIME;
	v_logs($cfg['ol_saved'], $cfg['saved_time']);
	return  $bottom/*.
	'<br>运行时间:'.round($time,3).
	'<br>包含时间:'.round($include,3).
	'<br>初始时间:'.round($system,3)*/
	;
}

function ehtml($str) {
echo head("好像遇到了点麻烦啊");
echo '
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family: "微软雅黑";background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;} 
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;} 
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} 
#header{width:100%;margin:0 0 0 0;color:#FFF;
background-color:#555555;}
#header table tr td a{
	color:#fff;
	}
#header table tr td{
	padding:6px 2% 6px 2%;} 
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
<div id="header">
 <table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="50%">
<h1>操作被拦截</h1></td><td width="50%" align="right"><h1><a href="'.$_SERVER['HTTP_REFERER'].'">返回</a></h1></td></tr></table>
</div>
<div id="content">
 <div class="content-container"><fieldset>
  <h2>操作出错</h2>
  <h3>'.$str.'</h3>
 </fieldset></div>
</div>
';
echo footer(1);
}