📄 admin_orderform.asp
字号:
<!--#include file="setup.asp"-->
<!--#include file="../inc/ubbcode.asp"-->
<!--#include file="check.asp"-->
<%
Admin_header
'=====================================================================
' 系统名称:润滑油营销网
' 开 发 商:方圆卓越——中国最专业的营销咨询团队
' 擅长项目:润滑油行业的营销培训、样板市场、人员培训
' 更新日期:2005-4-15
' 官方网站:润滑油营销网(www.lubesale.com) QQ:66687989
'=====================================================================
' Copyright 2006-2008 润滑油营销网·方圆卓越 - All Rights Reserved.
' newasp is a trademark of saleroad@163.com
'=====================================================================
Response.Write "<table border=0 align=center cellpadding=3 cellspacing=1 class=TableBorder>"
Response.Write " <tr>"
Response.Write " <th>" & sModuleName & "管理选项</th>"
Response.Write " </tr>"
Response.Write " <tr><form method=Post name=myform action='' onSubmit='return JugeQuery(this);'>"
Response.Write " <td class=TableRow1>搜索:"
Response.Write " <input name=keyword type=text size=30>"
Response.Write " 条件:"
Response.Write " <select name='field'>"
Response.Write " <option value='1' selected>订单号</option>"
Response.Write " <option value='2'>收 货 人</option>"
Response.Write " <option value='3'>用 户 名</option>"
Response.Write " </select> <input type=submit name=Submit value='开始查询' class=Button><br>"
Response.Write " <b>说明:</b>点击订单号查看和处理订单</td></form>"
Response.Write " </tr></form>"
Response.Write " <tr>"
Response.Write " <td colspan=2 class=TableRow2><strong>操作选项:</strong> <a href='admin_orderform.asp'>管理首页</a> | "
Response.Write " <a href='admin_orderform.asp?finish=1'>已处理订单</a> | "
Response.Write " <a href='admin_orderform.asp?finish=0'>未处理订单</a> | "
Response.Write " <a href='admin_orderform.asp?Cancel=1'>回收站管理</a></td>"
Response.Write " </tr>"
Response.Write "</table>"
Response.Write "<br>"
Dim Action,i
If CInt(ChannelID) = 0 Then ChannelID = 3
Action = LCase(Request("action"))
Select Case Trim(Action)
Case "save"
Call SaveOrderForm
Case "view"
Call ViewOrderForm
Case "del"
Call DelOrderForm
Case "cancel"
Call ReclaimOrder
Case "finish"
Call FinishOrderForm
Case "pay"
Call PaymentState
Case Else
Call showmain
End Select
If FoundErr = True Then
ReturnError(ErrMsg)
End If
Admin_footer
SaveLogInfo(AdminName)
CloseConn
Sub showmain()
Dim finish,Cancel
Dim keyword,findword,foundsql
Dim maxperpage,CurrentPage,Pcount,totalrec,totalnumber
Dim strList,strName,strRowstyle
maxperpage = 30 '--每页显示列表数
finish = Newasp.ChkNumeric(Request("finish"))
Cancel = Newasp.ChkNumeric(Request("Cancel"))
Response.Write "<script language=""JavaScript"" src=""include/showpage.js""></script>" & vbNewLine
Response.Write "<table border=0 align=center cellpadding=3 cellspacing=1 class=TableBorder>"
Response.Write " <tr>"
Response.Write " <th width='5%' nowrap>选择</th>"
Response.Write " <th width='23%'>定 单 号</th>"
Response.Write " <th width='12%' nowrap>收 货 人</th>"
Response.Write " <th width='15%' nowrap>合 计 金 额</th>"
Response.Write " <th width='19%' nowrap>定 购 时 间</th>"
Response.Write " <th width='10%' nowrap>付 款 方 式</th>"
Response.Write " <th width='8%' nowrap>付款状态</th>"
Response.Write " <th width='8%' nowrap>订单处理</th>"
Response.Write " </tr>"
If Request("keyword") <> "" Then
keyword = Newasp.ChkQueryStr(Request("keyword"))
If CInt(Request("field")) = 1 Then
foundsql = " And OrderID like '%" & keyword & "%'"
ElseIf CInt(Request("field")) = 2 Then
foundsql = " And Consignee like '%" & keyword & "%'"
ElseIf CInt(Request("field")) = 3 Then
foundsql = " And username like '%" & keyword & "%'"
Else
foundsql = " And OrderID like '%" & keyword & "%'"
End If
strName = "订单查询"
strList = "&keyword=" & keyword
Else
If Request("finish") <> "" Then
foundsql = " And finish=" & finish
strList = "&finish=" & finish
If finish = 0 Then
strName = "未处理订单"
Else
strName = "已处理订单"
End If
Else
If Cancel = 0 Then
strName = "所有订单"
Else
strName = "已经删除订单"
End If
End If
End If
strList = strList & "&Cancel=" & Cancel
CurrentPage = Newasp.ChkNumeric(Request("page"))
If CurrentPage = 0 Then CurrentPage = 1
totalrec = Newasp.Execute("SELECT COUNT(id) FROM [NC_OrderForm] WHERE Cancel="& Cancel & foundsql &"")(0)
Pcount = CLng(totalrec / maxperpage) '得到总页数
If Pcount < totalrec / maxperpage Then Pcount = Pcount + 1
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Pcount Then CurrentPage = Pcount
Set Rs = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT id,userid,username,ProductID,OrderID,Surcharge,totalmoney,Consignee,Email,PayMode,addTime,invoice,finish,Cancel,PayDone FROM [NC_OrderForm] WHERE Cancel="& Cancel & foundsql &" ORDER BY id DESC"
If IsSqlDataBase = 1 Then
If CurrentPage > 100 Then
Rs.Open SQL, Conn, 1, 1
Else
Set Rs = Conn.Execute(SQL)
End If
Else
Rs.Open SQL, Conn, 1, 1
End If
Newasp.SqlQueryNum = Newasp.SqlQueryNum + 1
If Rs.BOF And Rs.EOF Then
Response.Write "<tr><td align=""center"" colspan=""9"" class=""TableRow2"">还没有找到任何订单!</td></tr>"
Else
If Pcount > 1 then Rs.Move (CurrentPage - 1) * maxperpage
i = 0
Response.Write " <tr>"
Response.Write " <td colspan=""8"" class=""TableRow2"">"
ShowListPage CurrentPage,Pcount,totalrec,maxperpage,strList,strName
Response.Write "</td>"
Response.Write " </tr>"
Response.Write " <form name=selform method=post action=""admin_orderform.asp"">"
Response.Write " <input type=hidden name=action value='del'>"
Do While Not Rs.EOF And i < CInt(maxperpage)
If Not Response.IsClientConnected Then Response.End
If (i mod 2) = 0 Then
strRowstyle = "class=""TableRow1"""
Else
strRowstyle = "class=""TableRow2"""
End If
Response.Write " <tr align=""center"">"
Response.Write " <td align=center " & strRowstyle & "><input type=checkbox name=id value=" & Rs("id") & "></td>"
Response.Write " <td " & strRowstyle & " title=""点击此处查看订单详细信息""><a href='?action=view&id=" & Rs("id") & "' class=""showlink"">"
Response.Write Rs("OrderID")
Response.Write "</a></td>" & vbNewLine
Response.Write " <td " & strRowstyle & " title=""点击用户名查看此用户信息"">"
If Rs("userid") > 0 Then
Response.Write "<a href='admin_user.asp?action=edit&userid=" & Rs("userid") & "'>"
Response.Write Rs("Consignee")
Response.Write "</a>"
Else
Response.Write Rs("Consignee")
End If
Response.Write "</td>" & vbNewLine
Response.Write " <td " & strRowstyle & " align=""left"">¥"
Response.Write FormatNumber(Rs("totalmoney"))
Response.Write " 元</td>" & vbNewLine
Response.Write " <td " & strRowstyle & " align=""left"">"
If Datediff("d",Rs("addTime"),Now()) = 0 Then
Response.Write "<font color=""red"">" & Rs("addTime") & "</font>"
Else
Response.Write "<font color=""#808080"">" & Rs("addTime") & "</font>"
End If
Response.Write "</td>" & vbNewLine
Response.Write " <td " & strRowstyle & ">"
Response.Write Rs("PayMode")
Response.Write "</td>" & vbNewLine
Response.Write " <td " & strRowstyle & ">"
If Rs("PayDone") > 0 Then
Response.Write "<a href='?action=pay&sid=0&id=" & Rs("id") & "' title=""点击此处改变支付状态"">"
Response.Write "<font color=""blue"">已支付</font>"
Response.Write "</a>"
Else
Response.Write "<a href='?action=pay&sid=1&id=" & Rs("id") & "' title=""点击此处改变支付状态"">"
Response.Write "<font color=""red"">未支付</font>"
Response.Write "</a>"
End If
Response.Write "</td>" & vbNewLine
Response.Write " <td " & strRowstyle & ">"
If Rs("finish") > 0 Then
'Response.Write "<a href='?action=finish&fid=0&id=" & Rs("id") & "' title=""点击此处直接处理订单"">"
Response.Write "<font color=""blue"">已处理</font>"
'Response.Write "</a>"
Else
'Response.Write "<a href='?action=finish&fid=1&id=" & Rs("id") & "' title=""点击此处取消订单"">"
Response.Write "<font color=""red"">未处理</font>"
'Response.Write "</a>"
End If
Response.Write "</td>" & vbNewLine
Rs.movenext
i = i + 1
If i >= maxperpage Then Exit Do
Loop
End If
Rs.Close:Set Rs = Nothing
%>
<tr>
<td colspan="8" class="TableRow1">
<input class=Button type="button" name="chkall" value="全选" onClick="CheckAll(this.form)"><input class=Button type="button" name="chksel" value="反选" onClick="ContraSel(this.form)">
<input class=Button type="submit" name="Submit2" value="彻底删除" onclick="return confirm('订单删除后将不能恢复\n您确定执行该操作吗?');">
<%
If Cancel = 0 Then
%>
<input type=hidden name=can value='1'>
<input class=Button type="submit" name="Submit3" value="放入回收站" onclick="document.selform.action.value='cancel';return confirm('您确定要将这些订单放入回收站吗?');">
<%
Else
%>
<input type=hidden name=can value='0'>
<input class=Button type="submit" name="Submit4" value="还原回收站" onclick="document.selform.action.value='cancel';return confirm('您确定还原订单吗?');">
<%
End If
%>
</td>
</tr>
</form>
<tr>
<td colspan="8" align="right" class="TableRow2"><%ShowListPage CurrentPage,Pcount,totalrec,maxperpage,strList,strName %></td>
</tr>
</table>
<%
End Sub
Sub ReclaimOrder()
If Request("id") <> "" And Request("can") <> "" Then
If CInt(Request("can")) = 0 Then
Newasp.Execute ("UPDATE [NC_OrderForm] SET Cancel=0 WHERE id in (" & Request("id") & ")")
OutHintScript("您选择的订单已成功还原!")
Else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -