From 08ffa4ba36d72cc27bcdcac7e8cc7402c75b3054 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Fri, 17 Apr 2026 12:06:28 -0400 Subject: [PATCH] Add displaylocations, location/inspection migrations, UI refinements - New displaylocations.asp (production location listing) - 3 new SQL migrations: inspection machine type, location relationship types, pctype inspection update - displaymachine.asp / printbadge.asp substantial rework - editmachine/editpc/savemachineedit: ~50 line additions each - Dashboard index.html + tv-dashboard tweaks - .gitignore: block database-backup-*.sql, *.bak, *.pdf Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitignore | 10 + CLAUDE.md | 2 +- addmodel.asp | 16 +- api.asp | 28 +- displaylocations.asp | 353 ++++++++++++++++++++++++ displaymachine.asp | 309 +++++++++++++-------- displaypc.asp | 42 +-- editmachine.asp | 54 +++- editpc.asp | 54 +++- includes/config.asp | Bin 6965 -> 6984 bytes includes/config.asp.example | 2 +- includes/leftsidebar.asp | 1 + machineedit.asp | 52 ++++ pcmachinerelationships.asp | 28 +- printbadge.asp | 77 ++++-- savemachineedit.asp | 28 ++ secrets.md | Bin 478 -> 691 bytes shopfloor-dashboard/index.html | 4 +- sql/add_inspection_machine_type.sql | 19 ++ sql/add_location_relationship_types.sql | 14 + sql/update_pctype_inspection.sql | 24 ++ tv-dashboard/index.html | 4 + 22 files changed, 951 insertions(+), 170 deletions(-) create mode 100644 displaylocations.asp create mode 100644 sql/add_inspection_machine_type.sql create mode 100644 sql/add_location_relationship_types.sql create mode 100644 sql/update_pctype_inspection.sql diff --git a/.gitignore b/.gitignore index a35d494..e5a154c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,16 @@ tests/test_results_*.csv installers/ v2/installers/ +# Database backups (should not be version-controlled) +shopdb-database-backup-*.sql +database-backup-*.sql +employee*-database-backup-*.sql +shopdb_backup_*.sql + +# Backup/scratch files +*.bak +*.pdf + # OS files .DS_Store Thumbs.db diff --git a/CLAUDE.md b/CLAUDE.md index 3ed3873..061fda9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -23,7 +23,7 @@ ShopDB is a Classic ASP/VBScript web application for managing manufacturing shop - Production IIS server - Production IIS logs - Production MySQL database -- Zabbix server (10.48.130.113) +- Zabbix server (zabbix.compute.geaerospace.net) - Employee database (wjf_employees) - used by displayprofile.asp (can update code, cannot test) For production tasks, user must: diff --git a/addmodel.asp b/addmodel.asp index 9c0d2dd..3a5eb42 100644 --- a/addmodel.asp +++ b/addmodel.asp @@ -138,17 +138,23 @@ <% Dim rsMachineTypes, strMTSQL - strMTSQL = "SELECT machinetypeid, machinetype, category FROM machinetypes WHERE isactive = 1 ORDER BY category, machinetype ASC" + strMTSQL = "SELECT machinetypeid, machinetype, " & _ + "CASE " & _ + " WHEN machinetypeid BETWEEN 1 AND 15 OR machinetypeid BETWEEN 21 AND 25 OR machinetypeid = 45 OR machinetypeid = 47 THEN 'Equipment' " & _ + " WHEN machinetypeid BETWEEN 16 AND 20 OR machinetypeid = 46 THEN 'Network' " & _ + " ELSE 'Other' " & _ + "END AS category " & _ + "FROM machinetypes WHERE isactive = 1 AND machinetypeid NOT IN (1, 33, 44) ORDER BY category, machinetype ASC" Set rsMachineTypes = objconn.Execute(strMTSQL) Dim lastCategory lastCategory = "" While Not rsMachineTypes.EOF - If rsMachineTypes("category") <> lastCategory Then + If rsMachineTypes("category") & "" <> lastCategory Then If lastCategory <> "" Then Response.Write("") - Response.Write("") - lastCategory = rsMachineTypes("category") + Response.Write("") + lastCategory = rsMachineTypes("category") & "" End If - Response.Write("") + Response.Write("") rsMachineTypes.MoveNext Wend If lastCategory <> "" Then Response.Write("") diff --git a/api.asp b/api.asp index 715f55d..e9c35ef 100644 --- a/api.asp +++ b/api.asp @@ -957,7 +957,7 @@ Sub GetPCMachineRelationships() Dim rsRel, strSQL, relList, relCount, relData - strSQL = "SELECT " & _ + strSQL = "SELECT DISTINCT " & _ "pc.machineid AS pc_id, " & _ "pc.machinenumber AS hostname, " & _ "c.address AS ip, " & _ @@ -978,7 +978,31 @@ Sub GetPCMachineRelationships() "AND eq.machinenumber NOT IN ('0612', '0613', '0614', '0615') " & _ "AND (v.vendor IS NULL OR v.vendor != 'WJDT') " & _ "AND (m.modelnumber IS NULL OR m.modelnumber != 'TBD') " & _ - "ORDER BY eq.machinenumber" + "UNION " & _ + "SELECT DISTINCT " & _ + "pc.machineid AS pc_id, " & _ + "pc.machinenumber AS hostname, " & _ + "c.address AS ip, " & _ + "dp.machineid AS machine_id, " & _ + "dp.machinenumber AS machine_number, " & _ + "v.vendor AS vendor, " & _ + "m.modelnumber AS model " & _ + "FROM machinerelationships dual_rel " & _ + "JOIN relationshiptypes drt ON dual_rel.relationshiptypeid = drt.relationshiptypeid AND drt.relationshiptype = 'Dualpath' " & _ + "JOIN machines dp ON dual_rel.related_machineid = dp.machineid " & _ + "JOIN machinerelationships mr ON mr.machineid = dual_rel.machineid AND mr.isactive = 1 " & _ + "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid AND rt.relationshiptype IN ('Controls', 'Controlled By') " & _ + "JOIN machines pc ON mr.related_machineid = pc.machineid AND pc.pctypeid IS NOT NULL " & _ + "LEFT JOIN communications c ON pc.machineid = c.machineid AND c.isprimary = 1 AND c.comstypeid = 1 " & _ + "LEFT JOIN models m ON dp.modelnumberid = m.modelnumberid " & _ + "LEFT JOIN vendors v ON m.vendorid = v.vendorid " & _ + "WHERE dual_rel.isactive = 1 " & _ + "AND dp.machinenumber IS NOT NULL AND dp.machinenumber != '' " & _ + "AND dp.machinenumber REGEXP '^[0-9]{4}$' " & _ + "AND dp.machinenumber NOT IN ('0612', '0613', '0614', '0615') " & _ + "AND (v.vendor IS NULL OR v.vendor != 'WJDT') " & _ + "AND (m.modelnumber IS NULL OR m.modelnumber != 'TBD') " & _ + "ORDER BY machine_number" Set rsRel = objConn.Execute(strSQL) diff --git a/displaylocations.asp b/displaylocations.asp new file mode 100644 index 0000000..cd344a1 --- /dev/null +++ b/displaylocations.asp @@ -0,0 +1,353 @@ +<%@ Language=VBScript %> +<% +Option Explicit +Dim theme, strSQL, rs, objConn, rsRel +%> + + + + + + + +<% + theme = Request.Cookies("theme") + IF theme = "" THEN + theme="bg-theme1" + END IF +%> + + + +
+ + +
+ + + + +
+
+
+
+
+
+
+
+
+ Locations +
+
+ +<% +' Get all active locations with PC counts and relationship counts +strSQL = "SELECT m.machineid, m.machinenumber, m.alias, m.machinenotes, m.mapleft, m.maptop, " & _ + " (SELECT COUNT(*) FROM machinerelationships mr " & _ + " JOIN machines pc ON mr.related_machineid = pc.machineid " & _ + " WHERE mr.machineid = m.machineid AND mr.isactive = 1 AND pc.pctypeid IS NOT NULL AND pc.isactive = 1) AS pc_count, " & _ + " (SELECT COUNT(*) FROM machinerelationships mr " & _ + " JOIN machines child ON mr.related_machineid = child.machineid " & _ + " WHERE mr.machineid = m.machineid AND mr.isactive = 1 AND child.islocationonly = 1 AND child.isactive = 1) AS sublocation_count " & _ + "FROM machines m " & _ + "WHERE m.islocationonly = 1 AND m.isactive = 1 AND m.machinenumber <> 'TBD' " & _ + "ORDER BY m.machinenumber" +Set rs = objConn.Execute(strSQL) + +' Build a dictionary of all relationships for location machines +' Key = machineid, Value = array of relationship info +Dim relDict, relSQL +Set relDict = Server.CreateObject("Scripting.Dictionary") + +relSQL = "SELECT mr.machineid AS loc_id, child.machineid AS child_id, child.machinenumber AS child_name, " & _ + " child.hostname AS child_hostname, child.alias AS child_alias, " & _ + " child.pctypeid, child.islocationonly, " & _ + " rt.relationshiptype, rt.relationshiptypeid, " & _ + " GROUP_CONCAT(DISTINCT c.address ORDER BY c.address SEPARATOR ', ') AS child_ip " & _ + "FROM machinerelationships mr " & _ + "JOIN machines loc ON mr.machineid = loc.machineid " & _ + "JOIN machines child ON mr.related_machineid = child.machineid " & _ + "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " & _ + "LEFT JOIN communications c ON child.machineid = c.machineid AND c.comstypeid IN (1, 3) AND c.isactive = 1 " & _ + "WHERE loc.islocationonly = 1 AND loc.isactive = 1 AND mr.isactive = 1 AND child.isactive = 1 " & _ + "GROUP BY mr.machineid, child.machineid, child.machinenumber, child.hostname, child.alias, " & _ + " child.pctypeid, child.islocationonly, rt.relationshiptype, rt.relationshiptypeid " & _ + "ORDER BY mr.machineid, rt.relationshiptypeid, child.machinenumber" +Set rsRel = objConn.Execute(relSQL) + +Dim curLocId +Do While Not rsRel.EOF + curLocId = CStr(rsRel("loc_id")) + If Not relDict.Exists(curLocId) Then + relDict.Add curLocId, "" + End If + ' Build pipe-delimited entries: child_id|child_name|child_hostname|child_alias|child_ip|pctypeid|islocationonly|relationshiptype + Dim entry + entry = rsRel("child_id") & "|" & (rsRel("child_name") & "") & "|" & (rsRel("child_hostname") & "") & "|" & _ + (rsRel("child_alias") & "") & "|" & (rsRel("child_ip") & "") & "|" & _ + (rsRel("pctypeid") & "") & "|" & (rsRel("islocationonly") & "") & "|" & (rsRel("relationshiptype") & "") + If relDict(curLocId) <> "" Then + relDict(curLocId) = relDict(curLocId) & "~" & entry + Else + relDict(curLocId) = entry + End If + rsRel.MoveNext +Loop +rsRel.Close +Set rsRel = Nothing +%> + +
+ + + + + + + + + + + + + + +<% +Do While Not rs.EOF + Dim locName, locAlias, locNotes, pcCount, subCount, hasMap, mid, totalRels + mid = rs("machineid") + locName = rs("machinenumber") & "" + locAlias = rs("alias") & "" + locNotes = rs("machinenotes") & "" + pcCount = CLng(rs("pc_count") & "") + subCount = CLng(rs("sublocation_count") & "") + hasMap = Not (IsNull(rs("mapleft")) Or IsNull(rs("maptop"))) + totalRels = pcCount + subCount + + ' Check if this location has any relationships in our dict + Dim hasRels, midStr + midStr = CStr(mid) + hasRels = relDict.Exists(midStr) And relDict(midStr) <> "" +%> + class="loc-parent" data-mid="<%=mid%>" style="cursor:pointer;"<% End If %>> + + + + + + + + + +<% + ' Render hidden detail rows for this location's relationships + If hasRels Then + Dim entries, i, parts + entries = Split(relDict(midStr), "~") + For i = 0 To UBound(entries) + parts = Split(entries(i), "|") + ' parts: 0=child_id, 1=child_name, 2=child_hostname, 3=child_alias, 4=child_ip, 5=pctypeid, 6=islocationonly, 7=relationshiptype + Dim cId, cName, cHost, cAlias, cIp, cIsPC, cIsLoc, cRelType, cBadgeClass, cIcon, cLink + cId = parts(0) + cName = parts(1) + cHost = parts(2) + cAlias = parts(3) + cIp = parts(4) + cIsPC = (parts(5) <> "") + cIsLoc = (parts(6) = "1" Or parts(6) = "True") + cRelType = parts(7) + + ' Determine icon and badge + If cIsLoc Then + cIcon = "zmdi zmdi-pin text-info" + cBadgeClass = "badge-info" + cLink = "displaymachine.asp?machineid=" & cId + ElseIf cIsPC Then + cIcon = "zmdi zmdi-desktop-windows text-primary" + cBadgeClass = "badge-primary" + cLink = "displaypc.asp?machineid=" & cId + Else + cIcon = "zmdi zmdi-memory text-warning" + cBadgeClass = "badge-warning" + cLink = "displaymachine.asp?machineid=" & cId + End If + + ' Display name: use hostname for PCs if available, else machinenumber + Dim displayName + If cIsPC And cHost <> "" Then + displayName = cHost + Else + displayName = cName + End If +%> + + + + + + + + + +<% + Next + End If + + rs.MoveNext +Loop +rs.Close +Set rs = Nothing +Set relDict = Nothing +%> + +
LocationAliasPCsSub-locationsMapNotesActions
+<% If hasRels Then %> + +<% End If %> + + + <%=Server.HTMLEncode(locName)%> + + <%=Server.HTMLEncode(locAlias)%> +<% If pcCount > 0 Then %> + <%=pcCount%> +<% Else %> + 0 +<% End If %> + +<% If subCount > 0 Then %> + <%=subCount%> +<% Else %> + 0 +<% End If %> + +<% If hasMap Then %> + +<% Else %> + +<% End If %> + <% + If Len(locNotes) > 40 Then + Response.Write(Server.HTMLEncode(Left(locNotes, 40)) & "...") + Else + Response.Write(Server.HTMLEncode(locNotes)) + End If + %> + + + + + + +
+
+ +
+
+
+
+
+
+ + + + + +
+
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +<% + objConn.Close +%> diff --git a/displaymachine.asp b/displaymachine.asp index fb67272..22fa78b 100644 --- a/displaymachine.asp +++ b/displaymachine.asp @@ -83,7 +83,7 @@ "machines.modelnumberid, machines.businessunitid, machines.printerid, machines.pctypeid, " & _ "machines.loggedinuser, machines.osid, machines.machinestatusid, " & _ "machines.controllertypeid, machines.controllerosid, machines.requires_manual_machine_config, " & _ - "machines.lastupdated, machines.fqdn, " & _ + "machines.lastupdated, machines.fqdn, machines.islocationonly, " & _ "machinetypes.machinetype, " & _ "models.modelnumber, models.image, models.machinetypeid, " & _ "businessunits.businessunit, " & _ @@ -407,7 +407,44 @@ End If
Machine Relationships
- +<% + ' === Connected PCs (direct + inherited via dualpath) === + strSQL2 = "SELECT m.machineid, m.machinenumber, m.hostname, rt.relationshiptype, " & _ + "GROUP_CONCAT(DISTINCT c.address ORDER BY c.address SEPARATOR ', ') as address " & _ + "FROM machinerelationships mr " & _ + "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " & _ + "JOIN machines m ON (mr.machineid = m.machineid OR mr.related_machineid = m.machineid) " & _ + "LEFT JOIN communications c ON m.machineid = c.machineid AND c.comstypeid IN (1, 3) AND c.isactive = 1 " & _ + "WHERE (mr.machineid = ? OR mr.related_machineid = ?) " & _ + " AND m.pctypeid IS NOT NULL AND m.machineid <> ? AND mr.isactive = 1 " & _ + " AND rt.relationshiptype NOT IN ('Stored At', 'Contains') " & _ + "GROUP BY m.machineid, m.machinenumber, m.hostname, rt.relationshiptype " & _ + "UNION " & _ + "SELECT pc.machineid, pc.machinenumber, pc.hostname, 'Via Dualpath' as relationshiptype, " & _ + "GROUP_CONCAT(DISTINCT c.address ORDER BY c.address SEPARATOR ', ') as address " & _ + "FROM machinerelationships dual_rel " & _ + "JOIN relationshiptypes drt ON dual_rel.relationshiptypeid = drt.relationshiptypeid AND drt.relationshiptype = 'Dualpath' " & _ + "JOIN machinerelationships mr2 ON mr2.isactive = 1 " & _ + " AND ((dual_rel.related_machineid = mr2.machineid AND dual_rel.machineid = ?) " & _ + " OR (dual_rel.machineid = mr2.machineid AND dual_rel.related_machineid = ?)) " & _ + "JOIN machines pc ON (mr2.machineid = pc.machineid OR mr2.related_machineid = pc.machineid) " & _ + " AND pc.pctypeid IS NOT NULL AND pc.machineid <> ? " & _ + "JOIN relationshiptypes rt2 ON mr2.relationshiptypeid = rt2.relationshiptypeid " & _ + " AND rt2.relationshiptype NOT IN ('Stored At', 'Contains', 'Dualpath') " & _ + "LEFT JOIN communications c ON pc.machineid = c.machineid AND c.comstypeid IN (1, 3) AND c.isactive = 1 " & _ + "WHERE dual_rel.isactive = 1 " & _ + " AND (dual_rel.machineid = ? OR dual_rel.related_machineid = ?) " & _ + " AND pc.machineid NOT IN ( " & _ + " SELECT m2.machineid FROM machinerelationships mr3 " & _ + " JOIN machines m2 ON (mr3.machineid = m2.machineid OR mr3.related_machineid = m2.machineid) " & _ + " WHERE (mr3.machineid = ? OR mr3.related_machineid = ?) AND m2.pctypeid IS NOT NULL AND m2.machineid <> ? AND mr3.isactive = 1) " & _ + "GROUP BY pc.machineid, pc.machinenumber, pc.hostname " & _ + "ORDER BY relationshiptype, hostname" + Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid, machineid, machineid, machineid, machineid, machineid, machineid, machineid, machineid, machineid, machineid)) + + Dim pcHostname, pcIP, pcMachineID, pcLocation, pcRelType + If Not rs2.EOF Then +%>
Connected PCs
@@ -421,25 +458,6 @@ End If <% - ' Query ALL PCs related to this machine via machinerelationships - ' Check both directions - the PC is identified by pctypeid IS NOT NULL - ' Use GROUP_CONCAT to combine multiple IPs into one row per PC - strSQL2 = "SELECT m.machineid, m.machinenumber, m.hostname, rt.relationshiptype, " & _ - "GROUP_CONCAT(DISTINCT c.address ORDER BY c.address SEPARATOR ', ') as address " & _ - "FROM machinerelationships mr " & _ - "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " & _ - "JOIN machines m ON (mr.machineid = m.machineid OR mr.related_machineid = m.machineid) " & _ - "LEFT JOIN communications c ON m.machineid = c.machineid AND c.comstypeid IN (1, 3) AND c.isactive = 1 " & _ - "WHERE (mr.machineid = ? OR mr.related_machineid = ?) " & _ - " AND m.pctypeid IS NOT NULL AND m.machineid <> ? AND mr.isactive = 1 " & _ - "GROUP BY m.machineid, m.machinenumber, m.hostname, rt.relationshiptype " & _ - "ORDER BY rt.relationshiptype, m.hostname" - Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid, machineid, machineid)) - - Dim pcHostname, pcIP, pcMachineID, pcLocation, pcRelType - If rs2.EOF Then - Response.Write("") - Else Do While Not rs2.EOF pcHostname = rs2("hostname") & "" pcIP = rs2("address") & "" @@ -451,7 +469,6 @@ End If If pcIP = "" Then pcIP = "N/A" If pcLocation = "" Then pcLocation = "N/A" - ' Badge color based on relationship type Dim pcRelBadge Select Case LCase(pcRelType) Case "controls" @@ -472,15 +489,27 @@ End If Response.Write("") rs2.MoveNext Loop - End If - rs2.Close - Set rs2 = Nothing %>
No connected PCs
+<% + End If + rs2.Close + Set rs2 = Nothing - + ' === Machines Controlled === + strSQL2 = "SELECT m.machineid, m.machinenumber, mt.machinetype, mo.modelnumber, rt.relationshiptype " & _ + "FROM machinerelationships mr " & _ + "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " & _ + "JOIN machines m ON mr.related_machineid = m.machineid " & _ + "LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid " & _ + "LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " & _ + "WHERE mr.machineid = ? AND rt.relationshiptype NOT IN ('Controls', 'Dualpath', 'Connected To', 'Stored At', 'Contains') AND mr.isactive = 1" + Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid)) + + If Not rs2.EOF Then +%>
Machines Controlled by This Machine
@@ -494,20 +523,6 @@ End If <% - ' Query other machines related to this one (excluding Controls which is shown in "Controlled By PC" section) - ' This shows relationships like Cluster Member, Backup For, Master-Slave, etc. - strSQL2 = "SELECT m.machineid, m.machinenumber, mt.machinetype, mo.modelnumber, rt.relationshiptype " & _ - "FROM machinerelationships mr " & _ - "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " & _ - "JOIN machines m ON mr.related_machineid = m.machineid " & _ - "LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid " & _ - "LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " & _ - "WHERE mr.machineid = ? AND rt.relationshiptype NOT IN ('Controls', 'Dualpath', 'Connected To') AND mr.isactive = 1" - Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid)) - - If rs2.EOF Then - Response.Write("") - Else Do While Not rs2.EOF Dim ctrlMachineNum, ctrlType, ctrlModel, ctrlMachineID ctrlMachineNum = rs2("machinenumber") & "" @@ -526,17 +541,29 @@ End If Response.Write("") rs2.MoveNext Loop - End If - rs2.Close - Set rs2 = Nothing %>
This machine does not control any other machines
+<% + End If + rs2.Close + Set rs2 = Nothing - + ' === Dualpath Relationships === + strSQL2 = "SELECT m.machineid, m.machinenumber, mt.machinetype, mo.modelnumber, rt.relationshiptype " & _ + "FROM machinerelationships mr " & _ + "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " & _ + "JOIN machines m ON mr.related_machineid = m.machineid " & _ + "LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid " & _ + "LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " & _ + "WHERE mr.machineid = ? AND rt.relationshiptype = 'Dualpath' AND mr.isactive = 1" + Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid)) + + If Not rs2.EOF Then +%>
Dualpath / Redundant Machines
-
+
@@ -548,19 +575,6 @@ End If <% - ' Query dualpath relationships - strSQL2 = "SELECT m.machineid, m.machinenumber, mt.machinetype, mo.modelnumber, rt.relationshiptype " & _ - "FROM machinerelationships mr " & _ - "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " & _ - "JOIN machines m ON mr.related_machineid = m.machineid " & _ - "LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid " & _ - "LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " & _ - "WHERE mr.machineid = ? AND rt.relationshiptype = 'Dualpath' AND mr.isactive = 1" - Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid)) - - If rs2.EOF Then - Response.Write("") - Else Do While Not rs2.EOF Dim dualMachineNum, dualType, dualModel, dualMachineID dualMachineNum = rs2("machinenumber") & "" @@ -579,17 +593,42 @@ End If Response.Write("") rs2.MoveNext Loop - End If - rs2.Close - Set rs2 = Nothing %>
No dualpath relationships
+<% + End If + rs2.Close + Set rs2 = Nothing - + ' === Network Connections === + ' Query both directions for Connected To relationships + Dim hasNetConn + hasNetConn = False + + strSQL2 = "SELECT m.machineid, m.machinenumber, m.alias, mt.machinetype, rt.relationshiptype, 'to' AS direction " & _ + "FROM machinerelationships mr " & _ + "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " & _ + "LEFT JOIN machines m ON mr.related_machineid = m.machineid " & _ + "LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid " & _ + "LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " & _ + "WHERE mr.machineid = ? AND rt.relationshiptype = 'Connected To' AND mr.isactive = 1 " & _ + "UNION ALL " & _ + "SELECT m.machineid, m.machinenumber, m.alias, mt.machinetype, rt.relationshiptype, 'from' AS direction " & _ + "FROM machinerelationships mr " & _ + "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " & _ + "LEFT JOIN machines m ON mr.machineid = m.machineid " & _ + "LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid " & _ + "LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " & _ + "WHERE mr.related_machineid = ? AND rt.relationshiptype = 'Connected To' AND mr.isactive = 1" + Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid, machineid)) + + If Not rs2.EOF Then + hasNetConn = True +%>
Network Connections
-
+
@@ -601,66 +640,120 @@ End If <% - ' Query devices this machine is connected to (e.g., Camera -> IDF) - strSQL2 = "SELECT m.machineid, m.machinenumber, m.alias, mt.machinetype, rt.relationshiptype " & _ - "FROM machinerelationships mr " & _ - "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " & _ - "LEFT JOIN machines m ON mr.related_machineid = m.machineid " & _ - "LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid " & _ - "LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " & _ - "WHERE mr.machineid = ? AND rt.relationshiptype = 'Connected To' AND mr.isactive = 1" - Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid)) - - If Not rs2.EOF Then While Not rs2.EOF - Dim connAlias, connType + Dim connAlias, connType, connDir connAlias = "" : If Not IsNull(rs2("alias")) Then connAlias = rs2("alias") & "" connType = "" : If Not IsNull(rs2("machinetype")) Then connType = rs2("machinetype") & "" + connDir = rs2("direction") & "" Response.Write("") Response.Write("") Response.Write("") Response.Write("") - Response.Write("") + If connDir = "from" Then + Response.Write("") + Else + Response.Write("") + End If Response.Write("") rs2.MoveNext Wend - Else - Response.Write("") - End If - rs2.Close - - ' Query devices connected to this machine (e.g., IDF -> Cameras) - strSQL2 = "SELECT m.machineid, m.machinenumber, m.alias, mt.machinetype, rt.relationshiptype " & _ - "FROM machinerelationships mr " & _ - "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " & _ - "LEFT JOIN machines m ON mr.machineid = m.machineid " & _ - "LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid " & _ - "LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " & _ - "WHERE mr.related_machineid = ? AND rt.relationshiptype = 'Connected To' AND mr.isactive = 1" - Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid)) - - If Not rs2.EOF Then - While Not rs2.EOF - Dim connToAlias, connToType - connToAlias = "" : If Not IsNull(rs2("alias")) Then connToAlias = rs2("alias") & "" - connToType = "" : If Not IsNull(rs2("machinetype")) Then connToType = rs2("machinetype") & "" - - Response.Write("") - Response.Write("") - Response.Write("") - Response.Write("") - Response.Write("") - Response.Write("") - rs2.MoveNext - Wend - End If - rs2.Close - Set rs2 = Nothing %>
" & Server.HTMLEncode(rs2("machinenumber") & "") & "" & Server.HTMLEncode(connAlias) & "" & Server.HTMLEncode(connType) & "" & Server.HTMLEncode(rs2("relationshiptype") & "") & "Connected From" & Server.HTMLEncode(rs2("relationshiptype") & "") & "
No network connections
" & Server.HTMLEncode(rs2("machinenumber") & "") & "" & Server.HTMLEncode(connToAlias) & "" & Server.HTMLEncode(connToType) & "Connected From
+<% + End If + rs2.Close + Set rs2 = Nothing +%> + +<% + ' Location-specific section: show stored items and sub-locations + Dim isLoc + isLoc = rs("islocationonly") & "" + If isLoc = "1" Or isLoc = "True" Then +%> + +
Stored Items & Sub-locations
+
+ + + + + + + + + + +<% + strSQL2 = "SELECT m.machineid, m.machinenumber, m.hostname, m.alias, m.pctypeid, m.islocationonly, " & _ + "rt.relationshiptype, mt.machinetype, " & _ + "GROUP_CONCAT(DISTINCT c.address ORDER BY c.address SEPARATOR ', ') AS address " & _ + "FROM machinerelationships mr " & _ + "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " & _ + "JOIN machines m ON mr.related_machineid = m.machineid " & _ + "LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid " & _ + "LEFT JOIN machinetypes mt ON mo.machinetypeid = mt.machinetypeid " & _ + "LEFT JOIN communications c ON m.machineid = c.machineid AND c.comstypeid IN (1, 3) AND c.isactive = 1 " & _ + "WHERE mr.machineid = ? AND rt.relationshiptype IN ('Stored At', 'Contains') AND mr.isactive = 1 AND m.isactive = 1 " & _ + "GROUP BY m.machineid, m.machinenumber, m.hostname, m.alias, m.pctypeid, m.islocationonly, rt.relationshiptype, mt.machinetype " & _ + "ORDER BY rt.relationshiptype, m.machinenumber" + Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid)) + + If rs2.EOF Then + Response.Write("") + Else + Do While Not rs2.EOF + Dim storedName, storedType, storedIP, storedRelType, storedBadge, storedLink, storedIcon + storedRelType = rs2("relationshiptype") & "" + + If (rs2("islocationonly") & "") = "1" Or (rs2("islocationonly") & "") = "True" Then + storedName = rs2("machinenumber") & "" + storedType = "Sub-location" + storedIcon = "zmdi-pin" + storedBadge = "badge-info" + storedLink = "displaymachine.asp?machineid=" & rs2("machineid") + ElseIf rs2("pctypeid") & "" <> "" Then + storedName = rs2("hostname") & "" + If storedName = "" Then storedName = rs2("machinenumber") & "" + storedType = "PC" + storedIcon = "zmdi-desktop-windows" + storedBadge = "badge-primary" + storedLink = "displaypc.asp?machineid=" & rs2("machineid") + Else + storedName = rs2("machinenumber") & "" + storedType = rs2("machinetype") & "" + If storedType = "" Then storedType = "Equipment" + storedIcon = "zmdi-memory" + storedBadge = "badge-warning" + storedLink = "displaymachine.asp?machineid=" & rs2("machineid") + End If + + storedIP = rs2("address") & "" + If storedIP = "" Then storedIP = "N/A" + + Response.Write("") + Response.Write("") + Response.Write("") + Response.Write("") + Response.Write("") + Response.Write("") + rs2.MoveNext + Loop + End If + rs2.Close + Set rs2 = Nothing +%> + +
NameTypeIP / InfoRelationship
No stored items or sub-locations
" & Server.HTMLEncode(storedName) & "") + If rs2("alias") & "" <> "" Then Response.Write(" (" & Server.HTMLEncode(rs2("alias") & "") & ")") + Response.Write("" & Server.HTMLEncode(storedType) & "" & storedIP & "" & Server.HTMLEncode(storedRelType) & "
+
+<% + End If +%>
Compliance & Security
diff --git a/displaypc.asp b/displaypc.asp index 452156d..56adb09 100644 --- a/displaypc.asp +++ b/displaypc.asp @@ -524,20 +524,6 @@ End If <% End If %> - -
Connected Equipment
-
- - - - - - - - - - - <% ' Query ALL equipment related to this PC via machinerelationships ' Check both directions - the equipment is identified by pctypeid IS NULL @@ -552,9 +538,22 @@ End If "ORDER BY rt.relationshiptype, m.machinenumber" Set rs2 = ExecuteParameterizedQuery(objConn, strSQL2, Array(machineid, machineid, machineid)) - If rs2.EOF Then - Response.Write("") - Else + If Not rs2.EOF Then +%> +
Connected Equipment
+
+
Machine NumberTypeModelLocationRelationship
No connected equipment
+ + + + + + + + + + +<% Do While Not rs2.EOF Dim ctrlMachineNum, ctrlType, ctrlModel, ctrlMachineID, ctrlRelType ctrlMachineNum = rs2("machinenumber") & "" @@ -567,7 +566,6 @@ End If If ctrlType = "" Then ctrlType = "N/A" If ctrlModel = "" Then ctrlModel = "N/A" - ' Badge color based on relationship type Dim ctrlRelBadge Select Case LCase(ctrlRelType) Case "controls" @@ -589,13 +587,15 @@ End If Response.Write("") rs2.MoveNext Loop - End If - rs2.Close - Set rs2 = Nothing %>
Machine NumberTypeModelLocationRelationship
+<% + End If + rs2.Close + Set rs2 = Nothing +%>
Compliance & Security
diff --git a/editmachine.asp b/editmachine.asp index 7839c14..105a9e6 100644 --- a/editmachine.asp +++ b/editmachine.asp @@ -141,6 +141,26 @@ Set rsDualpath = Nothing Set cmd = Nothing + ' Load parent location (this machine is contained by a location) + Dim parentlocationid + parentlocationid = "" + strSQL = "SELECT mr.machineid AS parentid FROM machinerelationships mr " &_ + "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " &_ + "WHERE mr.related_machineid = ? AND rt.relationshiptype = 'Contains' AND mr.isactive = 1" + Set cmd = Server.CreateObject("ADODB.Command") + cmd.ActiveConnection = objConn + cmd.CommandText = strSQL + cmd.CommandType = 1 + cmd.Parameters.Append cmd.CreateParameter("@machineid", 3, 1, , machineid) + Dim rsParentLoc + Set rsParentLoc = cmd.Execute + If NOT rsParentLoc.EOF Then + If NOT IsNull(rsParentLoc("parentid")) Then parentlocationid = rsParentLoc("parentid") + End If + rsParentLoc.Close + Set rsParentLoc = Nothing + Set cmd = Nothing + ' Load compliance data Dim thirdpartymanaged, thirdpartymanager, otassetsystem, dodassettype thirdpartymanaged = "NA" : thirdpartymanager = "" : otassetsystem = "" : dodassettype = "" @@ -589,7 +609,7 @@ <% Dim rsDualpathList - strSQL = "SELECT machineid, machinenumber, alias FROM machines WHERE pctypeid IS NULL AND isactive = 1 AND machineid <> ? ORDER BY machinenumber ASC" + strSQL = "SELECT machineid, machinenumber, alias FROM machines WHERE pctypeid IS NULL AND isactive = 1 AND (islocationonly IS NULL OR islocationonly = 0) AND machineid <> ? ORDER BY machinenumber ASC" Set cmd = Server.CreateObject("ADODB.Command") cmd.ActiveConnection = objConn cmd.CommandText = strSQL @@ -620,6 +640,38 @@ Select a backup/redundant machine (creates bidirectional relationship)
+
+ + + Select a location that contains this machine (e.g., IT Closet, Bin, Shelf) +
+
diff --git a/editpc.asp b/editpc.asp index ce64f1c..2939f26 100644 --- a/editpc.asp +++ b/editpc.asp @@ -146,6 +146,26 @@ Set rsDualpath = Nothing Set cmd = Nothing + ' Load parent location (this PC is contained by a location) + Dim parentlocationid + parentlocationid = "" + strSQL = "SELECT mr.machineid AS parentid FROM machinerelationships mr " &_ + "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " &_ + "WHERE mr.related_machineid = ? AND rt.relationshiptype = 'Contains' AND mr.isactive = 1" + Set cmd = Server.CreateObject("ADODB.Command") + cmd.ActiveConnection = objConn + cmd.CommandText = strSQL + cmd.CommandType = 1 + cmd.Parameters.Append cmd.CreateParameter("@machineid", 3, 1, , machineid) + Dim rsParentLoc + Set rsParentLoc = cmd.Execute + If NOT rsParentLoc.EOF Then + If NOT IsNull(rsParentLoc("parentid")) Then parentlocationid = rsParentLoc("parentid") + End If + rsParentLoc.Close + Set rsParentLoc = Nothing + Set cmd = Nothing + ' Load compliance data Dim thirdpartymanaged, thirdpartymanager, otassetsystem, dodassettype thirdpartymanaged = "NA" : thirdpartymanager = "" : otassetsystem = "" : dodassettype = "" @@ -621,7 +641,7 @@ Set rsMachineStatus = Nothing 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" + "WHERE m.pctypeid IS NULL AND m.isactive = 1 AND (m.islocationonly IS NULL OR m.islocationonly = 0)" & equipmentTypeFilter & " ORDER BY m.machinenumber ASC" Set rsControlPCs = objconn.Execute(strSQL) While Not rsControlPCs.EOF Dim controlPCDisplay, selectedControlPC @@ -653,7 +673,37 @@ Set rsMachineStatus = Nothing %>
- +
+ + + Select a location that contains this PC (e.g., IT Closet) +
diff --git a/includes/config.asp b/includes/config.asp index d293fafb0e7502b7b2ba1f7ec2dee3079c59a8d5..7a3e9eadd366393e831c2d532fa61eb13663605b 100644 GIT binary patch literal 6984 zcmV-O8@J>DM@dveQdv+`01KG&)V3%qlY{nD=@O~lKi(eEJn4>5+S&;~1x!0A+!1z8 zoFQ1f5g6-?tSIUvQiWQ-Pu@MUgWxlTa4TVRRfO z0uJrV!tLRfqHD{*4xomshW!817?&t1gF)`(Yhnv`7OS{Ye%_o1_oF(hzjB!*txXxLOvR>fLBA(-`+5}vU8{ed@2t&1DY>@>eT&hHDq zOcMQOEWnwyc0FM&A)^%im)Wl3UTPt=V?H>E_7BXuTlTVyvdaPbCQb!mX)KkOWtxzi z_xLK5*S>3*Efk)Fagji^vs1Iw0-#@1XF%;8;Tu^=`ys>F<&+C48~(P~`F$V;Y4JeI zJE_HS*g=%il%6e}(ZD(mm7)$?80*}TNjX-nd}X+pe|c8oY2p%qkjwMxF1a7nJp9FN z^dDiG$&6X`AaO1nNH!*Gb5FT7LqV#!`iC*)LAS02YWV0nud4n!ZAvoQ|3$d{SxUaY zygQgY2rfY_0{Oh7TKGX$dN4{$-Nt4Oe%ic-CVhD=gvu+eSwuE@MRpI2Sl#)FbHkS86Zc^?PH?F5<;G3g49BST5~y=R~|4)Srb02+{jY zBtRpCWQkT58=K4(N;2P$F~B%umzA-N^w$3j(O}?un?LwiQcgWlm-O?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9!jyw-oALgPS*{?AHM@!>m;YB9&APo`fv1OUQLb z9Network
  • Network Devices
  • PC Admin
  • +
  • Locations
  • USB Devices
  • Notifications
  • Lobby Display
  • diff --git a/machineedit.asp b/machineedit.asp index 872594f..ac8bb7c 100644 --- a/machineedit.asp +++ b/machineedit.asp @@ -142,6 +142,26 @@ Set rsDualpath = Nothing Set cmd = Nothing + ' Load parent location (this machine is contained by a location) + Dim parentlocationid + parentlocationid = "" + strSQL = "SELECT mr.machineid AS parentid FROM machinerelationships mr " &_ + "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid " &_ + "WHERE mr.related_machineid = ? AND rt.relationshiptype = 'Contains' AND mr.isactive = 1" + Set cmd = Server.CreateObject("ADODB.Command") + cmd.ActiveConnection = objConn + cmd.CommandText = strSQL + cmd.CommandType = 1 + cmd.Parameters.Append cmd.CreateParameter("@machineid", 3, 1, , machineid) + Dim rsParentLoc + Set rsParentLoc = cmd.Execute + If NOT rsParentLoc.EOF Then + If NOT IsNull(rsParentLoc("parentid")) Then parentlocationid = rsParentLoc("parentid") + End If + rsParentLoc.Close + Set rsParentLoc = Nothing + Set cmd = Nothing + ' Load compliance data Dim thirdpartymanaged, thirdpartymanager, otassetsystem, dodassettype thirdpartymanaged = "NA" : thirdpartymanager = "" : otassetsystem = "" : dodassettype = "" @@ -630,6 +650,38 @@ Select a backup/redundant machine (creates bidirectional relationship) +
    + + + Select a location that contains this machine (e.g., IT Closet, Bin, Shelf) +
    + diff --git a/pcmachinerelationships.asp b/pcmachinerelationships.asp index 9de7713..bb39dc6 100644 --- a/pcmachinerelationships.asp +++ b/pcmachinerelationships.asp @@ -35,7 +35,7 @@ <% Dim strSQL, rs -strSQL = "SELECT " & _ +strSQL = "SELECT DISTINCT " & _ "pc.machineid AS pc_id, " & _ "pc.machinenumber AS hostname, " & _ "c.address AS ip, " & _ @@ -56,7 +56,31 @@ strSQL = "SELECT " & _ "AND eq.machinenumber NOT IN ('0612', '0613', '0614', '0615') " & _ "AND (v.vendor IS NULL OR v.vendor != 'WJDT') " & _ "AND (m.modelnumber IS NULL OR m.modelnumber != 'TBD') " & _ - "ORDER BY eq.machinenumber" + "UNION " & _ + "SELECT DISTINCT " & _ + "pc.machineid AS pc_id, " & _ + "pc.machinenumber AS hostname, " & _ + "c.address AS ip, " & _ + "dp.machineid AS machine_id, " & _ + "dp.machinenumber AS machine_number, " & _ + "v.vendor AS vendor, " & _ + "m.modelnumber AS model " & _ + "FROM machinerelationships dual_rel " & _ + "JOIN relationshiptypes drt ON dual_rel.relationshiptypeid = drt.relationshiptypeid AND drt.relationshiptype = 'Dualpath' " & _ + "JOIN machines dp ON dual_rel.related_machineid = dp.machineid " & _ + "JOIN machinerelationships mr ON mr.machineid = dual_rel.machineid AND mr.isactive = 1 " & _ + "JOIN relationshiptypes rt ON mr.relationshiptypeid = rt.relationshiptypeid AND rt.relationshiptype IN ('Controls', 'Controlled By') " & _ + "JOIN machines pc ON mr.related_machineid = pc.machineid AND pc.pctypeid IS NOT NULL " & _ + "LEFT JOIN communications c ON pc.machineid = c.machineid AND c.isprimary = 1 AND c.comstypeid = 1 " & _ + "LEFT JOIN models m ON dp.modelnumberid = m.modelnumberid " & _ + "LEFT JOIN vendors v ON m.vendorid = v.vendorid " & _ + "WHERE dual_rel.isactive = 1 " & _ + "AND dp.machinenumber IS NOT NULL AND dp.machinenumber != '' " & _ + "AND dp.machinenumber REGEXP '^[0-9]{4}$' " & _ + "AND dp.machinenumber NOT IN ('0612', '0613', '0614', '0615') " & _ + "AND (v.vendor IS NULL OR v.vendor != 'WJDT') " & _ + "AND (m.modelnumber IS NULL OR m.modelnumber != 'TBD') " & _ + "ORDER BY machine_number" Set rs = objConn.Execute(strSQL) diff --git a/printbadge.asp b/printbadge.asp index 347eecc..a163ba2 100644 --- a/printbadge.asp +++ b/printbadge.asp @@ -3,11 +3,48 @@ Option Explicit Dim objConn, rs %> + +<% +Dim machineid, strSQL, machineNumber, modelName, machineImage, isLocation + +machineid = Request.QueryString("machineid") +If machineid = "" Then machineid = "0" +If Not IsNumeric(machineid) Then machineid = "0" + +strSQL = "SELECT m.machinenumber, m.islocationonly, mo.modelnumber, mo.image FROM machines m LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid WHERE m.machineid = " & CLng(machineid) +Set rs = objConn.Execute(strSQL) + +If rs.EOF Then + machineNumber = "NOT FOUND" + modelName = "" + machineImage = "" + isLocation = False +Else + machineNumber = rs("machinenumber") & "" + modelName = rs("modelnumber") & "" + machineImage = rs("image") & "" + isLocation = (rs("islocationonly") & "" = "1") Or (rs("islocationonly") & "" = "True") +End If +rs.Close +Set rs = Nothing +objConn.Close +%> - Print Badge +<% If isLocation Then %> + + +<% Else %> +<% End If %> -<% -Dim machineid, strSQL, machineNumber, modelName, machineImage - -machineid = Request.QueryString("machineid") -If machineid = "" Then machineid = "0" -If Not IsNumeric(machineid) Then machineid = "0" - -strSQL = "SELECT m.machinenumber, mo.modelnumber, mo.image FROM machines m LEFT JOIN models mo ON m.modelnumberid = mo.modelnumberid WHERE m.machineid = " & CLng(machineid) -Set rs = objConn.Execute(strSQL) - -If rs.EOF Then - machineNumber = "NOT FOUND" - modelName = "" - machineImage = "" -Else - machineNumber = rs("machinenumber") & "" - modelName = rs("modelnumber") & "" - machineImage = rs("image") & "" -End If -rs.Close -Set rs = Nothing -objConn.Close -%> +<% If isLocation Then %> +
    +
    +
    +
    +
    <%=Server.HTMLEncode(machineNumber)%>
    +
    + +<% Else %>
    <%=Server.HTMLEncode(modelName)%>
    <% If machineImage <> "" Then %> @@ -60,5 +86,6 @@ objConn.Close +<% End If %> - \ No newline at end of file + diff --git a/savemachineedit.asp b/savemachineedit.asp index d1a2ccc..25453ea 100644 --- a/savemachineedit.asp +++ b/savemachineedit.asp @@ -651,6 +651,34 @@ Call SyncDualpathPartnerData(objConn, CLng(machineid), tempDualpathID) End If + '============================================================================= + ' INSERT PARENT LOCATION RELATIONSHIP (Contains) + '============================================================================= + Dim parentlocationid, containsTypeID + parentlocationid = Trim(Request.Form("parentlocationid")) + + If parentlocationid <> "" And IsNumeric(parentlocationid) And CLng(parentlocationid) > 0 Then + Set rsCheck = objConn.Execute("SELECT relationshiptypeid FROM relationshiptypes WHERE relationshiptype = 'Contains'") + If Not rsCheck.EOF Then containsTypeID = rsCheck("relationshiptypeid") + rsCheck.Close + + If Not IsEmpty(containsTypeID) Then + Dim cmdRelLoc + Set cmdRelLoc = Server.CreateObject("ADODB.Command") + cmdRelLoc.ActiveConnection = objConn + cmdRelLoc.CommandText = "INSERT INTO machinerelationships (machineid, related_machineid, relationshiptypeid, isactive) VALUES (?, ?, ?, 1)" + cmdRelLoc.CommandType = 1 + cmdRelLoc.Parameters.Append cmdRelLoc.CreateParameter("@machineid", 3, 1, , CLng(parentlocationid)) + cmdRelLoc.Parameters.Append cmdRelLoc.CreateParameter("@related_machineid", 3, 1, , CLng(machineid)) + cmdRelLoc.Parameters.Append cmdRelLoc.CreateParameter("@relationshiptypeid", 3, 1, , containsTypeID) + + On Error Resume Next + cmdRelLoc.Execute + Set cmdRelLoc = Nothing + On Error Goto 0 + End If + End If + '============================================================================= ' UPDATE OR INSERT COMPLIANCE DATA '============================================================================= diff --git a/secrets.md b/secrets.md index ea9a9532b4daeb0ab4d2525b21a18ec025ac3624..ab68a2490f3d93f439871fd2942e48ad9eb04abd 100644 GIT binary patch literal 691 zcmV;k0!;k?M@dveQdv+`05QVCZ-!`+KD=|5aWQ+-w8%!+g-d)hcyYM!m~2-0`wTj) zR}jxWPxVg_`$+l*HJebrPd~7OA{)!TrvfRyaVzetu>7s~1l5`c%Mgz`x-u>*#s+DB z-2iQ0D8sQ(7_i{I!9F)Om`KUl`HlShc%) zWZh$^f3}0cqikcga$cP+nIDAejYoEkN%jyWsglXI&=^};!IFKN4rpJ7a-A*wY&ZY0 z;kX5v8OH=;Xfo>dcH?(lKJAy+&T0`2&*$7M4Lw*5$s>HP`TN~+bP!V=SMF~on+{14 z%wMW12o*3DUb`mf>=opOQ@7Xn#UcYllCUXMxP z&#U0ykEBqZ&-dfs&$6BeP&mZv)H2=BNDu=10zH2H_dQVIX$RLD>&7YuunAv(c%JLv zl<=m5KGFGA;x^Mu0#9pS=rplRcs@;NNiZCQAPAOkl2pg}cB(~eRE z;g8SPbOV_%NO-q8n7j9Lw_taa^~G(+`aCtUSLZ8aJ8daop9RW=&5XD^ut9KX^&dU( zQpS=)KlGY?0D@f~fXtbkrv9pAh@CJX7e=1cj-vq;W-8cWi>GMdTDD@etXhaQWUbd> zRabf=a!iyA?p#Oc3BiP-l3?j&LqHYBwanPKFW?fEtE0QyQR9E74Sl&TW9M*l!E+(8 ze_+N8#e!m(K3Z)&AKdzEPTGd3#;)KnmagcC=;GMv+t~mws2ww8LAdSeM(&C~EVSW3 ztTER%lHZ};BP&=FJ}?{ypd+Q=P9x&9>8U}5K$wpwiROQ1ZdrqPd)kU+QG9YUN3=wN12f7bh^Qp
    - +
    diff --git a/sql/add_inspection_machine_type.sql b/sql/add_inspection_machine_type.sql new file mode 100644 index 0000000..c7bd740 --- /dev/null +++ b/sql/add_inspection_machine_type.sql @@ -0,0 +1,19 @@ +-- Add Inspection machine type and update 06xx machines +-- Date: 2026-02-03 +-- Purpose: Create Inspection machine type for 0612-0615 machines so they +-- appear on displaymachines.asp (previously hidden as LocationOnly) + +-- 1. Add Inspection machine type +INSERT INTO machinetypes (machinetypeid, machinetype) VALUES (47, 'Inspection'); + +-- 2. Create Inspection model (linked to new type, default vendor WJDT) +INSERT INTO models (modelnumber, vendorid, machinetypeid, isactive) +VALUES ('Inspection', 1, 47, 1); + +-- 3. Update machines 0612-0615 to use the new Inspection model +UPDATE machines +SET modelnumberid = (SELECT modelnumberid FROM models WHERE modelnumber = 'Inspection' AND machinetypeid = 47 LIMIT 1) +WHERE machinenumber IN ('0612', '0613', '0614', '0615'); + +-- 4. Enable WJDT vendor in machine edit model dropdown +UPDATE vendors SET ismachine = 1 WHERE vendorid = 1; diff --git a/sql/add_location_relationship_types.sql b/sql/add_location_relationship_types.sql new file mode 100644 index 0000000..34dd2e6 --- /dev/null +++ b/sql/add_location_relationship_types.sql @@ -0,0 +1,14 @@ +-- Add relationship types for location management (bins, shelves, PC storage) +-- Run against production MySQL + +-- New relationship types +INSERT INTO relationshiptypes (relationshiptypeid, relationshiptype, description, isactive, displayorder) VALUES +(7, 'Contains', 'Location contains a sub-location (e.g., Bin contains Shelf)', 1, 7), +(8, 'Stored At', 'PC or device is stored at this location', 1, 8); + +-- Fix DT Office -> GJX9B2Z3ESF from "Controls" to "Stored At" +-- Verify relationshipid 69 matches on prod before running +UPDATE machinerelationships SET relationshiptypeid = 8 WHERE relationshipid = 69; + +-- Flag IT Closet as a location (machineid=258) +UPDATE machines SET islocationonly = 1 WHERE machineid = 258; diff --git a/sql/update_pctype_inspection.sql b/sql/update_pctype_inspection.sql new file mode 100644 index 0000000..06d7d6c --- /dev/null +++ b/sql/update_pctype_inspection.sql @@ -0,0 +1,24 @@ +-- ============================================================================ +-- Update PC Type #10: "Part Marker" → "Inspection" +-- ============================================================================ +-- Date: 2026-02-05 +-- Description: Rename pctype 10 from "Part Marker" to "Inspection" +-- +-- Run against: Production shopdb database +-- ============================================================================ + +-- Update the pctype record +UPDATE pctype +SET typename = 'Inspection', + description = 'Inspection system' +WHERE pctypeid = 10; + +-- Verify the change +SELECT pctypeid, typename, description +FROM pctype +WHERE pctypeid = 10; + +-- Show all PC types for reference +SELECT pctypeid, typename, description, displayorder +FROM pctype +ORDER BY displayorder; diff --git a/tv-dashboard/index.html b/tv-dashboard/index.html index 5254388..16d626c 100644 --- a/tv-dashboard/index.html +++ b/tv-dashboard/index.html @@ -139,6 +139,10 @@ function showError(message) { document.getElementById('slideshow').innerHTML = '

    Display Error

    ' + message + '

    '; + // Clear slides so the next successful fetch always re-renders + slides = []; + currentSlide = 0; + if (slideTimer) { clearTimeout(slideTimer); slideTimer = null; } } function startSlideshow() {