<?php 
session_start();
error_reporting(0);
header("content-type:text/html;charset=utf-8"); 
date_default_timezone_set("PRC");
if(!file_exists("myadmin/sql.php")){header("location:install/index.php");exit;}
include "myadmin/sql.php";
$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">
<script src="jquery.js"></script>
<style>
*{
    margin: 0px;
    padding:0px;
    font-family: 微软雅黑;
}
a{
    text-decoration: none;
    color:#009999;
}
li{
    list-style: none;
}
.ceng{
    width: 100%;
    height:1610px;
    background:#588;
    opacity:0.5;
    position:absolute;
    top:0px;
    left:0px;
    display:none;
    filter:Alpha(opacity=50);
}
.ceng2{
    width:550px;
    height:550px;
    background:#fff;
    position:absolute;
    top:50%;
    left:50%;
    margin-top:-275px;
    margin-left:-275px;
    display:none;
}
.ceng3{
    width:550px;
    height:550px;
    background:#fff;
    position:absolute;
    top:50%;
    left:50%;
    margin-top:-275px;
    margin-left:-275px;
    display:none;
}
.biaotou{
    width:550px;
    height:50px;
    background:#009999;
}
.biaowei{
    width:500px;
    height:500px;  
}
.table1{
    width:490px;
    margin:10px 0px 0px 60px;
    line-height:50px;
}
input{
    width:300px;
    height:30px;
}
#main{
    margin:0 auto;
    width:1280px;
    height: auto;
}
.top{
    width:1280px;
    height:60px;
    background:#F9F9F9;
    margin:0 auto;
}
.topleft{
    width: 1180px;
    height:60px;
    float:left;
}
.topright{
    width: 100px;
    height:60px;
    float:left;
}
.daohanglan{
    width:1280px;
    height:200px;
    background:#fff;
    margin:0 auto;
    border-bottom: 1px solid #BCBCBC;
}
.imgdiv{
    height: 200px;
    width:500px;
    background: #fff; 
    float:left; 
}

.daohang{
    float:left;
    width: 580px;
    height:200px;
}
.daohang ul li{
    font-size: 25px;
    float: left;
    list-style: none;
    margin:90px 0px 0px 100px;
}
.shouji_eweima{
    text-align:center;
    float:left;
    width: 200px;
    height:200px;  
}
.gundong{
    width:1280px;
    height:350px;
    background:#fff;
    overflow: hidden;
}
.wrap{
    margin:0 auto;
}
.bottom{
    width:1280px;
    height: 755px;
    margin:0 auto;
}
.bottom .botcenter{
    width:900px;
    height:755px;
    background:#fff;
    float:left;
    
}
.renwuzhuanqian{
    float:left;
    width:900px;
    height:150px;
    background:#fff;
    border-bottom:1px solid #BCBCBC;
}
.renwuimg{
    width:150px;
    height:150px;
    background:#009999;
    text-align:center;
    float:left;
}
.renwuwenzi{
    width:750px;
    height:150px;
    background:#009999;
    float:left;
    
}
.renwuimg img{
    margin-top: 25px;
}
.renwup{
    font-size:25px;
    margin-top: 40px;
}
.bottom_right_main{
    width:378px;
    height:754px;
    float:left;
    border:1px solid #BCBCBC;
}
.bottom_right_top{
    width:378px;
    height:30px;
    border-bottom:1px solid #BCBCBC;
}
.bottom #botright{
    width:378px;
    height:722px;
    background:#fff;
    overflow: hidden;
}
#botright ul li{
    height:20px;
    color:#3A3A3A;
    text-align:center;
}
.dibu{
    width:1280px;
    height:245px;
    text-align:center;
    background:#333438;
    color:#888872;
}
.dibu ul{
    padding-top:20px;
}
</style>

	<title>诗龙分享传播推广系统</title>
