<% logout=Request.QueryString("logout") if (logout="true") then session.abandon response.write "

You are logged out. Login again or go to www.longrifle.ws


" response.end end if CheckSession() 'Connect to Database set conntemp=server.createobject("adodb.connection") conntemp.ConnectionTimeout = 20 conntemp.open myDSN if (session("securitylevel")="ShowcaseAdmin") then response.write ""+vbcrlf response.write ""+vbcrlf response.write "" response.write "

Welcome, "&session("name")&"

Logout

"+vbcrlf mySQL="SELECT ID, Title, Description, Price FROM ShowcaseItems;"'ORDER BY LastName;" else 'Regular Showcase User 'Determine number of listings and limit to 5 listinglimit=5 'mySQL="SELECT COUNT(*) AS intTotal FROM ShowcaseItems WHERE ShowcaseUserID="&session("userid")&";" mySQL="SELECT * FROM ShowcaseItems WHERE ShowcaseUserID="&session("userid")&";" set rstemp=conntemp.execute(mySQL) DIM iRecordCount iRecordCount = 0 DO WHILE NOT rstemp.EOF iRecordCount = iRecordCount + 1 rstemp.MoveNext Loop howmanyrecs=iRecordCount 'howmanyrecs=rstemp("intTotal") response.write ""+vbcrlf response.write ""+vbcrlf response.write ""+vbcrlf 'response.write ""+vbcrlf response.write "

Welcome, "&session("name")&"

" if (howmanyrecs < listinglimit) then response.write "Add an item to the ""for sale"" section on the CLA Website. (Limit is 5 items.)" else response.write "There is now a posting limit of 5 items.
You must delete item(s) if you want to post a new one."+vbcrlf end if response.write "

New Feature: Now you can mark your items as sold! When updating an item, simply click the Yes option next to ""Sold"".

"+vbcrlf mySQL="SELECT ID, Title, Description, Price FROM ShowcaseItems WHERE ShowcaseUserID="&session("userid")&";"'ORDER BY LastName;" end if response.write ""+vbcrlf set rstemp=conntemp.execute(mySQL) 'Put Headings On The Table of Field Names For each whatever in rstemp.fields hdrfield=whatever.name If whatever.name = "ID" then hdrfield="" End if response.write ""+vbcrlf Next response.write ""+vbcrlf counter=0 'Grab all the records DO UNTIL rstemp.eof if bgcounter=0 then bgcolor=row1bgcolor bgcounter=1 else bgcolor=row2bgcolor bgcounter=0 end if response.write ""+vbcrlf for each whatever in rstemp.fields counter=counter+1 thisfield=whatever.value if isnull(thisfield) then thisfield=shownull if trim(thisfield)="" then thisfield=showblank if whatever.name="ID" then thisfield="Edit | Delete"'addoredit.asp?Option=" & whatever.value & "&addoredit=deleteitem>Delete" elseif whatever.name="Price" then thisfield=FormatCurrency(thisfield,2) end if response.write ""+vbcrlf next response.write ""+vbcrlf rstemp.movenext LOOP if counter=0 then response.write ""+vbcrlf end if rstemp.close set rstemp=nothing conntemp.close set conntemp=nothing response.write "
" + hdrfield + "
"& thisfield & "
You do not have any listings currently in the showcase.

"+vbcrlf response.write ""+vbcrlf %>