📄 admin.php
字号:
<?php
ob_start();
$startTime = explode(" ",microtime());
$startTime = $startTime[0] + $startTime[1];
header("Content-type: text/html; charset=gbk");
require_once("config.php");
error_reporting(E_ERROR | E_WARNING | E_PARSE);
set_magic_quotes_runtime(0);
$system_time = $systemTime = time();
#[POST,GET等变量管理]
if(PHP_VERSION < "4.1.0")
{
$_GET = &$HTTP_GET_VARS;
$_POST = &$HTTP_POST_VARS;
$_COOKIE = &$HTTP_COOKIE_VARS;
$_SERVER = &$HTTP_SERVER_VARS;
$_ENV = &$HTTP_ENV_VARS;
$_FILES = &$HTTP_POST_FILES;
}
$magic_quotes_gpc = get_magic_quotes_gpc();
@extract(daddslashes($_POST));
@extract(daddslashes($_GET));
if(!$magic_quotes_gpc) {
$_FILES = daddslashes($_FILES);
}
#[加载数据库]
if(!file_exists("./class/".$connectDbType.".db.class.php"))
{
die("File:".$connectDbType.".db.class.php NOT EXISTS");
}
require_once("./class/".$connectDbType.".db.class.php");
$DB = new qgSQL($dbHost,$dbData,$dbUser,$dbPass,$dbOpenType);
#[设置Session信息]
#[更新时间2007-06-15 11:15:53]
include_once("./class/session.class.php");
#[加载常用函数]
include_once("./include/admin.func.php");
#[启用Session]
#[如果是获取验证码,则以下判断不显示]
if(!session_is_registered("admin")) session_register("admin");
#[头部信息]
echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=gbk' />";
echo "<Meta http-equiv='Expires' Content='Wed, 26 Feb 1997 08:21:57 GMT'>";
echo "<Meta http-equiv='Pragma' Content='No-cach'>";
#[判断会员是否已经登录]
if($_SESSION["admin"]["user"] && $_SESSION["admin"]["pass"] && strpos($act,"login") === false && $act != "logout")
{
echo "<title>清雅园进销存管理系统 v1.0 - Powered By 888comnet.Com</title>";
if(empty($file))
{
echo "</head>";
echo "<frameset cols='209,*' border='0'><frame src='./admin.php?file=left' name='FLeft' id='FLeft' noresize><frame src='./admin.php?file=index' noresize border='0' frameborder='0' scrolling='yes'></frameset>";
echo "<body></body></html>";
exit();
}
else
{
if($file != "left")
{
include_once("./admin/tpl/css.htm");
echo "</head><body>";
#[加载头部广告信息及语言选择]
if(strpos($file,"open.") === false)
{
include_once("./admin/right.head.php");
}
}
else
{
echo "</head><body>";
}
if(file_exists("./admin/".$file.".qg.php"))
{
#[加载其他常规操作信息]
if($file != "left")
{
include_once("./class/file.class.php");
$FS = new files();
}
include_once("./admin/".$file.".qg.php");
}
else
{
echo "<br /><br /><div align='center'>网页文件不存在...</div>";
}
if($file == "left")
{
echo "</body></html>";
$DB->qgClose();
ob_end_flush();
}
else
{
if(strpos($file,"open.") === false)
{
Foot();
}
else
{
echo "</body></html>";
$DB->qgClose();
ob_end_flush();
}
}
}
}
else
{
#[管理员未登录,开启登录页]
if($act == "loginok")
{
if(empty($username) || empty($password))
{
Error("用户名或密码或认证码为空...","admin.php?act=login",2,true);
}
else
{
#[对认证码进行验证]
$rows = $DB->qgGetOne("SELECT * FROM ".$prefix."admin WHERE user='".$username."' AND pass='".md5($password)."' LIMIT 0,1");
if($rows)
{
$_SESSION["admin"] = $rows;
#[写入验证Cookie以便上传图片]
Error("管理员 <strong>".$rows["user"]."</strong> 登录后台...","admin.php",2,true);
}
else
{
Error("管理员账号或密码不正确...","admin.php?act=login",2,true);
}
}
}
elseif($act == "logout")
{
session_destroy();
Error("管理员成功退出...","admin.php?act=login",2,true);
}
else
{
echo "<title>清雅园OA系统管理员登录 -- Powered By 888comnet.Com</title>";
echo "</head>";
echo "<body>";
include_once("./admin/tpl/admin_login.php");
}
echo "</body></html>";
$DB->qgClose();
ob_end_flush();
}
function daddslashes($string, $force = 0)
{
if(!$GLOBALS["magic_quotes_gpc"] || $force)
{
if(is_array($string))
{
foreach($string as $key => $val)
{
$string[$key] = daddslashes($val, $force);
}
}
else
{
#[将内容转化成无害信息]
$string = addslashes($string);
}
}
return $string;
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -