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:
@@ -11,6 +11,7 @@
|
||||
<head>
|
||||
<link rel="stylesheet" href="./style.css" type="text/css">
|
||||
<!--#include file="./includes/sql.asp"-->
|
||||
<!--#include file="./includes/response.asp"-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -54,9 +55,8 @@
|
||||
|
||||
' Validate required field - machineid
|
||||
If machineid = "" Or Not IsNumeric(machineid) Then
|
||||
Response.Write("<div class='alert alert-danger'>Error: Machine ID is required and must be numeric.</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Error: Machine ID is required and must be numeric.", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
@@ -74,9 +74,8 @@
|
||||
rsCheck.Close
|
||||
Set rsCheck = Nothing
|
||||
Set cmdCheck = Nothing
|
||||
Response.Write("<div class='alert alert-danger'>Error: Machine ID " & Server.HTMLEncode(machineid) & " does not exist.</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Error: Machine ID " & Server.HTMLEncode(machineid) & " does not exist.", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
End If
|
||||
@@ -86,40 +85,35 @@
|
||||
|
||||
' Validate ID fields - allow "new" as a valid value
|
||||
If modelid <> "new" And Not IsNumeric(modelid) Then
|
||||
Response.Write("<div class='alert alert-danger'>Error: Invalid model ID.</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Error: Invalid model ID.", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
If businessunitid <> "new" And Not IsNumeric(businessunitid) Then
|
||||
Response.Write("<div class='alert alert-danger'>Error: Invalid business unit ID.</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Error: Invalid business unit ID.", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
' Validate field lengths
|
||||
If Len(alias) > 50 Then
|
||||
Response.Write("<div class='alert alert-danger'>Error: Field length exceeded.</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Error: Field length exceeded.", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
' Handle new business unit creation
|
||||
If businessunitid = "new" Then
|
||||
If Len(newbusinessunit) = 0 Then
|
||||
Response.Write("<div class='alert alert-danger'>New business unit name is required</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "New business unit name is required", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
If Len(newbusinessunit) > 50 Then
|
||||
Response.Write("<div class='alert alert-danger'>Business unit name too long</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Business unit name too long", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
@@ -136,10 +130,9 @@
|
||||
cmdNewBU.Execute
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
Response.Write("<div class='alert alert-danger'>Error creating new business unit: " & Server.HTMLEncode(Err.Description) & "</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
Set cmdNewBU = Nothing
|
||||
objConn.Close
|
||||
ShowError "Error creating new business unit: " & Server.HTMLEncode(Err.Description), "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
@@ -156,55 +149,48 @@
|
||||
' Handle new model creation
|
||||
If modelid = "new" Then
|
||||
If Len(newmodelnumber) = 0 Then
|
||||
Response.Write("<div class='alert alert-danger'>New model number is required</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "New model number is required", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
If Len(newvendorid) = 0 Then
|
||||
Response.Write("<div class='alert alert-danger'>Vendor is required for new model</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Vendor is required for new model", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
' Handle new machine type creation (nested in new model)
|
||||
If newmodelmachinetypeid = "new" Then
|
||||
If Len(newmachinetype) = 0 Then
|
||||
Response.Write("<div class='alert alert-danger'>New machine type name is required</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "New machine type name is required", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
If Len(newfunctionalaccountid) = 0 Then
|
||||
Response.Write("<div class='alert alert-danger'>Functional account is required for new machine type</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Functional account is required for new machine type", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
If Len(newmachinetype) > 50 Or Len(newmachinedescription) > 255 Then
|
||||
Response.Write("<div class='alert alert-danger'>Machine type field length exceeded</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Machine type field length exceeded", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
' Handle new functional account creation (nested in new machine type)
|
||||
If newfunctionalaccountid = "new" Then
|
||||
If Len(newfunctionalaccount) = 0 Then
|
||||
Response.Write("<div class='alert alert-danger'>New functional account name is required</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "New functional account name is required", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
If Len(newfunctionalaccount) > 50 Or Len(newfunctionalaccountdescription) > 255 Then
|
||||
Response.Write("<div class='alert alert-danger'>Functional account field length exceeded</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Functional account field length exceeded", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
@@ -228,10 +214,9 @@
|
||||
cmdNewFA.Execute
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
Response.Write("<div class='alert alert-danger'>Error creating new functional account: " & Server.HTMLEncode(Err.Description) & "</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
Set cmdNewFA = Nothing
|
||||
objConn.Close
|
||||
ShowError "Error creating new functional account: " & Server.HTMLEncode(Err.Description), "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
@@ -267,10 +252,9 @@
|
||||
cmdNewMT.Execute
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
Response.Write("<div class='alert alert-danger'>Error creating new machine type: " & Server.HTMLEncode(Err.Description) & "</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
Set cmdNewMT = Nothing
|
||||
objConn.Close
|
||||
ShowError "Error creating new machine type: " & Server.HTMLEncode(Err.Description), "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
@@ -285,32 +269,28 @@
|
||||
End If
|
||||
|
||||
If Len(newmodelmachinetypeid) = 0 Or Not IsNumeric(newmodelmachinetypeid) Then
|
||||
Response.Write("<div class='alert alert-danger'>Machine type is required for new model</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Machine type is required for new model", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
If Len(newmodelnumber) > 50 Or Len(newmodelimage) > 100 Then
|
||||
Response.Write("<div class='alert alert-danger'>Model field length exceeded</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Model field length exceeded", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
' Handle new vendor creation (nested)
|
||||
If newvendorid = "new" Then
|
||||
If Len(newvendorname) = 0 Then
|
||||
Response.Write("<div class='alert alert-danger'>New vendor name is required</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "New vendor name is required", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
If Len(newvendorname) > 50 Then
|
||||
Response.Write("<div class='alert alert-danger'>Vendor name too long</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Vendor name too long", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
@@ -327,10 +307,9 @@
|
||||
cmdNewVendor.Execute
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
Response.Write("<div class='alert alert-danger'>Error creating new vendor: " & Server.HTMLEncode(Err.Description) & "</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
Set cmdNewVendor = Nothing
|
||||
objConn.Close
|
||||
ShowError "Error creating new vendor: " & Server.HTMLEncode(Err.Description), "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
@@ -368,10 +347,9 @@
|
||||
cmdNewModel.Execute
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
Response.Write("<div class='alert alert-danger'>Error creating new model: " & Server.HTMLEncode(Err.Description) & "</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
Set cmdNewModel = Nothing
|
||||
objConn.Close
|
||||
ShowError "Error creating new model: " & Server.HTMLEncode(Err.Description), "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
@@ -422,10 +400,9 @@
|
||||
cmdMachine.Execute
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
Response.Write("<div class='alert alert-danger'>Error updating machine: " & Server.HTMLEncode(Err.Description) & "</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
Set cmdMachine = Nothing
|
||||
objConn.Close
|
||||
ShowError "Error updating machine: " & Server.HTMLEncode(Err.Description), "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
Set cmdMachine = Nothing
|
||||
@@ -638,16 +615,14 @@
|
||||
newthirdpartyvendorname = Trim(Request.Form("newthirdpartyvendorname"))
|
||||
|
||||
If Len(newthirdpartyvendorname) = 0 Then
|
||||
Response.Write("<div class='alert alert-danger'>New third party vendor name is required</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "New third party vendor name is required", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
If Len(newthirdpartyvendorname) > 50 Then
|
||||
Response.Write("<div class='alert alert-danger'>Third party vendor name too long</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Third party vendor name too long", "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
@@ -664,10 +639,9 @@
|
||||
cmdNewTPVendor.Execute
|
||||
|
||||
If Err.Number <> 0 Then
|
||||
Response.Write("<div class='alert alert-danger'>Error creating new third party vendor: " & Server.HTMLEncode(Err.Description) & "</div>")
|
||||
Response.Write("<a href='javascript:history.back()'>Go back</a>")
|
||||
Set cmdNewTPVendor = Nothing
|
||||
objConn.Close
|
||||
ShowError "Error creating new third party vendor: " & Server.HTMLEncode(Err.Description), "editdevice.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
|
||||
Reference in New Issue
Block a user