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