<?php
session_start();
header("content-type:text/html;charset=utf-8");
error_reporting(0);
date_default_timezone_set("PRC");
if(isset($_SESSION['username'])){
    $username=$_SESSION['username']; 
}else{
    header("location:../index.php");
    exit; 
}
include "../myadmin/sql.php";
$page=isset($_GET['p'])?$_GET['p']:"zhuanqian_renwu";
$ip_qingkong_sql="select time from ip limit 1";
$ip_qingkong_rst=mysql_query($ip_qingkong_sql);
$ip_qingkong_row=mysql_fetch_assoc($ip_qingkong_rst);
$today_db=$ip_qingkong_row['time'];
$today=date("Ymd",time());
if($today!=$today_db){
    $ip_shanchu_sql="delete from ip where time!='{$today}'";
    mysql_query($ip_shanchu_sql);
}

$xitong_sql="select * from xitong_xiaoxi";
$xitong_row=mysql_fetch_assoc(mysql_query($xitong_sql));
$xg_logo_sql="select * from admin_logo";
$xg_logo_row=mysql_fetch_assoc(mysql_query($xg_logo_sql));
$admin_dibu_sql="select * from admin_dibu";
$admin_dibu_row=mysql_fetch_assoc(mysql_query($admin_dibu_sql));

?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7"><!– IE7 mode –>
	<title>诗龙分享传播推广系统</title>
    <script src="../jquery.js"></script>
<style>
*{
    margin: 0px;
    padding:0px;
    font-family: 微软雅黑;
}
a{
    text-decoration: none;
    color: #009999;
}
li{
    list-style: none;
}
#main{
    margin:0 auto;
    width:1280px;
    height: auto;
}
.top{
    width:1280px;
    height:60px;
    background:#F9F9F9;
    margin:0 auto;
}
.topleft{
    width:170px;
    height:60px;
    float:left;
}
.topcenter{
    width: 1010px;
    height:60px;
    float:left;
    position:relative;
    top:0px;
    left:0px;
    overflow: hidden;

    
}
.topcenter_span{
    width:1010px;
    height:60px;
    overflow: hidden;
    position:relative;
    top:0px;
    left:0px;
}
.topright{
    width: 100px;
    height:60px;
    float:left;
}
.daohanglan{
    width:1280px;
    height:200px;
    background:#fff;
    margin:0 auto;
}
.imgdiv{
    height: 200px;
    width:500px;
    background:#fff; 
    float:left; 
}

.daohang{
    float:left;
}
.daohang ul{
    float:left;
}
.daohangul{
    font-size:25px;
    margin: 70px 0px 0px 100px;
}
.daohangli{
    display:none;
    text-align: center;
    font-size: 13px;
    line-height: 20px;
    border: 1px solid #ccc;
}
.gonggao{
    width:1280px;
    height:45px;
    background:#009999;
}
.bottom{
    width: 1280px;
    height:755px;
}
.bottom_left{
    width:250px;
    height:755px;
    float: left;
}
.left_li{
    line-height:30px;
    text-align: center;
    font-size: 20px;
    width: 250px;
    background: #F9F9F9;
    color:#fff;
    cursor: pointer;
}
.caidan1,.caidan2,.caidan3,.caidan4{
    text-align: center;
    line-height:30px;
}
.left_top{
    width:250px;
    height:250px;
    background: #F9F9F9;
}
.left_bottom{
    width:250px;
    height: 500px;
    background: #fff;
}
.bottom_right{
    width:1030px;
    height:755px;
    background:#fff;
    float: left;
}
.botcenter{
    width:1050px;
    height:755px;
    float:left;
    
}
.renwuzhuanqian{
    float:left;
    width:1050px;
    height:150px;
    background:#fff;
    border-bottom:1px solid #BCBCBC;
}
.renwuimg{
    width:150px;
    height:150px;
    background:#009999;
    text-align:center;
    float:left;
}
.renwuwenzi{
    width:900px;
    height:150px;
    background:#009999;
    float:left;
    
}
.renwuimg img{
    margin-top: 25px;
}
.renwup{
    font-size:25px;
    margin-top: 40px;
}
.dibu{
    width:1280px;
    height:245px;
    text-align:center;
    background:#333438;
    color:#888872;
}

