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

📄 edittrade.asp

📁 英文版全站B2B仿阿里巴巴贸易平台网站,全英文
💻 ASP
字号:
<%
	if instr(session("EAPurview"),"24")=0 then
		response.redirect "../login.asp"
		response.end
	end if
%>
<!--#include file="../../Inc/DBConn1.asp" -->
<LINK href="../../CSS/style.css" rel="stylesheet" type="text/css"></LINK>

<script language="VBScript">
	function SJTrim(Str)
		SJTrim=Trim(Str)
	end function
</script>
<script LANGUAGE="JavaScript">
	function Check()
	{
		if (SJTrim(document.Form1.TradeTitle.value)=="")
		{
			alert("请输入主题!")
			document.Form1.TradeTitle.focus()
			document.Form1.TradeTitle.select()
			return
		}
		
		if (document.Form1.SortID.value=="")
		{
			alert("请选择行业大类!")
			document.Form1.SortID.focus()
			document.Form1.SortID.select()
			return
		}
		
		if (document.Form1.TypeID.value=="")
		{
			alert("请选择行业子类!")
			document.Form1.TypeID.focus()
			document.Form1.TypeID.select()
			return
		}
		
		if (SJTrim(document.Form1.Explain.value)=="")
		{
			alert("请输入详细说明!")
			document.Form1.Explain.focus()
			document.Form1.Explain.select()		
			return
		}
		document.Form1.submit();
	}
</script>

<%
	if request("action")="edit" then
		Set Rs=server.CreateObject("ADODB.Recordset")
		Rs.Open "select * from Trade where TID=" & request("TID"),conn,3,3	
		
		Rs("TradeTitle")=trim(request("TradeTitle"))
		Rs("TradeType")=request("TradeType")
		Rs("Period")=request("Period")
		Rs("SortID")=request("SortID")
		Rs("TypeID")=request("TypeID")
		Rs("Explain")=trim(request("Explain"))
		
		Rs.Update
		Rs.Close
		Set Rs=nothing
%>
<TABLE border="0" cellspacing="0" width="100%" cellpadding="4" ID="Table5">
	<TR>
		<TD bgcolor="#F78200" height=30 colspan=2><b><font color="#FFFFFF">贸易资料修改</font></b></TD>
	</TR>
	<tr>
		<td align=center height=200 style="font-size:16px;">
			<b>贸易资料修改成功!<br><br><a href="javascript:history.go(-2)">点击返回</a></b>
		</td>
	</tr>
</TABLE>
<%
		response.End
	end if
%>

<%
	Set Rs=server.CreateObject("ADODB.Recordset")
	Rs.Open "select * from Trade where TID=" & request("TID"),conn,1,1
