<%
act=cstr(trim(request("act")))
Classid=cstr(trim(request.QueryString("classid")))
SClassid=cstr(trim(request.QueryString("sclassid")))
NClassid=cstr(trim(request.QueryString("Nclassid")))
Specialid=cstr(request.QueryString("Specialid"))
if act="add" then title="添 加 歌 曲"
if act="edit" then title="编 辑 歌 曲"
if act="" then title="添 加 歌 曲 快 捷 方 式"
%><!--#include file="inc.asp"-->
<!--#include file="check.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="images/Admin_Style.css">
<head>
<title>福建音乐视听网 管理中心</title>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<%
dim i
set rs=server.createobject("adodb.recordset")
set rs2=server.createobject("adodb.recordset")

sql="select * from class order by classid"
rs.open sql,conn,1,1
i=request("id")
if i="" then i=rs("Classid")
%>
<%do while not rs.eof
%>
<%rs.movenext
loop
rs.close
%>
<%sql="select * from class where classid="&i
rs.open sql,conn,1,1
if rs.eof then%>
<%
else
%>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" style="border-collapse:collapse;">
<tr>
<td width="100%" height="22" align=center class="topbg"><strong>添 加 编 辑 歌 曲</strong></td>
</tr><tr>
<td width="100%" height="22" class="tdbg" align=center>
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="100%" bordercolordark="#FFFFFF">
<tr>
<td width="140">&nbsp;<b>→选择分类(第一步)：</b></td>
<td height="22" align=center>
<%
sql2="select * from SClass where Classid="&rs("Classid")&" order by Sclassid"
rs2.open sql2,conn,1,1
if rs2.eof then
%>
<%
else
j=0
do while not rs2.eof
j=j+1
%>
&nbsp;&nbsp;<a href='0hao_Geshou.asp?Classid=<%=rs("Classid")%>&SClassid=<%=rs2("SClassid")%>'><%=rs2("SClass")%></a>
<%
rs2.movenext
loop
end if
rs2.close
%></td>

<%
end if
rs.close
%>
</tr>
</table>
</div>
</td>
</tr>
<tr><td height=10></td></tr></table>



<table width="100%" border="1" cellpadding="2" cellspacing="0" class="border" style="border-collapse:collapse;">
<form method="POST" action="0hao_Song_Save.asp?Specialid=<%=Specialid%>" name="myform">
<tr>
<td width="100%" height="22" colspan=2 align=center><b><%=title%></b></td>
</tr>
<tr>
<td align="right">类型：</td>
<td>一级:
<select name="classid" size="1" onchange="window.open('0hao_Song_Add.asp?act=<%=act%>&classid='+this.options[this.selectedIndex].value,'_self')" style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;">
<option value="" <%if request("classid")="" then%> selected<%end if%> style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;">
选择栏目</option>
<%
set rs=server.createobject("adodb.recordset")
if act="edit" then
sql="select * from class where classid="&classid
else
sql="select * from class"
end if
rs.open sql,conn,1,1
do while not rs.eof
%>
<option<%if cstr(request("classid"))=cstr(rs("classid")) and request("classid")<>"" then
classn=rs("class")
response.write " selected"
end if%> value="<%=CStr(rs("classID"))%>" name=classid><%=left(rs("class"),5)%>..</option>
<%
rs.movenext
loop
rs.close
%>
</select>
二级:
<%if request("classid")<>"" then%>
<select name="sclassid" size="1" onchange="window.open('0hao_Song_Add.asp?act=<%=act%>&classid=<%=classid%>&sclassid='+this.options[this.selectedIndex].value,'_self')" style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;">
<option value="" <%if request("sclassid")="" then%> selected<%end if%>>选择栏目</option>
<%
if act="edit" then
sql="select * from sclass where sclassid="&request("sclassid")
else
sql="select * from sclass where classid="&request("classid")
end if
rs.open sql,conn,1,1
Do while not rs.eof
%>
<option<%if cstr(request("sclassid"))=cstr(rs("sclassid")) and request("sclassid")<>"" then
sclassn=rs("sclass")
response.write " selected"
end if%> value="<%=CStr(rs("sclassid"))%>" name=sclassid><%=rs("sclass")%></option>
<%
rs.MoveNext
Loop
rs.close
%>
<%else%>
<select name="sclassid" size="1">
<option value="" selected style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;">
选择栏目</option>
<%end if%>
</select>
歌手:
<%if request("Sclassid")<>"" then%>
<select name="Nclassid" size="1" onchange="window.open('0hao_Song_Add.asp?act=<%=act%>&classid=<%=classid%>&SClassid=<%=SClassid%>&nclassid='+this.options[this.selectedIndex].value,'_self')" style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;">
<option value="" <%if request("Nclassid")="" then%> selected<%end if%>>选择栏目</option>
<%
'if act="edit" then
'sql="select * from Nclass where Nclassid="&Nclassid
'else
sql="select * from Nclass where Sclassid="&request("Sclassid")
'end if
rs.open sql,conn,1,1
Do while not rs.eof
%>
<option<%if cstr(request("Nclassid"))=cstr(rs("Nclassid")) and request("Nclassid")<>"" then
nclassn=rs("Nclass")
response.write " selected"
end if%> value="<%=CStr(rs("Nclassid"))%>" name=Nclassid><%=rs("Nclass")%></option>
<%
rs.MoveNext
Loop
rs.close
%>
<%else%>
<select name="Nclassid" size="1">
<option value="" selected style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;">
选择栏目</option>
<%end if%>
</select>
专集:
<%if request("Nclassid")<>"" then%>
<select name="specialid" size="1" onchange="window.open('?act=<%=act%>&classid=<%=classid%>&SClassid=<%=SClassid%>&nclassid=<%=nclassid%>&Specialid='+this.options[this.selectedIndex].value,'_self')" style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;">
<option value="" <%if request("Specialid")="" then%> selected<%end if%>>选择栏目</option>
<%
if act="edit" then
sql="select * from Special where Specialid="&request("Specialid")
else
sql="select * from Special where Nclassid="&request("Nclassid")
end if
rs.open sql,conn,1,1
Do while not rs.eof
%>
<option<%if cstr(request("Specialid"))=cstr(rs("Specialid")) and request("Specialid")<>"" then
SpecialName=rs("name")
response.write " selected"
end if%> value="<%=CStr(rs("Specialid"))%>" name=Specialid><%=rs("name")%></option>
<%
rs.MoveNext
Loop
rs.close
%>
<%else%>
<select name="Specialid" size="1">
<option value="" selected style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;">
选择栏目</option>
<%end if%>
</select>
</td>
</tr>






