<%@ LANGUAGE=VBScript %> <% OPTION EXPLICIT %> <% 'on error resume next %> <% Response.Buffer = true Response.CacheControl="no-cache" Response.AddHeader "Pragma","no-cache" Response.Expires=0 %> <% CheckSecurity MgmtUsers,Session("GroupLevel"),"/login.php","desklog.asp" %> <% Dim VSQL,clip,ClipList,quot,strDBPath,vid,SortBy,SortDesc,RecCount,FileCheck,FilePath,FindIt Dim conntemp,I,DelRec_Count,UpRecsCount,UpStat,DelStat,Recs_Deleted,Field,ProjectID,LogID Dim DelFile,FirstProj,EventDate,EventTimeHr,EventTimeMin,EventTimeAMPM Dim TotalAvidHrs,TotalBetas,TotalVHS,TotalAnimHrs,TotalGraphicsHrs Dim DateSearch,FromDate,ToDate,minstr,RowColor,MaxRecords Dim soundfiles(),sndname,sndnamelen,FirstSound,LastEvent,NewEvent,EventLog Dim intPageCount,intRecordCount,intPage,intRecord,intStart,intFinish strDBPath = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/video/db/mbvideo.mdb") quot = Chr(34) RecCount = 0 FirstSound="" LastEvent=0 MaxRecords=50 NewEvent=vbFalse If Request("MaxRec")>1 Then MaxRecords = Request("MaxRec") Session("MaxRec") = MaxRecords Session.Timeout = 100 If NOT IsNull(Request.Cookies("myalertsnd")("LastEvent")) Then LastEvent = CInt(Request.Cookies("myalertsnd")("LastEvent")) 'Response.Write "
Cookie: " & Request.Cookies("LastEvent") 'Response.Write "
Last Event: " & LastEvent 'Response.Write "
Last Read: " & Request.Cookies("lastread") VSQL = "SELECT * FROM DeskLog ORDER By LogDate DESC;" Set vid = Server.CreateObject("ADODB.RecordSet") vid.Open VSQL,strDBPath,adOpenKeyset, adLockPessimistic, adCmdText If vid("LogID") <> LastEvent OR Len(Request("Event")) > 1 Then 'A new event has been posted NewEvent = vbTrue FirstSound="/sounds/" & Request.Cookies("alertsound") Response.Cookies("myalertsnd")("LastEvent")=vid("LogID") 'Store last event log ID in cookie Response.Cookies("myalertsnd").Domain="www.manhattanbureau.com" Response.Cookies("myalertsnd").Path="" Response.Cookies("myalertsnd").Expires=#December 31,2004# 'Response.Write "Saving Cookie: " & vid("LogID") End If 'Response.Write "
CurID: " & vid("LogID") 'Response.Write "
LastID: " & CInt(Request.Cookies("myalertsnd")("LastEvent")) 'Response.Write "
First Sound: " & FirstSound 'Response.Write "
Sound: " & Request.Cookies("myalertsnd")("alertsound") vid.Close %> Desk Log

 

Manhattan Bureau Desk Log

