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

📄 admin_down.asp

📁 研究生会网站,,适合大中专门院校学生组织使用
💻 ASP
📖 第 1 页 / 共 3 页
字号:
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
  if not isInteger(request.form("id")) then
    founderr=true
Response.Write("<script language=javascript>alert('非法的专题类id参数。');history.back(1);</script>")
  end if
end if
if founderr then
  call diserror()
  response.End
end if
sql="select * from soft where soft_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
soft_name=trim(replace(request.form("name"),"'",""))
soft_size=trim(replace(request.form("size"),"'",""))
soft_mode=trim(replace(request.form("mode"),"'",""))
roof=trim(replace(request.form("roof"),"'",""))
commend=cint(request.form("commend"))
demo=trim(replace(request.form("demo"),"'",""))
home=trim(replace(request.form("home"),"'",""))
showpic=trim(replace(request.form("showpic"),"'",""))
desc=trim(replace(request.form("desc"),"'",""))
downisbest=request.form("isbest")
url1=trim(replace(request.form("url1"),"'",""))
url2=trim(replace(request.form("url2"),"'",""))
url3=trim(replace(request.form("url3"),"'",""))
url4=trim(replace(request.form("url4"),"'",""))

if soft_name="" then
  founderr=true
Response.Write("<script language=javascript>alert('你必须填写专题名称!');history.back(1);</script>")
else
  rs("soft_name")=soft_name
end if
if commend<1 then
  founderr=true
Response.Write("<script language=javascript>alert('你必须选择专题推荐程度!');history.back(1);</script>")
else
  rs("soft_commend")=commend
end if
rs("isbest")=cint(downisbest)
if request("of")<>"" then
		Set rsclass = Server.CreateObject("ADODB.Recordset")
		sqlclass="SELECT * FROM d_class where class_id="&request("of")
		rsclass.OPEN sqlclass,Conn,1,1
		rs("soft_classid")=rsclass("class_id")
		rs("soft_classname")=rsclass("class_name")
		rs("soft_catid")=rsclass("cat_id")
		set rscat = Server.CreateObject("ADODB.Recordset")
		sqlcat="select cat_name from d_cat where cat_id="&rsclass("cat_id")
		rscat.open sqlcat,conn,1,1
		rs("soft_catname")=rscat("cat_name")
		rscat.close
		rsclass.close
		set rscat=nothing
		set rsclass=nothing
else
		founderr=true
Response.Write("<script language=javascript>alert('你必须选择所属分类,或者非法操作!');history.back(1);</script>")
end if
if demo="" then
  rs("soft_demo")=""
else
  rs("soft_demo")=demo
end if
if showpic="" then
  rs("soft_showpic")=""
else
  rs("soft_showpic")=showpic
end if
if desc="" then
  founderr=true
Response.Write("<script language=javascript>alert('你必须填写专题内容!');history.back(1);</script>")
else
  rs("soft_desc")=desc
end if

if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  response.redirect "admin_down.asp?action=list"
end if
end if

'delete
if request.Form("action")="delsoft" then
if request.Form("id")="" then
  founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
  if not isInteger(request.form("id")) then
    founderr=true
Response.Write("<script language=javascript>alert('非法的专题类id参数。');history.back(1);</script>")
  end if
end if
if founderr then
  call diserror()
  response.End
end if
sql="select * from soft where soft_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
  rs.delete
  rs.close
  set rs=nothing
  sql="update allcount set softcount = softcount - 1"
  conn.execute(sql)
  
  response.redirect "admin_down.asp?action=list"
