<%
DIM addvenu, adddate, addlocation, addcost, addmap, addwith, addflyer, addspecial, processtype, editid, ShowConn, rsList, strSQL, deleteid
deleteid = Request.QueryString("deleteid")
addvenu = Request.Form("venu")
adddate = Request.Form("fdate")
addlocation = Request.Form("location")
addcost = Request.Form("cost")
addmap = Request.Form("map")
addwith = Request.Form("with")
addflyer = Request.Form("flyer")
addspecial = Request.Form("special")
processtype = Request.Form("type")
editid = Request.Form("editid")
IF addvenu = "" THEN addvenu = "TBA"
IF adddate = "" THEN adddate = "1/1/01"
IF addlocation = "" THEN addlocation = "TBA"
IF addcost = "" THEN addcost = "TBA"
IF addmap = "" THEN addmap = "TBA"
IF addwith = "" THEN addwith = "TBA"
IF addflyer = "" THEN addflyer = "NONE"
IF addspecial = "" THEN addspecial = "TBA"
'******** DELETE *********
IF deleteid <> "" THEN
Response.Write "RECORD DELETED. ID: " & deleteid
Response.Write "
This page will update automatically or you may return to the Admin Page by clicking here."
Set ShowConn = Server.CreateObject("ADODB.Connection")
ShowConn.open info_db
Set rsList = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM showdates WHERE id = " & deleteid
rsList.Open strSQL, ShowConn, 1, 3, &H0001
rsList.delete
rslist.Close
Set rsList = Nothing
ShowConn.Close
Set ShowConn = Nothing
ELSE
'********* ADD RECORD *******
IF processtype = "adddate" THEN
Set ShowConn = Server.CreateObject("ADODB.Connection")
ShowConn.open info_db
Set rsList = Server.CreateObject("ADODB.Recordset")
strSQL = "showdates"
rsList.Open strSQL, ShowConn, 1, 3, &H0002
rsList.AddNew
rsList("venu") = addvenu
rsList("showdate") = adddate
rsList("location") = addlocation
rsList("cost") = addcost
rsList("with") = addwith
rsList("map") = addmap
rsList("special") = addspecial
rsList("flyer") = addflyer
rsList.Update
rslist.Close
Set rsList = Nothing
ShowConn.Close
Set ShowConn = Nothing
%>The Following Information Has been added to the database:
Date: <%=adddate%>
Venue: <%=addvenu%>
Location: <%=addlocation%>
Admission Cost: <%=addcost%>
Map: <%=addmap%>
Playing with: <%=addwith%>
Flyer Available: <%=addflyer%>
Special Information: <%=addspecial%>
<%
Response.Write "
This page will update automatically or you may return to the Admin Page by clicking here."
ELSE
'*********** EDIT RECORD ***********
Set ShowConn = Server.CreateObject("ADODB.Connection")
ShowConn.open info_db
Set rsList = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM showdates WHERE id = " & editid
rsList.Open strSQL, ShowConn, 1, 3, &H0001
'rsList.AddNew
rsList("venu") = addvenu
rsList("showdate") = adddate
rsList("location") = addlocation
rsList("cost") = addcost
rsList("with") = addwith
rsList("map") = addmap
rsList("special") = addspecial
rsList("flyer") = addflyer
rsList.Update
rslist.Close
Set rsList = Nothing
ShowConn.Close
Set ShowConn = Nothing
%>The Following Information Has been added to the database:
Date: <%=adddate%>
Venue: <%=addvenu%>
Location: <%=addlocation%>
Admission Cost: <%=addcost%>
Map: <%=addmap%>
Playing with: <%=addwith%>
Flyer Available: <%=addflyer%>
Special Information: <%=addspecial%>
<%
Response.Write "
This page will update automatically or you may return to the Admin Page by clicking here."
END IF
END IF%>