<!--#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.key_s.value==""){
		alert("快捷键不能为空!");
		obj.key_s.focus();
		return false;
	}
	if(obj.key_c.value==""){
		alert("文字内容不能为空!");
		obj.key_c.focus();
		return false;
	}
	return true;
}
</script>
</HEAD>
<BODY>
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p17")
'''''''''''''''''''''''''''''''''''''''''''''''
%>
<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 act,key_s,liveid,key_c,id,keyArr
id=Clng(request("id"))
act=request.QueryString("act")

if(act="add") then	
	key_s=trim(request.Form("key_s"))
	key_c=request.Form("key_c")
	liveid=Clng(request.Form("liveid"))
	'添加到库
	set rs=server.createobject("adodb.recordset")
	sql="select top 1 * from t_live_key where id="&id&" order by id desc "
	rs.open sql,conn,3,3	
	if not rs.eof then
		rs("key_s")=key_s		
		rs("key_c")=key_c
		rs("liveid")=liveid
		rs.update
	end if
	response.Write("<p align=""center"">修改直播成功~!<p>")
	response.Write("<br><p align=""center""><center><a href=live_key_manage.asp>返回</a></center></p>")
	rs.close
	set rs=nothing
else
	set rs=server.createobject("adodb.recordset")
	sql="select liveid,key_s,key_c from t_live_key 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
		keyArr=rs.GetRows()
	end if
	rs.close
	set rs=nothing
%>
<FORM method="POST" name="form1" action="?act=add&id=<%=id%>" 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><div align="center">所属直播：</div></TD>
  <TD>
  <select name="liveid" id="liveid">
  	<option value="0">所有通用</option>
  <%
  	set rs=server.createobject("adodb.recordset")
	rs.open "select id,LiveName from t_live order by id desc",conn,3,1
	while not rs.eof
		if(keyArr(0,0)=rs(0)) then
			seleStr=" selected=""selected"""
		else
			seleStr=""
		end if
		response.Write("<option value="""&rs(0)&""""&seleStr&">"&rs(1)&"</option>"&Chr(10))
		rs.movenext
	wend
	rs.close
	set rs=nothing
  %>
  </select>
  </TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD width="14%"><div align="center">快捷键名称：</div></TD>
  <TD width="86%"><input name="key_s" type="text" id="key_s" size="30" value="<%=keyArr(1,0)%>"></TD>
</TR>
<TR bgcolor="#F5F5F5">
  <TD align=right><div align="center">代表文字：</div></TD>
  <TD align=right><div align="left">
    <input name="key_c" type="text" id="key_c" size="60" value="<%=keyArr(2,0)%>">
  </div></TD>
</TR>
<TR bgcolor="#F5F5F5">
	<TD align=right>&nbsp;	  </TD>
    <TD align=right><div align="left"> 
        <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()
%>