admin_softinfo.asp

来自「.asp网站程序。专业的二手汽车商店网站。功能强大」· ASP 代码 · 共 577 行 · 第 1/2 页

ASP
577
字号
	end sub 
	
	sub SaveAdd()
      set rs=server.createobject("adodb.recordset")
	  sql="select * from "&CategoryName&"_SoftInfo where (SoftID is null)"
	  rs.open sql,conn,1,3
  	   rs.addnew
	   rs("SoftName")=checkstr(request.form("SoftName"))
	   rs("SoftVer")=checkstr(request.form("SoftVer"))
	   rs("CateID")=trim(request.form("CateID"))
	   rs("SubCateID")=trim(request.form("SubCateID"))
	   rs("Content")=request.form("content")
       rs("Images")=checkstr(trim(request.form("Images")))
	   rs("SoftFrom")=checkstr(trim(request.form("SoftFrom")))
	   rs("LicenceType")=trim(request.form("LicenceType"))
       rs("SoftSize")=trim(request.form("SoftSize"))
	   rs("Language")=Trim(Request.Form("Language"))
	   rs("System")=trim(request.form("System"))
	   rs("SoftType")=checkstr(request.form("SoftType"))
	   rs("DayHits")=4
	   rs("DayDate")=Now()
	   rs("WeekHits")=12
	   rs("WeekDate")=Now()
	   rs("MonthHits")=43
	   rs("MonthDate")=Now()
	   rs("AllHits")=179
	   rs("isShow")=1
	   rs("SoftTime")=date()
	   rs("UserName")=UserName
           rs("EssayNum")=0
	   rs.update
	   pubSoftID=rs("SoftID")	
	   rs.close
	   set rs=nothing
	   sql="update "&CategoryName&"_Cate set CateNum=CateNum+1 where CateId=" & trim(request.form("CateID"))
	  conn.execute sql
	   sql="update "&CategoryName&"_SubCate set SubCateNum=SubCateNum+1 where SubCateId=" & trim(request.form("SubCateID"))
	  conn.execute sql	  
	   msgtitle="添加信息成功"
	   msginfo="<li><a href=""Admin_SoftLink.Asp?SoftID="&pubSoftID&""">添加信息下载地址</a></li>"
	   call Sysmsg(msgtitle,msginfo)
	end sub
  
sub myform(isEdit)
 set rs=server.createobject("adodb.recordset")

     sql = "select * from "&CategoryName&"_SubCate order by subcateid asc"
     rs.open sql,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("SubCateName"))%>","<%=cstr(rs("cateid"))%>","<%=cstr(rs("subcateid"))%>");<%count = count + 1
        rs.movenext
        loop
        rs.close
        %>
    onecount=<%=count%>;

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

    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.myform.subcateid.options[document.myform.subcateid.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
    </SCRIPT> <form name="myform" method="post" action="Admin_SoftInfo.asp" onSubmit="return Juge(this)" >
          <%
  		 if isedit then
		  set rse=server.createobject("adodb.recordset")
 		   rse.open "select * from "&CategoryName&"_SoftInfo where SoftID=" & cstr(request("SoftID")),conn,1,1
		   cateid=cstr(rse("cateid"))
		   subcateid=cstr(rse("subcateid"))
	        pubTitle="编辑物品"
	     else
           cateid=request("cateid")
           subcateid=request("subcateid")	   
	       pubTitle="添加物品"
	    end if %>
          <input type="Hidden" name="action" value='<% If isedit then%>modify<% Else  %>add<% End If %>'>
          <%If isedit then%>
          <input type="Hidden" name="SoftID" value='<%=cstr(request("SoftID"))%>'>
          <%End If%>
          
  <table width="780" border="0" align="center" cellpadding="3" cellspacing="1" class="tableBorder">         
    <tr> 
      <th height="25" colspan="4" width="758"><%=pubTitle%></th>
    </tr>            
    <tr> 
      <td class="forumRowHighlight" width="86">物品名称:</td>
              
      <td class="forumRow" width="268"> 
        <input type="text" name="SoftName" size="28"  value='<% if isedit then
		                                                         response.write trim(rse("SoftName")) 
															 end if %>' maxlength="50"> 
                <font color="#FF0000">!</font> </td>
              
      <td class="forumRowHighlight" width="117">新旧程度:</td>
              
      <td class="forumRow" width="257">                       
                   <input type="text" name="SoftVer" maxlength="2" size="20" value='<% if isedit then
		                                                         response.write trim(rse("SoftVer")) 
															 end if %>'>
      </td>
    </tr>
            
    <tr> 
      <td class="forumRowHighlight" width="86">所属大类:</td>
              
      <td class="forumRow" width="268"> 
        <select name="cateid" onChange="changelocation(document.myform.cateid.options[document.myform.cateid.selectedIndex].value)" size="1">
                  <%
    sql="select * from "&CategoryName&"_Cate"
 	rs.open sql,conn,1,1
	if rs.eof and rs.bof then
		response.write "没有大类"
	else
	do while not rs.eof
        if cateid=cstr(rs("cateid")) then 
		sel="selected"
        else
		sel=""
        end if	
	response.write "<option " & sel & " value='"&cstr(rs("cateid"))&"' name=cateid>"+trim(rs("CateName"))+"</option>"
	rs.movenext
    	loop
	end if
	rs.close
%>
        </select> <font color="#FF0000">!</font> </td>
              
      <td class="forumRowHighlight" width="117">所属小类:</td>
              
      <td class="forumRow" width="257"> 
        <select name="subcateid" size="1">
                  <%
		if isedit or cateid<>"" then
  	       sql="select * from "&CategoryName&"_SubCate where cateid="&cateid
	    else
	       sql="select * from "&CategoryName&"_SubCate"
	    end if
 	    rs.open sql,conn,1,1
	    if rs.eof and rs.bof then
		    response.write "没有小类"
	    else
            do while not rs.eof
            if subcateid=cstr(rs("subcateid")) then
               sel="selected"
            else
               sel=""
            end if	
            response.write "<option " & sel & " value='"&cstr(rs("subcateid"))&"'>" + trim(rs("SubCateName")) + "</option>"
            rs.MoveNext
            Loop
	    end if
        rs.close
%>
        </select> <font color="#FF0000">!</font> </td>
    </tr>
                    <%
	  theSystem=split(SystemType, ",")
	   for i = 1 to ubound(theSystem)	
	   response.write "<input type=""checkbox"" name=""System""  value="""&trim(theSystem(i))&""" "
	   if isedit then
	       if instr(rse("System"),trim(theSystem(i)))>0 then 
		   response.write "checked"
		   end if
	   elseif instr(DefaultSystemType,trim(theSystem(i)))>0 then 
		   response.write "checked"
	   end if
	   response.write ">"&trim(theSystem(i))&" "
	   if i=5 then response.write "<br>"
	   next %> 
    <tr> 
      <td height="25" nowrap class="forumRowHighlight" width="86">物品价格:</td>
              
      <td height="25" class="forumRow" width="268"> 
        <input type="text" name="SoftSize" size="14" maxlength="10"  value='<% if isedit then
		                                                         response.write trim(rse("SoftSize")) 
															 end if %>'>&nbsp; <font color="#FF0000">!面议请填“0”</font> </td>                                  
                                                
      <td nowrap class="forumRowHighlight" width="117">物品所属类型:</td>                                  
                                                
      <td class="forumRow" width="257">                                   
        <select name="SoftType" size="1">                                  
                  <option value="转让" selected>转让</option>                              
                                                   
                  &nbsp;<% if isedit then                                 
			  response.write "<option value="""&rse("SoftType")&""">"&rse("SoftType")&"</option>"                                 
			  else                                 
			  response.write ""                                 
			  end if                                 
			  %>                                 
                  <option value="求购">求购</option>                              
                  <option value="出租">出租</option>
                  <option value="求租">求租</option>                              
                  <option value="其它">其它</option>          
        </select> <font color="#FF0000">!</font> </td>                                  
                                                
    </tr>                                  
                                              
    <tr>                                   
      <td nowrap class="forumRowHighlight" width="86">交易地区:</td>                                  
                                                
      <td class="forumRow" width="268">                                   
        <select name="LicenceType">
          <option value="合肥市" selected>合肥市</option>
          <option value="其它地市">其它地市</option>
          <option value="省外">省外</option>                                  
                  <% if isedit then                                  
			  response.write "<option value="""&rse("LicenceType")&""">"&rse("LicenceType")&"</option>"                                  
			  else                                  
			  response.write "<option value=""""></option>"                                  
			  end if                                  
			  %>                                 
        </select> <font color="#FF0000">!</font> </td>                                  
                                                
      <td class="forumRowHighlight" width="117">联系方式:</td>                                  
                                                
      <td class="forumRow" width="257">                                   
        <input type="text" name="SoftFrom" size="24" maxlength="100"  value='<% if isedit then                                  
		                                                         response.write trim(rse("SoftFrom"))                                   
															 end if %>'> &nbsp;  <font color="#FF0000">!</font>                                  
      </td>                                  
    </tr>                                  
                                              
    <tr>                                   
      <td nowrap class="forumRowHighlight" width="86">示例图片:</td>                                  
                                                
      <td colspan="3" class="forumRow" width="662">                                   
        <input type="text" name="images" size="38"  value='<% if isedit then                                  
		                                                         response.write trim(rse("images"))                                   
															 end if %>'>                                  
                物品的缩略图,建议大小为:135×120 px <iframe name="ad" frameborder=0 width=100% height=40 scrolling=no src=upload.asp></iframe></td>                                    
    </tr>                                    

                         
    <tr>                                     
      <td class="forumRowHighlight" width="86">物品简介:<br> <font color="#FF0000">1千字符内</font></td>                                    
                                                  
      <td colspan="3" class="forumRow" width="662">                                     
        <textarea onKeyDown=ctlent() name="content"  maxlength="1000" cols="60" rows="10" wrap="VIRTUAL"><% if isedit then response.write rse("Content") %></textarea>                                     
                <font color="#FF0000">!</font> </td>                                    
    </tr>                                    
                                                
    <tr>                                     
      <td class="forumRowHighlight" width="86"> </td>                                    
                                                  
      <td colspan="3" class="forumRow" width="662">                                     
        <input type="submit" name="Submit" value="提 交">                                     
                <input type="reset" name="Submit2" value="重 置"> <% if isedit then                                    
response.write "<input name=""updateTime"" type=""checkbox"" id=""updateTime"" value=""yes"" checked>更新信息时间"                                    
                               rse.close                                    
					 ' rs.close                                    
					set rse=nothing                                    
					set rs=nothing				                                    
				  end if %>                                    
      </td>                                    
    </tr>                                    
      </table>                                    
        </form>                                    
        <% end sub                                     
		sub Sysmsg(msgtitle,msginfo)                                    
		%>                                     
<table width="780" border="0" align="center" cellpadding="3" cellspacing="1" class="tableBorder" >                                    
  <tr>                                     
    <th><%=msgtitle%></th>                                    
  </tr>                                    
  <tr>                                     
    <td height="22" align="center" class="forumRowHighlight"><a href="javascript:history.go(-1)" >&lt;&lt;                                     
      返回上一页</a></td>                                    
  </tr>                                    
</table>                                    
<%end sub %>                                    
</BODY></HTML>                                    
<%                                    
CloseDatabase                                    
%><!-- #include file="end.asp" -->

⌨️ 快捷键说明

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