|

|
|
<%
' get calibers '
strSql = ""
strSql = strSql & "SELECT "
strSql = strSql & "* "
strSql = strSql & "FROM "
strSql = strSql & "tblCaliber "
strSql = strSql & "WHERE "
if request.querystring("c") = "handgun" then
strSql = strSql & "caliberType = 'Handgun'"
else
strSql = strSql & "caliberType = 'Rifle'"
end if
strSql = strSql & "ORDER BY caliberDiameter"
set rsCalibers = ConnBallistics.Execute(strSql)
theCaliberCount = 0
if not rsCalibers.eof then
do while not rsCalibers.eof
strSql = ""
strSql = strSql & "SELECT "
strSql = strSql & "CAR.* "
strSql = strSql & "FROM "
strSql = strSql & "tblCartridge CAR, tblGrain GR "
strSql = strSql & "WHERE "
strSql = strSql & "CAR.caliberID = " & rsCalibers("caliberID") & " AND "
strSql = strSql & "GR.cartridgeID = CAR.cartridgeID"
set rsCartridges = ConnBallistics.Execute(strSql)
if not rsCartridges.eof then theCaliberCount = theCaliberCount + 1
set rsCartridges = nothing
rsCalibers.moveNext
loop
theLeftColumnCount = cint(theCaliberCount / 2)
if theLeftColumnCount <> cint(theCaliberCount / 2) then theLeftColumnCount = theLeftColumnCount + 1
theRightColumnCount = theCaliberCount - theLeftColumnCount
%>
<% if theLeftColumnCount > 0 then %>

|

|

|
<%
rsCalibers.moveFirst
for theCounter = 1 to theLeftColumnCount
strSql = ""
strSql = strSql & "SELECT "
strSql = strSql & "CAR.cartridgeID, CAR.cartridgeName, CAR.cartridgeStatus, "
strSql = strSql & "GR.grainID, GR.GrainWeight, GR.grainStatus "
strSql = strSql & "FROM "
strSql = strSql & "tblCartridge CAR, tblGrain GR "
strSql = strSql & "WHERE "
strSql = strSql & "CAR.caliberID = " & rsCalibers("caliberID") & " AND "
strSql = strSql & "GR.cartridgeID = CAR.cartridgeID "
strSql = strSql & "ORDER BY cartridgeName, grainWeight"
set rsCartridges = ConnBallistics.Execute(strSql)
if rsCartridges.eof then
do while rsCartridges.eof
rsCalibers.moveNext
strSql = ""
strSql = strSql & "SELECT "
strSql = strSql & "CAR.cartridgeID, CAR.cartridgeName, CAR.cartridgeStatus, "
strSql = strSql & "GR.grainID, GR.GrainWeight, GR.grainStatus "
strSql = strSql & "FROM "
strSql = strSql & "tblCartridge CAR, tblGrain GR "
strSql = strSql & "WHERE "
strSql = strSql & "CAR.caliberID = " & rsCalibers("caliberID") & " AND "
strSql = strSql & "GR.cartridgeID = CAR.cartridgeID "
strSql = strSql & "ORDER BY cartridgeName, grainWeight"
set rsCartridges = ConnBallistics.Execute(strSql)
loop
end if
%>
<%= rsCalibers("caliberName") %>
|
<%
theCurrentCartridge = ""
do while not rsCartridges.eof
if cstr(rsCartridges("cartridgeName")) <> cstr(theCurrentCartridge) then
theCurrentCartridge = rsCartridges("cartridgeName")
%>
|
<%= theCurrentCartridge %><% if rsCartridges("cartridgeStatus") = "NEW!" then %> NEW!<% end if %>
|
<%
end if
%>
|
"><%= rsCartridges("grainWeight") %> Grain<% if rsCartridges("grainStatus") = "NEW!" then %> NEW!<% end if %>
|
<%
rsCartridges.moveNext
loop
%>

|
<%
rsCalibers.moveNext
next
%>
<% else %>

<% end if %>
|
|
<% if theRightColumnCount > 0 then %>

|

|

|
<%
do while not rsCalibers.eof
' get cartridges '
strSql = ""
strSql = strSql & "SELECT "
strSql = strSql & "CAR.cartridgeID, CAR.cartridgeName, CAR.cartridgeStatus, "
strSql = strSql & "GR.grainID, GR.GrainWeight, GR.grainStatus "
strSql = strSql & "FROM "
strSql = strSql & "tblCartridge CAR, tblGrain GR "
strSql = strSql & "WHERE "
strSql = strSql & "CAR.caliberID = " & rsCalibers("caliberID") & " AND "
strSql = strSql & "GR.cartridgeID = CAR.cartridgeID "
strSql = strSql & "ORDER BY cartridgeName, grainWeight"
set rsCartridges = ConnBallistics.Execute(strSql)
if not rsCartridges.eof then
%>
<%= rsCalibers("caliberName") %>
|
<%
theCurrentCartridge = ""
do while not rsCartridges.eof
if cstr(rsCartridges("cartridgeName")) <> cstr(theCurrentCartridge) then
theCurrentCartridge = rsCartridges("cartridgeName")
%>
|
<%= theCurrentCartridge %><% if rsCartridges("cartridgeStatus") = "NEW!" then %> NEW!<% end if %>
|
<%
end if
%>
|
"><%= rsCartridges("grainWeight") %> Grain<% if rsCartridges("grainStatus") = "NEW!" then %> NEW!<% end if %>
|
<%
rsCartridges.moveNext
loop
%>

|
<%
end if
rsCalibers.moveNext
loop
%>
<% else %>

<% end if %>
<%
end if
%>
|
|

|