edit.asp

来自「实现一个用JSP、Servlet技术实现的小型物流网站系统。实现功能如下:管理员」· ASP 代码 · 共 274 行

ASP
274
字号
<%@ codepage ="936" %>
<% data_path="../../" 'ACC连接数据库路径,对SQL无效 %>
<!--#include file="../../conn/conn.asp"-->
  <!--#include file="../../inc/filesystem.asp"-->
 <!--#include file="../../inc/safe.asp"-->
<%
if session("globalecmaster")="" or session("masterflag")="" then
response.write "<script language='javascript'>"
response.write"parent.location.href='../login.asp';</SCRIPT>" 
response.end
end if


	'权限限制^^^^^^^^^^^^^^^^^^^^
 dim ishavegant
 ishavegant=false
 in_str=split(session("masterflag"),",")
 for each ins in in_str
 if trim(ins)="71" then 
 ishavegant=true
 end if
 next 
 if ishavegant=false then
 response.redirect "../err.asp"
 response.end
 end if
 '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^




if request("newsid")="" then
Response.write("<script >alert('对不起!参数传递错误!');history.back(-1);</script>")
response.End()
end if

 newsid=Replace_Text(request("newsid"))
 %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加商业信息</title>
<link rel="stylesheet" type="text/css" href="../css/style.css">
</head>
<script LANGUAGE="JavaScript">
function check()
{
if (document.form.title.value=="")
{
alert("请输入资讯标题!")
document.form.title.focus()
document.form.title.select()
return
}
if (document.form.typeid.value=="")
{
alert("请选择资讯所属类别!")
document.form.typeid.focus()
document.form.typeid.select()
return
}
if (document.form.nfrom.value=="")
{
alert("请输入资讯添加人!")
document.form.nfrom.focus()
document.form.nfrom.select()
return
}

document.form.submit()
}
</script>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align=center class="tableBorder"> 
  <tr> 
     <th height=25 colspan="2" class="tableHeaderText">商业信息管理 </th> 
  </tr> 
  <tr> 
     <td colspan="2" class="forumRowHighlight"><p><B>注意</B>:<BR> 
         ①类别直接与发布的信息相关联,删除类别可能会影响到以前发布的专项商机信息。<BR>
		 <font color="red"><b>②如果选择了 首页推荐(图片) 和 首页头条 和 添加到图文列表 就一定要上传一张标题图片,。</b></font><br> </td> 
  </tr> 
  <tr> 
     <td width="10%" height=25 class="forumRowHighlight"> <B>操作选项</B></td> 
     <FORM name=searchForm action="index.asp" method=post onSubmit="javascript:if(doSearch()==false) return false;"> 
      <td class="forumRowHighlight"> 关键字:        <input name="keywords" type="text" value="<%=keywords%>"> 
&nbsp;所属类别:
         <select name="typeid" size="1"> 
          <%
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from Yixiang_newsType"
rs1.open sql1,conn,1,1
if not rs1.eof then
do while not rs1.eof
response.write "<option value='"&rs1("typeid")&"'>"&rs1("type")&" 类信息</option>"&chr(13)+chr(10)
rs1.movenext
loop
rs1.close
end if
%> 
        </select> 
         <input type="submit" value="立刻查找" id=submit name=submit> </td> 
    </form> 
  </tr> 
  <tr> 
    <td height=25 class="forumRowHighlight">&nbsp;</td> 
     <td class="forumRowHighlight"><a href="index.asp">管理商业信息</a> | <a href="addinfo.asp">添加商业信息</a> | <a href="type.asp">管理信息类别</a> | <a href="Class_Ok.asp?action=add_class_1">添加信息类别</a> | [<a href="javascript:location.reload()">刷新页面</a>] </td> 
  </tr> 
</table> 
<%
sql="select * from Yixiang_news where newsid="&newsid
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1

 %>
<form name="form" method="POST" action="saveedit.asp">
 <input type="hidden" name="picture" value = "<%if rs("picture")<>"nopicture.gif" then  response.write""&rs("picture")&""%>"> 
