<?php
$classid=SafeRequest("classId","get");
if($op==""){
$op="my";
}
?>
		<div class="userMain">
			<div class="uMain_title"><span class="iconFavorites">舞曲收藏</span></div>
			<div class="uMain_content">
				<div class="stageBox">
					<div class="stageBoxTop"><span></span></div>
					<div class="stageBoxCenter">
						<div class="stageBoxCenterContent">
							<div class="main_nav">
								<ul>
								<li class="<?php if($op=="my"){ echo "nava_4";}else{ echo "navb_5";}?>"><a href="?ac=fav&op=my">我的收藏</a></li>
								<li class="<?php if($op=="Friend"){ echo "nava_4";}else{ echo "navb_5";}?>"><a href="?ac=fav&op=Friend">大家的收藏</a></li>

								</ul>
							</div>
							<div class="main_nav2">
								<ul>
								<li <?php if($classid==""){ echo "class='nav2a_4'";}else{ echo "";}?>><a href="?ac=fav&op=<?php echo $op?>">全部舞曲</a></li>
<?php
	global $db;
	$sql="select * from s_class where S_SystemID=1 and S_IsHide=0 order by S_id asc";
	$rs=$db->query($sql);
	$num=$db->num_rows($rs);
	if($num==0) echo "<li>没有栏目类容。</li>";
	$nums=6;
	if($num<$nums){
		$j=$num;
	}else{
		$j=$nums;
	}
	for($i=0;$i<$j;$i++){
		$row=$db->fetch_array($rs);
?>
								<li <?php if($classid==$row["S_ID"]){ echo "class='nav2a_4'";}else{ echo "";}?>><a href="?ac=fav&op=<?php echo $op?>&classId=<?php echo $row["S_ID"]?>"><?php echo $row["S_Name"]?></a></li>
<?php
	}
?>

								</ul>
							</div>
							<div class="minHeight500" id="favoritesFriend">
<?php
if($op=="my"){
?>
								<div class="favoritesList" id="list">
<?php
}else{
?>
								<div class="favoritesFriend" id="list">

<?php
}
$a=1;
if($op=="my"){
global $db;
if($classid==""){
	$sql="select * from s_usersc where S_User='".$chsh_username."' order by s_addtime desc";
}else{
	$sql="select * from s_usersc where S_User='".$chsh_username."' and S_Classid=$classid order by s_addtime desc";
}
}elseif($op=="Friend"){
if($classid==""){
	$sql="select * from s_usersc order by s_addtime desc";
}else{
	$sql="select * from s_usersc where S_Classid=$classid order by s_addtime desc";
}
}
		$Arr=getuserpage($sql,"30");//sql,每页显示条数
		$result=$db->query($Arr[2]);
		$numdate="a";
		if($result){
			while ($row = $db ->fetch_array($result)){
		$numdate="b";
	$sqlu="select * from s_users where S_name='".$row["S_User"]."' order by s_id desc";
	$rsu=$db->query($sqlu);
	$rowu=$db->fetch_array($rsu);
    $sqlug="select * from s_class where S_ID=".$row["S_Classid"];
	$results = $db->query($sqlug);
	$rowug = $db->fetch_array($results);
	$classname=$rowug["S_Name"];
    $sqlud="select * from s_video where S_ID=".$row["S_Djid"];
	$results = $db->query($sqlud);
	$rowud = $db->fetch_array($results);
	$S_Reco=$rowud["S_Reco"];
if($S_Reco>0){
	$S_Reco=$S_Reco-1;
}
if($op=="my"){
?>
		<li><span class="cbox"><input name="checked" type="checkbox" value="<?php echo $row["S_Djid"]?>" /></span><span class="mname"><a href="<?php echo LinkUrl("s_video",$row['S_Classid'],1,$row['S_Djid'])?>" target="p"><?php echo $a?>.<?php echo $row["S_Name"]?></a></span><span class="mclass"><?php echo $classname?></span><span class="mrank appraise<?php echo $S_Reco?>" title="我的热爱级别"></span><span class="mtime" title="收藏时间"><?php echo datetime($row["S_Addtime"])?></span><span id="del-m42559" class="mdel" title="删除" onClick="window.open('do.php?ac=fav&op=del&id=<?php echo $row["S_ID"]?>')"></span></li>
<?php
}else{
?>
		<li><span class="icon"></span><span class="cbox"><input name="checked" type="checkbox" value="<?php echo $row["S_Djid"]?>" /></span><span class="mname"><a href="<?php echo LinkUrl("s_video",$row['S_Classid'],1,$row['S_Djid'])?>" target="p"><?php echo $a?>.<?php echo $row["S_Name"]?></a></span><span class="favoritesUser" title="收藏者：<?php echo $row["S_User"]?>"><p><img src="<?php echo piclink("logo",$rowu["S_Logo"],"big")?>" onerror="this.onerror=null;this.src='<?php echo S_SiteDomain?>/user/images/avatar/noface_small.gif'"/><a href="<?php echo userlink("index",$row["S_User"])?>" target="_blank"><?php echo $row["S_User"]?></a></p></span><span class="mclass"><?php echo $classname?></span><span class="mrank appraise<?php echo $S_Reco?>" title="TA的热爱度"></span><span class="mtime" title="收藏时间"><?php echo datetime($row["S_Addtime"])?></span></li>

<?php
}
$a=$a+1;
}
?>


																			</ul>
																	</div>
																<div class="page">
									<span class="button2-main"><span><button type="button" onclick=clk('all','list');>全选</button></span></span>
									<span class="button2-main"><span><button type="button" onclick=clk('un','list');>反选</button></span></span>
									<span class="button3-main"><span><button type="button" onclick=clk('play','list');>连续播放</button></span></span></form>
									<div class="pages"><?php echo $Arr[0];?></div>
<?php
}
if($numdate=="a"){
		echo("<div class='nothing'>还木有没有收藏舞曲。</div>");
}
?>
								</div>
															</div>
						</div>
					</div>
					<div class="stageBoxBottom"><span></span></div>
				</div>
			</div>