</head>
<body>
<div class="ceng">
</div>
<div class="ceng2">
<div class="biaotou">
<p style="line-height:50px;"><span style="margin-left: 240px; color: #fff;">用户注册</span><img  id="guanbi" style="margin-left: 190px;" src="myadmin/image/guanbi.png"/></p>
</div>
<div class="biaowei">
<table class="table1">
<form id="form1" action="user/insert.php" method="post">
<tr>
<td>
用户：<input id="userid" type="text" name="user" class="auth"/>&nbsp;<span style="color: red;">*</span><span id="cunzai"></span>
</td>
</tr>
<tr>
<td>
密码：<input id="passid" type="password" name="password" class="auth"/>&nbsp;<span style="color: red;">*</span><span id="mima" style="color: red;display:none;">密码不小于6位</span>
</td>
</tr>
<tr>
<td>
确认：<input id="querenid" type="password" name="queren" class="auth"/>&nbsp;<span style="color: red;">*</span><span id="yizhi" style="color: red;display:none;">两次密码不一致</span>
</td>
</tr>
<tr>
<td>
QQ号：<input style="width:303px;" id="qqid" type="text" name="qq" class="auth"/>&nbsp;<span style="color: red;">*</span><span id="qqerror" style="color: red;display:none;">必须填写</span>
</td>
</tr>
<tr>
<td>
支付宝账号：<input id="zhifubaoid" style="width:250px;" type="text" name="zhifubao" class="auth"/>&nbsp;<span style="color: red;">*</span><span id="zhifubaoerror" style="color: red;display:none;">必须填写</span>
</td>
</tr>
<tr>
<td>
支付宝姓名：<input id="xingmingid" style="width:250px;" type="text" name="zhifubaoxingming" class="auth"/>&nbsp;<span style="color: red;">*</span><span id="xingmingerror" style="color: red;display:none;">必须填写</span>
</td>
</tr>
<tr>
<td>
密码问题：<input id="wenti" style="width:270px;" type="text" name="wenti" class="auth"/>&nbsp;<span style="color: red;">*</span><span id="wentierror" style="color: red;display:none;">必须填写</span>
</td>
</tr>
<tr>
<td>
密码答案：<input id="daan" style="width:270px;" type="text" name="daan" class="auth"/>&nbsp;<span style="color: red;">*</span><span id="daanerror" style="color: red;display:none;">必须填写</span>
</td>
</tr>
<tr>
<td>
<input type="button" id="btn1" style="width: 70px;" value="提交"/>
<input type="reset" style="width: 70px;" value="重置"/>
</td>
</tr>
</form>
</table>
</div>
</div>
<div class="ceng3">
<div class="biaotou">
<p style="line-height:50px;"><span style="margin-left: 240px;color: #fff;">用户登录</span><img  id="guanbi2" style="margin-left: 190px;" src="myadmin/image/guanbi.png"/></p>
</div>
<div class="biaowei">
<table class="table1">
<form id="form2" action="user/login_queren.php" method="post">
<tr>
<td>
用户：<input id="userid2" type="text" name="user2" class="auth2"/><span style="color: red;">*</span><span id="usererror" style="color: red;"></span>
</td>
</tr>
<tr>
<td>
密码：<input id="passid2" type="password" name="password2" class="auth2"/><span style="color: red;">*</span><span id="passerror" style="color: red;"></span>
</td>
</tr>
<tr>
<td>
验证码：<input id="yzminput" type="text" name="yzm" style="width: 100px;" class="auth2" />&nbsp;<span id="yzm" style="padding:3px 30px 3px 30px;font-size:20px;background: #23334C;border: 1px solid #fff;"></span>
&nbsp;&nbsp;<a href="javascript:;" id="kan">看不清</a>&nbsp;&nbsp;<span id="yzmerror" style="color: red;"></span>
</td>
</tr>
<tr>
<td>
<input id="btn2" style="width:50px;" type="button" value="提交"/>&nbsp;&nbsp;&nbsp;
<input style="width:50px;" type="reset" value="重置"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="">忘记密码?</a>&nbsp;&nbsp;还没账号&nbsp;&nbsp;<a id="dl_zhuce" href="javascript:;">注册</a>
</td>
</tr>
</form>
</table>
</div>
</div>
<div id="main">
<div class="top">
<div class="topleft">
<p style="line-height:60px;">&nbsp;<?php if(isset($_SESSION['username'])){echo "欢迎：".$_SESSION['username'];echo "&nbsp;&nbsp;&nbsp;<a href='user/user_index.php'>[用户中心]</a>";}else{echo "欢迎：游客";} ?></p>
</div>
<div class="topright">
<p style="line-height:60px;"><?php if(isset($_SESSION['username'])){echo "<a href='user/loginout.php'>退出</a>";}else{echo "<span id='zhuce' style='cursor:pointer;'>注册</span>&nbsp;<span id='denglu' style='cursor:pointer;'>登录</span>";} ?></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="index.php"><?php echo $xg_logo_row['logo'];?></a>
</p>
</div>
<div class="daohang">
<ul>
<li>
<a href="index.php">网站首页</a>
</li>
<li>
<a href="#1f" href="">赚钱推广</a>
</li>
</ul>
</div>