%>
<TABLE border="0" cellspacing="0" width="100%" cellpadding="4" ID="Table1">
	<form name="Form1" method="post" action="EditTrade.asp?action=edit" ID="Form1">
	<input name="TID" value="<%=Rs("TID")%>" type=hidden ID="Hidden1">
	<TR>
		<TD bgcolor="#F78200" height=30 colspan=2><b><font color="#FFFFFF">贸易资料修改</font></b></TD>
	</TR>
	<tr>
		<td height=20 colspan=2 align=right style="padding-right:20px;">带&nbsp;<font color="#F78200">*</font>&nbsp;为必填项</td>
	</tr>
	<TR> 
		<TD width="25%" height="25" align=right><b>产品图片</b></TD>
		<TD width="75%" height="25">
			<table align=center border=0 cellpadding=0 cellspacing=0 width=100% ID="Table4">
				<tr>
					<td width=100% valign=top>
						<table width=100 height=100 border=0 cellpadding=0 cellspacing=1 style="border-color:#000000;" bgcolor="#333333" ID="Table7">
							<tr bgcolor="#F7F7F7">
								<td><a href="../../Trade/Pic/<%=Rs("PicPath")%>" target=_blank><img align=absmiddle name=ImgBigPic src="../../Trade/Pic/<%=Rs("PicPath")%>" border=0 onload="javascript:if(this.height>this.width){this.height=100;}else{this.width=100;}"></a></td>
							</tr>
						</table>												
					</td>
				</tr>
			</table>
		</TD>
	</TR>
	<TR> 
		<TD width="25%" height="25" align=right><b><font color="#F78200">*</font>&nbsp;信息类型:</b></TD>
		<TD width="75%" height="25">
			<input type=radio name="TradeType" value="Buy" <%if rs("TradeType")="Buy" then%> checked <%end if%> ID="Radio1">Buy&nbsp;
			<input type=radio name="TradeType" value="Sell" <%if rs("TradeType")="Sell" then%> checked <%end if%> ID="Radio2">Sell&nbsp;
			<input type=radio name="TradeType" value="Agent" <%if rs("TradeType")="Agent" then%> checked <%end if%> ID="Radio3">Agent&nbsp;
			<input type=radio name="TradeType" value="Cooperation" <%if rs("TradeType")="Cooperation" then%> checked <%end if%> ID="Radio4">Cooperation
		</TD>
	</TR>
	<TR> 
		<TD width="25%" height="25" align=right><b><font color="#F78200">*</font>&nbsp;有效期:</b></TD>
		<TD width="75%" height="25">
			<SELECT name=Period ID="Select2">
				<option value="1 week" <%if Rs("Period")="1 week" then%> selected <%end if%>>1 week</option>
				<option value="2 weeks" <%if Rs("Period")="2 weeks" then%> selected <%end if%>>2 weeks</option>
				<option value="3 weeks" <%if Rs("Period")="3 weeks" then%> selected <%end if%>>3 weeks</option>
				<option value="1 month" <%if Rs("Period")="1 month" then%> selected <%end if%>>1 month</option>
				<option value="3 months" <%if Rs("Period")="3 months" then%> selected <%end if%>>3 months</option>
				<option value="6 months" <%if Rs("Period")="6 months" then%> selected <%end if%>>6 months</option>
			</SELECT>
		</TD>
	</TR>
	<TR> 
		<TD width="25%" height="25" align=right><b><font color="#F78200">*</font>&nbsp;信息标题:</b></TD>
		<TD width="75%" height="25">
			<input type="text" size="30" name="TradeTitle" value="<%=rs("TradeTitle")%>" ID="Text1">
		</TD>
	</TR>
	<TR> 
		<TD width="25%" height="25" align=right><b><font color="#F78200">*</font>&nbsp;行业类别:</b></TD>
		<TD width="75%" height="25">
			<%
				Set TypeRs2=server.CreateObject("ADODB.Recordset")
				TypeStr2="select * from Sort2 order by TypeID ASC"
				TypeRs2.open TypeStr2,conn,1,1
			%>
			<script language = "JavaScript">
				var onecount1;
				onecount1=0;
				subcat = new Array();
				<%
				count1 = 0
				do while not TypeRs2.eof 
				%>
				subcat[<%=count1%>] = new Array("<%= trim(TypeRs2("Typename"))%>","<%= trim(TypeRs2("SortID"))%>","<%= trim(TypeRs2("TypeID"))%>");
				<%
				count1 = count1 + 1
				TypeRs2.movenext
				loop
				TypeRs2.close
				%>
				onecount1=<%=count1%>;
			
				function changelocation1(locationid)
				{
				document.Form1.TypeID.length = 0; 
				var locationid=locationid;
				var i;
				for (i=0;i < onecount1; i++)
					{
						if (subcat[i][1] == locationid)
						{ 
							document.Form1.TypeID.options[document.Form1.TypeID.length] = new Option(subcat[i][0], subcat[i][2]);
						}  
					}      
				}    
			</script>
			<%
				Set SortRs1=server.CreateObject("ADODB.Recordset")
				SortStr1="select * from Sort1 order by SortID ASC"
				SortRs1.open SortStr1,conn,1,1
			%>
			<SELECT name=SortID onChange="javascript:changelocation1(document.Form1.SortID.options[document.Form1.SortID.selectedIndex].value)" size="1" ID="Select3">
				<option value="">--请选择行业大类--</option>
				<%
					dim SortID
					SortID=SortRs1("SortID")
					while not SortRs1.eof
				%>
				<option value="<%=SortRs1("SortID")%>" <%if SortRs1("SortID")=Rs("SortID") then%> selected <%end if%>><%=SortRs1("SortName")%></option>
				<%
				 		SortRs1.movenext
					wend
				%>
			</select>
			<%
				SortRs1.close
				Set SortRs1=nothing
			%>
			<select name="TypeID" ID="Select4">
				<option value="">--请选择行业分类--</option>
				<%
					Dim TypeStr3,TypeRs3
					Set TypeRs3=server.CreateObject("ADODB.recordset")
					TypeStr3="select * from Sort2 where SortID="& Rs("SortID") &" order by TypeID ASC"
					TypeRs3.open TypeStr3,conn,1,1
					if not(TypeRs3.eof and TypeRs3.bof) then
						while not TypeRs3.eof
				%>
				<option value="<%=TypeRs3("TypeID")%>" <%if TypeRs3("TypeID")=Rs("TypeID") then%> selected <%end if%>><%=TypeRs3("TypeName")%></option>
				<% 
							TypeRs3.movenext
						wend
					end if
					TypeRs3.close
					set TypeRs3 = nothing
				%>
			</select>
		</TD>
	</TR>
	<TR> 
		<TD width="25%" height="25" align=right><b><font color="#F78200">*</font>&nbsp;详细说明:</b></TD>
		<TD width="75%" height="25">
			<textarea cols=40 rows=6 name="Explain" ID="Textarea2"><%=Rs("Explain")%></textarea>
		</TD>
	</TR>
	<tr>
		<td colspan=2 align=center height=80>
			<input type="button" value="确认无误,提交!" onclick="Check()" style="height:25pt;" ID="Button1" NAME="Button1">
		</td>
	</tr>
	</form>
</table>
<%
	Rs.Close
	Set Rs=nothing
%>

⌨️ 快捷键说明

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