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:
cproudlock
2025-12-07 11:16:14 -05:00
parent c7834d4b99
commit 65b622c361
1061 changed files with 19034 additions and 213120 deletions

View File

@@ -7,9 +7,10 @@
'=============================================================================
%>
<!--#include file="./includes/sql.asp"-->
<!--#include file="./includes/response.asp"-->
<%
' Get form inputs
Dim notificationid, notification, ticketnumber, starttime, endtime, isactive, isshopfloor, notificationtypeid, businessunitid
Dim notificationid, notification, ticketnumber, starttime, endtime, isactive, isshopfloor, notificationtypeid, businessunitid, appid
notificationid = Trim(Request.Form("notificationid"))
notification = Trim(Request.Form("notification"))
ticketnumber = Trim(Request.Form("ticketnumber"))
@@ -17,6 +18,7 @@ starttime = Trim(Request.Form("starttime"))
endtime = Trim(Request.Form("endtime"))
notificationtypeid = Trim(Request.Form("notificationtypeid"))
businessunitid = Trim(Request.Form("businessunitid"))
appid = Trim(Request.Form("appid"))
' Handle checkbox - if the hidden field is submitted but checkbox isn't, it means unchecked
If Request.Form("isactive_submitted") = "1" Then
@@ -52,8 +54,8 @@ End If
' Validate
If Not IsNumeric(notificationid) Or CLng(notificationid) < 1 Then
Response.Write("Invalid notification ID")
objConn.Close
ShowError "Invalid notification ID.", "displaynotifications.asp"
Response.End
End If
@@ -64,14 +66,14 @@ End If
' Validate required fields (endtime is now optional)
If Len(notification) = 0 Or Len(starttime) = 0 Then
Response.Write("Required fields missing")
objConn.Close
ShowError "Required fields missing.", "editnotification.asp?notificationid=" & notificationid
Response.End
End If
If Len(notification) > 500 Or Len(ticketnumber) > 50 Then
Response.Write("Field length exceeded")
objConn.Close
ShowError "Field length exceeded.", "editnotification.asp?notificationid=" & notificationid
Response.End
End If
@@ -96,9 +98,17 @@ Else
businessunitValue = CLng(businessunitid)
End If
' Handle optional appid - NULL means not linked to an application
Dim appidValue
If appid = "" Or Not IsNumeric(appid) Then
appidValue = Null
Else
appidValue = CLng(appid)
End If
' UPDATE using parameterized query
Dim strSQL, cmdUpdate
strSQL = "UPDATE notifications SET notificationtypeid = ?, businessunitid = ?, notification = ?, ticketnumber = ?, starttime = ?, endtime = ?, isactive = ?, isshopfloor = ? WHERE notificationid = ?"
strSQL = "UPDATE notifications SET notificationtypeid = ?, businessunitid = ?, appid = ?, notification = ?, ticketnumber = ?, starttime = ?, endtime = ?, isactive = ?, isshopfloor = ? WHERE notificationid = ?"
Set cmdUpdate = Server.CreateObject("ADODB.Command")
cmdUpdate.ActiveConnection = objConn
cmdUpdate.CommandText = strSQL
@@ -109,6 +119,11 @@ If IsNull(businessunitValue) Then
Else
cmdUpdate.Parameters.Append cmdUpdate.CreateParameter("@businessunitid", 3, 1, , businessunitValue)
End If
If IsNull(appidValue) Then
cmdUpdate.Parameters.Append cmdUpdate.CreateParameter("@appid", 2, 1, , Null)
Else
cmdUpdate.Parameters.Append cmdUpdate.CreateParameter("@appid", 2, 1, , appidValue)
End If
cmdUpdate.Parameters.Append cmdUpdate.CreateParameter("@notification", 200, 1, 500, notification)
cmdUpdate.Parameters.Append cmdUpdate.CreateParameter("@ticketnumber", 200, 1, 50, ticketnumber)
cmdUpdate.Parameters.Append cmdUpdate.CreateParameter("@starttime", 135, 1, , starttime)
@@ -127,10 +142,12 @@ cmdUpdate.Execute
If Err.Number = 0 Then
Set cmdUpdate = Nothing
objConn.Close
Response.Redirect("displaynotifications.asp")
ShowSuccess "Notification updated successfully.", "displaynotifications.asp", "notifications"
Else
Response.Write("Error: " & Server.HTMLEncode(Err.Description))
Dim updateErr
updateErr = Err.Description
Set cmdUpdate = Nothing
objConn.Close
ShowError "Error: " & Server.HTMLEncode(updateErr), "editnotification.asp?notificationid=" & notificationid
End If
%>