</div>
<div class="gundong">
<img id="gundong_img" style="width: 1280px;height:330px;">
</div>
<div class="bottom">
<div class="botcenter" >


<div style='width:900px;height:755px;background:#fff;'>
<center>
<a name="1f">
<p style="font-size: 20px;text-align: center;color:#676767;">分享传播推广赚钱列表</p>
<br/>
<table width="900px" align="center" cellspacing="0" style="color:#676767;">
<tr style="background: #009999;height:30px;color:#fff;"><th>序号</th><th>推广标题</th><th>推广金额</th><th>推广余额</th><th>推广单价</th><th>推广数量</th><th>剩余数量</th><th>投放区域</th><th>是否结束</th><th>发布时间</th><th>开始赚钱</th></tr>
<?php

//查询用户id并带到文章页面
//$cha_uid="select id from user where username='{$username}'";
//$cha_rst=mysql_query($cha_uid);
//$cha_row=mysql_fetch_assoc($cha_rst);
$length=10;
$totsql="select count(*) from user_renwu";
$totrst=mysql_query($totsql);
$totarr=mysql_fetch_row($totrst);
//总页数
$totpage=ceil($totarr[0]/$length);
//当前页
$pagenum=@$_GET['page']?@$_GET['page']:1;
//限制最大页数
if($pagenum>=$totpage){$pagenum=$totpage;}
//offset算法
$offset=($pagenum-1)*$length;
$zhuansql="select * from user_renwu order by id desc limit {$offset},{$length} ";
$zhuanrst=mysql_query($zhuansql);

//获取所有数据
$i=0;
while($zhuanrow=@mysql_fetch_assoc($zhuanrst)){
    $i++;
    echo "<tr align='center' style='height:50px;background:#fff;'>"; 
    echo "<td>";
    echo "<span style='padding:2px 5px 2px 5px;background:#ccc;'>{$i}</span>";
    echo "</td>";
    echo "<td>";
    echo mb_substr($zhuanrow['biaoti'],0,7,"utf-8").'...';
    echo "</td>";
    echo "<td>";
    echo $zhuanrow['jiner']."元";
    echo "</td>";
    echo "<td>";
    echo $zhuanrow['yuer']."元";
    echo "</td>";
    echo "<td>";
    echo $zhuanrow['meijian']."元";
    echo "</td>";
    echo "<td>";
    echo $zhuanrow['jianshu']."个";
    echo "</td>";
    echo "<td>";
    echo $zhuanrow['shengyu']."个";
    echo "</td>";
    echo "<td>";
    echo $zhuanrow['jilian'];
    echo "</td>";
    echo "<td>";
    if($zhuanrow['jieshu']){
        echo "<span style='color:red;'>结束</span>";
    }else{
        echo "<span style='color:#009999;'>正常</span>";
    }
    echo "</td>";
    echo "<td>";
    echo date("Y/m/d",$zhuanrow['time']);
    echo "</td>";
    echo "<td>";
    if(isset($_SESSION['username'])){
        echo "<a href='user/user_index.php' style='color:#111;padding:2px 5px 2px 5px;'><img style='border:0px;' src='image/lqtg.png'></a>";
    }else{
        echo "<a class='lingqu' href='javascript:;' style='color:#fff;padding:2px 5px 2px 5px;'><img style='border:0px;' src='image/lqtg.png'></a>";
    }
    
    echo "</td>";
    echo "</tr>";
    
}
echo "</table>";
//计算上一页和下一页
$prevpage=$pagenum-1;
$nextpage=$pagenum+1;
echo "<br/>";
echo "<p>";
echo "<a href='index.php?page=1'>首页</a>&nbsp;<a href='index.php?page={$prevpage}'>&lt;上一页</a>";
echo "&nbsp;<a style='color:#009999;' href='index.php?page={$pagenum}'>{$pagenum}</a>&nbsp;/&nbsp;<span>{$totpage}</span>";
echo "<a href='index.php?page={$nextpage}'>&nbsp;下一页&gt;</a>&nbsp;<a href='index.php?page={$totpage}'>尾页</a>";
echo "</p>";
@mysql_free_result($zhuanrst);
mysql_free_result($totrst);
?>
</center>
</div>