<% EventDate = DateValue(Now()) EventTimeHr = Hour(TimeValue(Now())) If EventTimeHr > 12 Then EventTimeHr = EventTimeHr-12 ElseIf EventTimeHr = 0 Then EventTimeHr = 12 End If EventTimeMin = Minute(TimeValue(Now())) EventTimeAmPm = Right(TimeValue(Now()),2) 'Response.Write EventTimeHr If Len(Request("Event")) > 1 Then 'Entering/editing an event 'Response.Write Request("LogID") LogID = Request("LogID") VSQL = "SELECT * FROM DeskLog WHERE LogID = " & LogID Set vid = Server.CreateObject("ADODB.RecordSet") 'Response.Write VSQL vid.Open VSQL,strDBPath,adOpenKeyset, adLockPessimistic, adCmdText If vid.EOF Then vid.AddNew If IsDate(Request("EventDate")) Then vid("LogDate") = Request("EventDate") & " " & Request("EventTimeHr") & ":" & Request("EventTimeMin") & " " & Request("EventTimeAMPM") vid("Event") = Trim(Request("Event")) vid("ModDate") = Now() vid("EnteredBy") = Session("DBUserID") vid.Update vid.close ElseIf Request.Querystring("LID")>0 Then 'Opening an existing event LogID = Request.QueryString("LID") VSQL = "SELECT * FROM DeskLog WHERE LogID = " & LogID Set vid = Server.CreateObject("ADODB.RecordSet") vid.Open VSQL,strDBPath,adOpenKeyset, adLockPessimistic, adCmdText If NOT vid.EOF Then If IsDate(vid("LogDate")) Then EventDate = DateValue(vid("LogDate")) EventTimeHr = Hour(TimeValue(vid("LogDate"))) If EventTimeHr > 12 Then EventTimeHr = EventTimeHr-12 ElseIf EventTimeHr = 0 Then EventTimeHr = 12 End If EventTimeMin = Minute(TimeValue(vid("LogDate"))) EventTimeAmPm = Right(TimeValue(vid("LogDate")),2) End If EventLog = vid("Event") End If vid.Close ElseIf Len(Request("ButUpdateRecords"))>2 Then 'Updating or deleting records set conntemp=server.createobject("adodb.connection") conntemp.open StrDBPath DelRec_Count=0 UpRecsCount=0 UpStat=0 DelStat=0 'Response.Write "
Count: " & Request.Form.Count For Each Field in Request.Form 'Response.write "
Old: " & Instr(Request.Form(Field),"Old") If Instr(Request.Form(Field),"Old")<=0 OR Instr(Request.Form(Field),"Delete")>0 Then 'Status has been changed If Instr(Request.Form(Field),"Delete") > 0 Then LogID = Replace(Request.Form(Field),"Delete","") If IsNumeric(LogID) Then VSQL = "DELETE * FROM DeskLog WHERE LogID = " & LogID 'Response.Write "
" & VSQL & "
" conntemp.execute(VSQL),Recs_Deleted DelRec_Count=DelRec_Count + Recs_Deleted End If 'Valid LogID End If End If 'Check for updates Next 'Field If DelRec_Count > 0 Then Response.Write "

You Have Deleted " & DelRec_Count & " Records

" If UpRecsCount > 0 Then Response.Write "

You Have Updated " & UpRecsCount & " Records

