<% Option Explicit If not Session("isLoggedIn") Then response.redirect("/ecommerce/default.asp?returnUrl=" & Server.URLEncode(Request.ServerVariables("SCRIPT_NAME"))) End If %> <% isDebug = false 'Dim elem 'For Each elem in Request.Form ' dump(elem & ": " & Request.Form(elem)) 'Next Dim intPortID, intOrderTypeID, intFreightTypeID, intCount40, intCount20, intShipInWeek, intSupUserID Dim intOrderID, strSQL, rsOrder, i, contCount, intShipInWeekEstimated intOrderID = 0 intPortID = 0 If Request.Form("portID") <> "" Then intPortID = CInt(Request.Form("portID")) intOrderTypeID = 0 If Request.Form("orderTypeID") <> "" Then intOrderTypeID = CInt(Request.Form("orderTypeID")) intFreightTypeID = 0 If Request.Form("freightTypeID") <> "" Then intFreightTypeID = CInt(Request.Form("freightTypeID")) intCount40 = 0 If Request.Form("count40") <> "" Then intCount40 = CInt(Request.Form("count40")) intCount20 = 0 If Request.Form("count20") <> "" Then intCount20 = CInt(Request.Form("count20")) intSupUserID = 4 If Request.Form("supUserID") <> "" Then intSupUserID = CInt(Request.Form("supUserID")) intShipInWeekEstimated = DatePart("WW", DateAdd("WW", 2, Date) ) intShipInWeek = intShipInWeekEstimated ' if given an actual week and error made, retain given week If Request.Form("shipInWeek") <> "" Then intShipInWeek = CInt(Request.Form("shipInWeek")) 'hard coded ordertypes and freighttypes for different users If Session("intUserTypeID") = USERTYPE_LOCAL Then ' local userType gets local ordertype intOrderTypeID = ORDERTYPE_LOCALPRICE End If If Session("intUserTypeID") = USERTYPE_INTL Then ' intl userType get intl ordertype intOrderTypeID = ORDERTYPE_INTLPRICE End If ' make sure any local ordertypes get free on board freighttype If intOrderTypeID = ORDERTYPE_LOCALPRICE Then intFreightTypeID = FREIGHTTYPE_FREEONBOARD End If If CInt(Request.Form("isSubmitted")) = 1 Then If intPortID = 0 Then strErrMsg = strErrMsg & "
  • you must select a port
  • " & vbcrlf isErr = true End If If intOrderTypeID = 0 Then strErrMsg = strErrMsg & "
  • you must select an order type
  • " & vbcrlf isErr = true End If If intFreightTypeID = 0 Then strErrMsg = strErrMsg & "
  • you must select a freight type
  • " & vbcrlf isErr = true End If If intCount40 = 0 and intCount20 = 0 Then strErrMsg = strErrMsg & "
  • you must select at create at least one of at least one container type
  • " & vbcrlf isErr = true End If If intShipInWeek = "" Then strErrMsg = strErrMsg & "
  • you must supply the week in which to ship
  • " & vbcrlf isErr = true End If ' if no errors, create container If not isErr Then strSQL = "EXEC stpOrderCreate " & intPortID & _ ", " & intOrderTypeID & _ ", " & intShipInWeek & _ ", " & Cint(Session("intUserID")) & ", " & intSupUserID & _ ", " & intFreightTypeID If isDebug Then dump(strSQL) Else Set rsOrder = dbconn.Execute(strSQL) '.NextRecordset intOrderID = rsOrder("orderID") rsOrder.Close Set rsOrder = Nothing End If contCount = 1 For i = 1 to intCount20 ' create 20' containers strSQL = "EXEC stpContainerCreate 1, " & intOrderID & ", " & contCount If isDebug Then dump(strSQL) Else Set rsOrder = dbconn.Execute(strSQL) rsOrder.Close Set rsOrder = Nothing contCount = contCount + 1 End If Next For i = 1 to intCount40 ' create 20' containers strSQL = "EXEC stpContainerCreate 2, " & intOrderID & ", " & contCount If isDebug Then dump(strSQL) Else Set rsOrder = dbconn.Execute(strSQL) rsOrder.Close Set rsOrder = Nothing contCount = contCount + 1 End If Next End If ' not isErr End If %> Galuku Cocopeat <% If CInt(Request.Form("isSubmitted")) = 1 and not isErr and not isDebug Then %> <% End If %>

    New Order

    <% If isErr Then %> <% End If %> <% If Session("intUserTypeID") = USERTYPE_ADMIN or Session("intUserTypeID") = USERTYPE_RECEIVER Then 'only admin and receiver get to choose%> <% End If If Session("intUserTypeID") = USERTYPE_ADMIN or Session("intUserTypeID") = USERTYPE_RECEIVER or Session("intUserTypeID") = USERTYPE_INTL Then 'only admin, galuku, intl get to choose%> <% End If %>
    The following errors occurred:
      <%= strErrMsg %>
    number of 40' containers:
    number of 20' containers:
    destination port: <%= writeSelectSTP("portID", "portID", "portDesc", "stpFullPortSelectAll 1", "", "Please Select", intPortID) %>
    order type: <%= writeSelectSTP("orderTypeID", "orderTypeID", "orderTypeDesc", "stpOrderTypeSelectAll", "if((this.options[this.selectedIndex].value == 1)||this.options[this.selectedIndex].value == 3){this.form.elements['freightTypeID'].selectedIndex = 1;hide('freightDiv')}else{show('freightDiv')};", "Please Select", intOrderTypeID) %>
    freight type:
    <%= writeSelectSTP("freightTypeID", "freightTypeID", "freightTypeDesc", "stpFreightTypeSelectAll", "", "Please Select", intFreightTypeID)%>
    ship in week: <%= writeWeeks(intShipInWeekEstimated, intShipInWeek, "") %>
    currently in week: <%= DatePart("WW", Date ) %> (<% Response.write(Day(Date)) If Day(Date) = "1" or Day(Date) = "21" or Day(Date) = "31" Then Response.write("st") ElseIf Day(Date) = "2" or Day(Date) = "22" Then Response.write("nd") ElseIf Day(Date) = "3" or Day(Date) = "23" Then Response.write("rd") Else Response.write("th") End If Response.write(" " & MonthName(Month(Date),0) & " " & Year(Date)) %>)
     
    Create Order

    ^ back to top