<input type="hidden" name="newsid" value="<%=rs("newsid")%>">
  <TABLE width="100%" border="0" align=center cellpadding="0" cellspacing="1" class="tableBorder"> 
    <tr> 
      <th height=25 colspan="2" class="tableHeaderText">添加商业信息</th> 
    </tr> 
    <TR ALIGN="center"> 
      <TD> <TABLE width="100%" border="0" cellpadding="5" cellspacing="2" bordercolorlight="#CEE7FF" bordercolordark="#CEE7FF" style="border-collapse: collapse"> 
          <TR> 
            <TD width="188" align="right" class="Forumrow"><b>信息标题:</b></TD> 
            <TD colspan="2" class="Forumrow"> <font color="#F4FAFF"> 
              <select name='IncludePic'> 
                <option selected> </option> 
                <option value='[图文]'>[图文]</option> 
                <option value='[组图]'>[组图]</option> 
                <option value='[推荐]'>[推荐]</option> 
                <option value='[注意]'>[注意]</option> 
              </select> 
              <input name="title" type="text" class="smallInput" value="<%=rs("title")%>" size="55" maxlength="25"> 
              </font> <font color='#FF0000'>*</font> 
              <select name='TitleFontColor' id='TitleFontColor'> 
                <option value='' selected>颜色</option> 
                <option value=''>默认</option> 
                <option value='#000000' style='background-color:#000000'></option> 
                <option value='#FFFFFF' style='background-color:#FFFFFF'></option> 
                <option value='#008000' style='background-color:#008000'></option> 
                <option value='#800000' style='background-color:#800000'></option> 
                <option value='#808000' style='background-color:#808000'></option> 
                <option value='#000080' style='background-color:#000080'></option> 
                <option value='#800080' style='background-color:#800080'></option> 
                <option value='#808080' style='background-color:#808080'></option> 
                <option value='#FFFF00' style='background-color:#FFFF00'></option> 
                <option value='#00FF00' style='background-color:#00FF00'></option> 
                <option value='#00FFFF' style='background-color:#00FFFF'></option> 
                <option value='#FF00FF' style='background-color:#FF00FF'></option> 
                <option value='#FF0000' style='background-color:#FF0000'></option> 
                <option value='#0000FF' style='background-color:#0000FF'></option> 
                <option value='#008080' style='background-color:#008080'></option> 
              </select></TD> 
          </TR>
		            <TR> 
            <TD align="right" valign="middle" class="Forumrow"><b>信息分类:</b></td> 
            <TD colspan="2" class="Forumrow"> <font color="#F4FAFF"> 
              <select name="typeid" size="1" class="lh17">
           <%
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from Yixiang_newsType"
rs1.open sql1,conn,1,1
if not rs1.eof then 
do while not rs1.eof
%>
<option value='<%=rs1("typeid")%>' <%if rs1("typeid")=rs("typeid") then response.Write("selected") end if %>><%=rs1("type")%>类信息</option> 
<%
rs1.movenext
loop
rs1.close
end if
%> 
              </select> <a href="Class_Ok.asp?action=add_class_1"><font color='#FF0000'>添加</font></a></font> 
			  &nbsp;&nbsp;&nbsp;<input name="pic_on" type="checkbox" id="pic_on" value="1" onClick=showadv()>
<font color="red"><span id="advance">上传标题图片</span> </font><%
if rs("picture")<>""  or rs("picture")<>"nopicture.gif" then
  %>
<img src="../../UploadFile/<%=rs("picture")%>"  width="35" height="35">

<%
else
%>
暂无图片!
<%
end if
%></TD> 
          </TR>   <TR>
		  <td class="Forumrow"></td> 
<TD colspan="2" class="Forumrow">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id=adv style="DISPLAY: none">
  <tr>
    <td width="92%">