</style>
</head>
<body>
<div id="main">
<div class="top">
<div class="topleft">
<p style="line-height:60px;">&nbsp;&nbsp;<a href="../index.php">网站首页</a>&nbsp;&nbsp;<span style="color:#E33A3A;">系统消息:</span></p>
</div>
<div class="topcenter">
<div class="topcenter_span">
<p style="line-height: 60px;color:#FFAD4F;z-index:0;"  id="xitong_xiaoxi"><?php echo $xitong_row['xiaoxi']; ?></p>
</div>
</div>
<div class="topright"><p style="line-height:60px;"><a id="tuichu" href="loginout.php">&nbsp;&nbsp;退出</a></p></div>
</div>
<div class="daohanglan">
<div class="imgdiv">
<p style="margin: 60px 0px 0px 10px;"><img style="width:80px;height:80px;vertical-align: middle;" class="logo" src="<?php echo "../myadmin/image/".$xg_logo_row['image'];?>"/>
&nbsp;<a style="font-size:30px;" href="user_index.php"><?php echo $xg_logo_row['logo'];?></a>
</p>
</div>
<div class="daohang">
<ul class="daohangul">
<li>
<a href="user_index.php">用户首页</a>
</li>
</ul>
<ul class="daohangul">
<li>
<a href="user_index.php?p=zhuanqian_renwu">推广赚钱</a>
</li>
</ul>
<ul class="daohangul">
<li>
<a href="user_index.php?p=xuetang">新手必看</a>
</li>
</ul>
</div>
</div>
<div class="daohangcaidan">
</div>
<div class="gonggao">
<div style="float: left;width:45px;"><img src="../image/laba.png" style="display:block;"></div>
<div style="float: left;width:1235px;"><p style="color:#FFAD4F;padding: 10px 0px 0px 10px;">
<?php 
echo $_SESSION['dizhi'];

?>
</p></div>
</div>
<div class="bottom">
<div class="bottom_left">
<div class="left_top">
<div style="float: left;width:91px;"><img src="../image/touxiang.png" style="margin-top: 20px;"/>
</div>
<div style="float: left;width:159px;">
<p style="margin-top: 20px;">&nbsp;会员 : <?php echo "<span style='color:#009999;'>".$username."</span>";?></p>
<?php

  $index_sql="select * from tb_tot where username='{$username}'";
  $index_rst=mysql_query($index_sql);
  if(!$index_row=mysql_fetch_assoc($index_rst)){
     echo "<p>&nbsp;金钱：<span style='color: red;font-size:25px;'>0</span>元</p>";
  }else{
     echo "<p>&nbsp;金钱：<span style='color: red;font-size:25px;'>{$index_row['jiage']}</span>元</p>";
  }
?>
<?php

  $zanting_sql="select * from user where username='{$username}'";
  $zanting_rst=mysql_query($zanting_sql);
  if($zanting_row=mysql_fetch_assoc($zanting_rst)){
      if($zanting_row['zanting']==0){
          echo "<p>&nbsp;运行状态：<span style='color:#009999;font-size:20px;'>正常</span></p>";  
      }else{
          echo "<p>&nbsp;运行状态：<span style='color: red;font-size:20px;'>停止</span></p>";
      }
}
?>

</div>
</div>
<div class="left_bottom">
<ul>
<li class="left_li" id="left_li3" style="background: #009999;">
推广赚钱
</li>
<li class="caidan3">
<a href="user_index.php?p=zhuanqian_renwu">分享传播推广</a>
</li>
<li class="left_li" id="left_li2" style="background: #009999;">
财务管理
</li>
<li class="caidan2">
<a href="user_index.php?p=tixian_index">申请提现</a>&nbsp;-&nbsp;<a href="user_index.php?p=tixian_mingxi">财务明细</a>
</li>
<li class="left_li" id="left_li1" style="background: #009999;">
用户管理
</li>
<li class="caidan1">
<a href="user_index.php?p=user_xiugai">
用户修改
</a>-
<a href="user_index.php?p=pass_xiugai">
密码修改
</a>
</li>
<li class="left_li" id="left_li4" style="background: #009999;">
联系方式
</li>
<li class="caidan4">
<a href="user_index.php?p=admin_qq">
管理员QQ
</a>
</li>
</ul>
</div>
</div>
<div class="bottom_right">
<?php
switch($page){
        case "zhuanqian_renwu":
    include "../page/zhuanqian_renwu.php";
    break;
        case "tixian_index";
    include "../myadmin/tixian/tixian_index.php";
    break;
       case "tixian_mingxi";
    include "../myadmin/tixian/tixian_mingxi.php";
    break;
      case "user_xiugai";
    include "../page/user_xiugai.php";
    break;
       case "mingxi";
    include "../page/mingxi.php";
    break;
       case "yuer";
    include "../page/yuer.php";
    break;
       case "user_xiugai";
    include "../page/user_xiugai.php";
    break;
    case "admin_qq";
    include "../page/admin_qq.php";
    break;
    case "xuetang";
    include "../page/xuetang.php";
    break;
      case "pass_xiugai";
    include "../page/pass_xiugai.php";
    break;
    
}




?>



</div>


</div>
<div class="dibu">
<br>
<?php 
  $replace_dibu=str_replace("@",";",$admin_dibu_row['dibu']);
  echo htmlspecialchars_decode($replace_dibu);
 ?>
<br>
<p><img src="../image/qq.png"/>&nbsp;<img src="../image/360.jpg"/></p>
</div>



</div>
</body>
<script>
var j=0;
setInterval(function(){
    var center_width=$(".topcenter_span").width(); 
    j--;
    $(".topcenter_span").css({"left":j+"px"});
    if(j<-center_width){j=center_width;}
},10)


$("#left_li1").click(function(){
    $(".caidan1").toggle();
})

$("#left_li2").click(function(){
    $(".caidan2").toggle();
})

$("#left_li3").click(function(){
    $(".caidan3").toggle();
})

$("#left_li4").click(function(){
    $(".caidan4").toggle();
})
</script>
</html>