<!--#include file="conn1.asp"-->
<%
Dim Action,WordID,MusicName,Singer,MusicWord_rs,MusicWord
Action=request.QueryString("action")
WordID=request.QueryString("id")
MusicName=request.QueryString("musicname")
Singer=request.QueryString("singer")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>歌词 <%Response.Write (Singer)%>  - 《 <%Response.Write (MusicName)%> 》</title>
<style>
body,td{font-size:12px}
.bk {color: #000000; border:1px #000000 solid;}
.Tips_bo {
	FONT-FAMILY: "Arial", "宋体";
	BORDER: 0px #000000 solid; 
	FONT-SIZE: 12px; 
	COLOR: #f78d00;  
	text-decoration: none; 
	POSITION: relative;
	HEIGHT: 19;
}
</style>
</head>
<body bgColor="#E1F8D8" text="#000000" >
<center>
  <font color="#000000">
  <%

If WordID="" or not IsNumeric(WordID) Then
	Response.Write ("<font color=#ff0000>很抱歉!这首歌曲还没有歌词.</font>")
	Response.Write ("<br><br><a href='javascript:window.close();'><font color=#000000>关闭窗口</font></a>")
	Response.End
End If

If Action = "show" Then
Response.Write ("<body oncontextmenu=""return false"" onselectstart=""return false"" onkeydown=""return false"" ondragstart=""return false"">")
Set MusicWord_rs=conn.execute("select MusicWord,IsShow from [ylmv_MusicWord] where MusicID="&WordID)
	If MusicWord_rs.eof Then
		Response.Write ("<font color=#ff0000>很抱歉!这首歌曲还没有歌词或已经删除.</font>　　 <a href=musicword.asp?action=add&id="&WordID&"&musicname="&MusicName&"&singer="&Singer&"><font color=#ff0000>添加歌词>></font></a>")
		Response.Write ("<br><br><a href='javascript:window.close();'><font color=#000000>关闭窗口</font></a>")
		Response.End
	End If
	If not (MusicWord_rs(1)) Then
		Response.Write ("<font color=#ff0000>很抱歉!该歌词尚未管理员通过审核.</font>")
		Response.Write ("<br><br><a href='javascript:window.close();'><font color=#000000>关闭窗口</font></a>")
		Response.End
	End If
	MusicWord=MusicWord_rs(0)
MusicWord_rs.close
Set MusicWord_rs=NOTHING
conn.close
Set conn=NOTHING
%>
  </font>
  <table width="290" border="0" bgcolor="#FFFFFF">
    <tr> 
      <td height="21" width="279"> <font color="#000000">
        <%Response.Write (Singer)%>
        - 《 
        <%Response.Write (MusicName)%>
        》 </font>
        <hr align="center" color="#000000" SIZE="1"></td>
    </tr>
    <tr> 
      <td width="279" height="180" valign="top">
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td style="line-height: 140%"><font color="#000000"> 
              <%Response.Write (Replace(MusicWord,chr(13),"<br>"))%>
              </font></td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  <font color="#000000">
  <%ELSEIf Action = "add" Then
If session("UserName")="" Then
	Response.Write ("<font color=#000000>很抱歉!您还没有登陆本站,请登陆后再添加.</font>")
	Response.Write ("<br><br><a href='javascript:window.close();'><font color=#000000>关闭窗口</font></a>")
	Response.end
End If
Set MusicWord_rs=conn.execute("select IsShow from [ylmv_MusicWord] where MusicID="&WordID)
	If not MusicWord_rs.eof Then
		If MusicWord_rs(0) Then
			Response.Write ("<font color=#000000>感谢您的支持!这首歌曲已经有歌词了!</font>")
			Response.Write ("<br><br><a href='javascript:window.close();'><font color=#000000>关闭窗口</font></a>")
		Else
			Response.Write ("<font color=#000000>感谢您的支持!<br><br>这首歌的歌词已经有网友添加,正等待管理员审核.</font>")
			Response.Write ("<br><br><a href='javascript:window.close();'><font color=#000000>关闭窗口</font></a>")
		End If
		MusicWord_rs.close
		Set MusicWord_rs=NOTHING
		conn.close
		Set conn=NOTHING
		Response.End
	End If
MusicWord_rs.close
Set MusicWord_rs=NOTHING
CloseDatabase
%>
  </font>
  <form method="POST" action="?action=save&id=<%Response.Write (WordID)%>&musicname=<%Response.Write (MusicName)%>&singer=<%Response.Write (singer)%>">
    <table width="290" border="0" bgcolor="#FFFFFF" height="193">
      <tr> 
        <td height="200" width="314" align="center"><font color="#000000"> 为 
          <%Response.Write (Singer)%>
          的 《 
          <%Response.Write (MusicName)%>
          》 添加歌词</font>
          <hr align="center" color="#000000" SIZE="1"> <font color="#000000">
          <textarea rows="9" name="MusicWord" cols="35" class="bk"></textarea>
          <input type="submit" value=" 添 加 " name="B1" class="Tips_bo">
          &nbsp;&nbsp; 
          <input type="button" value=" 关 闭 " name="B3" class="Tips_bo" onclick="javascript:window.close();">
          </font></td>
      </tr>
    </table>
  </form>
  <font color="#000000">
  <%
ElseIf Action = "save" Then
	MusicWord=replace(trim(Request.Form("MusicWord")),"'","‘")
	MusicWord=replace(MusicWord,"<","&lt;")
	MusicWord=replace(MusicWord,">","&gt;")
	
	If MusicWord="" Then
		Response.Write ("<font color=#000000>添加歌词错误! 请输入歌词的内容.</font>")
		Response.Write ("<br><br><a href='javascript:history.back();'><font color=#000000>返回</font></a>")
	Else
		conn.execute("insert into [ylmv_MusicWord] (MusicID,MusicWord,AddUser) values ("&WordID&",'"&MusicWord&"','"&session("UserName")&"')")
		Response.Write ("<font color=#000000>添加歌词成功!感谢您的支持!</font>")
		Response.Write ("<br><br><a href='javascript:window.close();'><font color=#000000>关闭窗口</font></a>")
	End If
Else
	Response.Write ("<font color=#000000>访问参数错误,请重试或与管理员联系.</font>")
End If%>
  </font>
</center>
</body>
</html>

