Add USB checkout system and SSO profile page
New Features: - USB Device checkout/check-in system with barcode scanning - displayusb.asp: List all USB devices with status - addusb.asp: Add new USB devices via barcode scan - checkout_usb.asp/savecheckout_usb.asp: Check out USB to SSO - checkin_usb.asp/savecheckin_usb.asp: Check in with wipe confirmation - usb_history.asp: Full checkout history with filters - api_usb.asp: JSON API for AJAX lookups - displayprofile.asp: SSO profile page showing user info and USB history - Date/time format changed to 12-hour (MM/DD/YYYY h:mm AM/PM) - SSO links in USB history now link to profile page via search Database: - New machinetypeid 44 for USB devices - New usb_checkouts table for tracking checkouts Cleanup: - Removed v2 folder (duplicate/old files) - Removed old debug/test files - Removed completed migration documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
78
tv-dashboard/api_slides.asp
Normal file
78
tv-dashboard/api_slides.asp
Normal file
@@ -0,0 +1,78 @@
|
||||
<%@ Language="VBScript" %>
|
||||
<%
|
||||
Response.ContentType = "application/json"
|
||||
Response.Buffer = True
|
||||
|
||||
' Slides folder path (local to IIS)
|
||||
Dim SLIDES_FOLDER
|
||||
SLIDES_FOLDER = Server.MapPath("slides")
|
||||
|
||||
' Valid image extensions
|
||||
Dim validExtensions
|
||||
validExtensions = Array("jpg", "jpeg", "png", "gif", "bmp", "webp")
|
||||
|
||||
On Error Resume Next
|
||||
|
||||
Dim fso, folder, file, slides, ext, i
|
||||
Set fso = Server.CreateObject("Scripting.FileSystemObject")
|
||||
|
||||
' Check if folder exists
|
||||
If Not fso.FolderExists(SLIDES_FOLDER) Then
|
||||
Response.Write("{""success"":false,""message"":""Slides folder not found""}")
|
||||
Set fso = Nothing
|
||||
Response.End
|
||||
End If
|
||||
|
||||
Set folder = fso.GetFolder(SLIDES_FOLDER)
|
||||
|
||||
' Build array of image files
|
||||
Dim fileList()
|
||||
Dim fileCount
|
||||
fileCount = 0
|
||||
|
||||
For Each file In folder.Files
|
||||
ext = LCase(fso.GetExtensionName(file.Name))
|
||||
|
||||
' Check if valid image extension
|
||||
For i = 0 To UBound(validExtensions)
|
||||
If ext = validExtensions(i) Then
|
||||
ReDim Preserve fileList(fileCount)
|
||||
fileList(fileCount) = file.Name
|
||||
fileCount = fileCount + 1
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
' Sort files alphabetically (simple bubble sort)
|
||||
Dim j, temp
|
||||
If fileCount > 1 Then
|
||||
For i = 0 To fileCount - 2
|
||||
For j = i + 1 To fileCount - 1
|
||||
If fileList(i) > fileList(j) Then
|
||||
temp = fileList(i)
|
||||
fileList(i) = fileList(j)
|
||||
fileList(j) = temp
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
End If
|
||||
|
||||
' Build JSON response
|
||||
Dim json
|
||||
json = "{""success"":true,""basepath"":""slides/"",""slides"":["
|
||||
|
||||
If fileCount > 0 Then
|
||||
For i = 0 To fileCount - 1
|
||||
If i > 0 Then json = json & ","
|
||||
json = json & "{""filename"":""" & fileList(i) & """}"
|
||||
Next
|
||||
End If
|
||||
|
||||
json = json & "]}"
|
||||
|
||||
Response.Write(json)
|
||||
|
||||
Set folder = Nothing
|
||||
Set fso = Nothing
|
||||
%>
|
||||
Reference in New Issue
Block a user