<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312" />
<META NAME="Keywords" CONTENT="" />
<META NAME="Description" CONTENT="" />
<TITLE>编辑视频</TITLE>
<link rel="stylesheet" href="../Images/CssAdmin.css">
<script language="javascript" src="../inc/Admin.js"></script>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
</HEAD>
<!--#include file="../../Include/Const.asp" -->
<!--#include file="../../Include/Conn1.asp" -->
<!--#include file="../CheckAdmin.asp"-->
<BODY>
<% 
dim Result
Result=request.QueryString("Result")
dim ID,SortName,Content,Keyword,FolderName
ID=request.QueryString("ID")
call ArticleSortEdit() 
%>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#628AE1">
  <tr>
    <td height="24" nowrap><font color="#FFFFFF"><img src="../Images/Explain.gif" width="18" height="18" border="0" align="absmiddle">&nbsp;<strong>视频分类：添加，修改，删除视频分类</strong></font></td>
  </tr>
  <tr>
    <td height="24" align="center" nowrap  bgcolor="#FFFFFF"><a href="ArticleSortEdit.asp?Result=Add" >添加分类</a><font color="#0000FF">&nbsp;|&nbsp;</font><a href="ArticleSortList.asp" >查看所有分类</a></td>
  </tr>
</table>
<br>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#628AE1">
  <form name="editForm" method="post" action="ArticleSortEdit.asp?Action=SaveEdit&Result=<%=Result%>&ID=<%=ID%>">
  <tr>
    <td height="24" nowrap bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="0" cellspacing="0" id=editArticle idth="100%">

      <tr>
        <td width="120" height="20" align="right">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="25" align="right">视频标题：</td>
        <td><input name="SortName" type="text" class="textfield" id="SortName" style="WIDTH: 380px;" value="<%=SortName%>" maxlength="100"></td>
      </tr>
      <tr>
        <td height="30" align="right">&nbsp;</td>
        <td valign="bottom"><input name="submitSaveEdit" type="submit" class="button"  id="submitSaveEdit" value="保存" style="WIDTH: 80;" ></td>
      </tr>
      <tr>
        <td height="20" align="right">&nbsp;</td>
        <td valign="bottom">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  </form>
</table>
</BODY>
</HTML>
<%
sub ArticleSortEdit()
  dim Action,rsRepeat,rs,sql
  Action=request.QueryString("Action")
  if Action="SaveEdit" then '保存编辑分类
    set rs = server.createobject("adodb.recordset")
    if Result="Add" then '创建分类
	  sql="select * from Angel_VodeoSort"
      rs.open sql,conn,1,3
      rs.addnew
	  rs("id")=GetID("id","Angel_VodeoSort")
      rs("SortName")=trim(Request.Form("SortName"))
	end if  
	if Result="Modify" then '修改分类
      sql="select * from Angel_VodeoSort where ID="&ID
      rs.open sql,conn,1,3
      rs("SortName")=trim(Request.Form("SortName"))
	end if
	rs.update
	rs.close
    set rs=nothing 
    response.write "<script language=javascript> alert('成功编辑分类！');location.replace('ArticleSortList.asp');</script>"
  else '提取分类
	if Result="Modify" then
      set rs = server.createobject("adodb.recordset")
      sql="select * from Angel_VodeoSort where ID="& ID
      rs.open sql,conn,1,1
      if rs.bof and rs.eof then
        response.write ("数据库读取记录出错！")
        response.end
      end if
	  SortName=rs("SortName")
	  rs.close
      set rs=nothing 
    end if
  end if
end sub
%>