end if
end if
sql="select * from d_cat"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if request.QueryString("action")="newsoft" then%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
              <form name="form1" method="post" action="admin_down.asp?action=list">
			  <tr> 
                <td colspan="2">新增专题</td>
              </tr>
              <tr> 
                <td width="16%">专题名称</td>
                <td width="84%">
                    <input type="text" name="name" size="40" class="textarea">
                  </td>
              </tr>
              <tr> 
                <td>推荐程度</td>
                <td>
                    <select name="commend">    
		     <option value="5">5stars</option>
                      <option value="4">4stars</option>
                      <option value="3" selected>3stars</option>
                      <option value="2">2stars</option>
                      <option value="1">1stars</option>
                      <option value="0">0stars</option>
                    </select>
                  </td>
              </tr>
              <tr> 
                <td>所属分类</td>
                <td>
                    <select name="of">
                      <%
dim catname,classname,catid,classid
Set rs = Server.CreateObject("ADODB.Recordset")
sql="SELECT * FROM d_cat"
rs.OPEN sql,Conn,1,1
if not (rs.eof and rs.bof) then
rs.movefirst
do while not rs.eof
sql="select * from d_class where cat_id="&rs("cat_id")
Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.OPEN sql,Conn,1,1
if not (rs2.eof and rs2.bof) then
do while not rs2.eof
catid=rs("cat_id")
classid=rs2("class_id")
catname=rs("cat_name")
classname=rs2("class_name")
%>
                      <option value='<%=rs2("class_id")%>'><%=rs2("class_name")%>(<%=rs("cat_name")%>)</option>
<%
rs2.movenext
loop
end if
rs.movenext
rs2.close
set rs2=nothing
loop
end if
%>
                    </select>
                  </td>
              </tr>

             <tr> 
              <td> 上传图片: </td>
              <td align="left" height="25"><iframe frameborder=0 width=290 height=25 scrolling=no src="upload.asp?action=downpic"></iframe></td>
            </tr>
              <tr> 
                <td>专题简介</td>
                <td>
                    <textarea name="desc" cols="65" rows="10" class="textarea">无内容</textarea>
                  </td>
              </tr>
              <tr> 
                <td colspan="2" align="center" height="30">
<input type="checkbox" name="isbest" value="1" style="display:none">
<input type="submit" name="Submit" value="确定新增" class="button">
                    <input type="reset" name="Reset" value="清空重填" class="button">
