<?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_UserFun==1) exit(Web_Error('抱歉,本站会员功能已经关闭!','/'));
if(isset($_COOKIE["cs_name"])) echo "<script>window.location.href ='space.php?ac=home';</script>"; 
?><!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>用户登入 - <?php echo CS_WebName?></title>
    <link rel="stylesheet" href="css/style.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>
<form name="regform" action="do.php?ac=login" method="post">
<div class="header">
    	<h1><a href="http://<?php echo CS_WebUrl?>/" class=""><?php echo CS_WebName?></a></h1>
        <div class="point">
             <a href="<?php echo CS_WebPath?>">网站首页</a>
<?php
	global $db;
	$sqlw="select * from ".Getdbname('class')." where cs_sid=1 order by CS_sid desc";
	$rs=$db->query($sqlw);
	$num=$db->num_rows($rs);
	$nums=5;
	if($num<$nums){
		$j=$num;
	}else{
		$j=$nums;
	}
	for($i=0;$i<$j;$i++){
		$row=$db->fetch_array($rs);
           echo '<a href="'.LinkUrl('list','dance','id',$row['CS_ID']).'" target="art">'.$row["CS_Name"].'</a>';
	}
?> 
             <a href="./">会员中心</a>
        </div>
</div>
<form name="regform" action="do.php?ac=login" method="get">
<div class="lo_ct w960">
	<div class="lo_left ft">
		<dl>
			<dt><img src="images/dj.gif" alt="<?php echo CS_WebName?>" width="300" height="200" /></dt>
			<dd>
				<strong>《<?php echo CS_WebName?>》</strong>
				<p>在这里你可以上传个人原创、翻唱的音乐作品供大家分享并进行交流。<a href="reg.php" title="免费注册"  class="red">立即注册&gt;&gt;</a></p>
			</dd>
		</dl>
	</div>
	<div class="login_rt">
	<div class="lo_login rt">
		<h2>会员登录</h2>	
		<div id="tishi" class="wr">&nbsp;</div>	
		<table class="lo_list">
			<tr>
				<th>通行证：</th>
				<td><input name="username" type="text" id="username" class="lo_inp" onfocus="this.style.borderColor='#F93'" onblur="this.style.borderColor='#CCC'"/></td>
			</tr>
			<tr>
				<th>密&nbsp;&nbsp;&nbsp;码：</th>
				<td><input name="password" type="password" id="password" class="lo_inp" onfocus="this.style.borderColor='#F93'" onblur="this.style.borderColor='#CCC'"/></td>
			</tr>
			<tr class="lo_jiz">
				<th>&nbsp;</th>
				<td><input type="checkbox" name="cookietime" id="cookietime" value="31536000" />
			            <label for="IsSave">在这台电脑上记住我</label></td>
			</tr>
			<tr>
				<th>&nbsp;</th>
				<td><input type="submit" name="Button" value="登  录" id="loginsubmit" class="lo_bnt" />
			            <input type="button" value=" " class="qq_bnt" onclick="window.open('open/qq/qq_login.php')"/></td>
			</tr>
			<tr>
				<th>&nbsp;</th>
				<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <a href="pass.php" title="忘记密码">忘记密码</a>&nbsp;|&nbsp;
                                    <a href="reg.php" title="免费注册">免费注册</a>
                                </td>
			</tr>
		</table>
	</div>
	<div class="cl"></div>
</div></div>
<div class="dw_fr w960">
Copyright (C) 2009-2013 <?php echo CS_WebUrl?>, All Rights Reserved. <a href="http://<?php echo CS_WebUrl?>/" title="<?php echo CS_WebName?>"><?php echo CS_WebName?></a> 版权所有<br />
增值电信业务经营许可证：<?php echo CS_Webicp?> <?php echo html_entity_decode(stripslashes(CS_WebCount))?>
</div>
</form>
</body>
</html>
