Add printer QR code printing and Windows name auto-update

- Add printerqrcode.asp for single printer QR code labels (ULINE S-20135)
- Add printerqrbatch.asp for batch printing multiple printers (6 per page)
- Add auto-update of Windows name when changing associated machine
- Windows name follows naming standard: [CSF]-[Machine]-[Vendor][Model]
- Remove UDC integrations from displaymachine.asp
- Add toner_inventory.csv for HP printer toner tracking
- Fix printerqrbatch.asp to show all printers, not just CSF ones

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
cproudlock
2025-12-19 16:38:38 -05:00
parent 51f4c078c7
commit 84c2120652
5 changed files with 1844 additions and 1638 deletions

154
printerqrcode.asp Normal file
View File

@@ -0,0 +1,154 @@
<%@ Language=VBScript %>
<%
Option Explicit
Dim objConn, rs
%>
<!DOCTYPE html>
<html>
<head>
<!--#include file="./includes/sql.asp"-->
<title>Print QR Code</title>
<script src="https://cdn.jsdelivr.net/npm/qrcodejs@1.0.0/qrcode.min.js"></script>
<style>
/* ULINE S-20135: 8.5x11 sheet, 3x3 labels, 2 cols x 3 rows */
/* Measured: top 0.875in, sides 1.1875in, gaps 0.125in */
@page { size: letter; margin: 0; }
body { font-family: Arial, sans-serif; background: #f0f0f0; margin: 0; padding: 20px; }
.no-print { margin-bottom: 20px; text-align: center; }
.print-btn { padding: 10px 30px; font-size: 16px; cursor: pointer; background: #667eea; color: white; border: none; border-radius: 5px; margin: 5px; }
.position-select { padding: 8px; font-size: 14px; margin-left: 10px; }
.print-sheet { width: 8.5in; height: 11in; background: white; margin: 0 auto; position: relative; border: 1px solid #ccc; }
.label {
width: 3in;
height: 3in;
position: absolute;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 0.1in;
box-sizing: border-box;
}
/* Label positions - top: 0.875in, left: 1.1875in, gap: 0.125in */
.pos-1 { top: 0.875in; left: 1.1875in; }
.pos-2 { top: 0.875in; left: 4.3125in; }
.pos-3 { top: 4in; left: 1.1875in; }
.pos-4 { top: 4in; left: 4.3125in; }
.pos-5 { top: 7.125in; left: 1.1875in; }
.pos-6 { top: 7.125in; left: 4.3125in; }
.label.inactive { border: 1px dashed #ccc; }
.label.active { border: 2px solid #667eea; }
.model-name { font-size: 11pt; font-weight: bold; text-align: center; margin-bottom: 0.1in; color: #000; }
.qr-container { text-align: center; }
.info-section { margin-top: 0.1in; display: flex; flex-direction: column; align-items: center; }
.info-inner { text-align: left; }
.info-row { font-size: 9pt; color: #333; margin: 1px 0; white-space: nowrap; }
.csf-name { font-size: 12pt; font-weight: bold; font-family: monospace; text-align: center; margin-bottom: 2px; }
@media print {
body { padding: 0; margin: 0; background: white; }
.no-print { display: none; }
.print-sheet { border: none; margin: 0; width: 8.5in; height: 11in; overflow: hidden; }
.label { border: none !important; }
.label.inactive { visibility: hidden; }
}
</style>
</head>
<body>
<%
Dim printerid, strSQL, csfName, winName, ipAddr, modelName
printerid = Request.QueryString("printerid")
If printerid = "" Then printerid = "0"
If Not IsNumeric(printerid) Then printerid = "0"
strSQL = "SELECT p.printercsfname, p.printerwindowsname, p.ipaddress, mo.modelnumber FROM printers p LEFT JOIN models mo ON p.modelid = mo.modelnumberid WHERE p.printerid = " & CLng(printerid)
Set rs = objConn.Execute(strSQL)
If rs.EOF Then
csfName = "NOT FOUND"
winName = ""
ipAddr = ""