<input type="button" value="返回"  onClick="location.href='admin_down.asp?action=list'" class="button"></td>
              </tr>
			  <input type="hidden" name="action" value="newsoft">
			  <input type="hidden" name="MM_insert" value="true">
			  </form>
            </table>
			<%end if
			if request.QueryString("action")="editsoft" then
			if request.querystring("id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
  response.end
else
  if not isinteger(request.querystring("id")) then
Response.Write("<script language=javascript>alert('非法的软件ID参数!');history.back(1);</script>")
	response.end
  end if
end if
sql="select * from soft where soft_id="&cint(request.querystring("id"))
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
              <form name="form1" method="post" action="admin_down.asp?action=list">
                <tr> 
                  <td colspan="2">编辑专题</td>
                </tr>
                <tr> 
                  <td width="16%">专题名称</td>
                  <td width="84%"> <input type="text" name="name" size="40" class="textarea" value="<%=rs2("soft_name")%>"> 
                  </td>
                </tr>
                  <tr> 
                  <td>推荐程度</td>
                  <td> <select name="commend" id="commend">
                      <option value="5" <%if rs2("soft_commend")=5 then response.write "selected" end if%>>5stars</option>
                      <option value="4" <%if rs2("soft_commend")=4 then response.write "selected" end if%>>4stars</option>
                      <option value="3" <%if rs2("soft_commend")=3 then response.write "selected" end if%>>3stars</option>
                      <option value="2" <%if rs2("soft_commend")=2 then response.write "selected" end if%>>2stars</option>
                      <option value="1" <%if rs2("soft_commend")=1 then response.write "selected" end if%>>1stars</option>
                      <option value="0" <%if rs2("soft_commend")=0 then response.write "selected" end if%>>0stars</option>
                    </select> </td>
                </tr>
                <tr> 
                  <td>所属分类</td>
                  <td> <select name="of" id="of">
                      <%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="SELECT * FROM d_cat"
rs.OPEN sql,Conn,1,1
if not (rs.eof and rs.bof) then
rs.movefirst
do while not rs.eof
sql="select * from d_class where cat_id="&rs("cat_id")
Set rs3 = Server.CreateObject("ADODB.Recordset")
rs3.OPEN sql,Conn,1,1
if not (rs3.eof and rs3.bof) then
do while not rs3.eof
catid=rs("cat_id")
classid=rs3("class_id")
catname=rs("cat_name")
classname=rs3("class_name")
%>
                      <option value='<%=rs3("class_id")%>' <%if rs3("class_id")=rs2("soft_classid") then response.Write "selected" end if%>><%=rs3("class_name")%>(<%=rs("cat_name")%>)</option>
                      <%
rs3.movenext
loop
end if
rs.movenext
rs3.close
set rs3=nothing
loop
end if
%>
                    </select> </td>
                </tr>
            <tr> 
              <td> 上传图片: </td>
              <td align="left" height="25"><iframe frameborder=0 width=290 height=25 scrolling=no src="upload.asp?action=downpic"></iframe></td>
            </tr>
                <tr> 
                  <td>专题内容:</td>
                  <td> <textarea name="desc" cols="65" rows="10" class="textarea" id="desc"><%=rs2("soft_desc")%></textarea> 
                  </td>
                </tr>
         
                <tr> 
                  <td colspan="2" align="center" height="30"> 
<input type="checkbox" name="isbest" value="1" id="isbest" <%if rs2("isbest")=1 then response.write "checked" end if%>  style="display:none">
                    <input name="Submit" type="submit" class="button" id="Submit" value="确定修改"> 
<input type="button" value="返回"  onClick="location.href='admin_down.asp?action=list'" class="button"></td>
                </tr>
				<input type="hidden" name="id" value="<%=request.QueryString("id")%>">
                <input type="hidden" name="action" value="editsoft">
                <input type="hidden" name="MM_insert" value="true">
              </form>
            </table>
			<%end if
			if request.QueryString("action")="delsoft" then
			if request.querystring("id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
  response.end
else
  if not isinteger(request.querystring("id")) then
Response.Write("<script language=javascript>alert('非法的软件ID参数!');history.back(1);</script>")
	response.end
  end if
end if
sql="select * from soft where soft_id="&cint(request.querystring("id"))
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
			%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
              <form name="form1" method="post" action="admin_down.asp?action=list">
                <tr> 
                  <td colspan="2" class="diaryhead">删除软件</td>
                </tr>
                <tr> 
                  <td width="16%">专题名称</td>
                  <td width="84%"><%=rs2("soft_name")%>
                  </td>
                </tr>
                <tr> 
                  <td>推荐程度</td>
                  <td><img src="img/star<%=rs2("soft_commend")%>.gif"></td>
                </tr>
                <tr> 
                  <td>所属分类</td>
                  <td><%=rs2("soft_catname")%> | <%=rs2("soft_classname")%></td>
                </tr>
                <tr> 
                  <td>图片地址</td>
                  <td><%=rs2("soft_showpic")%>
                  </td>
                </tr>
                <tr> 
                  <td>专题内容</td>
                  <td><%=ubb2html(formatStr(autourl(rs2("soft_desc"))), true, true)%>
                  </td>
                </tr>
                 <tr> 
                  <td colspan="2" align="center" height="30"> 
                    <input name="Submit" type="submit" class="button" id="Submit" value="确定删除">
<input type="button" value="返回"  onClick="location.href='admin_down.asp?action=list'" class="button"> </td>
                </tr>
                <input type="hidden" name="id" value="<%=request.QueryString("id")%>">
                <input type="hidden" name="action" value="delsoft">
                <input type="hidden" name="MM_insert" value="true">
              </form>
            </table>
<%
end if
rs.close
set rs=nothing

%>

⌨️ 快捷键说明

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