<!--#include file="Include/Const.Asp" -->
<!--#include file="Include/NoSQL.Asp" -->
<!--#include file="Include/ConnSiteData.Asp" -->
<%Call SiteInfo()%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>订购产品 - <% =SiteTitle %></title>
<meta name="keywords" content="<% =Keywords %>" />
<meta name="description" content="<% =Descriptions %>" />
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<!--#include file="Top.Asp" -->
<%
Dim Products
Dim mMemID, mRealName, mSex, mCompany, mAddress, mZipCode, mTelephone, mFax, mMobile, mEmail
If session("MemName")<>"" And session("MemLogin") = "Succeed" Then
    Call MemInfo()
Else
    mSex = "先生"
    mMemID = 0
End If
%>
<table width="998" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="left" valign="top"><table width="228" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:10px;">
        <tr>
          <td height="29" align="left" valign="middle" background="/template/shenbi_bz/images/cpfltop.jpg" style="padding:0 11px 0 39px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td align="left" valign="middle" class="titlewhite">产品分类</td>
               
              </tr>
          </table></td>
        </tr>
        <tr>
          <td align="left" valign="top" bgcolor="#FFFFFF" class="border-l-r" style="padding:12px 12px 6px;"><%Folder(0)%></td>
        </tr>
        <tr>
          <td align="left" valign="top"><img src="/template/shenbi_bz/images/cpflxia.jpg" width="228" height="6" /></td>
        </tr>
      </table>
<!--#include file="new_left.Asp" -->
</td>
    <td align="right" valign="top"><table width="755" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:10px;">
      <tr>
        <td height="30" align="left" valign="middle" background="/template/shenbi_bz/images/jpcptop.jpg" style="padding-left:42px; padding-right:15px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="left" valign="middle" class="titlewhite">订购列表</td>
              <td align="right" valign="middle" class="pink"><%=WebLocation()%></td>
            </tr>
        </table></td>
      </tr>
      <tr>
        <td align="left" valign="top" bgcolor="#FFFFFF" class="border-l-r" style="padding:20px 15px 15px;"><div class="deepgray">
        <table width="700" border="0"  cellpadding="3" cellspacing="5">
                        <tr>
          <td colspan="2" ><% call ProductList() %></td>
          </tr>
              <form action="ProductBuySave.Asp?MemberID=<%=mMemID%>" method="post" name="formBuy" id="formBuy">
                <tr>
                  <td width="108" align="right" >标题：</td>
                  <td width="480"><input name="OrderName" type="text" id="OrderName" value="订购产品" size="40" maxlength="100" />
                    <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">相关说明：</td>
                  <td><input type="hidden" name="Products" value="<%=Products%>" />
                    <textarea name="Remark" cols="60" rows="8" id="Remark"></textarea></td>
                </tr>
                <tr>
                  <td align="right">联系人：</td>
                  <td><input name="RealName" type="text" id="RealName" value="<%=mRealName%>" size="20" maxlength="50" />
                    <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">性别：</td>
                  <td><input name="Sex" type="radio" value="先生" class="inputnoborder" <%if mSex="先生" then response.write ("checked")%> />
                    先生
                    <input type="radio" name="Sex" value="女士" class="inputnoborder" <%if mSex="女士" then response.write ("checked")%> />
                    女士 <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">单位名称：</td>
                  <td><input name="Company" type="text" id="Company" value="<%=mCompany%>" size="40" maxlength="100" />
                    <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">详细地址：</td>
                  <td><input name="Address" type="text" id="Address" value="<%=mAddress%>" size="40" maxlength="100" />
                    <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">邮政编码：</td>
                  <td><input name="ZipCode" type="text" id="ZipCode" value="<%=mZipCode%>" size="20" maxlength="20" />
                    <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">联系电话：</td>
                  <td><input name="Telephone" type="text" id="Telephone" value="<%=mTelephone%>" size="20" maxlength="50" />
                    <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">传真号码：</td>
                  <td><input name="Fax" type="text" id="Fax" value="<%=mFax%>" size="20" maxlength="50" /></td>
                </tr>
                <tr>
                  <td align="right">手机号码：</td>
                  <td><input name="Mobile" type="text" id="Mobile" value="<%=mMobile%>" size="20" maxlength="50" /></td>
                </tr>
                <tr>
                  <td align="right">电子信箱：</td>
                  <td><input name="Email" type="text" id="Email" value="<%=mEmail%>" size="30" maxlength="50" />
                    <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">验证码：</td>
                  <td><input name="CheckCode" type="text" size="6" maxlength="6" />
                    <a href="javascript:refreshimg()" title="看不清楚，换个图片。"><img src="Include/CheckCode/CheckCode.Asp" name="checkcode" align="absmiddle" id="checkcode" style="border: 1px solid #ffffff" /></a> <font color="red">*</font></td>
                </tr>
                <tr>
                  <td align="right">&nbsp;</td>
                  <td><input name="Submit" type="submit" value="立即订购以上产品" /></td>
                </tr>
              </form>
            </table>
        </div></td>
      </tr>
      <tr>
        <td align="left" valign="top"><img src="/template/shenbi_bz/images/jpcpxia.jpg" width="755" height="10" /></td>
      </tr>
    </table>
    </td>
  </tr>
