<!--#include file="conn.asp" -->
<!--#include file="checkout.asp" -->

<%if (session("userkey")=1) then%>
  <script language=javascript>  
    alert( "错误：您无权进行用户管理！"  );
    location.href = "javascript:history.back()"  
  </script>
<%end if%>

<%
code=trim(request("code"))
name=trim(request("name"))
if isnull(name) or name="" then
	set rs1=server.createobject("adodb.recordset")
	sql1="select * from newclass where code='"& code &"'"
	rs1.open sql1,conn,1,1
	if not rs1.eof then
		name=trim(rs1("name"))
	end if
end if

id=request("id")
id=replace(trim(id),"'","")
id=replace(trim(id)," ","")

if isnull(id) then id=""
if id="" then
	op="add"
	opt="添加"
else
	op="update"
	opt="修改"
end if




if num="" or isnull(num) then num=1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>添加产品</title>
<LINK href="css.css" rel=stylesheet type=text/css>
</head>
<body>
<table align="center" width="95%" cellspacing="1"><tr>
  <td height="10">当前位置：<a href="main.asp">文章管理</a> >> <%=name%> >> <%=opt%></td></tr></table>                                                                                                                                                                                                                                                                                                         
<form action="news_save.asp" method="POST"  name="form1">
<table width="95%" cellspacing="1" cellpadding="5" bgcolor="#999999" align="center">
<input type=hidden name="id0" value="<%=id0%>">
<input type=hidden name="op" value="<%=op%>">
<tr bgcolor="#CCCCCC" align=center><td colspan="2"><b><%=opt%>文章</b></td>
</tr>
<tr bgcolor=#ffffff height=20><td colspan="2" height="20"></td></tr>
<tr bgcolor=#eeeeee><td width=77 align=right>排序：</td><td width="838"><input type=text name=num size=10 value="<%=num%>" style="BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 12px; BORDER-BOTTOM-WIDTH: 1px; BORDER-RIGHT-WIDTH: 1px"> 
    [请输入数字]</td></tr>                                  
<tr bgcolor=#eeeeee>
  <td width=77 align=right>文章类别：</td>
  <td width="838"><font color="#808000">[<%=code%>]</font> <%=name%></td></tr>                                                                                                                                                                                   
<tr bgcolor=#eeeeee>
      <td width=77 align=right>标题：</td>
      <td width="838"><input type=text name=title size=30 value="<%=title%>" style="BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 12px; BORDER-BOTTOM-WIDTH: 1px; BORDER-RIGHT-WIDTH: 1px"></td></tr>

<tr bgcolor=#eeeeee>
      <td width=77 align=right>最新：</td>
      <td width="838"><input type="radio" value="1" name="isnew" checked <%if isnew="NO" then response.write space(1) & "checked"%>>否&nbsp; 
        <input type="radio" value="2" name="isnew" <%if isnew="YES" then response.write space(1) & "checked"%>>是</td></tr>
<tr bgcolor=#eeeeee>
      <td width=77 align=right>状态：</td>
      <td width="838"><input type="radio" value="YES" name="status" checked <%if status="YES" then response.write space(1) & "checked"%>>可见<input type="radio" value="NO" name="status" <%if status="NO" then response.write space(1) & "checked"%>>隐藏</td></tr>
<tr bgcolor=#eeeeee>
      <td width=77 align=right>内容：</td>
      <td width="838">
<textarea name="content" style="display:none" cols="1" rows="1"><%if content<>"" then response.write content%></textarea>
<IFRAME ID="eWebEditor1" SRC="edit/ewebeditor.asp?id=content&style=news" FRAMEBORDER="0" SCROLLING="no" WIDTH="100%" HEIGHT="399" marginwidth="1" marginheight="1" name="wfasdg"></IFRAME>

	  </td>
    </tr>
<tr bgcolor=#eeeeee><td width="77"></td><td align="center" width="838">
<p align="left"><%if op="update" then%><input type="submit" value="修改" name="BB4" ><%end if%><%if op="add" then%><input  type="button" value="添加" name="BB1" OnClick="formok(form1)"> <%end if%>   
<input type="reset" value="全部重写" name="BB2"> <input type="button" onclick="history.back()" value="返回上页" name="BB3"></td></tr>                               
</table>
<input type=hidden name="id" value="<%=id%>">
<input type=hidden name="code" value="<%=code%>">
<input type=hidden name="name" value="<%=name%>">

</form>
<script language="vbscript">
sub formok(x)
	if trim(x.num.value)="" then
		msgbox "请填写排序！"
		x.num.focus()
		exit sub
	end if
	if trim(x.title.value)="" then
		msgbox "请填写文章标题！"
		x.title.focus()
		exit sub
	end if

	x.submit()
end sub
</script>

</body>
</html>








