<?php
# Name: PHP版程氏音乐CMS管理系统 v3.0
# Author: 程氏<web@chshcms.com> [QQ:848769359]
# Homepage:http://www.chshcms.cn/
include_once("../lib/cs_conn.php");
include_once("../lib/cs_common.php");
//判断网站开关
if(CS_Weboff==1) exit(stripslashes(html_entity_decode(CS_Webnoneir)));
if(CS_UserFun==1) exit(Web_Error('抱歉,本站会员功能已经关闭!','/'));
$ac=CS_Request("ac");
$op=CS_Request("op");
if($ac=='reg') echo "<script>window.location.href ='reg.php';</script>"; 
if($ac=='lostpasswd') echo "<script>window.location.href ='pass.php';</script>"; 
if(isset($_COOKIE["cs_name"])) echo "<script>window.location.href ='space.php?ac=home';</script>"; 
?><!doctype html>
<html>
<head>
    <meta charset="gbk">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title>会员中心 - <?php echo CS_WebName?> - Powered by csdjcms Dance</title>
    <meta name="generator" content="csdjcms" />
    <link rel="stylesheet" href="css/index.css" type="text/css"/>
    <script src="../public/js/jquery.js"></script>
    <script language="javascript"> 
        $(document).ready(function(){
        $("#loginsubmit").click(function(){
		var username=$("#username").val();
		var password=$("#password").val();
	$("#username").css("border-color","#666 #ccc #ccc #666");
	$("#password").css("border-color","#666 #ccc #ccc #666");
	    if(username==""){
		$("#username").css("border","1px solid red");
		$("#tishi").text("请输入正确的账号！").css("color","red");
		return false;}
	    else if((len(username)<4)||(len(username)>16)){
		$("#username").css("border","1px solid red");
		$("#tishi").text("账号限制4-16位！").css("color","red");
		return false;}
	    else if(password==""){
		$("#password").css("border","1px solid red");
		$("#tishi").text("登陆密码不能为空！").css("color","red");
		return false;}
	    });
        });
        function len(s) {
	    var l = 0;
	    var a = s.split("");
	    for (var i=0;i<a.length;i++) {
	    if (a[i].charCodeAt(0)<299) {
		l++;
		}
	    else{
               l+=2;
		}
	    }
	    return l;
        }
    </script>
</head>
<body>
<div class="header">
  <div class="HL">
    <h1>CSDJCMS</h1>
  </div>
  <div class="HR"> <img src="images/noface_small.gif" width="48" height="48" alt="请登录"/>
    <p><a href="login.php">欢迎您登陆</a></p>
    <p><a href="reg.php">账号注册</a></p>
  </div>
</div>
<div class="main">
  <div class="ML">
    <ul>
      <li><img src="images/index/li1.gif" class="i0" width="94" height="94" alt="分享会员"> 
<?php
	global $db;
	$sql="SELECT COUNT(*) AS CS_ID,CS_User FROM ".Getdbname('dance')." GROUP BY CS_User ORDER BY CS_ID DESC LIMIT 0,14";
	$rs=$db->query($sql);
	$num=$db->num_rows($rs);
	for($i=0;$i<$num;$i++){
		$row=$db->fetch_array($rs);
                $us=$db->getrow("select * from ".Getdbname('user')." where CS_Name='".$row['CS_User']."'");
                $pic=piclink('logo',$us['CS_Logo']);
                if($i>1){
                      $ii=2;
                }else{
                      $ii=1;
                }

               echo "<a href=\"".userlink('index',$us['CS_ID'])."\" target=\"_blank\"><img src=\"".$pic."\" onerror=\"this.src='images/noface_small.gif'\" class=\"i".$ii."\" title=\"会员ID:".$us["CS_ID"].",会员呢称:".$us["CS_Nichen"]."\"></a>";
        }
?>
      </li>
      <li>
      <img src="images/index/li2.gif" class="i0" width="94" height="94" alt="活跃会员">
<?php
	global $db;
	$sql="select * from ".Getdbname('user')." where CS_Sid=0 order by CS_LogTime desc";
	$rs=$db->query($sql);
	$num=$db->num_rows($rs);
	$nums=14;
	if($num<$nums){
		$j=$num;
	}else{
		$j=$nums;
	}
	for($i=0;$i<$j;$i++){
		$row=$db->fetch_array($rs);
                $pic=piclink('logo',$row['CS_Logo']);
                if($i>1){
                      $ii=2;
                }else{
                      $ii=1;
                }

               echo "<a href=\"".userlink('index',$row['CS_ID'])."\" target=\"_blank\"><img src=\"".$pic."\" onerror=\"this.src='images/noface_small.gif'\" class=\"i".$ii."\" title=\"会员ID:".$row["CS_ID"].",会员呢称:".$row["CS_Nichen"]."\"></a>";
        }