</div>
<div class="bottom_right_main" style="display: none;">
<div class="bottom_right_top">
<p style="text-align: center;line-height:30px;color:#000;font-size:20px;">今日提现会员</p></div>
<div id="botright">
<?php
$zuogundong="select * from zuogundong";
$row=mysql_fetch_assoc(mysql_query($zuogundong));
$replace=str_replace("@",";",$row['neirong']);
echo htmlspecialchars_decode($replace);
?>
</div>
</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 i=0;
setInterval(function(){
    ++i;
    if(i>4){
        i=1;
        
    }
    $("#gundong_img").attr("src","image/load"+i+".jpg");
    
    
},2500)

var lih=80;
var time;
botright.innerHTML+=botright.innerHTML;
botright.scrollTop=0;
function smove(){
    botright.scrollTop++;
    time=setInterval("sup()",1);
}
function sup(){
    if(botright.scrollTop%lih==0){
        clearInterval(time);
        setTimeout("smove()",2000);
    }else{
        botright.scrollTop++;
        if(botright.scrollTop>=botright.scrollHeight/2){
            botright.scrollTop=0;
        }
    }
}
setTimeout("smove()",2000);



$("#passid").val("");
$("#querenid").val("");

$("#guanbi").click(function(){
    $(".ceng").css({"display":"none"});
    $(".ceng2").css({"display":"none"});
})

$("#zhuce").click(function(){
    $(window).scrollTop(0);
    $(".ceng").css({"display":"block"});
    $(".ceng2").css({"display":"block"});
})

$("#guanbi2").click(function(){
    $(".ceng").css({"display":"none"});
    $(".ceng3").css({"display":"none"});
})

$("#denglu").click(function(){
    $(window).scrollTop(0);
    $(".ceng").css({"display":"block"});
    $(".ceng3").css({"display":"block"});
})

$(".lingqu").click(function(){
    $(window).scrollTop(0);
    $(".ceng").css({"display":"block"});
    $(".ceng3").css({"display":"block"});
})

$("#dl_zhuce").click(function(){
    $(".ceng3").hide();
    $(".ceng2").show();
})

$("#passid").blur(function(){
    var passval=$(this).val();
    if(passval.length<6){
        $("#mima").show();
        $(this).data({"s":0});
    }else{
        $("#mima").hide();
        $(this).data({"s":1});
        }
})

$("#querenid").blur(function(){
    var passval=$("#passid").val();
    var querenval=$(this).val();
    if(passval!==querenval){
        $("#yizhi").show();
        $(this).data({"s":0});
    }else{
        $("#yizhi").hide();
        $(this).data({"s":1});
    }
})

