⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_2sedit.asp

📁 校园二手交易系统,具有完备的后台操作以及应用功能!
💻 ASP
字号:
<!--#include file="admin_head.asp"--><!--#include file="../Inc/SchoolSelect.asp"--><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>多多校园产品后台管理官方网站http://www.ddtaobao.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="多多校园产品后台管理官方网站http://www.ddtaobao.com">
<meta name="description" content="多多校园产品后台管理官方网站http://www.ddtaobao.com">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><link rel="stylesheet" type="text/css" href="img/admin_style.css">
<!--#include file="../Inc/getSchool.asp"-->

<%
if request.Form("method") = 1 then
	if Request("Unid") = "" then
		Errmsg = "<li>发现异常错误。<li>错误编号为: error 105。<li>请和工作室联系解决问题。"
		FoundErr = true
	else
		Unid = Request("Unid")
	end if 	
	if Request("Classid") = "" or Request("Nclassid") = "" then
		Errmsg = "<li>请选择文章所属的大栏目及小栏目。"
		FoundErr = true
	else
		Classid = Request("Classid")
		Nclassid = Request("Nclassid")
	end if
	
	if Trim(Request.Form("title")) = "" then
		Errmsg = Errmsg + "<li>请输入文章标题。"
		FoundErr = true
	else
		title = Qcdn.checkStr(Trim(Request.Form("title")))
	end if
	
	if Trim(Request.Form("u_id")) = "" then
		u_id = 0
	else
		u_id = Request.Form("u_id")
	end if
	
	if Trim(Request.Form("author")) = "" then
		author = "匿名"
	else
		author = Qcdn.checkStr(Trim(Request.Form("author")))
	end if
	

	if Trim(Request("content")) = "" then
		Errmsg = Errmsg + "<li>请输入文章内容。"
		FoundErr = true
	else
		Content = Qcdn.checkStr(Trim(Request("content")))
	end if
	if Trim(Request.form("DefaultPic")) <> "" then
		pic = 1
		DefaultPic = Trim(Request.form("DefaultPic"))
	else
		pic = Request.Form("pic")
		DefaultPic = Trim(Request.form("DefaultPic"))
	end if

	if FoundErr then
		Call Qcdn.Err_List(Errmsg,1)
		Response.End()
	end if
	
	lx = Request.Form("lx")
	dq = Request.Form("dq")
	jx = Request.Form("jx")
	email_rs= Request.Form("email_rs")
    name_rs= Request.Form("name_rs")
    tel_rs= Request.Form("tel_rs")
'title,u_id,author,Nclassid,classid,lx,dq,jx,content	
'"&title&"',"&u_id&",'"&author&"',"&Nclassid&","&classid&","&lx&","&dq&","&jx&",'"&content&"',u_id="&u_id&",author='"&author&"',Nclassid="&Nclassid&",classid="&classid&",lx="&lx&",dq='"&dq&"',jx="&jx&",content='"&content&"',email_rs='"&email_rs&"',name_rs='"&name_rs&"',tel_rs='"&tel_rs&"' 

	Sql = "Update 2s_list set title='"&title&"',DefaultPic='"& DefaultPic &"',u_id="&u_id&",author='"&author&"',Nclassid="&Nclassid&",classid="&classid&",lx="&lx&",dq='"&dq&"',jx="&jx&",content='"&content&"',email_rs='"&email_rs&"',name_rs='"&name_rs&"',tel_rs='"&tel_rs&"'  where s_id = "&Unid

	Conn.execute(Sql)
	Response.Write("<script>alert(""修改成功"");location.href=""admin_2s.asp"";</script>")
	Response.End()
end if
sql = "select * from 2s_class where flag <>0 order by Unid asc"
set rs = conn.execute(sql)
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof 
        %>
