<?php
include "../../include/label.php";
$ac=SafeRequest("ac","get","zr");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script>if(top==self)top.location="http://www.pj57.com"</script>
<script language="JavaScript"> 
document.oncontextmenu=new Function("event.returnValue=false;"); 
document.onselectstart=new Function("event.returnValue=false;"); 
</script>
<style type="text/css">
form, input, ul, div,li,img{border:0px; margin:0px;padding: 0px;text-align:left;border:0px none;list-style:none;}
body {font-size:12px;color: #FF6600;background:#11161A; cursor: url('http://img.ik123.com/js/ico/joekoe.cur');}
A {font-size: 12px; color: #83CDE1; text-decoration: none}
a:visited {text-decoration: none;color: #83CDE1;}
a:hover {text-decoration: none;color: #FF6600;}
a:active {text-decoration: none;}
.d,.d1,.dx,.u{background: url(images/hui_titleBG.gif);}
#gqtour ul{width:650x;}
#gqtour .paigm{width:211px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:#253A41;}
#gqtour li{float:left;line-height:24px;HEIGHT: 24px;border-bottom:solid 1px #11161A;border-right:solid 1px #11161A;}
#gqtour .pairq{width:40px;background:#253A41}
#gqtour .p{width:30px;}
#gqtour .b{width:646px;}
#gqtour .d{width:568px;text-align:left;border:0px;}
#gqtour .d1{width:40px;border:0px;}


#zjp {BACKGROUND: #11161a;border:solid 1px #253A41;width:647px;height:30px;}
#zjp a{width:30px;line-height:25px;height:25px;display: block;}
#zjp a:hover{background: #253a41; color:#FF9900;}
#zjp li{float:left;width:30px;line-height:25px;height:25px;text-align:center;background: url(images/FL.gif);border:solid 1px #000;margin:2px;}
#zjp .pageinfo{float:right;border:0px;width:200px;line-height:24px;height:24px;padding-top:1px;}
#zjp .pageinfo input{height:24px;line-height:23px; border:1px solid #253a41; color:#FF6600; background:url('images/hui_titleBG.gif');width:55px;text-align:center;}

#djourx ul{width:650px;height:575px;background:#253A41;}
#djourx li { float:left; margin:0px 0 0 0px; height:25px;}
#djourx p{float:left;border-bottom:solid 1px #11161A;border-right:solid 1px #11161A;line-height:24px;height:24px;text-align:center;}
#djourx .id{width:50px;}
#djourx .url{width:300px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#djourx .bf{width:59px;line-height:14px;height:14px;padding-bottom:5px; padding-top:5px}
#djourx .box{width:35px;background:#11161A;}
#djourx .day{width:80px;color: #5599bb;overflow:hidden;text-overflow:ellipsis;}
#djourx .b{width:649px;border-top:solid 3px #253A41;background:#11161A;}
#djourx .d{width:570px;text-align:left;line-height:24px;border:0px;}
#djourx .d1{width:40px;border:0px;line-height:24px;}
#djourx .n{color: #FF6600;}
#djourx .pageinfo{float:right;border:0px;width:200px;line-height:24px;height:24px;padding-top:1px;}
#djourx .pageinfo input{height:24px;line-height:23px; border:1px solid #253a41; color:#FF6600; background:url('images/hui_titleBG.gif');width:55px;text-align:center;}

</style>
<script type="text/javascript">var web_url ="/";</script>
<script type="text/javascript" src="js/js.js"></script>
</head>
<body>
<?php
if($ac=="5x"){
?>
<form id="musiclist" name="musiclist" method="get">
<div id="gqtour" WIDTH="658">
<ul>
<li class="d1"><img src="images/play.gif"alt="推荐DJ舞曲" width="30" height="14"></li>
<li class="d"><b><a class="time" href=/toplist/?ac=5x target=_blank>本站推荐DJ舞曲</a></b></li>
<li class="d1"><a href="/toplist/?ac=5x" target=_blank>更多..</a></li>
<li class="p">&nbsp;&nbsp;选</li>
<li class="paigm">&nbsp;舞曲</li>
<li class="pairq">&nbsp;下载</li>
<li class="pairq">&nbsp;视听</li>
<li class="p">&nbsp;&nbsp;选</li>
<li class="paigm">&nbsp;舞曲</li>
<li class="pairq">&nbsp;下载</li>
<li class="pairq">&nbsp;视听</li>
<?php
	global $db;
	$sql="select * from s_video where S_IsHide=0 order by s_reco desc";
	$Arr=djpage($sql,"20");//sql,每页显示条数
	$result=$db->query($Arr[2]);
	$numdate="a";
	if($result){
		while ($row = $db ->fetch_array($result)){
?>
<li class="p">&nbsp;<input type="checkbox" name="checkbox" value="<?php echo $row['S_ID']?>" /></li>
<li class="paigm">&nbsp;<a href=<?php echo LinkUrl("s_video",$row['S_ClassID'],1,$row['S_ID'])?> target=_blank><?php echo $row['S_Name']?> </a></li>
<li class="pairq">&nbsp;<a href=/down.asp?id=<?php echo $row['S_ID']?>>下载</a></li>
<li class="pairq">&nbsp;&nbsp;<a href=<?php echo LinkUrl("s_video",$row['S_ClassID'],1,$row['S_ID'])?> target=_blank><img src=/skins/skin_01/images/real_play.gif alt="↘舞曲：<?php echo $row['S_Name']?>↘视听：<?php echo $row['S_Hits']?>次"></a></li>
<?php
                }
        }
?>
</ul>
<div id="zjp">
<?php echo $Arr[0];?>
<li class="pageinfo"><input type="button" onclick="CheckAll(this.form);" value="全 选" title="选择显示的所有歌曲"/>
<input type="button" onclick="CheckTurn(this.form);" value="反 选" title="反向选择歌曲"/>
<input type="button" onclick="CheckRun(this.form);" value="连 播" title="请先选择你想听的歌曲后再点击连 播" /></li>
</div>
</div>
</form>
<?php
}else{
?>
<form id="musiclist" name="musiclist" method="get">
<div id="djourx">
<ul>
<li class="d1">&nbsp;<img src="images/heom.gif"alt="最新DJ舞曲" width="30" height="14"></li>
<li class="d"><b><a class="time" href=/toplist/?ac=news target=_blank>本站最新DJ舞曲</a></b></li>
<li class="d1"><a href="/toplist/?ac=news" target=_blank>更多..</a></li>
<li class="n"><p class="id">编号</p><p class="box">选择</p><p class="url">歌曲</p><p class="bf">试听</p><p class="bf">人气</p><p class="bf">下载</p><p class="day">更新时间</p></li>
<?php
	global $db;
	$sql="select * from s_video where S_IsHide=0 order by s_addtime desc";
	$Arr=djpage($sql,"21");//sql,每页显示条数
	$result=$db->query($Arr[2]);
	$numdate="a";
	if($result){
		while ($row = $db ->fetch_array($result)){
?>
<li onmouseover="this.style.backgroundColor='#11161A'" onmouseout="this.style.backgroundColor=''"><p class="id"><?php echo $row['S_ID']?></p><p class="box"><input type="checkbox" name="checkbox" value="<?php echo $row['S_ID']?>" /></p><p class="url"><a href=<?php echo LinkUrl("s_video",$row['S_ClassID'],1,$row['S_ID'])?>><?php echo $row['S_Name']?></a> </p><p class="bf"><a href=<?php echo LinkUrl("s_video",$row['S_ClassID'],1,$row['S_ID'])?>><img src=/skins/skin_01/images/real_play.gif alt="试听DJ芳芳打造越鼓迷情专辑之情急智生 （BPM140）"></a></p><p class="bf">1</p><p class="bf"><a class="he" href='/down.php?id=<?php echo $row['S_ID']?>'>下载</a></p><p class="day"> <?php echo $row['S_AddTime']?></p></li>
<?php
                }
        }
?>
</ul>
<div id="zjp">
<?php echo $Arr[0];?>
<li class="pageinfo"><input type="button" onclick="CheckAll(this.form);" value="全 选" title="选择显示的所有歌曲"/>
<input type="button" onclick="CheckTurn(this.form);" value="反 选" title="反向选择歌曲"/>
<input type="button" onclick="CheckRun(this.form);" value="连 播" title="请先选择你想听的歌曲后再点击连 播" /></li>
</div>
</div>
</form>
<?php
}
function djpage($mysql,$pagesize,$pagenum=9){
	$url=$_SERVER["QUERY_STRING"];
	if(stristr($url,'&pages')) $url=preg_replace('/&pages=([\S]+?)$/','',$url);
	if(stristr($url,'pages')) $url=preg_replace('/pages=([\S]+?)$/','',$url);                                                   
	if(IsNul($url)) $url.="&"; 
	global $db;
	$pages=SafeRequest("pages","get","zr");
	$pagesok=$pagesize;//每页显示记录数
    if (!isset($pages)||$pages==""||!is_numeric($pages)||$pages<=0) $pages=1;
  	$sqlstr=$mysql;
  	$res=$db -> query($sqlstr);
 	$nums= $db -> num_rows($res);
	if($nums==0){$nums=1;}
    $pagejs=ceil($nums/$pagesok);//总页数
    if($pages>$pagejs){
     $pages=$pagejs;
    }
    $sql=$sqlstr." LIMIT ".$pagesok*($pages-1).",".$pagesok;
	$result = $db -> query($sql);
	$str="";
	$first="?".$url."pages=1";
	$pageup="?".$url."pages=".($pages-1)."";
	$pagenext="?".$url."pages=".($pages+1)."";
        if($pages<2){
             $str.="<li><font color=#FF9900>首页</font></li>";
        }else{
              $str.="<li><a href='".$first."'>首页</a></li>";
        }
	if($pagejs<=$pagenum){
  		for($i=1;$i<=$pagejs;$i++){
                   if($pages==$i){
                             $str.="<li><font color=#FF9900>".$i."</font></li>";
                   }else{
   		             $str.="<li><a href='?".$url."pages=".$i."'>".$i."</a></li>";
                   }
 	 	}
	}
	else{
 		if($pages>=($pagenum)){
 			for($i=$pages-intval($pagenum/2);$i<=$pages+(intval($pagenum/2));$i++){
   				if($i<=$pagejs){
                                  if($pages==$i){
                                       $str.="<li><font color=#FF9900>".$i."</font></li>";
                                  }else{
   		                       $str.="<li><a href='?".$url."pages=".$i."'>".$i."</a></li>";
                                  }
    			}
  			}
   		}
  		else{
  			for($i=1;$i<=$pagenum;$i++){
                                  if($pages==$i){
                                       $str.="<li><font color=#FF9900>".$i."</font></li>";
                                  }else{
   		                       $str.="<li><a href='?".$url."pages=".$i."'>".$i."</a></li>";
                                  }
 		} 
 		 }
	}
          $str.="<li><a href='".$pagenext."'><font face='Webdings'>8</font></a></li>";
          $str.="<li><a href='?".$url."pages=".$pagejs."'><font face='Webdings'>:</font></a></li>";
	 while ($row = $db -> fetch_array($result) ){ }
	 $arr=array($str,$result,$sql,$nums,$pagelist,$pages,$pagejs,$first,$pageup,$pagenext,$last,$pagesok);
	  @mysql_free_result($res);
	 return $arr;
}
?>
</body>
</html>