<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<HTML>
<HEAD>
<TITLE>修改直播</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<style>
body,td,input,textarea {font-size:9pt}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
</style>
<script type="text/javascript">
function check(obj){
	if(obj.LiveName.value==""){
		alert("名称不能为空!");
		obj.LiveName.focus();
		return false;
	}
	return true;
}
</script>
</HEAD>
<BODY>
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p0000")
'''''''''''''''''''''''''''''''''''''''''''''''
%>
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><iframe src="right_top.htm" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" height="30" width="100%"></iframe></td>
  </tr>
</table>
<%
dim id,act,LiveName,roleArr
act=request.QueryString("act")
id=Cint(request("id"))
if(act="mod") then	
	LiveName=trim(request.Form("LiveName"))	
	'添加到库
	set rs=server.createobject("adodb.recordset")
	rs.open "select * from t_live where LiveName='"&LiveName&"' and id<>"&id,conn,3,1
	if not rs.eof then
		response.Write("<script>alert(""该直播已存在!"");history.back();</script>")
		response.End()
	end if
	rs.close
	sql="select top 1 * from t_live where id="&id&" order by id desc "
	rs.open sql,conn,3,3	
	rs("LiveName")=LiveName	
	rs("moditime")=now	
	rs.update
	rs.close
	set rs=nothing
	response.Write("<p align=""center"">修改直播成功~!<p>")
	response.Write("<br><p align=""center""><center><a href=live_manage.asp>返回</a></center></p>")
else
	set rs=server.createobject("adodb.recordset")
	sql="select top 1 LiveName from t_live where id="&id&" order by id desc "
	rs.open sql,conn,3,1	
	if rs.eof or rs.bof then
		response.Write("没有找到ID为"&id&"的记录！")
		response.End()
	else
		roleArr=rs.GetRows()
	end if
	rs.close
	set rs=nothing
%>
<FORM method="POST" name="form1" action="?act=mod" style="margin:0 0 0 0;" onSubmit="return check(this)">
  <TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#666666">
<TR bgcolor="#FF9900">
  <TD height="24" colspan="2"><div align="center" class="style1">修改直播</div></TD>
  </TR>
<TR bgcolor="#F5F5F5">
  <TD width="14%"><div align="center">直播名称：</div></TD>
  <TD width="86%"><input name="LiveName" type="text" id="LiveName" size="30" value="<%=roleArr(0,0)%>"></TD>
</TR>
<TR bgcolor="#F5F5F5">
	<TD align=right>&nbsp;	  </TD>
    <TD align=right><div align="left"> 
	<input type="hidden" name="id" value="<%=id%>">
        <input type=submit name=b1 value="提 交">&nbsp;&nbsp;
        <input type=reset name=b2 value="重 填">       
    </div></TD>
</TR>
</TABLE>
</FORM>
<%
end if
%>
</BODY>
</HTML>
<%
call connclose()
%>