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) <noreply@anthropic.com>
This commit is contained in:
cproudlock
2026-04-17 12:06:28 -04:00
parent 814897f075
commit 08ffa4ba36
22 changed files with 951 additions and 170 deletions

View File

@@ -3,11 +3,48 @@
Option Explicit
Dim objConn, rs
%>
<!--#include file="./includes/sql.asp"-->
<%
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
%>
<!DOCTYPE html>
<html>
<head>
<!--#include file="./includes/sql.asp"-->
<title>Print Badge</title>
<% If isLocation Then %>
<script src="https://cdn.jsdelivr.net/npm/qrcodejs@1.0.0/qrcode.min.js"></script>
<style>
@page { size: 2in 2in; margin: 0; }
body { font-family: Arial, sans-serif; background: #f0f0f0; margin: 0; padding: 20px; }
.badge-container { width: 2in; height: 2in; background: white; margin: 0 auto; border: 1px solid #ccc; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0.1in; box-sizing: border-box; }
.machine-number { font-size: 10pt; font-weight: bold; font-family: Arial, sans-serif; margin-top: 5px; text-align: center; color: #000; }
.qr-container { text-align: center; }
.print-btn { display: block; margin: 20px auto; padding: 10px 30px; font-size: 16px; cursor: pointer; background: #667eea; color: white; border: none; border-radius: 5px; }
@media print { .print-btn { display: none; } .badge-container { border: none; margin: 0; } body { background: white; padding: 0; } }
</style>
<% Else %>
<script src="https://cdn.jsdelivr.net/npm/jsbarcode@3.11.5/dist/JsBarcode.all.min.js"></script>
<style>
@page { size: 2.13in 3.38in; margin: 0; }
@@ -21,32 +58,21 @@ Dim objConn, rs
.print-btn { display: block; margin: 20px auto; padding: 10px 30px; font-size: 16px; cursor: pointer; background: #667eea; color: white; border: none; border-radius: 5px; }
@media print { .print-btn { display: none; } .badge-container { border: none; margin: 0; } body { background: white; padding: 0; } }
</style>
<% End If %>
</head>
<body>
<%
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
%>
<button class="print-btn" onclick="window.print()">Print Badge</button>
<% If isLocation Then %>
<div class="badge-container">
<div class="qr-container">
<div id="qrcode" style="margin:0 auto;"></div>
</div>
<div class="machine-number"><%=Server.HTMLEncode(machineNumber)%></div>
</div>
<script>
new QRCode(document.getElementById("qrcode"), {text:"<%=Server.HTMLEncode(machineNumber)%>",width:140,height:140,correctLevel:QRCode.CorrectLevel.M});
</script>
<% Else %>
<div class="badge-container">
<div class="model-name"><%=Server.HTMLEncode(modelName)%></div>
<% If machineImage <> "" Then %>
@@ -60,5 +86,6 @@ objConn.Close
<script>
JsBarcode("#barcode", "<%=Server.HTMLEncode(machineNumber)%>", {format:"CODE39",displayValue:false,width:2,height:70,margin:0});
</script>
<% End If %>
</body>
</html>
</html>