</table>
</div>


<!--#include file="End.Asp"-->
<%
  Function Folder(id)
    Dim rs, sql, i, ChildCount, FolderType, FolderName, onMouseUp, ListType
    Set rs = server.CreateObject("adodb.recordset")
    sql = "Select * From Shenbi_ProductSort where ParentID="&id&" order by id"
    rs.Open sql, conn, 1, 1
    If id = 0 And rs.recordcount = 0 Then
        response.Write ("<center>暂无产品分类</center>")
        Exit Function
    End If
    i = 1
    response.Write("<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">")
    While Not rs.EOF
        ChildCount = conn.Execute("select count(*) from Shenbi_ProductSort where ParentID="&rs("id"))(0)
        If ChildCount = 0 Then
            If i = rs.recordcount Then
                FolderType = "SortFileEnd"
            Else
                FolderType = "SortFile"
            End If
            FolderName = rs("SortName")
            onMouseUp = ""
        Else
            If i = rs.recordcount Then
                FolderType = "SortEndFolderClose"
                ListType = "SortEndListline"
                onMouseUp = "EndSortChange('a"&rs("id")&"','b"&rs("id")&"');"
            Else
                FolderType = "SortFolderClose"
                ListType = "SortListline"
                onMouseUp = "SortChange('a"&rs("id")&"','b"&rs("id")&"');"
            End If
            FolderName = rs("SortName")
        End If
        datafrom = "Shenbi_ProductSort"
        If ISHTML = 1 Then
            AutoLink = ""&ProSortName&""&Separated&""&rs("ID")&""&Separated&"1."&HTMLName&""
        Else
            AutoLink = "ProductList.Asp?SortID="&rs("ID")&""
        End If
		
		
        response.Write("	<tr height=""23"">")
		if id=0 then
        response.Write("		<td nowrap id=""b"&rs("id")&""" class="""&FolderType&"""></td><td nowrap style=""padding-top: 2px""><h4><a href="""&AutoLink&"""><font color=""#ac2c2c"">"&FolderName&"</font></a></h4></td>")
		else
		        response.Write("		<td nowrap id=""b"&rs("id")&""" class="""&FolderType&"""></td><td nowrap style=""padding-top: 2px""><h5><a href="""&AutoLink&"""><font color=""#000000"">"&FolderName&"</font></a></h5></td>")   
		 end if		

        response.Write("	</tr>")
        If ChildCount>0 Then
%>
<tr id="a<%= rs("id")%>" style="display:yes">
  <td class="<%= ListType%>" nowrap></td>
 <td><% Folder(rs("id")) %></td>
</tr>
<%
End If
rs.movenext
i = i + 1
Wend
response.Write("</table>")
rs.Close
Set rs = Nothing
End Function


Function WebLocation()
    WebLocation = "&nbsp;当前位置：<a href=""index.Asp"" class=""pink"">首页</a> - <a href=""ProductList.Asp"" class=""pink"">公司产品</a> - 订单"&vbCrLf
End Function

Function NoList()
    If request("UpdateOrder") = "更新选择" Then
        Session("NoList") = ""
    End If
    Dim ProductNo, NoArray, i
    If Trim(request("ProductNo"))<>"" Then ProductNo = Trim(request("ProductNo"))&","
    If session("NoList") = "" And Trim(request("ProductNo")) = "" Then
        NoList = ""
        Exit Function
    End If
    If InStr(ProductNo, ",")>0 Then
        NoArray = Split(ProductNo, ",")
        For i = 0 To UBound(NoArray)
            If Not InStr(session("NoList"), NoArray(i)&",")>0 Then session("NoList") = session("NoList")&NoArray(i)&","
        Next
    End If
    For i = 0 To UBound(Split(session("NoList"), ","))
        NoList = NoList&"'"&Trim(Split(session("NoList"), ",")(i))&"',"
    Next
    NoList = Left(NoList, Len(NoList) -4)
End Function

Function ProductList()
    Response.Write "<table width=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">"&vbCrLf
    Response.Write "  <form action=""ProductBuy.Asp"" method=""POST"" name=""check"">"&vbCrLf
    Response.Write "    <tr>"&vbCrLf
    Response.Write "      <td height=""28"" colspan=""2"" style=""background:url(Images/bg2.gif) repeat-x left bottom;"">您选购的产品如下：</td>"&vbCrLf
    Response.Write "    </tr>"&vbCrLf
    If Nolist() = "" Then
        Response.Write "    <tr>"&vbCrLf
        Response.Write "      <td height=""28"" colspan=""2"" align=""center"">未选择任何产品</td>"&vbCrLf
        Response.Write "    </tr>"&vbCrLf
    Else
        Dim rs, sql
        Set rs = server.CreateObject("adodb.recordset")
        sql = "select * from Shenbi_Products where ProductNo in ("&NoList()&") order by id"
        rs.Open sql, conn, 1, 1
        While Not rs.EOF
            If ISHTML = 1 Then
                AutoLink = ""&ProName&""&Separated&""&rs("ID")&"."&HTMLName&""
            Else
                AutoLink = "ProductView.Asp?ID="&rs("ID")&""
            End If
            Response.Write "    <tr>"&vbCrLf
            Response.Write "      <td width=""3%"" height=""28"" style=""background:url(Images/bg2.gif) repeat-x left bottom;""><input type=""CheckBox"" name=""ProductNo"" value="""&rs("ProductNo")&""" class=""inputnoborder"" Checked></td>"&vbCrLf
            Response.Write "      <td width=""97%"" style=""background:url(Images/bg2.gif) repeat-x left bottom;""><a href="""&AutoLink&""" title="""&rs("ProductName")&""">"&rs("ProductName")&"&nbsp;["&rs("ProductNo")&"]</a></td>"&vbCrLf
            Response.Write "    </tr>"&vbCrLf
            Products = Products&rs("ProductName")&" 产品编号："&rs("ProductNo")&"<br>"
            rs.movenext
        Wend
        Response.Write "    <tr>"&vbCrLf
        Response.Write "      <td colspan=""2"" height=""35""><input type=""submit"" name=""UpdateOrder"" value=""更新选择""></td>"&vbCrLf
        Response.Write "    </tr>"&vbCrLf
        rs.Close
        Set rs = Nothing
    End If
    Response.Write "  </form>"&vbCrLf
    Response.Write "</table>"&vbCrLf
End Function

Sub MemInfo()
    Dim rs, sql
    Set rs = server.CreateObject("adodb.recordset")
    sql = "select * from Shenbi_Members where MemName='"&session("MemName")&"'"
    rs.Open sql, conn, 1, 1
    If rs.bof And rs.EOF Then
        response.Write "<center>暂无相关信息</center>"
    Else
        mMemID = rs("ID")
        If Not rs("RealName") = "" Then
            mRealName = rs("RealName")
        Else
            mRealName = rs("MemName")
        End If
        mSex = rs("Sex")
        mCompany = rs("Company")
        mAddress = rs("Address")
        mZipCode = rs("ZipCode")
        mTelephone = rs("Telephone")
        mFax = rs("Fax")
        mMobile = rs("Mobile")
        mEmail = rs("Email")
    End If
    rs.Close
    Set rs = Nothing
End Sub
%>
<script language="javascript">
<!--
function refreshimg(){document.all.checkcode.src="Include/CheckCode/CheckCode.Asp";}
//-->
</script>