%
Const DQ=""""
Const SQ="'"
Const ACTION = "a"
Const ACTION_DISPLAY = "d"
Const ACTION_RANK = "r"
Const ACTION_SEARCH = "s"
Const ACTIONURL = "http://www.bycx.com/steam/timeline.asp?a=d&id="
'Sub DoDate()
' Dim day
' day = Date
' WriteLine day
'End Sub
Sub Search(cnDB)
Set rsData = Server.CreateObject("ADODB.Recordset")
rsData.Open "SELECT * from [events] WHERE [events].[body] LIKE " & SQ & "%" & Trim(Request("search")) & "%" & SQ, cnDB, adOpenDynamic, adLockOptimistic
' rsData.Open "SELECT * from [events] WHERE [events].[body] LIKE " & SQ & Trim(Request("search")) & SQ, cnDB, adOpenDynamic, adLockOptimistic
Do Until rsData.EOF
WriteLine "MARTINS MINUTES - " & rsData("date") & " #" & rsData("number") & "
"
WriteLine "" & rsData("title") & "
"
WriteLine "" & rsData("body") & "
"
rsData.MoveNext
Loop
rsData.Close
End Sub
'Sub DisplayMinute(cnDB)
' Set rsData = Server.CreateObject("ADODB.Recordset")
' rsData.Open "SELECT * from [events] WHERE [events].[number] =" & Trim(Request("number")), cnDB, adOpenDynamic, adLockOptimistic
' WriteLine "
| "
' WriteLine "MARTINS MINUTES - " & rsData("date") & " #" & rsData("number") & " "
' WriteLine "" & rsData("title") & " "
' WriteLine "" & "" & rsData("body") & "
"
' WriteLine " | "
' rsData.Close
'End Sub
Sub DisplayMinutes(cnDB)
WriteLine ""
dim rsData 'As ADODB Recordset
dim rsDataPart 'As ADODB Recordset
dim sel ' As integer
dim lasttype ' As interger
dim hn, rank
dim firstday, unload, shop
firstday = Date
if( Request(Action) = ACTION_RANK ) then
rank = TRUE
end if
Set rsData = Server.CreateObject("ADODB.Recordset")
' rsData.Open "SELECT * FROM [fixes] ORDER BY [fixes].[version]
' WHERE [platform] = " & SQ & platform & SQ ,cnDB, adOpenDynamic, readonly
if( Trim(Request("search")) = "" ) then
rsData.Open "SELECT * FROM [events] ORDER BY [events].[date] DESC",cnDB, adOpenDynamic, readonly
searching = FALSE
else
rsData.Open "SELECT * from [events] WHERE [events].[description] LIKE " & SQ & "%" & Trim(Request("search")) & "%" & SQ & " ORDER BY [events].[date] DESC", cnDB, adOpenDynamic, adLockOptimistic
searching = TRUE
end if
WriteLine "| "
' WriteLine "  "
WriteLine ""
WriteLine " "
WriteLine ""
WriteLine "
|
"
WriteLine("")
If( searching = TRUE ) then
WriteLine "Events containing: " & SQ & Request("search") & SQ & " "
end if
Do Until rsData.EOF
if( rsData("description") <> "" ) then
desc = Left( rsData("description"),33)
if( len(Trim(desc)) >= 33 ) then
desc = desc + "...."
end if
if( searching = TRUE ) then
WriteLine "" & rsData("date") & " " & desc & ""
else
WriteLine "" & rsData("date") & " " & desc & ""
end if
if( trim(request("id")) = trim(rsData("id"))) then
WriteLine " "
end if
WriteLine " "
if rsData("id") > hn then
hn = rsData("id")
end if
if (rsData("date") < firstday) then
firstday = rsData("date")
end if
if (rsData("id") = 14) then
unload = rsDAta("date")
end if
if (rsData("id") = 25) then
shop = rsDAta("date")
end if
end if
rsData.movenext
Loop
rsData.Close
WriteLine(" | ")
Dim dn
dn = Trim(request("id"))
if( dn = "" ) then
dn = hn
end if
WriteLine "Steam Locomotive Timeline -" & firstday & " to " & Date & "
"
WriteLine "#16 Total project days = " & Date - firstday & "
"
WriteLine "#16 Total days @ Chelatchie = " & Date - unload & "
"
WriteLine "#16 Total days since first moved into shop = " & Date - shop & "
"
WriteLine "Number of days before opening day = " & CDate(#5/24/2003#) - Date & "
"
WriteLine "Number of days before 4th of July = " & CDate(#7/4/2003#) - Date & "
"
WriteLine "Percentage of days used before opening day since unloading = " & left((Date - unload) / ( CDate(#5/24/2003#) - unload) * 100,2) & "%
"
Set rsData = Server.CreateObject("ADODB.Recordset")
rsData.Open "SELECT * from [events] WHERE [events].[id] =" & dn, cnDB, adOpenDynamic, adLockOptimistic
WriteLine " | "
WriteLine ""
WriteLine " "
if( trim(dn) < trim(hn) ) then
WriteLine " | "
end if
WriteLine " | "
if(NOT rsData.EOF) then
WriteLine "Locomotive# " & rsData("loco") & " - " & rsData("date") & "
"
' WriteLine "" & rsData("title") & "
"
WriteLine rsData("Description") & "
"
' rsData("views") = rsData("views") + 1
if( rsData("photo") <> "" ) then
WriteLine " "
end if
Else
WriteLine "Event # " & dn & " Can't Be Found"
end if
WriteLine " |
"
rsData.Update
rsData.Close
End Sub
Sub DisplayFileDate(path)
Dim fs, f
set fs = CreateObject("Scripting.FileSystemObject")
found = fs.FileExists(path)
if( found ) then
set f = fs.GetFile(path)
Response.Write ""
Response.Write f.DateLastModified & " "
if( DateDiff("d", f.DateLastModified, Date) <= 7 ) then
Response.Write " *NEW*"
end if
Response.Write ""
' Response.Write f.Size
else
Response.Write "Offline"
end if
End Sub
Sub DisplayFileSize(path)
Dim fs, f
set fs = CreateObject("Scripting.FileSystemObject")
found = fs.FileExists(path)
if( found ) then
set f = fs.GetFile(path)
Response.Write ""
Response.Write FormatNumber(f.Size / 1000000,1) & "Meg"
Response.Write ""
' Response.Write f.Size
else
Response.Write "Offline"
end if
End Sub
Function OpenDB(byRef FatalError)
Dim cnDB ' As ADODB.Connection
dim sourcestr ' As string
On Error Resume Next
FatalError = 0
sourcestr = server.MapPath("db/steam.mdb")
Set cnDB = Server.CreateObject("ADODB.Connection")
cnDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & sourcestr
cnDB.Open
If Err.Number <> 0 then
FatalError = 1
End If
Set OpenDB = cnDB
End Function
Sub CloseDB(cnDB)
cnDB.Close
Set cnDB = Nothing
End Sub
Sub WriteLine(strData)
Response.Write strData & vbCrLF
End Sub
Sub WriteComment(strData)
WriteLine ""
End Sub
'Call Main
'Sub Main
Dim cnDB 'As ADODB.Connection
Dim FatalError
Set cnDB = OpenDB(FatalError)
If FatalError then
WriteLine "Database Offline check back soon"
' Response.Redirect "OffLine.html"
' Exit Sub
End If
'End Sub
%>
<%
Select Case Request(Action)
Case ACTION_DISPLAY
DisplayMinutes cnDB
Case ACTION_SEARCH
DisplayMinutes cnDB
Case ACTION_CLEAR
DisplayMinutes cnDB
Case Else
DisplayMinutes cnDB
' DoTime
End Select
%>