%@ language = VBScript %>
AS/400 Customer List Active Server Page
<%
'-----------------------------------------------------------------
'define constants, set intial values for Sort options
'-----------------------------------------------------------------
const Space3 = " "
const sortNone = 0 'first time flag
const sortCus = 1 'sort by Customer number
const sortName = 2 'sort by Contact name
const sortCity = 3 'sort by City
const sortState = 4 'sort by State
const sortZip = 5 'sort by Zip Code
const sortBal = 6 'sort by Balance Dur
const chkChecked = "checked" 'Radio checked
chkCus = vbNullString 'option checked placeholder - Customer number
chkName = vbNullString 'option checked placeholder - Name
chkCity = vbNullString 'option checked placeholder - City
chkState = vbNullString 'option checked placeholder - State
chkZip = vbNullString 'option checked placeholder - Zip
chkBal = vbNullString 'option checked placeholder - Balance Due
'-----------------------------------------------------------------
'determine which Sort Option is selected, format variables
'-----------------------------------------------------------------
SortOption = CInt(Request("optSort")) 'get requested sort selection
select case SortOption
case sortCus
hdgSort = "Sort by Customer Number"
chkCus = chkChecked
OrderBy = "CUSNUM"
case sortName
hdgSort = "Sort by Contact Name"
chkName = chkChecked
OrderBy = "LSTNAM"
case sortCity
hdgSort = "Sort by City"
chkCity = chkChecked
OrderBy = "CITY"
case sortState
hdgSort = "Sort by State"
chkState = chkChecked
OrderBy = "STATE"
case sortZip
hdgSort = "Sort by Zip Code"
chkZip = chkChecked
OrderBy = "ZIPCOD"
case sortBal
hdgSort = "Sort by Balance Due"
chkBal = chkChecked
OrderBy = "BALDUE DESC"
end select
%>
Customer Listing
<%= hdgSort & Space3 & Date & Space3 & Time%>