$("#userid").blur(function(){
var user=$(this).val();
if(user!=""){
$.post("user/userajax.php",{"user111":user},function(data){
          if(data=="yes"){
            $("#cunzai").html("用户已存在");
            $("#cunzai").css({"color":"red"});
            $("#userid").data({"s":0});
          }else{
            $("#cunzai").html("恭喜可以注册");
            $("#cunzai").css({"color":"green"});
            $("#userid").data({"s":1});
          }
  })
}else{
    alert('用户名不能为空');
} 
})

$("#qqid").blur(function(){
    var qqval=$(this).val();
    if(qqval==""){
        $("#qqerror").show();
        $(this).data({'s':0});
    }else{
        $("#qqerror").hide();
        $(this).data({'s':1});
    }
    
})

$("#zhifubaoid").blur(function(){
    var zhifubaoval=$(this).val();
    if(zhifubaoval==""){
        $("#zhifubaoerror").show();
        $(this).data({'s':0});
    }else{
        $("#zhifubaoerror").hide();
        $(this).data({'s':1});
    }
    
})

$("#xingmingid").blur(function(){
    var xingmingval=$(this).val();
    if(xingmingval==""){
        $("#xingmingerror").show();
        $(this).data({'s':0});
    }else{
        $("#xingmingerror").hide();
        $(this).data({'s':1});
    }
    
})

$("#wenti").blur(function(){
    var wentival=$(this).val();
    if(wentival==""){
        $("#wentierror").show();
        $(this).data({'s':0});
    }else{
        $("#wentierror").hide();
        $(this).data({'s':1});
    }
    
})

$("#daan").blur(function(){
    var daanval=$(this).val();
    if(daanval==""){
        $("#daanerror").show();
        $(this).data({'s':0});
    }else{
        $("#daanerror").hide();
        $(this).data({'s':1});
    }
    
})



$("#btn1").click(function(){
  $("#userid").blur();
  $("#passid").blur();
  $("#querenid").blur();
  $("#qqid").blur();
  $("#zhifubaoid").blur();
  $("#xingmingid").blur();
  $("#wenti").blur();
  $("#daan").blur();
  tot=0;
  $(".auth").each(function(){
    tot+=$(this).data('s');
    
  })
  if(tot==8){
    $("#form1").submit();
  } 
})


$.post("user/yzm.php",function(data){
    $("#yzm").html(data);
})

$("#userid2").blur(function(){
    var username2=$.trim($("#userid2").val());
    thiz=$(this);
    $.post("user/yz_user.php",{"username":username2},function(data){
        if(data=='no'){
            $("#usererror").html("用户有误");
            $(thiz).data({'c':0});
        }else{
            $("#usererror").html("");
            $(thiz).data({'c':1});
        }
    })
})

$("#passid2").blur(function(){
    var user=$.trim($("#userid2").val());
    var pass=$.trim($("#passid2").val());
    thiz=$(this);
    $.post("user/loginajax.php",{"username":user,"password":pass},function(data){
        if(data=='no'){
            $("#passerror").html("密码有误");
            $(thiz).data({'c':0});
        }else{
            $("#passerror").html("");
            $(thiz).data({'c':1});
        }
    })
})

$("#yzminput").blur(function(){
    var yzminput=$.trim($(this).val());
    var yzmdata=$("#yzm").html();
 if(yzmdata!=yzminput){
    $("#yzmerror").html("验证码有误");
    $(this).data({"c":0});
 }else{
    $("#yzmerror").html("");
    $(this).data({"c":1}); 
 }
})

$("#btn2").click(function(){
    $("#userid2").blur();
    $("#passid2").blur();
    $("#yzminput").blur();
    $.post("user/yzm.php",function(data){
    $("#yzm").html(data);
})
    tot2=0;
    $(".auth2").each(function(){
    tot2+=$(this).data("c");
  })
  if(tot2==3){
        $("#form2").submit();
  }
  
})

 
$("#kan").click(function(){
    $.post("user/yzm.php",function(data){
        $("#yzm").html(data);
    })
})
</script>
</html>
