home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / pcboard / script2s.zip / SCRIPT2.PPS < prev    next >
Text File  |  1993-03-01  |  50KB  |  1,525 lines

  1. ;*****************************************************************************
  2. ;* Ordering Questionnaire for All New Orders, Support Renewals & Upgrades    *
  3. ;* Copyright 1993 (C)Clark Development Company, Inc.                         *
  4. ;*                                                                           *
  5. ;*  SCRIPT2.PPS   (Souce code for Script 2)                                  *
  6. ;*  SCRIPT2.PPE   (Compiled version of SCRIPT2.PPS)                          *
  7. ;*  COUNTRY.IDX   (List of Countries for Shipping Calculations)              *
  8. ;*  DOMESTIC.IEX  (Doimestic Federal Express Shipping Rates)                 *
  9. ;*  OVERSEAS.FEX  (International Federal Express Rates)                      *
  10. ;*  OVERSEAS.DHL  (International DHL Rates)                                  *
  11. ;*  SCRIPT        (Script MENU file)                                         *
  12. ;*  CHOICES.TXT   (Main Menu of choices available)                           *
  13. ;*  NEWPROD.TXT   (New Products Sub-Menu)                                    *
  14. ;*  PCBSTAN.TXT   (Standard Products Menu)                                   *
  15. ;*  PCB-M.TXT     (/M Code Products Menu)                                    *
  16. ;*  UPGRADE.TXT   (Upgrade Menu)                                             *
  17. ;*  OTHERSW.TXT   (Other Software Menu - DOORWAY, ToolKit, etc.)             *
  18. ;*  PACKAGE.TXT   (Bundled deals menu)                                       *
  19. ;*  HARDWARE.TXT  (Hardware menu)                                            *
  20. ;*  SPRT.TXT      (Support Renewal Menu                                      *
  21. ;*                                                                           *
  22. ;*****************************************************************************
  23.  
  24.  
  25. ;*****************************************************************************
  26. ;* Define variable types                                                     *
  27. ;*****************************************************************************
  28.  
  29.    string Answer
  30.    string Command
  31.    string Name
  32.    string SerialNo
  33.    string Company
  34.    string Address
  35.    string City
  36.    string State
  37.    string Zip
  38.    string Country
  39.    string ShipName
  40.    string ShipCompany
  41.    string ShipAddress
  42.    string ShipCity
  43.    string ShipState
  44.    string ShipZip
  45.    string ShipCountry
  46.    string CCNum
  47.    string CCExpire
  48.    string CCPhone
  49.    string CCName
  50.    string CCType
  51.    string CCDisplay
  52.    string CCExpireDisplay
  53.    string VoicePhone
  54.    string FaxPhone
  55.    string TShirtSize
  56.    string Comment1
  57.    string Comment2
  58.    string CustomerNumber
  59.  
  60.    ;************************************
  61.    ;* Used for Display Selections Made *
  62.    ;************************************
  63.  
  64.    string SelectionDisplay
  65.    string StandardDisplay
  66.    string PackageDisplay
  67.    string MCodeDisplay
  68.    string UpgradeDisplay
  69.    string OtherSWDisplay
  70.    string HardwareDisplay
  71.    string SupportDisplay
  72.    string OrderText(10)
  73.    string PriceDisplay
  74.    string Domestic
  75.    string Foreign
  76.    string FileCountry
  77.    string FEXZone
  78.    string DHLZone
  79.    string OverSeasShipType
  80.    string DomesticShipType
  81.  
  82.    ;*****************************************************************
  83.    ;* Used for identifying products ordered, their price and weight *
  84.    ;* In the arrays below, element 1 is the price, 2 is the weight  *
  85.    ;*****************************************************************
  86.  
  87.    integer Standard,StandardPrices(5,2)
  88.    integer MCode
  89.    integer MCodePrices(4,2)
  90.    integer Upgrade
  91.    integer UpgradePrices(7,2)
  92.    integer OtherSW
  93.    integer OtherSWPrices(4,2)
  94.    integer Package
  95.    integer PackagePrices(3,2)
  96.    integer Hardware
  97.    integer HardwarePrices(5,2)
  98.    integer Support
  99.    integer SupportPrices(2)
  100.    integer OrderArray(10,2)
  101.    integer TotalWeight
  102.    integer SubTotal
  103.    integer TotalFreight
  104.    integer TotalPrice
  105.    integer CardMonth
  106.    integer CardYear
  107.    integer ThisMonth
  108.    integer ThisYear
  109.    integer NumOrders
  110.    integer StartNum
  111.    integer NumDisp
  112.    integer Item
  113.    integer DLPrice
  114.    integer FEXEcon
  115.    integer FEXStan
  116.    integer FEXPrio
  117.    integer DHLPrio
  118.    integer CanadaUPS
  119.  
  120.    boolean OutSideUSA
  121.    boolean ShipDifferent
  122.    boolean DownloadOnly
  123.    boolean Extended
  124.    boolean UnableWieght
  125.    boolean Review
  126.    boolean Match
  127.    boolean OrderPlaced
  128.    boolean Error
  129.    boolean OnLocal
  130.  
  131. ;*****************************************************************************
  132. ;* Define Defaults                                                           *
  133. ;*****************************************************************************
  134.  
  135.    Country="USA"
  136.  
  137.    ;*****************************************
  138.    ;* PCBoard Standard Prices & Weight      *
  139.    ;*****************************************
  140.  
  141.    StandardPrices(1,1)=170
  142.    StandardPrices(2,1)=340
  143.    StandardPrices(3,1)=680
  144.    StandardPrices(4,1)=1000
  145.    StandardPrices(5,1)=2500
  146.  
  147.    StandardPrices(1,2)=4
  148.    StandardPrices(2,2)=4
  149.    StandardPrices(3,2)=4
  150.    StandardPrices(4,2)=4
  151.    StandardPrices(5,2)=4
  152.  
  153.    ;*****************************************
  154.    ;* PCBoard /M Prices & Weight            *
  155.    ;*****************************************
  156.  
  157.    MCodePrices(1,1)=440
  158.    MCodePrices(2,1)=780
  159.    MCodePrices(3,1)=1100
  160.    MCodePrices(4,1)=2600
  161.  
  162.    MCodePrices(1,2)=4
  163.    MCodePrices(2,2)=4
  164.    MCodePrices(3,2)=4
  165.    MCodePrices(4,2)=4
  166.  
  167.    ;*****************************************
  168.    ;* Upgrade Prices & Weight               *
  169.    ;*****************************************
  170.  
  171.    UpgradePrices(1,1)=85
  172.    UpgradePrices(2,1)=195
  173.    UpgradePrices(3,1)=535
  174.    UpgradePrices(4,1)=365
  175.    UpgradePrices(5,1)=685
  176.    UpgradePrices(6,1)=345
  177.    UpgradePrices(7,1)=100
  178.  
  179.    UpgradePrices(1,2)=4
  180.    UpgradePrices(2,2)=4
  181.    UpgradePrices(3,2)=4
  182.    UpgradePrices(4,2)=4
  183.    UpgradePrices(5,2)=4
  184.    UpgradePrices(6,2)=4
  185.    UpgradePrices(7,2)=1
  186.  
  187.    ;*****************************************
  188.    ;* Other Software Prices & Weight        *
  189.    ;*****************************************
  190.  
  191.    OtherSWPrices(1,1)=180
  192.    OtherSWPrices(2,1)=275
  193.    OtherSWPrices(3,1)=40
  194.    OtherSWPrices(4,1)=179
  195.  
  196.    OtherSWPrices(1,2)=4
  197.    OtherSWPrices(2,2)=2
  198.    OtherSWPrices(3,2)=1
  199.    OtherSWPrices(4,2)=3
  200.  
  201.    ;*****************************************
  202.    ;* Package Prices & Weight               *
  203.    ;*****************************************
  204.  
  205.    PackagePrices(1,1)=1060
  206.    PackagePrices(2,1)=1525
  207.    PackagePrices(3,1)=1830
  208.  
  209.    PackagePrices(1,2)=14
  210.    PackagePrices(2,2)=18
  211.    PackagePrices(3,2)=18
  212.  
  213.    ;*****************************************
  214.    ;* Hardware Prices & Weight              *
  215.    ;*****************************************
  216.  
  217.    HardwarePrices(1,1)=495
  218.    HardwarePrices(2,1)=515
  219.    HardwarePrices(3,1)=995
  220.    HardwarePrices(4,1)=1035
  221.    HardwarePrices(5,1)=179
  222.  
  223.    HardwarePrices(1,2)=5
  224.    HardwarePrices(2,2)=7
  225.    HardwarePrices(3,2)=7
  226.    HardwarePrices(4,2)=12
  227.    HardwarePrices(5,2)=2
  228.  
  229.    ;*****************************************
  230.    ;* Support Prices                        *
  231.    ;*****************************************
  232.  
  233.    SupportPrices(1)=60
  234.    SupportPrices(2)=120
  235.  
  236.  
  237. ;*****************************************************************************
  238. ;* Get Information from PCBOARD.SYS for this caller                          *
  239. ;*****************************************************************************
  240.  
  241. :GetCustomerInfo
  242.    GETUSER
  243.    Name=U_Name()
  244.    Name=upper(Name)
  245.    if (Name="FRED CLARK" | Name="DAVID TERRY") goto SkipDefaults
  246.    if (Name="JOE ROBINSON" | Name="SCOTT ROBISON") goto SkipDefaults
  247.    if (Name="SCOTT CARPENTER" | Name="DANIEL CHLARSON") goto SkipDefaults
  248.    if (Name="RICHARD KOZIK" | Name="STEVE CATMULL") goto SkipDefaults
  249.    if (Name="LOUIS ZIRKEL" | Name="MATT SMITH") goto SkipDefaults
  250.    if (Name="DAVID CLAYTON") goto SkipDefaults
  251.    CCName=Name
  252.    SerialNo=mid(U_CMNT2,1,6)
  253.    VoicePhone=U_HVPHONE
  254.    CCPhone=VoicePhone
  255.    Answer=U_CMNT2
  256.    Answer=rtrim(Answer," ")
  257.    CustomerNumber=right(Answer,6)
  258.    Answer=""
  259.    goto GetCCInfo
  260.  
  261. :SkipDefaults
  262.    Name=""
  263.    OnLocal=True
  264.  
  265. ;*****************************************************************************
  266. ;* Before they start placing their order, get some valid information to find *
  267. ;* out if they will be using a valid credit card, etc.                       *
  268. ;*****************************************************************************
  269.  
  270. :GetCCInfo
  271.    cls
  272.    println "@X0EWe accept the following credit cards:"
  273.    println
  274.    println "@X0F   (1) VISA"
  275.    println "@X0F   (2) MasterCard"
  276.    println "@X0F   (3) American Express/Optima"
  277.    println "@X0F"
  278.    println "@X0F   (A) Abort, I don't have a Credit Card!"
  279.    println
  280.    inputstr "Enter the Credit Card Type for this order: (1/2/3/A)",CCType,@X0E,1,"123Aa",10
  281.    println
  282.    if (CCType="1") goto GetVISAInfo
  283.    if (CCType="2") goto GetMASTInfo
  284.    if (CCType="3") goto GetAMEXInfo
  285.    Answer="N"
  286.    beep
  287.    println
  288.    inputyn "Are you sure you want to abort this script (Y/N)",Answer,@X0C
  289.    if (Answer<>"Y") goto getccinfo
  290.    println
  291.    goto abortscript
  292.  
  293. ;**********************************
  294. ;* Bad Credit Card Number         *
  295. ;**********************************
  296.  
  297. :BadCCNum
  298.    beep
  299.    println
  300.    println "@X8CThe card number you entered was invalid.  Either you selected"
  301.    println "the wrong credit card type vs the card number entered, or you did"
  302.    println "failed to enter the proper number of digits.  Please try again ..."
  303.    println "@X0E"
  304.    gosub pressakey
  305.    goto GetCCInfo
  306.  
  307. ;**********************************
  308. ;* Get VISA Info                  *
  309. ;**********************************
  310.  
  311. :GetVISAInfo
  312.    inputstr "    Enter the VISA Card Number",CCNUM,@X0E,16,"1234567890",2
  313.    println
  314.    if (left(CCnum,1)<>"4") goto BadCCNum
  315.    if (len(CCNum)=13 | len(CCNUM)=16) goto GetCCExpireDate
  316.    goto BadCCNum
  317.  
  318. ;**********************************
  319. ;* Get MasterCard Info            *
  320. ;**********************************
  321.  
  322. :GetMASTInfo
  323.    inputstr "   Enter the MasterCard Number",CCNUM,@X0E,16,"1234567890",2
  324.    println
  325.    if (left(CCnum,1)<>"5") goto BadCCNum
  326.    if (len(CCNUM)<>16) goto BadCCNum
  327.    goto GetCCExpireDate
  328.  
  329. ;**********************************
  330. ;* Get American Express Info      *
  331. ;**********************************
  332.  
  333. :GetAMEXInfo
  334.    inputstr "    Enter the AMEX Card Number",CCNUM,@X0E,15,"1234567890",2
  335.    println
  336.    if (left(CCnum,1)<>"3") goto BadCCNum
  337.    if (len(CCNUM)<>15) goto BadCCNum
  338.    goto GetCCExpireDate
  339.  
  340. ;**********************************
  341. ;* Get Card's Expiration Date     *
  342. ;**********************************
  343.  
  344. :GetCCExpireDate
  345.    inputstr " Expiration date (@X0CMMYY@X0E) format",CCExpire,@X0E,4,"1234567890",2
  346.    println
  347.    if (len(CCExpire)=4) goto CheckDate
  348.    beep
  349.    println
  350.    println "@X0CError in expiration date format!  Please try again ..."
  351.    println "@X0E"
  352.    goto GetCCExpireDate
  353.  
  354. :BadCCExpire
  355.    beep
  356.    println
  357.    println "@X0CError in expiration date!  Please try again ..."
  358.    println "@X0E"
  359.    goto GetCCExpireDate
  360. :CheckDate
  361.    CardMonth=left(ccexpire,2)
  362.    CardYear=mid(ccexpire,3,2)
  363.    ThisMonth=month(date())
  364.    ThisYear=Year(date())
  365.    if (CardMonth>12 | CardMonth<1) goto BadCCExpire
  366.    If (CardYear>ThisYear) goto GetCCName
  367.    if (CardYear=ThisYear & CardMonth>=ThisMonth) goto GetCCName
  368.    println
  369.    beep
  370.    println "@X0CThat card has expired!"
  371.    println
  372.    println "@X0E    Enter (R) to re-enter the card's expiration date."
  373.    println "@X0E    Enter (D) to use a different credit card."
  374.    println "@X0E    Enter (A) to abort this order and return."
  375.    println
  376.    Command="R"
  377.    inputstr "Your Choice: (R/D/A)",Command,@X0E,1,"RDA",@X0E,10
  378.    println
  379.    if (Command="R") goto GetCCExpireDate
  380.    if (Command="D") goto GetCCInfo
  381.    goto AbortScript
  382.  
  383. ;***************************************
  384. ;* Get Card Holder's Name              *
  385. ;***************************************
  386.  
  387. :GetCCName
  388.    inputtext "   Enter the Cardholder's Name",CCName,@X0E,50
  389.    println
  390.    CCName=upper(CCName)
  391.    Name=CCName
  392.    ShipName=CCName
  393.    inputstr  "Enter the Cardholder's Phone #",CCPhone,@X0E,13,"1234567890.-()/",2
  394.    VoicePhone=CCPhone
  395.    CLS
  396.    println "@X0EYou have entered the following Credit Card information:"
  397.    println
  398.    if (CCType="1" & len(CCNum)=13) CCDisplay=left(CCNum,4)+"-"+mid(CCNum,5,3)+"-"+mid(CCNum,8,3)+"-"+mid(CCNum,11,3)
  399.    if (CCType="1" & len(CCNum)=16) CCDisplay=left(CCNum,4)+"-"+mid(CCNum,5,4)+"-"+mid(CCNum,9,4)+"-"+mid(CCNum,13,4)
  400.    if (CCType="2") CCDisplay=left(CCNum,4)+"-"+mid(CCNum,5,4)+"-"+mid(CCNum,9,4)+"-"+mid(CCNum,13,4)
  401.    if (CCType="3") CCDisplay=left(CCNum,4)+"-"+mid(CCNum,5,6)+"-"+mid(CCNum,11,5)
  402.    ccexpiredisplay=left(ccexpire,2)+"/"+mid(ccexpire,3,2)
  403.    print   "@X0F   Credit Card #: "
  404.    println "@X07",CCDisplay
  405.    print   "@X0F Expiration Date: "
  406.    println "@X07",CCExpireDisplay
  407.    print   "@X0FCardholders Name: "
  408.    println "@X07",CCName
  409.    print   "@X0F           Phone: "
  410.    println "@X07",CCPhone
  411.    println
  412.    Answer="Y"
  413.    inputyn "Is the above information correct (Y/N)",Answer,@X0E
  414.    println "@X07"
  415.    if (Answer="Y") goto GetNameInfo
  416.    goto GetCCInfo
  417.  
  418. ;***********************************************
  419. ;* Now get Purchaser & Billing Information     *
  420. ;***********************************************
  421.  
  422. :GetNameInfo
  423.    cls
  424.    println "@X0FNow that we have valid credit card information, you need to complete"
  425.    println "your billing and shipping information.  In order for the script to"
  426.    println "properly calculate your freight and other functions, you @X0AMUST@X0F enter"
  427.    println "your State/Province and Country in their appropriate fields.  Please do"
  428.    println "@X0CNOT@X0F include your State and Zip (Postal) code in the 'City' field."
  429.    println
  430.    println "Customers from outside the US and Canada may need to use the 'Company'"
  431.    println "or 'City' fields in order to enter all of your information properly."
  432.    println
  433.  
  434. :GetCustName
  435.    if (SerialNo="" | left(SerialNo,1)=" ") SerialNo="None"
  436.    inputstr  "  Serial # (if applicable)",SerialNo,@X0E,6,"1234567890",2
  437.    println
  438.    if (SerialNo="" | left(SerialNo,1)=" " | left(SerialNo,1)="N") goto FinishSerial
  439.    if (len(SerialNo)=6) goto FinishSerial
  440.    beep
  441.    println
  442.    println "@X0CSerial # must be 6 characters in length!  Please try again ..."
  443.    println
  444.    goto GetCustName
  445.  
  446. :FinishSerial
  447.    if (CustomerNumber="" | left(CustomerNumber,1)=" ") CustomerNumber="None"
  448.    inputtext "Customer # (if applicable)",CustomerNumber,@X0E,6
  449.    println
  450.    CustomerNumber=upper(CustomerNumber)
  451.    inputtext "Purchaser Name",Name,@X0E,50
  452.    Name=upper(Name)
  453.    ShipName=Name
  454.    println
  455.  
  456.    inputstr " Voice Phone #",VoicePhone,@X0E,13,"1234567890.-()/",2
  457.    println
  458.  
  459.    inputstr "   FAX Phone #",FaxPhone,@X0E,13,"1234567890.-()/",2
  460.    println
  461.  
  462.    inputtext "  Company Name",Company,@X0E,50
  463.    Company=upper(Company)
  464.    ShipCompany=Company
  465.    println
  466.  
  467.    inputtext "Street Address",Address,@X0E,50
  468.    Address=upper(Address)
  469.    ShipAddress=Address
  470.    println
  471.  
  472.    inputtext "          City",City,@X0E,25
  473.    City=upper(City)
  474.    ShipCity=City
  475.    println
  476.  
  477.    inputtext "State/Province",State,@X0E,2
  478.    State=Upper(state)
  479.    ShipState=State
  480.    println
  481.  
  482.    inputtext "           ZIP",Zip,@X0E,10
  483.    Zip=upper(Zip)
  484.    ShipZip=Zip
  485.    println
  486.  
  487.    inputtext "       Country",Country,@X0E,20
  488.    println
  489.    OutSideUSA=False
  490.    Country=Upper(Country)
  491.    ShipCountry=Country
  492.    if (Country="USA" & State="") gosub BadState
  493.    if (Country="" & State="") gosub BadState
  494.    if (Country="USA" & State="") goto GetCustName
  495.    if (Country="" & State="") goto GetCustName
  496.    if (Country<>"USA") OutSideUSA=True
  497.    if (Country="") OutsideUSA=false
  498.  
  499. ;*************************************************
  500. ;* Let Them Verify their Information             *
  501. ;*************************************************
  502.  
  503.    cls
  504.    println "@X0EYou have entered the following purchaser information:"
  505.    println
  506.    print   "@X0F        Serial #: "
  507.    println "@X07",SerialNo
  508.    print   "@X0F Customer Number: "
  509.    println "@X07",CustomerNumber
  510.    print   "@X0F   Customer Name: "
  511.    println "@X07",Name
  512.    print   "@X0F   Voice Phone #: "
  513.    println "@X07",VoicePhone
  514.    print   "@X0F     FAX Phone #: "
  515.    println "@X07",FaxPhone
  516.    if (Company="") goto SkipCompany
  517.    print   "@X0F         Company: "
  518.    println "@X07",Company
  519.  
  520. :SkipCompany
  521.    print   "@X0F         Address: "
  522.    println "@X07",Address
  523.    print   "@X0F                  "
  524.    println "@X07"+City+", "+state+"  "+Zip
  525.    print   "@X0F                  "
  526.    println "@X07",Country
  527.    println "@X07"
  528.    Answer="Y"
  529.    inputyn "Is the above information correct (Y/N)",Answer,@X0E
  530.    println
  531.    if (Answer="Y") goto ShipContinue
  532.    println
  533.    goto GetCustName
  534.  
  535. ;*****************************************************
  536. ;* If they are in USA, make them enter a valid State *
  537. ;*****************************************************
  538.  
  539. :BadState
  540.    cls
  541.    beep
  542.    println
  543.    println "@X0CYou must enter a valid State!  Please re-enter your information ..."
  544.    println "@X0E"
  545.    return
  546.  
  547. ;********************************************
  548. ;* Find Out if Shipping is the Same?        *
  549. ;********************************************
  550.  
  551. :ShipContinue
  552.    Answer="Y"
  553.    inputyn "Is the Shipping Information the Same as above (Y/N)",Answer,@X0E
  554.    println
  555.    ShipDifferent=False
  556.    if (Answer="Y") goto Main
  557.  
  558. ;********************************************
  559. ;* Nope - get correct shipping info         *
  560. ;********************************************
  561.  
  562. :GetShipInfo
  563.    println
  564.    ShipDifferent=True
  565.    inputtext "     Ship Name",ShipName,@X0E,50
  566.    ShipName=upper(ShipName)
  567.    println
  568.  
  569.    inputtext "  Ship Company",ShipCompany,@X0E,50
  570.    ShipCompany=upper(ShipCompany)
  571.    println
  572.  
  573.    inputtext "  Ship Address",ShipAddress,@X0E,50
  574.    ShipAddress=upper(ShipAddress)
  575.    println
  576.  
  577.    inputtext "     Ship City",ShipCity,@X0E,25
  578.    ShipCity=upper(ShipCity)
  579.    println
  580.  
  581.    inputtext "Ship State/Pro",ShipState,@X0E,2
  582.    ShipState=Upper(ShipState)
  583.    println
  584.  
  585.    inputtext "      Ship ZIP",ShipZIP,@X0E,10
  586.    ShipZip=Upper(ShipZip)
  587.    println
  588.  
  589.    inputtext "  Ship Country",ShipCountry,@X0E,20
  590.    println
  591.    OutSideUSA=False
  592.    ShipCountry=Upper(ShipCountry)
  593.    if (ShipCountry="USA" & ShipState="") gosub BadState
  594.    if (ShipCountry="" & State="") gosub BadState
  595.    if (ShipCountry="USA" & ShipState="") goto GetShipInfo
  596.    if (ShipCountry="" & State="") goto GetShipInfo
  597.    if (ShipCountry<>"USA") OutSideUSA=True
  598.    if (ShipCountry="") OutsideUSA=false
  599.  
  600. ;**************************************************
  601. ;* Now Verify their 'ShipTo' Information          *
  602. ;**************************************************
  603.  
  604.    cls
  605.    println "@X0EYou have entered the following shipping information:"
  606.    println
  607.    print   "@X0F       Ship Name: "
  608.    println "@X07",ShipName
  609.    if (ShipCompany="") goto SkipShipCompany
  610.    print   "@X0F    Ship Company: "
  611.    println "@X07",ShipCompany
  612.  
  613. :SkipShipCompany
  614.    print   "@X0F         Address: "
  615.    println "@X07",ShipAddress
  616.    print   "@X0F                  "
  617.    println "@X07"+ShipCity+", "+ShipState+"  "+SHipZip
  618.    print   "@X0F                  "
  619.    println "@X07",ShipCountry
  620.    println "@X07"
  621.    Answer="Y"
  622.    inputyn "Is the above information correct (Y/N)",Answer,@X0E
  623.    println
  624.    if (Answer="Y") goto Main
  625.    println
  626.    goto GetShipInfo
  627.  
  628. ;*****************************************************************************
  629. ;* Here's Where we start the menu selection process                          *
  630. ;*****************************************************************************
  631.  
  632. :Main
  633.    cls
  634.    dispfile "c:\pcb\gen\choices.txt",0
  635.    println
  636.  
  637.    Command=""
  638.    inputstr  "@X0EMain Order Command: (1-6), (R), (S), (A)",Command,@X0E,1,"123456RSA",10
  639.    println
  640.  
  641.    if (Command="") goto Main
  642.    if (Command="S") goto WriteScript
  643.    if (Command="R") goto ReviewOrder
  644.    if (Command="A") goto AbortScript
  645.    if (NumOrders=10) goto excessive
  646.    if (Command="1") gosub NewOrder
  647.    if (Command="2") gosub UpgradeOrder
  648.    if (Command="3") gosub OtherSWOrder
  649.    if (Command="4") gosub HardwareOrder
  650.    if (Command="5") gosub RenewalOrder
  651.    if (Command="6") gosub PackageOrder
  652.    goto Main
  653.  
  654. ;*****************************************************************************
  655. ;* Terminate the script because the caller did not wish to continue          *
  656. ;*****************************************************************************
  657.  
  658. :AbortScript
  659.       println
  660.       beep
  661.       println "@X0FScript Aborted.  Returning to normal board operations ..."
  662.       stop
  663.  
  664. ;*****************************************************************************
  665. ;* Excessive Number of Orders - MAX Allowed is 10                            *
  666. ;*****************************************************************************
  667.  
  668. :Excessive
  669.    Println
  670.    beep
  671.    println "@X0CA maximum number of @X0F10@X0C items can be ordered with this Script!"
  672.    println
  673.    gosub pressakey
  674.    goto main
  675.  
  676. ;*****************************************************************************
  677. ;* Review The order here - what they have ordered so far                     *
  678. ;*****************************************************************************
  679.  
  680. :ReviewOrder
  681.    Review=True
  682.    gosub verify
  683.    if (NumOrders>0) goto ReviewContinue
  684.    goto main
  685.  
  686. :ReviewContinue
  687.    Answer="R"
  688.    inputstr "Verify Command: (D)elete Item, (R)eturn to Main Menu (S)ave Order",Answer,@X0E,1,"DRS",10
  689.    println
  690.    if (Answer="") goto ReviewContinue
  691.    if (Answer="R") goto Main
  692.    if (Answer="S") goto SaveNow
  693.    beep
  694.    Item=0
  695.    inputint "Which item # do you wish to delete (0 to Cancel)",Item,@X0C
  696.    if (Item=0) goto ReviewOrder
  697.    if (Item=>1 & Item<=NumDisp) goto ValidDelete
  698.    beep
  699.    println
  700.    println "@X0CYou entered an invalid item number!"
  701.    println
  702.    gosub pressakey
  703.    goto revieworder
  704.  
  705. ;************************************************
  706. ;* Allow them to delete an item already ordered *
  707. ;************************************************
  708.  
  709. :ValidDelete
  710.    NumOrders=NumOrders-1
  711.    OrderText(Item)=""
  712.    OrderArray(Item,1)=0
  713.    OrderArray(Item,2)=0
  714.    if (Item=10) goto ReviewOrder
  715.    if (NumOrders=0) goto Main
  716.  
  717. :IncrementDelete
  718.    OrderText(Item)=OrderText(Item+1)
  719.    OrderArray(Item,1)=OrderArray(Item+1,1)
  720.    OrderArray(Item,2)=OrderArray(Item+1,2)
  721.    Item=Item+1
  722.    OrderText(Item)=""
  723.    OrderArray(Item,1)=0
  724.    OrderArray(Item,2)=0
  725.    if (Item>NumOrders+1) goto ReviewOrder
  726.    goto IncrementDelete
  727.  
  728. ;*****************************************************************************
  729. ;* This is the New Order Part                                                *
  730. ;*****************************************************************************
  731.  
  732. :NewOrder
  733.    cls
  734.    dispfile "c:\pcb\gen\newprod.txt",0
  735.    println
  736.  
  737. :NewOrderAgain
  738.    Command=""
  739.    inputstr "New Product Selection: (1-2), (E)xit",Command,@X0E,1,"12E",10
  740.    println
  741.    if (Command="") goto NewOrderAgain
  742.    if (Command="1") goto StandardOrder
  743.    if (Command="2") goto MCodeOrder
  744.  
  745. :ReturnToMain
  746.    command=""
  747.    return
  748.  
  749. ;***************************************
  750. ;* Standard Code Ordering Part         *
  751. ;***************************************
  752.  
  753. :StandardOrder
  754.    cls
  755.    standard=0
  756.    dispfile "c:\pcb\gen\pcbstan.txt",0
  757.    println
  758.    Command=""
  759.    inputstr "Standard Product Selection: (1-5), (E)xit",Command,@X0E,1,"12345E",10
  760.    PRINTLN
  761.    if (Command="") goto ReturnToMain
  762.    if (instr("12345",command)<1) goto ReturnToMain
  763.    Standard=Command
  764.    StandardDisplay="PCBoard "
  765.    if (command="1") StandardDisplay=StandardDisplay+"2"
  766.    if (command="2") StandardDisplay=StandardDisplay+"10"
  767.    if (command="3") StandardDisplay=StandardDisplay+"100"
  768.    if (command="4") StandardDisplay=StandardDisplay+"250"
  769.    if (command="5") StandardDisplay=StandardDisplay+"1000"
  770.    StandardDisplay=StandardDisplay+" Node Standard Code for $ "
  771.    println
  772.    print "@X0FProduct Ordered: "
  773.    print "@X07",StandardDisplay
  774.    pricedisplay=StandardPrices(Standard,1)
  775.    pricedisplay=pricedisplay+".00"
  776.    println pricedisplay
  777.    println
  778.    Answer="Y"
  779.    inputyn "Is the above correct (Y/N)",Answer,@X0E
  780.    if (Answer="N") goto StandardOrder
  781.    NumOrders=NumOrders+1
  782.    OrderArray(NumOrders,1)=StandardPrices(Standard,1)
  783.    OrderArray(NumOrders,2)=StandardPrices(Standard,2)
  784.    OrderText(NumOrders)=StandardDisplay+PriceDisplay
  785.    goto ReturnToMain
  786.  
  787. ;******************************************
  788. ;* /M Code Ordering Part                  *
  789. ;******************************************
  790.  
  791. :MCodeOrder
  792.    cls
  793.    MCode=0
  794.    dispfile "c:\pcb\gen\pcb-m.txt",0
  795.    println
  796.    Command=""
  797.    inputstr "/M Code Product Selection: (1-4), (E)xit",Command,@X0E,1,"1234E",10
  798.    println
  799.    if (Command="") goto ReturnToMain
  800.    if (instr("1234",command)<1) goto ReTurnToMain
  801.    MCode=Command
  802.    MCodeDisplay="PCBoard "
  803.    if (command="1") MCodeDisplay=MCodeDisplay+"10"
  804.    if (command="2") MCodeDisplay=MCodeDisplay+"100"
  805.    if (command="3") MCodeDisplay=MCodeDisplay+"250"
  806.    if (command="4") MCodeDisplay=MCodeDisplay+"1000"
  807.    MCodeDisplay=MCodeDisplay+" Node /M (80386) Code for $ "
  808.    println
  809.    print "@X0FProduct Ordered: "
  810.    print "@X07",MCodeDisplay
  811.    pricedisplay=MCodePrices(MCode,1)
  812.    pricedisplay=pricedisplay+".00"
  813.    println pricedisplay
  814.    println
  815.    Answer="Y"
  816.    inputyn "Is the above correct (Y/N)",Answer,@X0E
  817.    if (Answer="N") goto MCodeOrder
  818.    NumOrders=NumOrders+1
  819.    OrderArray(NumOrders,1)=MCodePrices(MCode,1)
  820.    OrderArray(NumOrders,2)=MCodePrices(MCode,2)
  821.    OrderText(NumOrders)=MCodeDisplay+PriceDisplay
  822.    goto ReturnToMain
  823.  
  824. ;****************************************************
  825. ;* Package Deal Order Part                          *
  826. ;****************************************************
  827.  
  828. :PackageOrder
  829.    cls
  830.    Package=0
  831.    dispfile "c:\pcb\gen\package.txt",0
  832.    println
  833.    Command=""
  834.    inputstr "/M Package Deal Product Selection: (1-3), (E)xit",Command,@X0E,1,"123E",10
  835.    println
  836.    if (Command="") goto ReturnToMain
  837.    if (instr("123",command)<1) goto ReTurnToMain
  838.    Package=Command
  839.    if (command="1") PackageDisplay="10/M, ARNET 4, DOORWAY, DESQView, Cables"
  840.    if (command="2") PackageDisplay="10/M, ARNET 8, DOORWAY, DESQView, Cables"
  841.    if (command="3") PackageDisplay="100/M, ARNET 8, DOORWAY, DESQView, Cables"
  842.    PackageDisplay=PackageDisplay+" for $ "
  843.    println
  844.    print "@X0FProduct Ordered: "
  845.    print "@X07",PackageDisplay
  846.    pricedisplay=PackagePrices(Package,1)
  847.    pricedisplay=pricedisplay+".00"
  848.    println pricedisplay
  849.    println
  850.    Answer="Y"
  851.    inputyn "Is the above correct (Y/N)",Answer,@X0E
  852.    if (Answer="N") goto PackageOrder
  853.    NumOrders=NumOrders+1
  854.    OrderArray(NumOrders,1)=PackagePrices(Package,1)
  855.    OrderArray(NumOrders,2)=PackagePrices(Package,2)
  856.    OrderText(NumOrders)=PackageDisplay+PriceDisplay
  857.    goto ReturnToMain
  858.  
  859.  
  860. ;****************************************************
  861. ;* Hardware Order Part                              *
  862. ;****************************************************
  863.  
  864. :HardwareOrder
  865.    cls
  866.    Hardware=0
  867.    dispfile "c:\pcb\gen\hardware.txt",0
  868.    println
  869.    Command=""
  870.    inputstr "Hardware Product Selection: (1-5), (E)xit",Command,@X0E,1,"12345E",10
  871.    println
  872.    if (Command="") goto ReturnToMain
  873.    if (instr("12345",command)<1) goto ReTurnToMain
  874.    Hardware=Command
  875.    if (command="1") HardwareDisplay="ARNET 4-Port Serial card w/o Cables"
  876.    if (command="2") HardwareDisplay="ARNET 4-Port Serial card with Cables"
  877.    if (command="3") HardwareDisplay="ARNET 8-Port Serial card w/o Cables"
  878.    if (command="4") HardwareDisplay="ARNET 8-Port Serial card with Cables"
  879.    if (command="5") HardwareDisplay="Willies' 4-Port Serial Card w/16550's"
  880.    HardwareDisplay=HardwareDisplay+" for $ "
  881.    println
  882.    print "@X0FProduct Ordered: "
  883.    print "@X07",HardwareDisplay
  884.    pricedisplay=HardwarePrices(Hardware,1)
  885.    pricedisplay=pricedisplay+".00"
  886.    println pricedisplay
  887.    println
  888.    Answer="Y"
  889.    inputyn "Is the above correct (Y/N)",Answer,@X0E
  890.    if (Answer="N") goto HardwareOrder
  891.    NumOrders=NumOrders+1
  892.    OrderArray(NumOrders,1)=HardwarePrices(Hardware,1)
  893.    OrderArray(NumOrders,2)=HardwarePrices(Hardware,2)
  894.    OrderText(NumOrders)=HardwareDisplay+PriceDisplay
  895.    goto ReturnToMain
  896.  
  897.  
  898. ;*************************************************
  899. ;* Other Software Order                          *
  900. ;*************************************************
  901.  
  902. :OtherSWOrder
  903.    cls
  904.    OtherSW=0
  905.    dispfile "c:\pcb\gen\othersw.txt",0
  906.    println
  907.    Command=""
  908.    inputstr "Other Software Product Selection: (1-4), (E)xit",Command,@X0E,1,"1234E",10
  909.    println
  910.    if (Command="") goto ReturnToMain
  911.    if (instr("1234",command)<1) goto ReTurnToMain
  912.    OtherSW=Command
  913.    if (command="1") OtherSWDisplay="PCBoard Development ToolKit"
  914.    if (command="2") OtherSWDisplay="PCB-MHS Novell GateWay"
  915.    if (command="3") OtherSWDisplay="DOORWAY Remote Access/DOS"
  916.    if (command="4") OtherSWDisplay="DESQview 386 Multitasking"
  917.    OtherSWDisplay=OtherSWDisplay+" Software for $ "
  918.    println
  919.    print "@X0FProduct Ordered: "
  920.    print "@X07",OtherSWDisplay
  921.    pricedisplay=OtherSWPrices(OtherSW,1)
  922.    pricedisplay=pricedisplay+".00"
  923.    println pricedisplay
  924.    println
  925.    Answer="Y"
  926.    inputyn "Is the above correct (Y/N)",Answer,@X0E
  927.    if (Answer="N") goto OtherSWOrder
  928.    NumOrders=NumOrders+1
  929.    OrderArray(NumOrders,1)=OtherSWPrices(OtherSW,1)
  930.    OrderArray(NumOrders,2)=OtherSWPrices(OtherSW,2)
  931.    OrderText(NumOrders)=OtherSWDisplay+PriceDisplay
  932.    goto ReturnToMain
  933.  
  934.  
  935. ;***************************************************
  936. ;* This is the Upgrade Part                        *
  937. ;***************************************************
  938.  
  939. :UpgradeOrder
  940.    cls
  941.    Upgrade=0
  942.    DownloadOnly=False
  943.    dispfile "c:\pcb\gen\upgrade.txt",0
  944.    println
  945.    Command=""
  946.    inputstr "Upgrade Product Selection: (1-7), (E)xit",Command,@X0E,1,"1234567E",10
  947.    println
  948.    if (Command="") goto ReturnToMain
  949.    if (instr("1234567",command)<1) goto ReTurnToMain
  950.    Upgrade=Command
  951.    if (command="1") UpgradeDisplay="Like-to-Like Upgrade"
  952.    if (command="2") UpgradeDisplay="2 Node to 10 Node Upgrade"
  953.    if (command="3") UpgradeDisplay="2 Node to 100 Node Upgrade"
  954.    if (command="4") UpgradeDisplay="10 Node to 100 Node Upgrade"
  955.    if (command="5") UpgradeDisplay="10 Node to 250 Node Upgrade"
  956.    if (command="6") UpgradeDisplay="100 Node to 250 Node Upgrade"
  957.    if (command="7") UpgradeDisplay="/M Code Supplement"
  958.    UpgradeDisplay=UpgradeDisplay+" for $ "
  959.    println
  960.    print "@X0FProduct Ordered: "
  961.    print "@X07",UpgradeDisplay
  962.    pricedisplay=UpgradePrices(Upgrade,1)
  963.    pricedisplay=pricedisplay+".00"
  964.    println pricedisplay
  965.    println
  966.    Answer="Y"
  967.    inputyn "Is the above correct (Y/N)",Answer,@X0E
  968.    println
  969.    if (Answer="N") goto UpgradeOrder
  970.    if (Upgrade=1 | Upgrade=7) goto FinishUpgrade
  971.    println
  972.    answer="Y"
  973.    inputyn "Download your upgrade and save $25 (Y/N)",Answer,@X0E
  974.    if (answer="N") goto FinishUpgrade
  975.    dlprice=UpgradePrices(Upgrade,1)-25
  976.    pricedisplay=dlprice
  977.    pricedisplay=pricedisplay+".00 via D/L"
  978.    DownLoadOnly=True
  979.  
  980. :FinishUpgrade
  981.    NumOrders=NumOrders+1
  982.    OrderArray(NumOrders,1)=UpgradePrices(Upgrade,1)
  983.    if (DownLoadOnly) OrderArray(NumOrders,1)=OrderArray(NumOrders,1)-25
  984.    if (!DownloadOnly) OrderArray(NumOrders,2)=UpgradePrices(Upgrade,2)
  985.    OrderText(NumOrders)=UpgradeDisplay+PriceDisplay
  986.    goto ReturnToMain
  987.  
  988. ;*******************************************************
  989. ;* This is the Support Renewal Part                    *
  990. ;* Get the serial Number for Support Renewal           *
  991. ;*******************************************************
  992.  
  993. :RenewalOrder
  994.    cls
  995.    Support=0
  996.    Extended=False
  997.    dispfile "c:\pcb\gen\sprt.txt",0
  998.    println
  999.    Command=""
  1000.    inputstr "Support Renewal Selection: (1-2), (E)xit",Command,@X0E,1,"12E",10
  1001.    println
  1002.    if (Command="") goto ReturnToMain
  1003.    if (instr("12",command)<1) goto ReTurnToMain
  1004.    Support=Command
  1005.    if (command="1") SupportDisplay="Standard Renewal"
  1006.    if (command="2") SupportDisplay="Extended Renewal"
  1007.    SupportDisplay=SupportDisplay+" for $ "
  1008.    println
  1009.    print "@X0FSupport Ordered: "
  1010.    print "@X07",SupportDisplay
  1011.    pricedisplay=SupportPrices(Support)
  1012.    pricedisplay=pricedisplay+".00"
  1013.    println pricedisplay
  1014.    println
  1015.    Answer="Y"
  1016.    inputyn "Is the above correct (Y/N)",Answer,@X0E
  1017.    println
  1018.    if (Answer="N") goto RenewalOrder
  1019.    if (Command="1") goto FinishSupport
  1020.  
  1021. :GetShirtSize
  1022.    TShirtSize="XL"
  1023.    inputstr "What size T-Shirt do you want (L/XL/XXL)",TShirtSize,@X0E,3,"XLxl",2
  1024.    println
  1025.    TShirtSize=Upper(TShirtSize)
  1026.    if (TShirtSize<>"L" & TShirtSize<>"XL" & TShirtSize<>"XXL") goto GetShirtSize
  1027.    TShirtSize="         T-Shirt Size: "+TShirtSize
  1028.    Extended=True
  1029.  
  1030. :FinishSupport
  1031.    NumOrders=NumOrders+1
  1032.    OrderArray(NumOrders,1)=SupportPrices(Support)
  1033.    OrderText(NumOrders)=SupportDisplay+PriceDisplay
  1034.    goto ReturnToMain
  1035.  
  1036. ;*************************************************************
  1037. ;* Wait for a keypress - Generic - displays the prompt       *
  1038. ;* 'Press (Enter) to Continue ...' and then returns          *
  1039. ;*************************************************************
  1040.  
  1041. :PressAKey
  1042.    wait
  1043.    return
  1044.  
  1045. ;*****************************************************************
  1046. ;* Verify Menu Portion of Order So Far and Before Saving         *
  1047. ;*****************************************************************
  1048.  
  1049. :Verify
  1050.    cls
  1051.    totalweight=0
  1052.    subtotal=0
  1053.    totalfreight=0
  1054.    StartNum=1
  1055.    NumDisp=1
  1056.    Match=false
  1057.  
  1058. :CalcWeight
  1059.    if (NumOrders=0) goto ContinueDisplay
  1060.    if (OrderArray(StartNum,1)>0) TotalWeight=TotalWeight+OrderArray(Startnum,2)
  1061.    Startnum=Startnum+1
  1062.    if (Startnum<=NumOrders) goto CalcWeight
  1063.    if (TotalWeight=0) goto NoWeight
  1064.    if (OutSideUSA) goto CalcForeign
  1065.  
  1066. ;******************************************
  1067. ; Load Domestic FedEx Chart & Calculate   *
  1068. ;******************************************
  1069.  
  1070.    fopen 1,"c:\pcb\gen\domestic.fex",0,0
  1071.    startnum=1
  1072.  
  1073. :FEXDomestic
  1074.    fget 1,Domestic
  1075.    Error=Ferr(1)
  1076.    if (Error) goto DefaultDomestic
  1077.    if (left(Domestic,1)=";") goto FEXDomestic
  1078.    if (Startnum=Totalweight) goto CalcFedEx
  1079.    startnum=startnum+1
  1080.    goto FEXDomestic
  1081.  
  1082. ;**********************************
  1083. ;Unable to locate a match         *
  1084. ;**********************************
  1085.  
  1086. :defaultDomestic
  1087.    Domestic="72+100 130 150"
  1088.  
  1089. :CalcFedEx
  1090.    fclose 1
  1091.    FEXEcon=mid(Domestic,4,3)
  1092.    FEXStan=mid(Domestic,8,3)
  1093.    FEXPrio=mid(Domestic,12,3)
  1094.    if (State<>"HI" & State<>"AK") goto DomesticChoice
  1095.    FEXEcon=FEXEcon+10
  1096.    FEXStan=FEXStan+10
  1097.    FEXPrio=FEXPrio+10
  1098.  
  1099. :DomesticChoice
  1100.    println
  1101.    print "@X0EYour total shipping weight is @X0F"
  1102.    print TotalWeight
  1103.    println "@X0E pounds.  We ship only by @X0CFederal Express@X0E."
  1104.    println "@X0EFederal Express delivery days are based on '@X0ABusiness Days@X0E' and do @X0CNOT@X0E"
  1105.    println "include weekends or Holidays.  How would you like your order shipped:"
  1106.    println
  1107.    print "@X0F(1)@X0E  Economy Two-Day Business Service for ............... $ @X0F"
  1108.    print FEXEcon
  1109.    println ".00"
  1110.    print "@X0F(2)@X0E  Standard Overnight (3:30pm delivery most areas) for  $ @X0F"
  1111.    print FEXStan
  1112.    println ".00"
  1113.    print "@X0F(3)@X0E  Priority Overnight (10:30am delivery most areas) for $ @X0F"
  1114.    print FEXPrio
  1115.    println ".00"
  1116.    println
  1117.    Answer="1"
  1118.    inputstr "Shipping Method Desired: (1) Economy, (2) Standard, (3) Priority",Answer,@X0E,1,"123",2
  1119.    println
  1120.    if (Answer="1") TotalFreight=FEXEcon
  1121.    if (Answer="2") Totalfreight=FEXStan
  1122.    if (Answer="3") TotalFreight=FEXPrio
  1123.    if (Answer="1") DomesticShipType="2-Day Economy"
  1124.    if (Answer="2") DomesticShipType="Standard Overnight"
  1125.    if (Answer="3") DomesticShipType="Priority Overnight"
  1126.    goto ContinueDisplay
  1127.  
  1128. ;*********************************************************
  1129. ;* Calculate Overseas Shipping Charges                   *
  1130. ;*********************************************************
  1131.  
  1132. ;**********************************************************
  1133. ;* First, load COUNTRY.IDX and try to find a match on the *
  1134. ;* country they entered.  'Ship-To' country will always   *
  1135. ;* over-ride 'Sold-To' country.                           *
  1136. ;**********************************************************
  1137.  
  1138. :CalcForeign
  1139.    Match=false
  1140.    fopen 1,"c:\pcb\gen\country.idx",0,0
  1141.    print "@X0FPlease wait while we load non-domestic shipping tables ..."
  1142.  
  1143. :GetCountry
  1144.    fget 1,Foreign
  1145.    Error=Ferr(1)
  1146.    if (Error) goto NoCountryMatch
  1147.    if (left(foreign,1)=";") goto GetCountry
  1148.    FileCountry=left(foreign,15)
  1149.    FileCountry=rtrim(FileCountry," ")
  1150.    if (instr(ShipCountry,FileCountry)>0) goto FoundMatch
  1151.    goto GetCountry
  1152.  
  1153. :FoundMatch
  1154.    match=true
  1155.    goto FinishCountryFile
  1156.  
  1157. :NOCountryMatch
  1158.    match=false
  1159.    beep
  1160.    println
  1161.    println
  1162.    print "@X0CAn exact country match on country '@X0F",ShipCountry,"@X0C' was not found!"
  1163.  
  1164. ;**********************************************************
  1165. ;* Setting FEXZone=7 and DHLZone=H before actually using  *
  1166. ;* the proper match information means that if a country   *
  1167. ;* match was not made we will use the highest rate data   *
  1168. ;* available.  This is good because most likely their     *
  1169. ;* country would fall under that category since the major *
  1170. ;* countries are all listed.                              *
  1171. ;**********************************************************
  1172.  
  1173. ;**********************************************************
  1174. ;* Do a lookup from the FedEx table called OVERSEAS.FEX   *
  1175. ;**********************************************************
  1176.  
  1177. :FinishCountryFile
  1178.    fclose 1
  1179.    FEXZone="7"
  1180.    DHLZone="H"
  1181.    if (Match) FEXZone=mid(foreign,16,1)
  1182.    if (Match) DHLZone=mid(foreign,18,1)
  1183.    if (FEXZone="0") goto DHLCalc
  1184.    if (Totalweight>72) goto DefaultFEX
  1185.    fopen 1,"c:\pcb\gen\overseas.fex",0,0
  1186.    startnum=1
  1187.  
  1188. :FEXOverseas
  1189.    fget 1,foreign
  1190.    Error=Ferr(1)
  1191.    if (Error) goto DefaultFEX
  1192.    if (left(Foreign,1)=";") goto FEXOverseas
  1193.    if (Startnum=TotalWeight) goto FEXCalc
  1194.    startnum=Startnum+1
  1195.    goto FEXOverseas
  1196.  
  1197. :DefaultFEX
  1198.    Foreign="72+  200  270  310  295  360  540  660"
  1199.  
  1200. :FEXCalc
  1201.    fclose 1
  1202.    if (FEXZone="1") FEXPrio=mid(foreign,6,3)
  1203.    if (FEXZone="2") FEXPrio=mid(foreign,11,3)
  1204.    if (FEXZone="3") FEXPrio=mid(foreign,16,3)
  1205.    if (FEXZone="4") FEXPrio=mid(foreign,21,3)
  1206.    if (FEXZone="5") FEXPrio=mid(foreign,26,3)
  1207.    if (FEXZone="6") FEXPrio=mid(foreign,31,3)
  1208.    if (FEXZone="7") FEXPrio=mid(foreign,36,3)
  1209.  
  1210. ;**********************************************************
  1211. ;* Do a lookup from the DHL table called OVERSEAS.DHL     *
  1212. ;**********************************************************
  1213.  
  1214. :DHLCalc
  1215.    if (DHLZone="0") goto ForeignChoice
  1216.    if (totalweight>72) goto DefaultDHL
  1217.    fopen 1,"c:\pcb\gen\overseas.dhl",0,0
  1218.    startnum=1
  1219.  
  1220. :DHLNext
  1221.    fget 1,foreign
  1222.    Error=Ferr(1)
  1223.    if (Error) goto DefaultDHL
  1224.    if (left(foreign,1)=";") goto DHLNext
  1225.    if (Startnum=Totalweight) goto DHLFinish
  1226.    startnum=startnum+1
  1227.    goto DHLNext
  1228.  
  1229. :DefaultDHL
  1230.    Foreign="72+  205  215  220  195  300  380  250  440"
  1231.  
  1232. :DHLFinish
  1233.    fclose 1
  1234.    if (DHLZone="A") DHLPrio=mid(foreign,6,3)
  1235.    if (DHLZone="B") DHLPrio=mid(foreign,11,3)
  1236.    if (DHLZone="C") DHLPrio=mid(foreign,16,3)
  1237.    if (DHLZone="D") DHLPrio=mid(foreign,21,3)
  1238.    if (DHLZone="E") DHLPrio=mid(foreign,26,3)
  1239.    if (DHLZone="F") DHLPrio=mid(foreign,31,3)
  1240.    if (DHLZone="G") DHLPrio=mid(foreign,36,3)
  1241.    IF (DHLZone="H") DHLPrio=mid(foreign,41,3)
  1242.  
  1243. :ForeignChoice
  1244.    println
  1245.    println
  1246.    if (Match) goto SkipNoMatch
  1247.    beep
  1248.    answer="R"
  1249.    println "@X0EDo you want to use the (@X0BD@X0E)efault shipping charges or (@X0BR@X0E)e-enter your Country"
  1250.    inputstr "in a different format in order to find a possible direct match (D/R)",Answer,@X0E,1,"DR",10
  1251.    println "@X0E"
  1252.    if (Answer="D") cls
  1253.    if (Answer="D") goto SkipNoMatch
  1254.  
  1255. :ShipAgain
  1256.    println
  1257.    inputtext "  Ship Country",ShipCountry,@X0E,20
  1258.    cls
  1259.    OutSideUSA=False
  1260.    ShipCountry=Upper(ShipCountry)
  1261.    if (ShipCountry<>"USA") OutSideUSA=True
  1262.    if (ShipCountry="") OutsideUSA=false
  1263.    goto CalcForeign
  1264.  
  1265. :SkipNoMatch
  1266.    print "@X0ETotal shipping weight is @X0F"
  1267.    print TotalWeight
  1268.    println "@X0E pounds.  Available shipping to your area"
  1269.    println "is as follows:"
  1270.    println
  1271.    print "@X0F(1)@X0E  Federal Express International for USD $ @X0F"
  1272.    if (FEXZone="0") println "(Not Available)"
  1273.    if (FEXZone<>"0") print right(FEXPrio,3)
  1274.    if (FEXZone<>"0") println ".00"
  1275.    print "@X0F(2)@X0E  DHL International for ........... USD $ @X0F"
  1276.    if (DHLZone="0") println "(Not Available)"
  1277.    if (DHLZone<>"0") print right(DHLPrio,3)
  1278.    if (DHLZone<>"0") println ".00"
  1279.    if (ShipCountry<>"CANADA") goto SkipCanada
  1280.    if (TotalWeight<=20) CanadaUPS=9+totalweight
  1281.    if (TotalWeight>20 & TotalWeight<31) CanadaUPS=30
  1282.    if (TotalWeight>30) CanadaUPS=totalWeight
  1283.    print "@X0F(3)@X0E  UPS Canada Delivery for ......... USD $ @X0F"
  1284.    print right(CanadaUPS,3)
  1285.    println ".00"
  1286.  
  1287. :SkipCanada
  1288.    println
  1289.    println "@X0AFederal Express@X0E maintains their own Custom's Agents and usually provides"
  1290.    println "@X0B2-3 day service@X0E throughout the world.  @X0ADHL@X0E requires your own Custom's Agent"
  1291.    println "and usually provides @X0B4-5 day service@X0E.  Both FedEx and DHL may not be"
  1292.    println "available in your area.  @X0AUPS@X0E to Canada takes about @X0B5-10@X0E days to arrive"
  1293.    println "depending on custom's delays."
  1294.    println
  1295.    println "@X0DFor all Canadian orders, you will be required to pay GST on package arrival."
  1296.    println "For all overseas orders, you will be responsible for import tariff's (if any)."
  1297.  
  1298. :GetShipAgain
  1299.    println "@X0E"
  1300.    Answer="1"
  1301.    if (left(OverseasShipType,1)="F") Answer="1"
  1302.    if (left(OverseasShipType,1)="D") Answer="2"
  1303.    if (left(OverseasShipType,1)="U") Answer="3"
  1304.    if (ShipCountry<>"CANADA") inputstr "Shipping Method Desired: (1) FedEx, (2) DHL",Answer,@X0E,1,"12",2
  1305.    if (ShipCountry="CANADA") inputstr "Shipping Method Desired: (1) FedEx, (2) DHL, (3) UPS",Answer,@X0E,1,"123",2
  1306.    println
  1307.    if (Answer="") goto GetShipAgain
  1308.    if (Answer="1" & FEXZone="0") goto BadForeign
  1309.    if (Answer="2" & DHLZone="0") goto BadForeign
  1310.    if (Answer="3" & ShipCountry<>"CANADA") goto BadForeign
  1311.    TotalFreight=FEXPrio
  1312.    OverseasShipType="Federal Express"
  1313.    if (Answer="2") Totalfreight=DHLPrio
  1314.    if (Answer="2") OverseasShipType="DHL Overseas"
  1315.    if (Answer="3") TotalFreight=CanadaUPS
  1316.    if (Answer="3") OverseasShipType="UPS Canada"
  1317.    goto ContinueDisplay
  1318.  
  1319. ;**********************************************************
  1320. ;* We are going to require them to enter a valid shipping *
  1321. ;* choice.                                                *
  1322. ;**********************************************************
  1323.  
  1324. :BadForeign
  1325.    beep
  1326.    println
  1327.    println "@X0CYou must choose a valid shipping method!  If you wish to leave us a comment"
  1328.    println "concerning the shipping charges, you will be given the opportunity of doing so"
  1329.    println "at the time you (S)ave your order."
  1330.    println "@X0E"
  1331.    gosub pressakey
  1332.    goto ForeignChoice
  1333.  
  1334. ;***********************************************************
  1335. ;* Now that we have calculated either Domestic or Overseas *
  1336. ;* shipping charges, we'll display the caller's order so   *
  1337. ;* far to them - along with freight charges.               *
  1338. ;***********************************************************
  1339.  
  1340. :ContinueDisplay
  1341.    cls
  1342.    orderplaced=false
  1343.  
  1344. :NoWeight
  1345.    println "@X0EYou have currently placed an order for the following:"
  1346.    println
  1347.    startnum=1
  1348.  
  1349. :CheckAgain
  1350.    if (NumOrders=0) goto DisplayNothing
  1351.    if (OrderArray(StartNum,1)<1) goto IncrementVerify
  1352.    OrderPlaced=True
  1353.    print "@X0F     "
  1354.    print right(NumDisp,2)
  1355.    NumDisp=NumDisp+1
  1356.    println "@X07. ",OrderText(StartNum)
  1357.    SubTotal=SubTotal+OrderArray(Startnum,1)
  1358.  
  1359. :IncrementVerify
  1360.    startnum=startnum+1
  1361.    if (startnum<=NumOrders) goto CheckAgain
  1362.    if (Orderplaced) goto DisplayPrices
  1363.  
  1364. :DisplayNothing
  1365.    println "@X07     Nothing!"
  1366.    println
  1367.    NumOrders=0
  1368.    gosub pressakey
  1369.    command=""
  1370.    return
  1371.  
  1372. :DisplayPrices
  1373.    println
  1374.    if (totalweight=0) goto SkipShip
  1375.    print "@X0F             Sub-Total: USD $ "
  1376.    print "@X07"
  1377.    print right(subtotal,5)
  1378.    println ".00"
  1379.    print "@X0F           S&H Charges: USD $ "
  1380.    print "@X07"
  1381.    print right(TotalFreight,5)
  1382.    println ".00"
  1383.  
  1384. :SkipShip
  1385.    TotalPrice=Subtotal+TotalFreight
  1386.    print "@X0F           Grand Total: USD $ "
  1387.    print "@X07"
  1388.    print right(TotalPrice,5)
  1389.    println ".00"
  1390.    println
  1391.    command=""
  1392.    if (ShipState<>"UT") return
  1393.    if (TotalWeight=0) return
  1394.    println "@X0ASince you are from Utah, we will be adding 6.25% sales tax to"
  1395.    println "your order at the time the credit card is run."
  1396.    println
  1397.    Return
  1398.  
  1399. ;************************************************************
  1400. ;* Get ready to save their order.  First, re-verify it if   *
  1401. ;* they have not already decided to save their order from   *
  1402. ;* the review screen.  If they have, don't redisplay the    *
  1403. ;* verification menu again.                                 *
  1404. ;************************************************************
  1405.  
  1406. :WriteScript
  1407.    Review=False
  1408.    if (NumOrders<>0) goto FinishScript
  1409.    BEEP
  1410.    println
  1411.    println "@X0CNothing has been Ordered!"
  1412.    println
  1413.    gosub pressakey
  1414.    goto Main
  1415.  
  1416. :FinishScript
  1417.    gosub verify
  1418.    println
  1419.    Answer="Y"
  1420.    inputyn "Is the above information correct (Y/N)",Answer,@X0E
  1421.    println
  1422.    if (answer="N") goto Main
  1423.  
  1424. ;***********************************************************
  1425. ;* This label is called when a customer saves their order  *
  1426. ;* direct from the review screen.                          *
  1427. ;***********************************************************
  1428.  
  1429. :SaveNow
  1430.    println
  1431.    Answer="N"
  1432.    println "@X0EBefore actually saving your order, you can leave us two general comment lines"
  1433.    inputyn "@X0Econcerning the placement of this order.  Do you wish to do so (Y/N)",Answer,@X0E
  1434.    if (Answer<>"Y") goto DisplayLegal
  1435.    println
  1436.    inputtext "Comment 1: ",Comment1,@X0E,50
  1437.    println
  1438.    inputtext "Comment 2: ",Comment2,@X0E,50
  1439.    println
  1440.  
  1441. ;*********************************************************************
  1442. ;* Getting ready to save their order, we best tell them that if they *
  1443. ;* are using a stolen credit card we will be unhappy!                *
  1444. ;*********************************************************************
  1445.  
  1446. :DisplayLegal
  1447.    CLS
  1448.    dispfile "c:\pcb\gen\legal.txt",0
  1449.    println
  1450.    print "    @X0FWe will be charging your credit card in the amount of USD $ "
  1451.    print ToTalPrice
  1452.    println ".00"
  1453.    println
  1454.    Answer="Y"
  1455.    inputyn "    Do you agree to this purchase (Y/N)",Answer,@X0E
  1456.    println
  1457.    if (Answer<>"Y") goto AbortScript
  1458.  
  1459. :WriteInfo
  1460.    if (!OnLocal) fputln 0,"            User Info: ",U_CMNT2
  1461.    fputln 0,"        Purchaser S/N: ",SerialNo
  1462.    fputln 0,"      Customer Number: ",CustomerNumber
  1463.    fputln 0,""
  1464.    fputln 0,"     CREDIT CARD INFO."
  1465.    fputln 0,"        Credit Card #: ",CCDisplay
  1466.    fputln 0,"      Expiration Date: ",CCExpireDisplay
  1467.    fputln 0,"    Cardholder's Name: ",CCName
  1468.    fputln 0,"   Cardholder's Phone: ",CCPhone
  1469.    fputln 0,""
  1470.    fputln 0,"  SOLD TO INFORMATION"
  1471.    fputln 0,"          Voice Phone: ",VoicePhone
  1472.    fputln 0,"            FAX Phone: ",FAXPhone
  1473.    fputln 0,"            Purchaser: ",Name
  1474.    if (Company<>"") fputln 0,"              Company: ",Company
  1475.    fputln 0,"              Address: ",Address
  1476.    fputln 0,"       City/State/ZIP: ",City,", ",State,"  ",Zip
  1477.    fputln 0,"              Country: ",Country
  1478.    fputln 0,""
  1479.    if (! ShipDifferent) goto FinishUp
  1480.    fputln 0,"  SHIP TO INFORMATION"
  1481.    fputln 0,"            Ship Name: ",ShipName
  1482.    if (ShipCompany<>"") fputln 0,"         Ship Company: ",ShipCompany
  1483.    fputln 0,"         Ship Address: ",ShipAddress
  1484.    fputln 0,"  Ship City/State/ZIP: ",ShipCity,", ",ShipState,"  ",ShipZip
  1485.    fputln 0,"         Ship Country: ",ShipCountry
  1486.    fputln 0,""
  1487. :FinishUp
  1488.    fputln 0,"PRODUCTS/SERVICES ORDERED"
  1489.    StartNum=1
  1490. :PrnAnother
  1491.    fput 0,"         Product # "
  1492.    fput 0,right(StartNum,2)
  1493.    fputln 0,": ",OrderText(StartNum)
  1494.    startNum=StartNum+1
  1495.    if (StartNum<=NumOrders) goto PrnAnother
  1496.    if (Extended) fputln 0,"         T-Shirt Size: ",TShirtSize
  1497.    fputln 0,""
  1498.    fput 0,"          Ship Weight:  "
  1499.    fput 0,TotalWeight
  1500.    fputln 0," #'s"
  1501.    fput 0,"            Sub-Total: $ "
  1502.    fput 0,right(SubTotal,5)
  1503.    fputln 0,".00"
  1504.    fput 0,"            S&H Total: $ "
  1505.    fput 0,right(TotalFreight,5)
  1506.    fputln 0,".00"
  1507.    fput 0,"          Grand Total: $ "
  1508.    fput 0,right(TotalPrice,5)
  1509.    fputln 0,".00"
  1510.    fput 0,"         Shipping via: "
  1511.    if (OutsideUSA) fputln 0,OverseasShipType
  1512.    if (!OutsideUSA) fputln 0,DomesticShipType
  1513.    fputln 0,""
  1514.    fputln 0,"      Agree to Charge: YES"
  1515.    fputln 0,"      Order Comment 1: ",Comment1
  1516.    fputln 0,"      Order Comment 2: ",Comment2
  1517.    fputln 0,""
  1518.    fputln 0,""
  1519.    fputln 0," Card Authorization #: _______________________"
  1520.    fputln 0,""
  1521.    fputln 0," Authorization Ref. #: _______________________"
  1522.  
  1523. end
  1524. 
  1525.