" conntemp.close set conntemp=nothing End If SortBy = "LogDate DESC,Event,Lastname,Firstname" If Len(Request.QueryString("Srt")) > 0 Then SortBy = Request.QueryString("Srt") If Request.QueryString("Des") = 1 Then SortBy = SortBy & " DESC" End If 'If Len(Request.QueryString) > 0 OR Len(Trim(Request("Gsearch"))) > 0 OR Len(Trim(Request("FromDate"))) > 0 OR Len(Trim(Request("ToDate"))) > 0 Then 'Performing A Search If Len(Trim(Request("Gsearch"))) = 0 Then Session("FindIt") = "" If Len(Request.QueryString) = 0 Then FindIt = Trim(Request("Gsearch")) Session("FindIt") = FindIt FromDate = Trim(Request("FromDate")) ToDate = Trim(Request("ToDate")) If Len(FromDate) <= 1 Then FromDate = "1/1/90" Session("FromDate") = "" Else Session("FromDate") = FromDate End If If Len(ToDate) <= 1 Then ToDate = "1/1/2050" Session("ToDate") = "" Else Session("ToDate") = ToDate End If If Len(ToDate) <= 1 Then ToDate = Date() DateSearch = " (LogDate >= #" & DateValue(FromDate) & "# AND LogDate <= #" & DateValue(ToDate) & "#) AND " Session("DateSearch") = DateSearch Else FindIt = Session("FindIt") 'Remember search criteria when sorting or paging thru records DateSearch = Session("DateSearch") End If 'Response.Write "Find: " & FindIt VSQL = "SELECT * FROM DeskLogInfo WHERE " & DateSearch &_ "((FirstName Like '%" & FindIt & "%') OR " &_ "(LastName Like '%" & FindIt & "%') OR (Event Like '%" & FindIt & "%') OR " &_ "(DeskLog.Notes Like '%" & FindIt & "%')) ORDER BY " & SortBy 'Else 'Session("FindIt") = "" 'VSQL="SELECT * FROM DeskLogInfo ORDER BY " & SortBy 'End If Set vid = Server.CreateObject("ADODB.RecordSet") 'Response.Write VSQL vid.Open VSQL,strDBPath,adOpenKeyset, adLockPessimistic, adCmdText ' For Each I in vid.Fields 'Show all field names for debugging ' Response.Write "
" & I.Name ' Next %>

  Enter Event   

Date

Time

1 Then Response.Write Request.QueryString("LID") Else Response.Write "0"%>">
<% If vid.EOF Then %>

No Logs were found. Please Try Again

<% Else intPage=1 If Request.Querystring("Nav") <> "" Then 'Requesting next or previous page intPage = Request.QueryString("NAV") ElseIf NewEvent Then intPage = 1 End If vid.PageSize = CInt(Session("MaxRec")) vid.CacheSize = vid.PageSize intPageCount = vid.PageCount intRecordCount = vid.RecordCount ' Setup page position in recordset If CInt(intPage) > CInt(intPageCount) Then intPage = intPageCount If CInt(intPage) <= 0 Then intPage = 1 If intRecordCount > 0 Then vid.AbsolutePage = intPage intStart = vid.AbsolutePosition If CInt(intPage) = CInt(intPageCount) Then intFinish = intRecordCount Else intFinish = intStart + (vid.PageSize - 1) End if End If %>

<% ' Set up Previous & Next links If cInt(intPage) > 1 Then %> |< << Prev <% End If %> <% If cInt(intPage) < cInt(intPageCount) Then %> Next >> >| <% End If %>

<% If Session("GroupLevel") = 1 Then 'Allow Admins to delete records %> <% End If %> <% 'Response.Write Request.Cookies("lastread") FOR intRecord = 1 to vid.PageSize If IsDate(vid("LogDate")) Then EventDate = DateValue(vid("LogDate")) EventTimeHr = Hour(TimeValue(vid("LogDate"))) If EventTimeHr > 12 Then EventTimeHr = EventTimeHr-12 ElseIf EventTimeHr = 0 Then EventTimeHr = 12 End If EventTimeMin = Minute(TimeValue(vid("LogDate"))) If EventTimeMin < 10 Then EventTimeMin = "0" & EventTimeMin EventTimeAmPm = Right(TimeValue(vid("LogDate")),2) End If If RecCount/2 = CInt(RecCount/2) Then RowColor = "#FFFFFF" Else RowColor = "#D1FCF0" 'Response.Write "
Read: " & Request.Cookies("lastread") & " Last Msg: " & vid("LogDate") 'Response.Write "
Read: " & Request.Cookies("lastread") & " Last: " & CDate(vid("LogDate")) & " Dif: " & DateDiff("s", CDate(Request.Cookies("lastread")), CDate(vid("LogDate"))) If Len(Request.Cookies("lastread"))>1 Then If DateDiff("s", CDate(Request.Cookies("lastread")), CDate(vid("LogDate"))) > -120 Then 'Unread event 'Response.Write "
Dif: " & DateDiff("s", Request.Cookies("lastread"), vid("LogDate")) 'Response.Write "
Time: " & TimeValue(vid("LogDate")) RowColor = "#FFFF00" End If End If %> <% If Session("GroupLevel") = 1 Then 'Allow Admins to delete records %> <% End If %> <% vid.movenext RecCount = RecCount + 1 If vid.EOF Then Exit for Next 'Record %> <% If Session("GroupLevel") = 1 Then 'Allow Admins to delete records %> <% End If %>
  Time   Event    You are viewing records <%=intStart%> through <%=intFinish%> of <%=intRecordCount%> Poster Print Del
<%=RecCount+intstart%>. <% = Month(EventDate) & "/" & Day(EventDate) & "/" & Right(Year(EventDate),2) & " " & EventTimeHr & ":" & EventTimeMin & " " & EventTimeAMPM%>  "><%=vid("Event")%>  <%=vid("FirstName") & " " & vid("LastName")%>  " onclick="javascript:if(this.checked)myrow<%=RecCount%>.bgColor='#38CD38'; else myrow<%=RecCount%>.bgColor='<%=RowColor%>'"> " onclick="javascript:if(this.checked)myrow<%=RecCount%>.bgColor='#FF0000'; else myrow<%=RecCount%>.bgColor='<%=RowColor%>'">

<% ' Set up Previous & Next links If cInt(intPage) > 1 Then %> |< << Prev <% End If %> <% If cInt(intPage) < cInt(intPageCount) Then %> Next >> >| <% End If %>

   

<% End If ' Any records found %> <% Call ListFolderContents("/sounds",soundfiles) %>

Find

 

From

 

To

 

Rec/Pg

  Alert Sound
">   " onFocus="formtosubmit='searchform';" >   " onFocus="formtosubmit='searchform';" >  

 
"" Then Response.Write Request("Gsearch") Else Response.Write Request.QueryString("Crit")%>"> <% vid.close set vid=nothing set clip=nothing %>