<!----------------------------------------------------文件上传----------------------------------------------->
  <iframe id="d_file" frameborder="0" src="../../inc/upload.asp?tMode=3&istwo=0&utype=kind" width="300" height="40" scrolling="no"></iframe>
  <!---------------------------------------------------------------------------> 
	  <input type="hidden" name="oldpic" value="<%=rs("picture")%>" maxlength="40"> 
	  </td>
  </tr>
  <tr><td><input type="radio" name="cimg" value="1" checked><b><font color="red">▲</font></b>使用原有图片 
           <input type="radio" name="cimg" value="2"><b><font color="red">◆</font></b>删除原有图片重新上传</td></tr>
  
</table></TD>
</TR> 
          <TR> 
            <TD align="right" class="Forumrow"><b>信息属性: </b></TD> 
            <TD width="555" class="Forumrow"><input name="tjnews" type="checkbox" id="tjnews" value="1" <%if rs("tjnews")=1 then response.write"CHECKED"%>> 
              小类推荐&nbsp;&nbsp;&nbsp;&nbsp;
              <input name="tjhome" type="checkbox" id="tjhome" value="1" <%if rs("tjhome")=1 then response.write"CHECKED"%>> 
              首页推荐&nbsp;&nbsp;&nbsp;&nbsp;
              <input name="homepic" type="checkbox" id="homepic" value="1" <%if rs("homepic")=1 then response.write"CHECKED"%> onClick=showadv1()> 
            首页推荐<font color="blue">(图片)</font>&nbsp;&nbsp;&nbsp;&nbsp;
            <input name="homehot" type="checkbox" id="homehot" value="1" <%if rs("homehot")=1 then response.write"CHECKED"%> onClick=showadv2()> 
            首页头条<font color="blue">(必需图片)</font>&nbsp;&nbsp;&nbsp;</TD> 
            <TD width="168" class="Forumrow"  id=advpic><input name="pictext" type="checkbox" id="pictext"  value="1" <%if rs("pictext")=1 then response.write"CHECKED"%>>
<span style="color:red;">添加到图文列表</span></TD>
          </TR>
		  		  		  		
		  <TR> 
            <TD align="right" class="Forumrow"><b>信息来源:</b></td> 
            <TD colspan="2" valign="middle" class="Forumrow"><font color="#F4FAFF"> 
              <input name="nfrom" type="text" class="smallInput" value="<%=rs("nfrom")%>" size="50" maxlength="30"> 
              <font color='blue'><=【<font color='green' onclick="document.form.nfrom.value='<%=webname%>信息中心'" style="cursor:hand;"><%=webname%>信息中心</font>】</font>
            </TD> 
          </TR> 
          <TR> 
            <TD align="right" class="Forumrow"><b>详细信息:</b></TD> 
            <TD colspan="2" class="Forumrow"><textarea name="content" style="display:none"><%=rs("content")%></textarea><iframe ID="eWebEditor1" src="../../editor/ewebeditor.asp?id=content&style=standard&originalfilename=d_originalfilename &savefilename=d_savefilename &savepathfilename=d_savepathfilename" frameborder="0" scrolling="no" width="617" HEIGHT="450"></iframe></TD> 
          </TR> 
          <TR height="40"> 
            <TD colspan="3" align="center" class="Forumrow" height="40">
              <input type="button" name="Submit" value=" 提 交 保 存" class="smallInput" onClick="check()">
			  &nbsp;&nbsp;&nbsp; 
            <input type="reset" name="Submit2" value=" 重 新 添 写" class="smallInput">          </TR> 
      </TABLE></TD> 
    </TR> 
  </TABLE> 
</FORM> 
<script>
function showadv(){
if (document.form.pic_on.checked == true) {
		adv.style.display = "";
		advance.innerText="取消上传标题图片"
	}else{
		adv.style.display = "none";
		advance.innerText="上传标题图片"
	}
}		
</script> 
<script>
function showadv1(){
if (document.form.homepic.checked == true) {
		adv.style.display = "";
	}else{
		adv.style.display = "none";
	}
}		
</script>
<script>
function showadv2(){
if (document.form.homehot.checked == true) {
		adv.style.display = "";
	}else{
		adv.style.display = "none";
	}
}		
</script>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<!--#include file="../copy.asp" -->

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?