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

📄 admin_orderform.asp

📁 网络上经典的图片程序
💻 ASP
📖 第 1 页 / 共 2 页
字号:
			Newasp.Execute ("UPDATE [NC_OrderForm] SET Cancel=1 WHERE id in (" & Request("id") & ")")
			OutHintScript("您选择的订单已成功放入回收站!")
		End If
	Else
		ErrMsg = "<li>请选择正确的系统参数!</li>"
		Founderr = True
		Exit Sub
	End If
End Sub
Sub DelOrderForm()
	If Request("id") <> "" Then
		Newasp.Execute ("DELETE FROM [NC_OrderForm] WHERE id in (" & Request("id") & ")")
		Newasp.Execute ("DELETE FROM [NC_Buy] WHERE orderid in (" & Request("id") & ")")
	Else
		ErrMsg = "<li>请选择正确的系统参数!</li>"
		Founderr = True
		Exit Sub
	End If
	OutHintScript("您选择的订单已成功删除!")
End Sub
Sub FinishOrderForm()
	If Request("id") <> "" And Request("fid") <> "" Then
		If Request("fid") = 0 Then
			Newasp.Execute ("UPDATE [NC_OrderForm] SET finish=0 WHERE id=" & CLng(Request("id")))
		Else
			Newasp.Execute ("UPDATE [NC_OrderForm] SET finish=1 WHERE id=" & CLng(Request("id")))
		End If
		Response.Redirect (Request.ServerVariables("HTTP_REFERER"))
	Else
		ErrMsg = "<li>请选择正确的系统参数!</li>"
		Founderr = True
		Exit Sub
	End If
End Sub

Sub PaymentState()
	If Request("id") <> "" And Request("sid") <> "" Then
		If Request("sid") = 0 Then
			Newasp.Execute ("UPDATE [NC_OrderForm] SET PayDone=0 WHERE id=" & CLng(Request("id")))
		Else
			Newasp.Execute ("UPDATE [NC_OrderForm] SET PayDone=1 WHERE id=" & CLng(Request("id")))
		End If
		Response.Redirect (Request.ServerVariables("HTTP_REFERER"))
	Else
		ErrMsg = "<li>请选择正确的系统参数!</li>"
		Founderr = True
		Exit Sub
	End If
End Sub

Sub ViewOrderForm()
	Dim id,totalmoney
	id = Newasp.ChkNumeric(Request("id"))
	If id = 0 Then
		ErrMsg = "<li>请选择正确的系统参数!</li>"
		Founderr = True
		Exit Sub
	End If
	Set Rs = Newasp.Execute("SELECT * FROM [NC_OrderForm] WHERE id=" & id)
	If Rs.BOF And Rs.EOF Then
		ErrMsg = "<li>请选择正确的系统参数!</li>"
		Founderr = True
		Set Rs = Nothing
		Exit Sub
	End If
	totalmoney = FormatNumber(Rs("totalmoney"))
%>
<table border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
<tr>
	<th colspan="4">订单查看/处理</th>
</tr>
<form name="subform" method="post" action="admin_orderform.asp">
<input type="hidden" name="action" value="save">
<input type="hidden" name="id" value="<%=Rs("id")%>">
<tr>
	<td width='15%' class="tablerow1" align="right">订 单 号:</td>
	<td width='42%' class="tablerow1"><font color=red><%=Rs("OrderID")%></font></td>
	<td width='15%' class="tablerow1" align="right">用 户 名:</td>
	<td width='28%' class="tablerow1"><%
	If Rs("userid") > 0 Then
		Response.Write "<a href='admin_user.asp?action=edit&userid=" & Rs("userid") & "'>"
		Response.Write Rs("username")
		Response.Write "</a>"
	Else
		Response.Write "匿名用户"
	End If
	%></td>
</tr>
<tr>
	<td class="tablerow2" align="right">合计金额:</td>
	<td class="tablerow2"><font color=blue>¥<%=FormatNumber(Rs("totalmoney"))%> 元</font></td>
	<td class="tablerow2" align="right">附加费用:</td>
	<td class="tablerow2">¥<%=FormatNumber(Rs("Surcharge"),,-1)%> 元</td>
</tr>
<tr>
	<td class="tablerow1" align="right">订购时间:</td>
	<td class="tablerow1"><font color=red><%=Rs("addTime")%></font></td>
	<td class="tablerow1" align="right">付款方式:</td>
	<td class="tablerow1"><%=Rs("PayMode")%></td>
</tr>
<tr>
	<td class="tablerow2" align="right">收 货 人:</td>
	<td class="tablerow2"><font color=blue><%=Rs("Consignee")%></font></td>
	<td class="tablerow2" align="right">收货单位:</td>
	<td class="tablerow2"><%=Rs("Company")%></td>
</tr>
<tr>
	<td class="tablerow1" align="right">收货人电话:</td>
	<td class="tablerow1"><%=Rs("phone")%></td>
	<td class="tablerow1" align="right">收货人邮编:</td>
	<td class="tablerow1"><%=Rs("postcode")%></td>
</tr>
<tr>
	<td class="tablerow2" align="right">收货人邮箱:</td>
	<td class="tablerow2"><%=Rs("Email")%></td>
	<td class="tablerow2" align="right">收货人QQ号:</td>
	<td class="tablerow2"><%=Newasp.ChkNull(Rs("oicq"))%></td>
