<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../conn/nosql.asp"-->
<!--#include file="../../conn/config.asp"-->
<!--#include file="../../conn/md5.asp"-->
 <%
if session("user")="" then
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if
if session("id")="" then 
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if
if session("uflag")<>3 then 
response.write "<script language='javascript'>"
response.write "alert('您还不是诚信会员，没有个人主页功能，相关情况请联系管理员！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if
userid=session("id")
sql="select * from snsn_user where username='"&session("user")&"' and id="&session("id")&""
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1
if rs("uflag")<>3 then
response.write "<script language='javascript'>"
response.write "alert('您还不是诚信会员，没有个人主页功能，相关情况请联系管理员！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
else
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>交易助手管理操作平台_<%=webname%></title>
<script>
function IsDigit()
{
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
</script><script language="JavaScript">
function CheckForm()
{
    if (fff.title.value.length == 0) {
		alert("请填写音乐标题.")
		fff.title.focus()
		return false
	}

	if (fff.name.value.length == 0) {
		alert("请填写歌手大名.")
		fff.name.focus()
		return false
	}

	if (fff.url.value.length == 0) {
		alert("请输入音乐地址.")
		fff.url.focus()
		return false
	}
	if (fff.px.value.length == 0) {
		alert("请输入排序数字.")
		fff.px.focus()
		return false
	}

}
</script>
<link rel="stylesheet" href="/css.css" type="text/css">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style></head>

<body><!--#include file="../../top.asp"-->
<table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
    <td width="970"><table width="970"  border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="10"><img src="/img/m_left.gif" width="10" height="20"></td>
          <td width="950" bgcolor="#FFFFFF"></td>
          <td width="10"><img src="/img/m_right.gif" width="10" height="20"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="188" colspan="3"><table width="950"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="1" bgcolor="efefef"></td>
                <td width="200" height="77" valign="top"><!--#include file="../left.asp"--></td>
                <td width="1" bgcolor="efefef"></td>
                <td valign="top"><%
if request("action")="addsave" then
title=nosql(Trim(Request.Form("title")))
mname=nosql(Trim(Request.Form("name")))
url=nosql(request.form("url"))
px=nosql(request.form("px"))
dateandtime=now()
set rs=server.CreateObject("adodb.recordset")
sql="select * from snsn_music"
rs.open sql,conn,1,3
rs.addnew
rs("title")=title
rs("mname")=mname
rs("url")=url
rs("px")=px
rs("lx")=1
rs("uid")=session("id")
rs("dateandtime")=dateandtime
rs.update
rs.close
response.Redirect("music.asp")
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
if request("action")="save" then
title=nosql(request.Form("title"))
mname=nosql(request.Form("name"))
url=nosql(request.Form("url"))
px=nosql(request.form("px"))
if isChkInteger(request.Form("id")) then
id=request("id")
else
response.write "<script language='javascript'>"
response.write "alert('非法操作，正在返回！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if
if mname="" or title="" or url="" or px="" then%>
<script language="JavaScript">
alert("音乐内容不能为空！")
history.go(-1)
</script>
<%else
set rs=server.CreateObject("adodb.recordset")
sql="select * from snsn_music where id="&id
rs.open sql,conn,3,3
rs("title")=title
rs("mname")=mname
rs("url")=url
rs("px")=px
rs.update
response.write "<script language='javascript'>"
response.write "alert('音乐编辑成功，正在返回！');"
response.write"this.location.href='music.asp';</SCRIPT>"
response.end
 end if 
 end if
 if request("action")="edit" then
id=nosql(cint(request.QueryString("id")))
if id<>"" then
set rs=server.CreateObject("adodb.recordset")
sql="select * from snsn_music where id="&id&"  order by px desc"
rs.open sql,conn,1,1%>
<table width="90%" border="0" cellspacing="1" cellpadding="4" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF" bgcolor="#BBD7FF">
  <form name="fff" method="post" action="music_edit.asp?action=save" onsubmit="return CheckForm()">
    <tr bgcolor="#e8f4ff">
      <td colspan="2" align="center"><b>编辑音乐</b></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width="18%" align="center" nowrap>音乐名：</td>
      <td width="82%"><input name="title" class="wenbenkuang" type="text" id="title" size="30" value="<%=rs("title")%>">
      排序：
        <input name="px" class="wenbenkuang" type="text" id="px" size="10" value="<%=rs("px")%>" onkeypress="return event.keyCode>=46&&event.keyCode<=57"></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width="18%" align="center" nowrap>歌手：</td>
      <td width="82%"><input name="name" class="wenbenkuang" type="text" id="name" size="30" value="<%=rs("mname")%>"></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width="18%" align="center" nowrap>音乐地址：</td>
      <td width="82%"><input name="url" class="wenbenkuang" type="text" id="url" size="60" value="<%=rs("url")%>">
        <a href=# onclick="window.open('/conn/upload.asp?formname=fff&editname=url&infoname=music','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')">上传音乐</a></td>
    </tr>
    <tr bgcolor="#FFFFFF"> 　
        <input type="hidden" name="sub" value="sub">
        <input type="hidden" name="id" value="<%=id%>">
        <td colspan="2" align="center" nowrap><input type="submit" name="Submit" value="编辑" class="go-wenbenkuang"  onclick="return CheckForm();">
            <input type="reset" name="Submit2" value="重置" class="go-wenbenkuang">
            <input type="button" name="Submit3" value="取消" onClick="javascript:history.back(-1);"  class="go-wenbenkuang">
            (是传支持格式：mid、wma、mp3，文件最大：<%=up12%>)</td>
    </tr>
  </form>
</table><%end if%><%end if%><%if request("action")="add" then%><%if request("lx")<>"musicname" then%>
<table width="90%" border="0" cellspacing="1" cellpadding="4" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF" bgcolor="#BBD7FF">
   <form name="fff" method="post" action="?action=add&lx=musicname"><tr>
    <td bgcolor="#FFFFFF">音乐名：
      <input name="musicname" class="wenbenkuang" type="text" id="musicname" size="30">
      <input type="submit" name="Submit4" value="查看音乐库是否有该音乐存在" class="go-wenbenkuang"  onclick="return CheckForm();">
      </td>
  </tr></form>
</table>
<%else
				musicname=nosql(request("musicname"))
			sql="select * from snsn_music where title='"&musicname&"' "
			set rs=conn.execute(sql)
		    if not rs.eof then
				response.write "<script language='javascript'>"
                response.write "alert('音乐库中已经存在该音乐了，正在进入音乐，请购买！');"
                response.write"this.location.href='music_list.asp?action=musicname&musicname="&musicname&"';</SCRIPT>"
				response.End()
		    else

%><table width="90%" border="0" cellspacing="1" cellpadding="4" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF" bgcolor="#BBD7FF">
  <form name="fff" method="post" action="music_edit.asp?action=addsave" onsubmit="return CheckForm()">
    <tr bgcolor="#e8f4ff">
      <td colspan="2" align="center"><b>添加音乐</b></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width="18%" align="center" nowrap>音乐名：</td>
      <td width="82%"><input name="title" type="text" class="wenbenkuang" id="title" value="<%=musicname%>" size="30">
        排序：
        <input name="px" class="wenbenkuang" type="text" id="px" size="10" onkeypress="return event.keyCode>=46&&event.keyCode<=57"></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width="18%" align="center" nowrap>歌手：</td>
      <td width="82%"><input name="name" class="wenbenkuang" type="text" id="name" size="30"></td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td width="18%" align="center" nowrap>音乐地址：</td>
      <td width="82%"><input name="url" class="wenbenkuang" type="text" id="url" size="50">
        <a href=# onclick="window.open('/conn/upload.asp?formname=fff&editname=url&infoname=music','','status=no,scrollbars=no,top=20,left=110,width=420,height=165')">上传音乐</a> 请输入网址或上传</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 　
        <input type="hidden" name="sub" value="sub">
        <input type="hidden" name="id" value="<%=id%>">
        <td colspan="2" align="center" nowrap><input type="submit" name="Submit" value="添加" class="go-wenbenkuang"  onclick="return CheckForm();">
            <input type="reset" name="Submit2" value="重置" class="go-wenbenkuang">
            <input type="button" name="Submit3" value="取消" onClick="javascript:history.back(-1);"  class="go-wenbenkuang">
            (是传支持格式：mid、wma、mp3，文件最大：<%=up12%>)</td>
    </tr>
  </form>
</table><%end if
end if%><%end if%><br>
<table width="90%" border="0" cellspacing="1" cellpadding="4" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF" bgcolor="#BBD7FF">

    <tr>
      <td bgcolor="#FFFFFF"><div align="center">注：本站音乐均为网友自行上传，如涉及到音乐版权问题将由网友自行负责，本站不承担任何责任！</div></td>
    </tr>

</table>
</td>
              </tr>
          </table></td>
        </tr>
    </table></td>
    <td valign="top"><img src="/img/index_img.jpg" width="10"></td>
  </tr>
</table>
</td>
</tr>
</table>
<!--#include file="../../end.asp"-->

</body>
</html>
<%
end if
%>