Renamed 45 ASP files to follow lowercase concatenated naming convention: - Direct handlers: save_machine_direct.asp -> savemachinedirect.asp - USB files: checkin_usb.asp -> checkinusb.asp - API files: api_usb.asp -> apiusb.asp - Map files: network_map.asp -> networkmap.asp - Printer files: printer_lookup.asp -> printerlookup.asp Also: - Updated 84+ internal references across all ASP and JS files - Deleted 6 test/duplicate files (editmacine.asp, test_*.asp) - Updated production migration guide with filename changes - Added rename scripts for Linux (bash) and Windows (PowerShell)
59 lines
1.9 KiB
Plaintext
59 lines
1.9 KiB
Plaintext
<!--#include file="./includes/sql.asp"-->
|
|
<%
|
|
Response.Write("<h1>Check for Duplicate Printer Machines</h1>")
|
|
|
|
Dim strSQL, rs
|
|
|
|
' Find duplicates by machinenumber
|
|
strSQL = "SELECT machinenumber, COUNT(*) as cnt " &_
|
|
"FROM machines " &_
|
|
"WHERE machinenumber LIKE '%-PRINTER' " &_
|
|
"GROUP BY machinenumber " &_
|
|
"HAVING COUNT(*) > 1 " &_
|
|
"ORDER BY cnt DESC, machinenumber"
|
|
set rs = objConn.Execute(strSQL)
|
|
|
|
Response.Write("<h3>Duplicate Machine Numbers:</h3>")
|
|
Response.Write("<table border='1' style='border-collapse:collapse'>")
|
|
Response.Write("<tr><th>Machine Number</th><th>Count</th></tr>")
|
|
Dim hasDuplicates
|
|
hasDuplicates = False
|
|
While Not rs.EOF
|
|
hasDuplicates = True
|
|
Response.Write("<tr>")
|
|
Response.Write("<td>" & Server.HTMLEncode(rs("machinenumber") & "") & "</td>")
|
|
Response.Write("<td>" & rs("cnt") & "</td>")
|
|
Response.Write("</tr>")
|
|
rs.MoveNext
|
|
Wend
|
|
Response.Write("</table>")
|
|
|
|
If Not hasDuplicates Then
|
|
Response.Write("<p style='color:green'>No duplicates found!</p>")
|
|
End If
|
|
rs.Close
|
|
|
|
' Show all printer machines grouped
|
|
Response.Write("<h3>All Printer Machines (grouped by name):</h3>")
|
|
strSQL = "SELECT machinenumber, COUNT(*) as cnt, GROUP_CONCAT(machineid) as ids " &_
|
|
"FROM machines " &_
|
|
"WHERE machinetypeid = 15 " &_
|
|
"GROUP BY machinenumber " &_
|
|
"ORDER BY machinenumber"
|
|
set rs = objConn.Execute(strSQL)
|
|
Response.Write("<table border='1' style='border-collapse:collapse'>")
|
|
Response.Write("<tr><th>Machine Number</th><th>Count</th><th>Machine IDs</th></tr>")
|
|
While Not rs.EOF
|
|
Response.Write("<tr>")
|
|
Response.Write("<td>" & Server.HTMLEncode(rs("machinenumber") & "") & "</td>")
|
|
Response.Write("<td>" & rs("cnt") & "</td>")
|
|
Response.Write("<td>" & Server.HTMLEncode(rs("ids") & "") & "</td>")
|
|
Response.Write("</tr>")
|
|
rs.MoveNext
|
|
Wend
|
|
Response.Write("</table>")
|
|
rs.Close
|
|
|
|
objConn.Close
|
|
%>
|