</tr>
<tr>
	<td class="tablerow1" align="right">收货人地址:</td>
	<td class="tablerow1"><%=Rs("Address")%></td>
	<td class="tablerow2" align="right">是否开发票:</td>
	<td class="tablerow2"><%
	If Rs("invoice") > 0 Then
		Response.Write "<font color=""red"">是</font>"
	Else
		Response.Write "<font color=""#808080"">否</font>"
	End If
%></td>
</tr>
<tr>
	<td class="tablerow2" align="right">其它说明:</td>
	<td class="tablerow2" colspan="3">&nbsp;&nbsp;<%=Newasp.HTMLEncode(Rs("Readme"))%></td>
</tr>
<tr>
	<td class="tablerow1" align="right">订单处理:</td>
	<td class="tablerow1"><font color=red><%
	If Rs("finish") > 0 Then
		Response.Write "<font color=""blue"">已处理</font>"
	Else
		Response.Write "<font color=""red"">未处理</font>"
	End If
%></font></td>
	<td class="tablerow1" align="right">付款状态:</td>
	<td class="tablerow1"><%
	If Rs("PayDone") > 0 Then
		Response.Write "已支付 <input type=radio name=PayDone value=""1"" checked>"
	Else
		Response.Write "未支付 <input type=radio name=PayDone value=""0"" checked>&nbsp;&nbsp;"
		Response.Write "已支付 <input type=radio name=PayDone value=""1"">"
	End If
	Rs.Close:Set Rs = Nothing
%></td>
</tr>
<tr>
	<th>订购数量</td>
	<th>产品名称</td>
	<th>单 价</td>
	<th>合 计</td>
</tr>
<%
	SQL = "SELECT * FROM NC_Buy WHERE orderid=" & id & " ORDER BY ID ASC"
	Set Rs = Newasp.Execute(SQL)
	If Not (Rs.BOF And Rs.EOF) Then
	Do While Not Rs.EOF
%>
<tr>
	<td class="tablerow1" align="center"><%=Rs("Amount")%></td>
	<td class="tablerow1"><a href="admin_shop.asp?action=view&shopid=<%=Rs("shopid")%>"><%=Rs("TradeName")%></a></td>
	<td class="tablerow1" align="center"><font color=blue>¥<%=FormatNumber(Rs("Price"))%> 元</font></td>
	<td class="tablerow1"  align="center"><font color=red>¥<%=FormatNumber(Rs("totalmoney"))%> 元</font></td>
</tr>
<%
		Rs.movenext
	Loop
	End If
	Rs.Close:Set Rs = Nothing
%>
<tr align="center">
	<td class="tablerow2" colspan="4"><input type="button" onclick="javascript:history.go(-1)" value="返回上一页" name="B1" class=Button>&nbsp;&nbsp; 
		<input type=hidden name=can value='1'>
		<input class=Button type="submit" name="Submit3" value="取消订单" onclick="document.subform.action.value='cancel';return confirm('您确定要将这些订单放入回收站吗?');">&nbsp;&nbsp;
		<input class=Button type="submit" name="Submit4" value="删除订单" onclick="document.subform.action.value='del';return confirm('订单删除后将不能恢复\n您确定执行该操作吗?');">&nbsp;&nbsp;
		<input class=Button type="submit" name="Submit2" value="处理此订单" onclick="return confirm('确定处理此订单吗?');">
	</td>
</tr></form>
<tr>
	<td class="tablerow2" colspan="4"><b>说明:</b><br>
	&nbsp;&nbsp;请确定用户已经汇款,再处理订单,订单一但处理,就证明货已发出。
	</td>
</tr>
</table>
<%
End Sub

Sub SaveOrderForm()
	Dim id,totalmoney,Consignee,Readme,PayDone
	id = Newasp.ChkNumeric(Request("id"))
	If id = 0 Then
		ErrMsg = "<li>请选择正确的系统参数!</li>"
		Founderr = True
		Exit Sub
	End If
	Set Rs = Server.CreateObject("ADODB.Recordset")
	SQL = "SELECT * FROM NC_OrderForm WHERE finish=0 And id=" & id
	Rs.Open SQL,Conn,1,3
	If Rs.BOF And Rs.EOF Then
		ErrMsg = "<li>此订单已经处理,请不要重复处理订单!</li>"
		Founderr = True
		Set Rs = Nothing
		Exit Sub
	Else
		PayDone = Rs("PayDone")
		Rs("finish") = 1
		Rs("PayDone") = Newasp.ChkNumeric(Request.Form("PayDone"))
		Rs.update
		totalmoney = Rs("totalmoney")
		Consignee = Rs("Consignee")
		Readme = Newasp.ChkNull(Rs("Readme"))
	End If
	Rs.Close
	'-- 开始添加交易明细表
	If PayDone = 0 Then
		SQL = "SELECT * FROM NC_Account WHERE (AccountID is null)"
		Rs.Open SQL,Conn,1,3
		Rs.addnew
			Rs("payer").Value = Consignee
			Rs("payee").Value = Newasp.CheckRequest(Newasp.SiteName,20)
			Rs("product").Value = "网上购物"
			Rs("Amount").Value = 1
			Rs("unit").Value = "次"
			Rs("price").Value = totalmoney
			Rs("TotalPrices").Value = totalmoney
			Rs("DateAndTime").Value = Now()
			Rs("Accountype").Value = 0
			Rs("Explain").Value = Readme
			Rs("Reclaim").Value = 0
		Rs.update
		Rs.Close:Set Rs = Nothing
	End If
	Succeed("<li>恭喜您!订单处理成功。请赶快给用户发货去吧!</li>")
End Sub
%>

⌨️ 快捷键说明

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