<%
if session("admin")="" then
response.Write "<script LANGUAGE='javascript'>alert('网络超时或者您还没有登录请登录');window.location.href='login.asp';</script>"
response.End
end if
%>
<!--#include file="ljconn.asp"-->
<%
select case request("action")
case ""
set rs=server.CreateObject("adodb.recordset")
rs.Open "select anclass from shop_anclass where anclassid="&request("anclassid")&"",conn,1,3
anclass=rs("anclass")
rs.close
set rs=nothing
set rs=server.CreateObject("adodb.recordset")
rs.Open "select nclass from shop_nclass where nclassid="&request("nclassid")&"",conn,1,3
nclass=rs("nclass")
rs.close
set rs=nothing
set rs=server.CreateObject("adodb.recordset")
rs.Open "select id,anclassid,nclassid,content from lxwm where anclassid="&request("anclassid")&" and nclassid="&request("nclassid")&"",conn,1,1
if rs.recordcount=0 then
action="add"
content=""
id=""
anclassid=request("anclassid")
nclassid=request("nclassid")
else
action="edit"
content=rs("content")
id=rs("id")
anclassid=rs("anclassid")
nclassid=rs("nclassid")
end if
rs.close
set rs=nothing
%>
<html><head><title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="img/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	font-size: 12px;
	font-weight: bold;
}
.style3 {font-size: 12px}
-->
</style>
</head>
<body>
<table class="tableBorder" width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
<tr bgcolor="#E8F1FF">
<td height="25" align="center" background="img/admin_bg_1.gif">
<span class="style1">
<font color="#ffffff"><span class="style3">
<%=anclass%> >>> <%=nclass%>
</span></font> </span></td>
</tr>
<tr bgcolor="#E8F1FF"> 
<%
function HTMLEncodet(fStringt)
	fStringt = Replace(fStringt,"",CHR(13))
	fStringt = Replace(fStringt,"</P><P>",CHR(10) & CHR(10))
	fStringt = Replace(fStringt,"<BR>",CHR(10))
	HTMLEncodet = fStringt
end function
%>
<form name="myform" method="post" action="gywm_2.asp?action=<%=action%>" OnSubmit="return checkkk()" >
<td> 
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#ffffff">
		  <tr bgcolor="#E8F1FF"> 
            <td width="20%" align="right"><span class="style3">内容:</span></td>
            <td width="80%"><textarea name="content" style="display:none"><%=content%></textarea>
	  <IFRAME ID="eWebEditor1" src="xuexiao/editor.html" frameborder="0" scrolling="no" width="98%" height="350"></IFRAME></td>
		  </tr>
          <tr bgcolor="#E8F1FF"> 
            <td></td>
            <td height="30"> <span class="style3">
              <input type="submit" name="Submit" value="修改保存 "> 
              <input onClick="ClearReset()" type=reset name="Clear" value=" 重新填写 ">
              <input name="id" type="hidden" id="id" value="<%=id%>">
			  <input name="anclassid" type="hidden" id="anclassid" value="<%=anclassid%>"><input name="nclassid" type="hidden" id="nclassid" value="<%=nclassid%>">
</span></td>
          </tr>
        </table>
</td>
</form>
</tr>
</table>
<!--#include file="copyright.asp"-->
</body>
</html>
<%
conn.close
set conn=nothing
%>
<%case "add"%>
<%
set rs_01=server.CreateObject("adodb.recordset")
rs_01.open "select anclassid,nclassid,content from lxwm ",conn,3,3
rs_01.addnew
rs_01("anclassid")=request("anclassid")
rs_01("nclassid")=request("nclassid")
rs_01("content")=request("content")
rs_01.update
rs_01.close
set rs_01=nothing
conn.close
set conn=nothing
response.Write "<script language=javascript>alert('添加成功！');history.go(-1);</script>"
response.End
%>
<%case "edit"%>
<%
set rs_01=server.CreateObject("adodb.recordset")
rs_01.open "select content from lxwm where id="&request("id")&"",conn,3,3
rs_01("content")=request("content")
rs_01.update
rs_01.close
set rs_01=nothing
conn.close
set conn=nothing
response.Write "<script language=javascript>alert('修改成功！');history.go(-1);</script>"
response.End
%>
<%end select%>