?>
      </li>
      <li>
      <img src="images/index/li3.gif" class="i0" width="94" height="94" alt="人气会员">
<?php
	global $db;
	$sql="select * from ".Getdbname('user')." where CS_Sid=0 order by cs_hits desc";
	$rs=$db->query($sql);
	$num=$db->num_rows($rs);
	$nums=14;
	if($num<$nums){
		$j=$num;
	}else{
		$j=$nums;
	}
	for($i=0;$i<$j;$i++){
		$row=$db->fetch_array($rs);
                $pic=piclink('logo',$row['CS_Logo']);
                if($i>1){
                      $ii=2;
                }else{
                      $ii=1;
                }

               echo "<a href=\"".userlink('index',$row['CS_ID'])."\" target=\"_blank\"><img src=\"".$pic."\" onerror=\"this.src='images/noface_small.gif'\" class=\"i".$ii."\" title=\"会员ID:".$row["CS_ID"].",会员呢称:".$row["CS_Nichen"]."\"></a>";
        }
?>
              </li>
      <li class="news">
      <img src="images/index/li4.gif" class="ip" alt="最新相册">
<?php
	global $db;
	$sql="select * from ".Getdbname('pic')." order by cs_id desc";
	$rs=$db->query($sql);
	$num=$db->num_rows($rs);
	$nums=39;
	if($num<$nums){
		$j=$num;
	}else{
		$j=$nums;
	}
	for($i=0;$i<$j;$i++){
		$row=$db->fetch_array($rs);
                $us=$db->getrow("select * from ".Getdbname('user')." where CS_name='".$row['CS_User']."'");
                echo '<a href="'.userlink('pick',$us['CS_ID'],$row['CS_ID']).'" target="_blank"><img src="'.getpic('url',$row['CS_ID']).'" class="ip" title="会员:'.$us["CS_Nichen"].'"></a> 
                    ';
        }
?>
              </li>
    </ul>
  </div>
  <div class="MR">
    <div class="Box"> 
      <div class="ta"> <span id="tishi"></span></div>
      <form name="loginform" action="do.php?ac=login" method="post">
        <div class="ta"> <span>账号</span>
          <input type="text" name="username" id="username" class="i1" />
        </div>
        <div class="ta"> <span>密码</span>
          <input type="password" name="password" id="password" class="i2" />
        </div>
        <span class="checkYes">
        <input type="checkbox" name="cookietime" id="cookietime" value="31536000" />
        记住用户名 <a href="?ac=lostpasswd">忘记密码？</a></span>
        <div class="clear"></div>
        <div class="ta">
          <input type="submit" id="loginsubmit" class="i3" value=""/>
        </div>
      </form>
      <div class="ta">
        <h2>使用合作网站账号登陆：</h2>
        <a href="open/qq/qq_login.php" style="margin-left:63px"><img src="images/index/qqconnect_1.gif" alt="使用QQ登录本站会员"></a>
      </div>
      <div class="ta">
  <a href="reg.php" style="margin-left:63px"><img src="images/index/regist_a.png" alt="您还不是会员？请点击注册"></a>
      </div>
      <div class="ta" style="margin-top:30px;">
	    <div class="gg"><h3>公告：</h3></div>
<?php
        $a=1;
	global $db;
	$sqlw="select * from ".Getdbname('news')." where CS_CID=7 order by CS_addtime desc";
	$rs=$db->query($sqlw);
	$num=$db->num_rows($rs);
        if($num==0) echo '<div class="gg">没有公告！</div>';
	$nums=5;
	if($num<$nums){
		$j=$num;
	}else{
		$j=$nums;
	}
	for($i=0;$i<$j;$i++){
		$row=$db->fetch_array($rs);
           echo '<div class="gg"><a href="'.LinkUrl('show','news','id',$row['CS_CID'],$row['CS_ID']).'" target="art">'.$a.'.'.$row["CS_Name"].'</a></div>';
        $a=$a+1;
	}
?> 
      </div>
    </div>
  </div>
  <div class="clear"></div>
</div>
<div class="footer">本站仅提供音乐作品的推广及发布服务，所有音乐的版权归各音乐公司及作者所有<br />Copyright &copy; 2013 <?php echo CS_WebUrl?> All Rights Reserved  <?php echo html_entity_decode(stripslashes(CS_WebCount))?></div>
</body>
</html>
