<?php
error_reporting(E_ALL ^ E_NOTICE);$do   = isset($_GET['do']) ? trim($_GET['do']) : 'login';
$go   = isset($_GET['go']) ? trim($_GET['go']) : 'mymps_right';
$part = isset($_GET['part']) ? trim($_GET['part']) : 'default';
if($do == 'login'){
define('IN_MYMPS', true);
include "../include/global.php";
require_once MYMPS_DATA."/config.php";
require_once MYMPS_DATA."/config.db.php";
require_once MYMPS_INC."/db.class.php";
require_once MYMPS_INC."/admin.class.php";
@include MYMPS_DATA.'/caches/authcodesettings.php';
$authcodesettings = $data;
$data = NULL;
$url = trim($url);
if ($part == 'chk'){
define(CURSCRIPT,'admin_login');
$url = $url ? $url : 'index.php?do=manage&go='.$go;
//$authcodesettings['adminlogin'] == 1 && mymps_chk_randcode();
$username = trim($username);
$password = trim($password);
$pubdate  = $timestamp ? $timestamp : time();
$ip   = GetIP();
$row = $db->getRow("SELECT id,userid,pwd,uname FROM {$db_mymps}admin WHERE userid='".$username."' AND pwd='".md5($password)."'");
if($row){
$admin_id   = $row['userid'];
$admin_name = $row['uname'];
$mymps_admin -> mymps_admin_login($admin_id,$admin_name);
$db->query("UPDATE {$db_mymps}admin SET loginip='".GetIP()."',logintime='". time() ."' WHERE userid='$row[userid]'");
$db->query("INSERT INTO `{$db_mymps}admin_record_login` (id,adminid,adminpwd,pubdate,ip,result) VALUES ('','$username','".md5($password)."','$pubdate','$ip','1')");
//
}else{
$db->query("INSERT INTO `{$db_mymps}admin_record_login` (id,adminid,adminpwd,pubdate,ip,result) VALUES ('','$username','$password','$pubdate','$ip','0')");
//
} }elseif ($part == 'out'){
define('IN_MYMPS', true);
$mymps_admin -> mymps_admin_logout();
//
}elseif ($part == 'default'){
define('IN_MYMPS', true);
$url   = trim($_GET['url']);
if($mymps_admin -> mymps_admin_chk_getinfo()){
write_msg("","?do=manage");
}else{
include(mymps_tpl("login"));
}
}else{
define('IN_MYMPS', true);
write_msg("","?do=manage");
}
}elseif($do == 'manage'){
require_once dirname(__FILE__)."/global.php";
require_once MYMPS_INC."/cheer.inc.php";
if($part == 'left1'){
require_once dirname(__FILE__)."/include/mymps.menu.inc.php";
$part=trim($_GET['part']);
$part = $part ? $part : 'info';
$constant  = get_defined_constants();
$mymps_admin_menu = mymps_admin_menu("left");
print <<<EOT
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<link rel="stylesheet" type="text/css" href="css/menu.css" />
<script type="text/javascript" src="js/ShowLeft.js"></script>
<script type="text/javascript" src="js/mymps_noerr.js"></script>
</head>
<body>
<div id="my_menu" class="{$constant['MPS_SOFTNAME']}">
<span class="top">
<a href="../" target="_blank">hhhh</a> <a href="#" onclick="parent.framRight.location='?do=manage&part=right'">.....</a>
</span>
{$mymps_admin_menu}
</div>
</body>
</html>
EOT;
}elseif($part == 'default'){
?>
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
        <html><head>
        <title>VbmCms Administrator's Control Panel</title>
        <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
        </head>
        <body style="margin: 0px" scroll="no">
        <div style="position: absolute;top: 0px;left: 0px; z-index: 2;height: 45px;width: 100%">
        <iframe frameborder="0" id="framHeader" name="framHeader" src="?do=manage&part=top" scrolling="no" style="height: 45px; visibility: inherit; width: 100%; z-index: 1;"></iframe>
        </div>
        <table border="0" cellPadding="0" cellSpacing="0" height="100%" width="100%" style="table-layout: fixed;">
        <tr><td width="165" height="45"></td><td></td></tr>
        <tr>
        <td><iframe frameborder="0" id="framLeft" name="framLeft" src="?do=manage&part=left" scrolling="yes" style="height: 100%; visibility: inherit; width: 100%; z-index: 1;overflow: auto;"></iframe></td>
        <td><iframe frameborder="0" id="framRight" name="framRight" src="?do=manage&part=right&go=<?=$go?>" style="border-top:2px #000000 solid; border-left:2px #000000 solid; height: 100%; visibility: inherit; width: 100%; z-index: 1;overflow: auto;" scrolling="auto"></iframe></td>
        </tr></table>
        </body>
        </html>
<?
}elseif($part == 'top'){
     require_once dirname(__FILE__)."/include/mymps.menu.inc.php";
     $constant  = get_defined_constants();
     $mymps_admin_menu = mymps_admin_menu("top");
$admindir = getcwdOL();
print <<<EOT
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="css/{$constant['MPS_SOFTNAME']}.css" rel="stylesheet" type="text/css">
<title>Mymps Administrator's Control Panel - powered by mymps</title>
<script type="text/javascript" src="js/menu.js"></script>
<script>
var menus = new Array('index','info', 'member', 'category', 'news', 'siteabout', 'sitesys','plugin','extend');
function togglemenu(id) {
if(parent.framLeft) {
for(k in menus) {
if(parent.framLeft.document.getElementById(menus[k])) {
parent.framLeft.document.getElementById(menus[k]).style.display = menus[k] == id ? '' : 'none';
}
}
}
}
function sethighlight(n) {
var lis = document.getElementsByTagName('li');
for(var i = 0; i < lis.length; i++) {
lis[i].id = '';
}
lis[n].id = 'menuon';
}
</script>
<script type="text/javascript" src="../mypub/messagebox.js"></script>
</head>
<body class="top" onLoad="sethighlight('0')">
<div class="logo"><img src="images/logo.gif" border="0" alt="{$constant['MPS_SOFTNAME']} {$constant['MPS_VERSION']}"/></div>
<div class="nav">
<div class="t-menu"><span>$admin_id</span>jjjjjjjjjjj <a href="javascript:setbg('{$constant['MPS_SOFTNAME']}kkkkkkkk',670,545,'../box.php?part=adminmenu&admindir=$admindir')" target="framRight" style="color:white">bbbb<img src="images/menu-down.gif"></a></div>
{$mymps_admin_menu}
</div>
</body>
</html>
EOT;
}elseif($part == 'right'){     $go = trim($_GET['go']);
        require_once MYMPS_INC."/db.class.php";
        require_once MYMPS_DATA."/config.inc.php";
        require_once dirname(__FILE__)."/include/mymps.count.inc.php";
        require_once dirname(__FILE__)."/include/welcome.inc.php";
$level = get_admin_type();
        foreach ($ele as $w =>$v){
            $mymps_count_str .= "<span style=\"background-color:#dff6ff; color:#006acd\">".$v."</span>";
            foreach ($element[$w] as $k =>$u){
                $mymps_count_str .= $u[where] ? "<a href=\"#\" onclick=\"parent.framRight.location='$u[url]';\">".$k."<span>(".mymps_count($u[table],$u[where]).")</span></a>" : "<a href=\"#\" onclick=\"parent.framRight.location='$u[url]';\">".$k."<span>(".mymps_count($u[table]).")</span></a>";
            }
        }
        foreach($welcome as $k => $value){
            $mymps_welcome_str .="<tr bgcolor=\"#f5fbff\"><td width=\"15\" bgcolor=\"#f5fbff\" style=\"font-weight:bold\">".$k."</td><td bgcolor=\"white\" style=\"padding:15px;\" class=\"other\">
            ".$value."</td></tr>";
        }
        $here = "uuuuuuuu";
echo mymps_admin_tpl_global_head($go);
        ?>
<script type="text/javascript" src="../mypub/messagebox.js"></script>
<div class="ccc2">
<ul>
ppppppppp <font color="#FF6600"><strong><?php echo $admin_name?></strong></font>gggggggg<font color="#FF6600"><strong><?php echo GetIP(); ?></strong></font>£¨π‹¿Ì‘±’ ∫≈ «<font color="#FF6600"><strong><?php echo $admin_id?></strong></font>llllllllllll<font color="#FF6600"><strong><?php echo $level?></strong></font>
</ul>
</div>
<div id="<?=MPS_SOFTNAME?>">
<table cellspacing="0" cellpadding="0"  width="100%" align="center" class="vbm">
<tr bgcolor="#f5fbff">
 <td colspan="6" style="padding:10px">
 <b>œ‡πÿ–≈œ¢Õ≥º∆</b></td>
</tr>
<tr bgcolor="#f5fbff">
  <td bgcolor="white" style="padding:10px">
<?php echo $mymps_count_str;?>
  </td>
</tr>
</table>
</div>
<div id="<?=MPS_SOFTNAME?>">
<table cellspacing="0" cellpadding="0"  width="100%" align="center" class="vbm">
<?php echo $mymps_welcome_str;?>
</table>
</div>
<?php
unset($ele,$element);
echo mymps_admin_tpl_global_foot();
    }
}elseif($do == 'power'){
require_once dirname(__FILE__)."/global.php";
require_once MYMPS_INC."/member.class.php";
$s_uid = trim($_GET['userid']);
$s_pwd = trim($_GET['password']);
$member_log -> in($s_uid,$s_pwd,'off',$url);
}else{
define('IN_MYMPS', true);
require_once dirname(__FILE__)."/../include/global.fun.php";
unknown_err_msg();
}is_object($db) && $db->Close();
$db = $mymps_global = $part = $action = $here = NULL;
?>503