<?php
$classid=SafeRequest("classId","get");
  if($op=="")  $op="list";
?>
		<div class="userMain">
			<div class="uMain_title"><span class="iconDance">舞曲分享</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=="ds"){ echo "nava_4";}else{ echo "navb_5";}?>"><a href="?ac=music&op=ds">待审舞曲</a></li>
								<li class="<?php if($op=="list"){ echo "nava_4";}else{ echo "navb_5";}?>"><a href="?ac=music&op=list">舞曲列表</a></li>
								</ul>
								<div class="action"><a href="?ac=music&op=add">上传舞曲</a></div>
							</div>
<?php if($op!="add"){ ?>
							<div class="main_nav2">
								<ul>
								<li <?php if($classid==""){ echo "class='nav2a_4'";}else{ echo "";}?>><a href="?ac=music&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=10;
	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=music&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
$a=1;
if($op=="ds"){
global $db;
if($classid==""){
	$sql="select * from s_video where S_Direct='".$chsh_username."' and S_IsHide=1 order by s_id desc";
}else{
	$sql="select * from s_video where S_Direct='".$chsh_username."' and S_Classid=$classid and S_IsHide=1 order by s_id desc";
}
}elseif($op=="list"){
if($classid==""){
	$sql="select * from s_video where S_Direct='".$chsh_username."' and S_IsHide=0 order by s_id desc";
}else{
	$sql="select * from s_video where S_Direct='".$chsh_username."' and S_Classid=$classid and S_IsHide=0 order by s_id desc";
}
}
		$Arr=getuserpage($sql,"30");//sql,每页显示条数
		$result=$db->query($Arr[2]);
		$numdate="a";
?>

								<div <?php if(($op=="add")){echo 'style="display:none;"';}?> class="favoritesList" id="list">
<?php
		if($result){
			while ($row = $db ->fetch_array($result)){
		$numdate="b";
    $sqlug="select * from s_class where S_ID=".$row["S_ClassID"];
	$results = $db->query($sqlug);
	$rowug = $db->fetch_array($results);
	$classname=$rowug["S_Name"];
	$S_Reco=$row["S_Reco"];
if($S_Reco>0){
	$S_Reco=$S_Reco-1;
}
?>
		<li><span class="cbox"><input name="checked" type="checkbox" value="<?php echo $row["S_ID"]?>" /></span><span class="mname"><a href="<?php echo LinkUrl("s_video",$row['S_ClassID'],1,$row['S_ID'])?>" 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></li>

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

																			</ul>
																	</div>
																<div <?php if(($op=="add")){echo 'style="display:none;"';}?> 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>
								</div>
<?php
if($numdate=="a"){
		echo("<div class='nothing'>还木有没有发布舞曲。</div>");
}
}
}else{
if((!$userlogin==true)){$disabled="disabled";}
$playadd=playadd(1);
?>
								<div class="profile">
									<div class="title">
										<div class="name">舞曲发布</div>
									</div>
									<ul><form  name="form3" action="do.php?ac=music&op=add" method="post"> 
										<li>
											<div class="name">名称：</div>
											<div class="input"><input type="texe" style="width:190px;" class="input_normal" name="S_Name" id="S_Name" maxlength="50"/></div>
											<div class="input_msg" id="moldpassword"><font color="#FF0000">＊</font>舞曲名称。</div>
										</li>
										<li>
											<div class="name">分类：</div>
											<div class="input"><select name="S_ClassID" id="S_ClassID">
              <?php
              	global $db;
              	$sqlclass="select * from s_class where S_SystemID=1 ";
				$results=$db->query($sqlclass);
				if($results){
					while ($row3=$db->fetch_array($results)){

							echo "<option value='".$row3['S_ID']."' >".$row3['S_Name']."</option>";
						
						}
					}
			  ?>	 
</select></div>
											<div class="input_msg" id="moldpassword"><font color="#FF0000">＊</font>舞曲风格分类。</div>
										</li>
										<li>
											<div class="name">专集：</div>
											<div class="input"><select name="S_Topic" id="S_Topic">
<option value='0' selected='selected'>选择专集</option>
              <?php
              	global $db;
              	$sqlclass="select * from s_topic where S_Keywords='".$chsh_username."'";
				$results=$db->query($sqlclass);
				if($results){
					while ($row3=$db->fetch_array($results)){

							echo "<option value='".$row3['S_ID']."' >".$row3['S_Name']."</option>";	
						
						}
					}
			  ?>	 
</select></div>
											<div class="input_msg" id="moldpassword"><font color="#FF0000">＊</font>舞曲所属专集。</div>
										</li>
										<li>
											<div class="name">歌手：</div>
											<div class="input"><input type="texe" style="width:190px;" class="input_normal" name="S_Author" id="S_Author" maxlength="20"/></div>
											<div class="input_msg" id="mpassword"><font color="#FF0000">＊</font>舞曲歌手，作者，公司。</div>
										</li>
										<li>
											<div class="name">来源：</div>
											<div class="input"><select name="S_Source" id="S_Source"><?php echo playselect($playadd,"");?></select></div>
											<div class="input_msg" id="mpassword2"><font color="#FF0000">＊</font>舞曲播放器类型,请认真选择。</div>
										</li>
										<li>
											<div class="name">地址：</div>
											<div class="input"><input type="texe" style="width:320px;" class="input_normal" name="S_Vdata" id="S_Vdata" /></div>
											<div class="input_msg" id="mpassword2">
											<?php
											if(S_Vipdj==1){
											?>
											<input type="button" value="选择文件" onclick="SelectUpload1('form3.S_Vdata');" class="rb1" <?php echo $disabled;?>/>
											<?php
											}elseif(S_Vipdj==2){
											?>
											<input type="button" value="选择文件" onClick="SelectUpload('form3.S_Vdata');" class="rb1" <?php echo $disabled;?>/>
											<?php
											}elseif(S_Vipdj==3){
											?>
											<input type="button" value="选择文件" onClick="window.open('skins/upload.php','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')" class="rb1" <?php echo $disabled;?>/>
											<?php
											}elseif(S_Vipdj==4){
											?>
											<input type="button" value="选择文件" onClick="SelectUpload2('form3.S_Vdata');" class="rb1" <?php echo $disabled;?>/>
											<?php
											}elseif(S_Vipdj==5){
											?>
											<input type="button" value="选择文件" onClick="SelectUpload3('form3.S_Vdata');" class="rb1" <?php echo $disabled;?>/>
											<?php
											}elseif(S_Vipdj==0){
											?>
											<input type="button" value="选择文件" onClick="alert('本站已经关闭上传,如有需要请联系管理员!');" class="rb1" <?php echo $disabled;?>/>
											<?php
											}
											?>
											<font color="#FF0000">＊</font>舞曲视听地址。</div>
										</li>
										<li>
											<div class="name">模版：</div>
											<div class="input"><select name='S_Templay'>
                                                <option value='play.html'>普通歌曲</option>
                                                <option value='spplay.html'>视频歌曲</option>
                                                </select></div>
											<div class="input_msg" id="mpassword2"><font color="#FF0000">＊</font>默认为普通，如果您发布的视频，请选择视频模版。</div>
										</li>
										<li>
											<div class="name">会员：</div>
											<div class="input"><?php echo $chsh_username?></div>
											<div class="input_msg" id="mpassword2"><font color="#FF0000">＊</font>舞曲所属会员，自动获取。</div>
										</li>
										<li>
											<div class="name">简介：</div>
											<div class="input"><textarea name="S_Content" id="S_Content" style="width:300px;height:70px"></textarea></div>
											<div class="input_msg" id="mpassword2">舞曲简介或歌词。</div>
										</li>
			<li></li>
										<li>
											<div class="name"></div>
											<div class="input"><span class="button-main"><span><button type="submit" id="adddj" >确定发布</button></span></span></div>
									<div class="input_msg" id="mpassword2"><font color="#FF0000">＊注意：舞曲发布默认到回收站未审核，我们一般在3天类审核，如果需要加速审核，请联系QQ：<?php echo S_AdminQQ?></font></div>
										</li></form>
									</ul>
								
<script type="text/javascript">
function SelectUpload3(fname){
   if(document.all){
     var posLeft = 100;
     var posTop = 100;
   }
   else{
     var posLeft = 100;
     var posTop = 100;
   }
 window.open('up/up.php','newwindow','height=150,width=530,top=200,left=200,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no, status=no');
}
function SelectUpload1(fname){
   if(document.all){
     var posLeft = 100;
     var posTop = 100;
   }
   else{
     var posLeft = 100;
     var posTop = 100;
   }
 window.open('flash/uploaddj.php','newwindow','height=100,width=500,top=200,left=200,toolbar=no,menubar=no,scrollbars=no,	 resizable=no,location=no, status=no');
}
function SelectUpload(fname){
   if(document.all){
     var posLeft = 100;
     var posTop = 100;
   }
   else{
     var posLeft = 100;
     var posTop = 100;
   }
   window.open("../include/rayfileup/?f="+fname, "popupWin", "scrollbars=yes,resizable=yes,statebar=no,width=600,height=400,left="+posLeft+", top="+posTop);
}
function SelectUpload2(fname){
   if(document.all){
     var posLeft = 100;
     var posTop = 100;
   }
   else{
     var posLeft = 100;
     var posTop = 100;
   }
 window.open('http://www.vdisk.cn/api/webupload?success=<?php echo S_SiteDomain?>/include/rayfileup/kimi.php','newwindow','height=100,width=700,top=200,left=200,toolbar=no,menubar=no,scrollbars=no,	 resizable=no,location=no, status=no');
}
</script>
<script language="javascript">
$(document).ready(function(){
	$("#adddj").click(function(){
		var S_Name=$("#S_Name").val();
		var S_ClassID=$("#S_ClassID").val();
		var S_Author=$("#S_Author").val();
		var S_Source=$("#S_Source1").val();
		var S_Vdata=$("#S_Vdata").val();
	$("#S_Name").css("border-color","#666 #ccc #ccc #666");
	$("#SClassID").text("");
	$("#SSource").text("");
	if(S_Name==""){
		$("#S_Name").css("border","1px solid red");
		$("#SClassID").text("出错了，请填写舞曲名称！").css("color","red");
		jAlert("出错了，请填写舞曲名称！","操作提示");
		
		return false;
		}
	else if(S_ClassID=="0"){
		$("#SClassID").text("请选择舞曲分类！").css("color","red");
		jAlert("出错了，请选择舞曲分类！","操作提示");
		return false;
		}
	else if(S_Source==""){
		$("#SSource").text("请选择播放源").css("color","red");
		jAlert("出错了，请选择播放源！","操作提示");
		return false;}
	else if(S_Vdata==""){
		$("#S_Vdata").css("border","1px solid red");
		$("#S_Vdata").focus();
		jAlert("出错了，请填写播放地址！","操作提示");
		return false;}
	else if(S_Templay==""){
		$("#S_Templay").css("border","1px solid red");
		$("#S_Templay").focus();
		jAlert("出错了，请选择播放页模版！","操作提示");
		return false;}
	});

});
</script>
<?php
}
?>

															</div>
						</div>
					</div>
					<div class="stageBoxBottom"><span></span></div>
				</div>
			</div>