subcat[<%=count%>] = new Array("<%=Qcdn.HTMLcode(rs(1))%>","<%=rs(2)%>","<%=rs(0)%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;

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

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.form1.Nclassid.options[document.form1.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
<script src="inc/forms.js"></script>
<%
Unid = Request("unid")
Sql = "Select title,u_id,author,classid,Nclassid,lx,dq,content,jx,hits,Intime,email_rs,name_rs,tel_rs from 2s_list where s_id = " & Unid
set Rs = conn.execute(Sql)
if not rs.eof then
title= Rs(0)
u_id= Rs(1)
author= Rs(2)
classid= Rs(3)
Nclassid= Rs(4)
lx= Rs(5)
dq= Rs(6)
content= Rs(7)
jx= Rs(8)
hits= Rs(9)
Intime= Rs(10)
email_rs= Rs(11)
name_rs= Rs(12)
tel_rs= Rs(13)
end if
rs.close
%>
<link rel="stylesheet" type="text/css" href="img/admin_style.css">


<table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#62C0FF" class="border" style="border-width: 0">
          
         
          <tr align="center">
    <td height=20 class="topbg" colspan="2">多多科技管理</tr>

  <tr>   <form action="" name="form1" method="post" onsubmit="WBTB_CopyData('Body');return check();">
    <tr> 
      <td colspan="2" align="center" height="30" bgcolor="#FFFFFF"><b>发布信息 
        </b> </td>
    </tr>
    <tr valign="middle"> 
      <td width="15%" height="25" bgcolor="#FFFFFF">信息类别:</td>
      <td width="85%" height="25" bgcolor="#FFFFFF"> <%
					sql = "select Unid,classname from 2s_class where flag = 0 order by Unid asc"
					set rs = conn.execute(sql)
					if rs.eof and rs.bof then
						response.write "请先添加栏目。"
						response.end
					else
					%>
        <select name="classid" onChange="changelocation(document.form1.classid.options[document.form1.classid.selectedIndex].value)" size="1">
          <%do while not rs.eof%>
          <option value="<%=rs(0)%>" <%if Cint(classid) = Cint(rs(0)) then response.Write("selected")%>><%=Qcdn.HTMLcode(rs(1))%></option>
          <%
        				rs.movenext
       					loop
						end if
       					rs.close
        				set rs = nothing
						%>
        </select> &nbsp; <select name="Nclassid" size="1">
          <%
	sql = "select * from 2s_class where flag = "& Classid &" order by Unid asc"
 	set rs = conn.execute(sql)
	if not rs.eof then
        do while not rs.eof
        if cint(nclassid)=cint(rs(0)) then
               sel="selected"
        else
               sel=""
        end if	
        response.write "<option " & sel & " value='" +  Cstr(rs(0)) + "'>" + rs(1) + "</option>"
        rs.MoveNext
        Loop
	end if
        rs.close
%>
        </select> <font color="red">*</font></td>
    </tr>
    <tr> 
      <td height="25" bgcolor="#FFFFFF"> 信息标题:</td>
      <td height="25" bgcolor="#FFFFFF"> 
        <input name="title" type="text" id="title" value="<%=Qcdn.HTMLcode(title)%>" size="47" maxlength="40">
        (<font color="#CC5200">40字以内</font>)</td>
    </tr>
   <tr valign="middle"> 
      <td height="25" bgcolor="#FFFFFF">上传图片:</td>
      <td height="25" bgcolor="#FFFFFF"> <iframe name="ad" src="admin_upload.asp" width="400" height="25" frameborder=0 scrolling=no></iframe> 
      </td>
    </tr>
    <tr valign="middle"> 
      <td height="25" bgcolor="#FFFFFF">默认图片:</td>
      <td height="25" bgcolor="#FFFFFF"> <input type="text" name="DefaultPic" size="65"value="<%=DefaultPic%>"> </td>
    </tr>
    <tr> 
      <td height="25" bgcolor="#FFFFFF">类型:</td>
      <td height="25" bgcolor="#FFFFFF"> 
        <select name="lx" id="lx">
		  <option value="<%=lx%>" selected><% 
		  Select Case lx
                Case "1"
                response.write "出售"
                Case "2"
                response.write "求购"
                Case "3"
                response.write "出租"
                Case "4"
                response.write "求租"
                Case "5"
                response.write "求职"
                Case "6"
                response.write "[招聘]"
                Case Else
                response.write "[其它]"
                End Select
		   %></option>
          <option value="1">出售</option>
          <option value="2">求购</option>
          <option value="3">出租</option>
          <option value="4">求租</option>
          <option value="5">求职</option>
          <option value="6">招聘</option>
        </select></td>
    </tr>
    <tr>
      <td height="25" bgcolor="#FFFFFF">交易状态:</td>
      <td height="25" bgcolor="#FFFFFF">
<select name="jx" id="jx">
           <option value="<%= jx %>"><% 
		  Select Case jx
                Case "0"
                response.write "没有完成交易"
                Case "1"
                response.write "完成交易"
                End Select
		   %></option> 
          <option value="0">没有完成交易</option>
          <option value="1">完成交易</option>
        </select></td>
    </tr>
    <tr> 
      <td height="25" bgcolor="#FFFFFF"> 所在地区:</td>
      <td height="25" bgcolor="#FFFFFF"> 
        <select name="dq" id="dq">
		<%=schoolselect%>               </select>
        </td>
    </tr>
    <tr> 
      <td height="25" bgcolor="#FFFFFF"> 
        <p>详细说明:</td>
      <td height="25" bgcolor="#FFFFFF"> 
        <textarea name="content" cols="53" rows="11" id="content"><%=Qcdn.Ubbcode(content)%></textarea></td>
    </tr>
    <tr> 
      <td height="25" bgcolor="#FFFFFF"> 联系人:</td>
      <td height="25" bgcolor="#FFFFFF"> 
        <input name="name_rs" type="text" id="name_rs" value="<%= name_rs %>" size="23" maxlength="15"></td>
    </tr>
    <tr> 
      <td height="25" bgcolor="#FFFFFF"> email:</td>
      <td height="25" bgcolor="#FFFFFF"> 
        <input name="email_rs" type="text" id="email_rs" value="<%= email_rs %>" size="23" maxlength="40"> 
      </td>
    </tr>
    <tr> 
      <td height="25" bgcolor="#FFFFFF"> 联系方式:</td>
      <td height="25" bgcolor="#FFFFFF"> 
        <textarea name="tel_rs" cols="53" rows="2" id="tel_rs"><%= tel_rs %></textarea></td>
    </tr>

    <tr> 
      <td height="25" colspan="2" align="center" bgcolor="#FFFFFF"> <input type="submit" name="Submit" value=" 提 交 " class="tbutton"> 
        <input name="u_id" type="hidden" id="u_id" value="<%= Request.Cookies("qcdn")("u_id") %>"> 
        <input name="author" type="hidden" id="author" value="<%= Request.Cookies("qcdn")("user_name") %>"> 
        <input type="hidden" name="method" value="1"> <input type="reset" name="Submit2" value=" 重 置 " class="tbutton"> 
      </td>
    </tr>
  </form>
</table>
<script language="javascript">
function check(){
if (form1.classid.value =="" || form1.Nclassid.value==""){
alert("请选择栏目");
return false;
}
if (form1.title.value ==""){
alert("请输入标题");
form1.title.focus();
return false;
}
if (form1.Body.value ==""){
alert("请输入内容");
return false;
}
if (form1.nkey.value ==""){
alert("请输入相关文章");
form1.nkey.focus();
return false;
}
return true;
}
</script>

<!--#include file="copy.asp"-->

⌨️ 快捷键说明

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