gusucode.com > 爱美尔女性商城源码 1.0源码程序 > admintouch/addhelp.asp

    <!--#include file="conn.asp"-->
<%if session("bjxadmin")="" then
response.Write "<script LANGUAGE='javascript'>alert('网络超时或者您还没有登录请登录');window.location.href='login.asp';</script>"
response.End
else
if session("flag")>2 then
response.Write "<p align=center><font color=red>您没有此项目管理权限!</font></p>"
response.End
end if
end if

 if request.QueryString("action")="save" then
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from T_help",conn,1,3
rs.addnew
rs("titles")=trim(request("titles"))
rs("anclassid")=trim(request("anclassid"))
rs("nclassid")=trim(request("nclassid"))
Content=Request.Form("Content")

'将里面的链接换成本地链接
 aa="http://"&Request.ServerVariables("server_name")&Request.ServerVariables("path_info")
 aa= mid(aa,1,len(aa)-17)		'16=admin/addnews.asp
rs("Content")=content
rs.update
rs.close
set rs=nothing
session("content")=""
response.write "<script language=javascript>alert('添加成功!');window.location.href='managehelp.asp';</script>"
response.End
end if
%>
<html><head><title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
<!--
function checkdata()
{
if (document.myform.titles.value=="")
	{
	  alert("对不起,请输入主题!")
	  document.myform.titles.focus()
	  return false
	 }
}

//-->
</script>
<%dim count
set rs=server.createobject("adodb.recordset")
rs.open "select * FROM BJX_class2 where typeid=3 order by Nclassidorder ",conn,1,1%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
   count = 0
   do while not rs.eof 
%>
subcat[<%=count%>] = new Array("<%= trim(rs("Nclass"))%>","<%= rs("anclassid")%>","<%= rs("Nclassid")%>");
<%
        count = count + 1
        rs.movenext
        loop
        rs.close
%>
		
onecount=<%=count%>;

function changelocation(locationid)
    {
    document.myform.Nclassid.length = 0; 

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { //这句不是很理解
             document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
<link href="images/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
-->
</style>
</head>
<body>
<table class="tableBorder" width="90%" border="0" align="center" cellpadding="0" cellspacing="1" >
<tr> 
<td  align="center" background="images/admin_bg_1.gif" height="25"><span class="style1">添加帮助中心</span></td>
</tr>
<tr> 
<td valign="top"> 
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1">
<form name="myform" method="post" action="addhelp.asp?action=save" onSubmit="return checkdata()" onReset="return ResetForm();">
          <tr > 
            <td width="20%" align="right">标题:</td>
            <td style="PADDING-LEFT: 10px">
			<input name="titles" type="text" id="titles" size="50"></td>
          </tr>
          <tr > 
                                    <td width="20%" align="right">选择分类:</td>
                                    <td> 
                                      <%
	rs.open "select * FROM BJX_class1 where typeid=3 order by anclassidorder",conn,1,1
	if rs.eof and rs.bof then
	response.write "请先添加栏目。"
	response.end
	else
%>
										大类:
<select name="anclassid" size="1" id="anclassid" onChange="changelocation(document.myform.anclassid.options[document.myform.anclassid.selectedIndex].value)">
                                        <option selected value="<%=rs("anclassid")%>"><%=trim(rs("anclass"))%></option>
                                        <%      dim selclass
         selclass=rs("anclassid")
        rs.movenext
        do while not rs.eof
%>
                                        <option value="<%=rs("anclassid")%>"><%=trim(rs("anclass"))%></option>
                                        <%
        rs.movenext
        loop
		end if
        rs.close
%>
                                      </select> 
									  小类:
<select name="Nclassid">
                                        <%rs.open "select * FROM BJX_class2 where typeid=3 and anclassid="&selclass ,conn,1,1
if not(rs.eof and rs.bof) then
%>
                                        <option selected value="<%=rs("NclassID")%>"><%=rs("Nclass")%></option>
                                        <% rs.movenext
do while not rs.eof%>
                                        <option value="<%=rs("NclassID")%>"><%=rs("Nclass")%></option>
                                        <% rs.movenext
loop
end if
        rs.close
        set rs = nothing
%>
                                      </select></td>
								  </tr>
          <tr > 
            <td align="right" valign="top">内容:</td>
            <td style="PADDING-LEFT: 10px">
<IFRAME ID="ewebeditor1" SRC="../webedit/ewebeditor.asp?id=Content&style=s_coolblue1" FRAMEBORDER="0" SCROLLING="no" WIDTH="600" HEIGHT="380"></IFRAME>
		  <textarea name="Content" id="Content"  style="display:none"></textarea>
			</td>
          </tr>
          <tr >
		  <td height="30"></td>
		  <td height="30" style="PADDING-LEFT: 10px">
		  <input type="submit" name="Submit" value="提交发表" >
		  <input onClick="ClearReset()" type=reset name="Clear" value="重新填写">
		  </td>
          </tr>
</form>
</table>
</td>
</tr>
</table>
<!--#include file="bjxfoot.asp"-->
</body>
</html>