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

@@ -10,6 +10,7 @@
<head>
<link rel="stylesheet" href="./style.css" type="text/css">
<!--#include file="./includes/sql.asp"-->
<!--#include file="./includes/response.asp"-->
</head>
<body>
@@ -38,47 +39,41 @@
' Validate required fields
If modelnumber = "" Then
Response.Write("<div class='alert alert-danger'>Error: Model number is required.</div>")
Response.Write("<a href='addmodel.asp'>Go back</a>")
objConn.Close
ShowError "Model number is required.", "addmodel.asp"
Response.End
End If
' Validate field lengths
If Len(modelnumber) > 255 Then
Response.Write("<div class='alert alert-danger'>Error: Model number too long.</div>")
Response.Write("<a href='addmodel.asp'>Go back</a>")
objConn.Close
ShowError "Model number too long.", "addmodel.asp"
Response.End
End If
If Len(notes) > 255 Then
Response.Write("<div class='alert alert-danger'>Error: Notes too long.</div>")
Response.Write("<a href='addmodel.asp'>Go back</a>")
objConn.Close
ShowError "Notes too long.", "addmodel.asp"
Response.End
End If
If Len(documentationpath) > 255 Then
Response.Write("<div class='alert alert-danger'>Error: Documentation path too long.</div>")
Response.Write("<a href='addmodel.asp'>Go back</a>")
objConn.Close
ShowError "Documentation path too long.", "addmodel.asp"
Response.End
End If
' Check if we need to create a new vendor first
If vendorid = "new" Then
If newvendorname = "" Then
Response.Write("<div class='alert alert-danger'>Error: Manufacturer name is required when adding a new manufacturer.</div>")
Response.Write("<a href='addmodel.asp'>Go back</a>")
objConn.Close
ShowError "Manufacturer name is required when adding a new manufacturer.", "addmodel.asp"
Response.End
End If
If Len(newvendorname) > 50 Then
Response.Write("<div class='alert alert-danger'>Error: Manufacturer name too long.</div>")
Response.Write("<a href='addmodel.asp'>Go back</a>")
objConn.Close
ShowError "Manufacturer name too long.", "addmodel.asp"
Response.End
End If
@@ -97,9 +92,8 @@
rsCheck.Close
Set rsCheck = Nothing
Set cmdCheck = Nothing
Response.Write("<div class='alert alert-danger'>Error: Manufacturer '" & Server.HTMLEncode(Request.Form("newvendorname")) & "' already exists.</div>")
Response.Write("<a href='addmodel.asp'>Go back</a>")
objConn.Close
ShowError "Manufacturer '" & Server.HTMLEncode(Request.Form("newvendorname")) & "' already exists.", "addmodel.asp"
Response.End
End If
End If
@@ -130,10 +124,9 @@
cmdVendor.Execute
If Err.Number <> 0 Then
Response.Write("<div class='alert alert-danger'>Error creating manufacturer: " & Server.HTMLEncode(Err.Description) & "</div>")
Response.Write("<a href='addmodel.asp'>Go back</a>")
Set cmdVendor = Nothing
objConn.Close
ShowError "Error creating manufacturer: " & Server.HTMLEncode(Err.Description), "addmodel.asp"
Response.End
End If
@@ -152,9 +145,8 @@
Else
' Validate existing vendor ID
If Not IsNumeric(vendorid) Or CLng(vendorid) < 1 Then
Response.Write("<div class='alert alert-danger'>Error: Invalid manufacturer ID.</div>")
Response.Write("<a href='addmodel.asp'>Go back</a>")
objConn.Close
ShowError "Invalid manufacturer ID.", "addmodel.asp"
Response.End
End If
End If
@@ -199,9 +191,8 @@
rsCheck.Close
Set rsCheck = Nothing
Set cmdCheck = Nothing
Response.Write("<div class='alert alert-danger'>Error: Model '" & Server.HTMLEncode(Request.Form("modelnumber")) & "' already exists for this manufacturer.</div>")
Response.Write("<a href='addmodel.asp'>Go back</a>")
objConn.Close
ShowError "Model '" & Server.HTMLEncode(Request.Form("modelnumber")) & "' already exists for this manufacturer.", "addmodel.asp"
Response.End
End If
End If
@@ -226,10 +217,9 @@
cmdModel.Execute
If Err.Number <> 0 Then
Response.Write("<div class='alert alert-danger'>Error: " & Server.HTMLEncode(Err.Description) & "</div>")
Response.Write("<a href='addmodel.asp'>Go back</a>")
Set cmdModel = Nothing
objConn.Close
ShowError Server.HTMLEncode(Err.Description), "addmodel.asp"
Response.End
End If
@@ -250,14 +240,9 @@
objConn.Close
If newModelId > 0 Then
Response.Write("<div class='alert alert-success'><i class='zmdi zmdi-check'></i> Model added successfully!</div>")
Response.Write("<p>Model '" & Server.HTMLEncode(Request.Form("modelnumber")) & "' has been added.</p>")
Response.Write("<p><a href='addmodel.asp' class='btn btn-primary'>Add Another Model</a> ")
Response.Write("<a href='addprinter.asp' class='btn btn-secondary'>Add Printer</a> ")
Response.Write("<a href='addmachine.asp' class='btn btn-secondary'>Add Machine</a></p>")
ShowSuccess "Model '" & Server.HTMLEncode(Request.Form("modelnumber")) & "' added successfully.", "addmodel.asp", "add another"
Else
Response.Write("<div class='alert alert-danger'>Error: Model was not added successfully.</div>")
Response.Write("<a href='addmodel.asp'>Go back</a>")
ShowError "Model was not added successfully.", "addmodel.asp"
End If
%>
</div>