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:
65
editpc.asp
65
editpc.asp
@@ -13,9 +13,9 @@
|
||||
theme="bg-theme1"
|
||||
END IF
|
||||
|
||||
' Get and validate pcid parameter
|
||||
' Get and validate machineid parameter (Phase 2: PCs are in machines table)
|
||||
Dim machineid, machineData, strSQL
|
||||
machineid = Request.QueryString("pcid")
|
||||
machineid = Request.QueryString("machineid")
|
||||
|
||||
' Security validation - ensure pcid is numeric
|
||||
If NOT IsNumeric(machineid) OR machineid = "" Then
|
||||
@@ -24,8 +24,8 @@
|
||||
End If
|
||||
|
||||
' Load PC data (pctypeid IS NOT NULL identifies PCs)
|
||||
strSQL = "SELECT m.*, " &_
|
||||
"mo.modelnumber, mo.vendorid AS modelvendorid, mo.machinetypeid, mo.image AS modelimage, " &_
|
||||
strSQL = "SELECT m.*, m.machinetypeid AS pcmachinetypeid, " &_
|
||||
"mo.modelnumber, mo.vendorid AS modelvendorid, mo.machinetypeid AS modelmachinetypeid, mo.image AS modelimage, " &_
|
||||
"v.vendor, " &_
|
||||
"bu.businessunit, " &_
|
||||
"mt.machinetype " &_
|
||||
@@ -34,7 +34,7 @@
|
||||
"LEFT JOIN vendors v ON mo.vendorid = v.vendorid " &_
|
||||
"LEFT JOIN businessunits bu ON m.businessunitid = bu.businessunitid " &_
|
||||
"LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " &_
|
||||
"WHERE m.machineid = ? AND m.pctypeid IS NOT NULL"
|
||||
"WHERE m.machineid = ? AND m.machinetypeid IN (33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43)"
|
||||
|
||||
Dim cmd, rsMachine
|
||||
Set cmd = Server.CreateObject("ADODB.Command")
|
||||
@@ -54,7 +54,7 @@
|
||||
End If
|
||||
|
||||
' Store machine data
|
||||
Dim serialnumber, hostname, machinenumber, modelid, businessunitid, alias, machinenotes, mapleft, maptop
|
||||
Dim serialnumber, hostname, machinenumber, modelid, businessunitid, alias, machinenotes, mapleft, maptop, pcMachineTypeId, currentMachineStatusId
|
||||
serialnumber = "" : If NOT IsNull(rsMachine("serialnumber")) Then serialnumber = rsMachine("serialnumber") & ""
|
||||
hostname = "" : If NOT IsNull(rsMachine("hostname")) Then hostname = rsMachine("hostname") & ""
|
||||
machinenumber = "" : If NOT IsNull(rsMachine("machinenumber")) Then machinenumber = rsMachine("machinenumber") & ""
|
||||
@@ -64,6 +64,8 @@
|
||||
machinenotes = "" : If NOT IsNull(rsMachine("machinenotes")) Then machinenotes = rsMachine("machinenotes") & ""
|
||||
mapleft = "" : If NOT IsNull(rsMachine("mapleft")) Then mapleft = rsMachine("mapleft")
|
||||
maptop = "" : If NOT IsNull(rsMachine("maptop")) Then maptop = rsMachine("maptop")
|
||||
pcMachineTypeId = 0 : If NOT IsNull(rsMachine("pcmachinetypeid")) Then pcMachineTypeId = CLng(rsMachine("pcmachinetypeid"))
|
||||
currentMachineStatusId = "" : If NOT IsNull(rsMachine("machinestatusid")) Then currentMachineStatusId = rsMachine("machinestatusid")
|
||||
|
||||
rsMachine.Close
|
||||
Set rsMachine = Nothing
|
||||
@@ -247,6 +249,25 @@
|
||||
<small class="form-text text-muted">Network hostname for this PC</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="machinestatusid">Machine Status</label>
|
||||
<select class="form-control" id="machinestatusid" name="machinestatusid">
|
||||
<%
|
||||
Dim rsMachineStatus
|
||||
Set rsMachineStatus = objConn.Execute("SELECT machinestatusid, machinestatus FROM machinestatus WHERE isactive = 1 ORDER BY machinestatusid")
|
||||
While Not rsMachineStatus.EOF
|
||||
Dim selectedMachineStatus
|
||||
selectedMachineStatus = ""
|
||||
If CStr(rsMachineStatus("machinestatusid")) = CStr(currentMachineStatusId) Then selectedMachineStatus = " selected"
|
||||
Response.Write("<option value='" & rsMachineStatus("machinestatusid") & "'" & selectedMachineStatus & ">" & Server.HTMLEncode(rsMachineStatus("machinestatus") & "") & "</option>" & vbCrLf)
|
||||
rsMachineStatus.MoveNext
|
||||
Wend
|
||||
rsMachineStatus.Close
|
||||
Set rsMachineStatus = Nothing
|
||||
%>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="modelid">Model <span class="text-danger">*</span></label>
|
||||
<div class="input-group">
|
||||
@@ -566,8 +587,23 @@
|
||||
<select class="form-control" id="controllingpc" name="controllingpc">
|
||||
<option value="">-- None --</option>
|
||||
<%
|
||||
Dim rsControlPCs
|
||||
strSQL = "SELECT machineid, machinenumber, alias FROM machines WHERE pctypeid IS NULL AND isactive = 1 ORDER BY machinenumber ASC"
|
||||
' Filter controlled machines based on PC type
|
||||
' PC - CMM (41) -> CMM equipment (machinetypeid 3)
|
||||
' PC - Wax Trace (42) -> Wax Trace equipment (machinetypeid 5)
|
||||
' PC - Measuring Tool (43) -> Measuring Machine equipment (machinetypeid 23)
|
||||
Dim rsControlPCs, equipmentTypeFilter
|
||||
equipmentTypeFilter = ""
|
||||
Select Case pcMachineTypeId
|
||||
Case 41
|
||||
equipmentTypeFilter = " AND m.machinetypeid = 3" ' CMM
|
||||
Case 42
|
||||
equipmentTypeFilter = " AND m.machinetypeid = 5" ' Wax Trace
|
||||
Case 43
|
||||
equipmentTypeFilter = " AND m.machinetypeid = 23" ' Measuring Machine
|
||||
End Select
|
||||
strSQL = "SELECT m.machineid, m.machinenumber, m.alias FROM machines m " &_
|
||||
"LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid " &_
|
||||
"WHERE m.pctypeid IS NULL AND m.isactive = 1" & equipmentTypeFilter & " ORDER BY m.machinenumber ASC"
|
||||
Set rsControlPCs = objconn.Execute(strSQL)
|
||||
While Not rsControlPCs.EOF
|
||||
Dim controlPCDisplay, selectedControlPC
|
||||
@@ -589,7 +625,18 @@
|
||||
Set rsControlPCs = Nothing
|
||||
%>
|
||||
</select>
|
||||
<small class="form-text text-muted">Select a machine that this PC controls</small>
|
||||
<%
|
||||
' Show filter info for specialized PCs
|
||||
If pcMachineTypeId = 41 Then
|
||||
Response.Write("<small class='form-text text-info'><i class='zmdi zmdi-filter-list'></i> Filtered to CMM equipment only</small>")
|
||||
ElseIf pcMachineTypeId = 42 Then
|
||||
Response.Write("<small class='form-text text-info'><i class='zmdi zmdi-filter-list'></i> Filtered to Wax Trace equipment only</small>")
|
||||
ElseIf pcMachineTypeId = 43 Then
|
||||
Response.Write("<small class='form-text text-info'><i class='zmdi zmdi-filter-list'></i> Filtered to Measuring Machine equipment only</small>")
|
||||
Else
|
||||
Response.Write("<small class='form-text text-muted'>Select a machine that this PC controls</small>")
|
||||
End If
|
||||
%>
|
||||
</div>
|
||||
|
||||
<!-- Dualpath relationships don't typically apply to PCs -->
|
||||
|
||||
Reference in New Issue
Block a user