<%
if request("specialid")<>"" then
set rsmin=server.createobject("adodb.recordset")
sqlmin="select * from special where specialid="&request("specialid")
rsmin.open sqlmin,conn,1,1
name=rsmin("name")
hits=rsmin("hits")
isgood=rsmin("isgood")
rsmin.close
set rsmin=nothing
end if
%>
<script language="javascript">
function setid()
{
str='';
if(!window.myform.no.value)
window.myform.no.value=1;

for(i=1;i<=window.myform.no.value;i++)
{
if(window.myform.no.value<100)
{
	if(i<10)
	{
	str+='<tr><td width=80 style="color:green; background-color:#E4EDF9;">&nbsp;第0'+i+'首：</td>'
	}
	else
	{
	str+='<tr><td width=80 style="color:green; background-color:#E4EDF9;">&nbsp;第'+i+'首：</td>'
	}

	str+='<td width="350">&nbsp;<input type="text" name="name'+i+'" value="" size="30"> (歌曲名)</td><td>&nbsp;点 击 数：<input type="text" name="hits'+i+'" size="8" class="smallinput" maxlength="8" value="0"></td></tr>';
	str+='<tr><td width=80>&nbsp;试听地址：&nbsp;</td><td width="350">&nbsp;<input type="text" name="url'+i+'" style="padding-left:1pt" size=30 value="'+window.myform.no1.value+''+i+''+window.myform.no2.value+'"></td><td>&nbsp;备用地址：<input type="text" name="backurl'+i+'" style="padding-left:1pt" size=30 value="'+window.myform.no3.value+''+i+''+window.myform.no2.value+'"></td></tr>';
	str+='<tr><td width=80>&nbsp;LRC歌词：&nbsp;</td><td colspan="2">&nbsp;<textarea rows="8" name="LRC'+i+'" cols="80"></textarea></td></tr>';
	str+='<tr><td><p align="center">首页推荐：</td><td colspan="2">&nbsp;<input type="radio" name="isgood'+i+'" value="1" > 是 <input type="radio" name="isgood'+i+'" value="0"  checked > 否</td></tr><tr><td colspan="3" height=5><hr color=red></td></tr>';
} 
}
window.upid.innerHTML='<table width="100%" height="11" border="1" cellspacing="0" class="border" style="border-collapse: collapse">'+str+'</table>';
} 

                        </script>
          <tr>
            <td width="60" valign="center" height="6">歌曲列表：</td>
            <td height="6"><input type="text" name="no1" class="button" value="" size="30">
      备用地址：<input type="text" name="no3" class="button" value="" size="30">
      格式 <input type="text" name="no2" class="button" value=".wma" size="5"> 数目 <input type="text" name="no" class="button" value="1" size="3">
      <input type="button" name="Button" class="buttonface" onclick="setid();" value="设定"></td>
          </tr>
          <tr>
            <td colspan="2" id="upid"></td>
          </tr>
<tr>
<td colspan=2 align=center>
<input type="hidden" value="<%if act<>"" then%><%=act%><%else%>add<%end if%>" name="act">
<input type="hidden" value="<%=classn%>" name="class">
<input type="hidden" value="<%=sclassn%>" name="sclass">
<input type="hidden" value="<%=nclassn%>" name="nclass">
<input type="hidden" value="<%=specialname%>" name="specialname">
<%if request("Classid")="" then%>
<input style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;" type="button" value=" &#30830; &#23450; " name="cmdok" onclick="window.alert('&#35831;&#20808;&#36873;&#25321;&#19968;&#32423;&#26639;&#30446;&#65281;')">&nbsp;
<%elseif request("SClassid")="" then%>
<input style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;" type="button" value=" &#30830; &#23450; " name="cmdok" onclick="window.alert('&#35831;&#20808;&#36873;&#25321;&#20108;&#32423;&#26639;&#30446;&#65281;')">&nbsp;
<%elseif request("NClassid")="" then%>
<input style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;" type="button" value=" &#30830; &#23450; " name="cmdok" onclick="window.alert('&#35831;&#20808;&#36873;&#25321;&#19977;&#32423;&#26639;&#30446;&#65281;')">&nbsp;
<%else%>
<input style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;" type="submit" value=" &#30830; &#23450; " name="cmdok">&nbsp;
<%end if%>
<input style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;" type="reset" value=" &#28165; &#38500; "  name="cmdcancel">
</td>
</tr>
</form>
</table>
<%
set rs=nothing
set rs2=nothing
conn.close
set conn=nothing
%>