<% theme = Request.Cookies("theme") IF theme = "" THEN theme="bg-theme1" END IF %>
<% Dim strSQL, rs strSQL = "SELECT n.*, nt.typename, nt.typecolor, bu.businessunit, " & _ "TIMESTAMPDIFF(MINUTE, n.endtime, NOW()) as minutes_since_end, " & _ "CASE " & _ " WHEN n.endtime IS NOT NULL AND n.endtime < NOW() THEN 1 " & _ " ELSE 0 " & _ "END as is_complete " & _ "FROM notifications n " & _ "LEFT JOIN notificationtypes nt ON n.notificationtypeid = nt.notificationtypeid " & _ "LEFT JOIN businessunits bu ON n.businessunitid = bu.businessunitid " & _ "WHERE n.isactive = 1 OR " & _ " (n.isactive = 0 AND n.endtime IS NOT NULL AND " & _ " DATE_ADD(n.endtime, INTERVAL 30 MINUTE) >= NOW()) " & _ "ORDER BY n.notificationid DESC" Set rs = objconn.Execute(strSQL) If rs.EOF Then Response.Write("") Else Do While Not rs.EOF Dim statusText, statusClass, typeText, typeColor, rowOpacity, rowStyle If CBool(rs("isactive")) = True Then statusText = "Active" statusClass = "success" Else statusText = "Inactive" statusClass = "secondary" End If ' Calculate opacity for completed notifications (fade over 30 minutes) rowOpacity = 1.0 If rs("is_complete") = 1 And Not IsNull(rs("minutes_since_end")) Then ' Fade from 1.0 to 0.5 over 30 minutes Dim minutesSinceEnd minutesSinceEnd = CDbl(rs("minutes_since_end")) If minutesSinceEnd >= 0 Then rowOpacity = 1.0 - (minutesSinceEnd / 30) * 0.5 If rowOpacity < 0.5 Then rowOpacity = 0.5 End If statusText = "Complete" statusClass = "info" End If ' Get notification type info If IsNull(rs("typename")) Or rs("typename") = "" Then typeText = "TBD" typeColor = "secondary" Else typeText = rs("typename") typeColor = rs("typecolor") End If ' Get business unit info Dim businessUnitText If IsNull(rs("businessunit")) Or rs("businessunit") = "" Then businessUnitText = "All" Else businessUnitText = Server.HTMLEncode(rs("businessunit")) End If ' Apply opacity style rowStyle = "opacity: " & rowOpacity & ";" Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") Response.Write("") ' Shopfloor Dashboard column Dim shopfloorText, shopfloorIcon If CBool(rs("isshopfloor")) = True Then shopfloorText = "Yes" shopfloorIcon = "" Else shopfloorText = "No" shopfloorIcon = "" End If Response.Write("") Response.Write("") Response.Write("") rs.MoveNext Loop End If rs.Close Set rs = Nothing objConn.Close %>
Message Type Business Unit Ticket Start Time End Time Status Shopfloor Actions
No notifications found.
" & Server.HTMLEncode(rs("notification") & "") & "" & typeText & "" & businessUnitText & "" & Server.HTMLEncode(rs("ticketnumber") & "") & "" & rs("starttime") & "" & rs("endtime") & "" & statusText & "" & shopfloorIcon & "") Response.Write(" ") If CBool(rs("isactive")) = True Then Response.Write("") Else Response.Write("") End If Response.Write("