<%
' Debug page - show how many markers should be on map
Response.ContentType = "text/html"
%>
<!DOCTYPE html>
<html>
<head>
<title>Network Map Debug</title>
</head>
<body style="background:#1a1a1a; color:#fff; font-family:monospace; padding:20px;">
<h1>Network Map Debug Information</h1>

<h2>Printers with Map Coordinates:</h2>
<!--#include file="./includes/sql.asp"-->
<%
Dim strSQL, rs
strSQL = "SELECT printers.printerid, machines.machinenumber, printers.mapleft, printers.maptop, printers.ipaddress " &_
         "FROM printers " &_
         "INNER JOIN machines ON printers.machineid = machines.machineid " &_
         "WHERE printers.isactive = 1 " &_
         "AND printers.mapleft IS NOT NULL " &_
         "AND printers.maptop IS NOT NULL " &_
         "ORDER BY printers.mapleft, printers.maptop"

set rs = objConn.Execute(strSQL)

Dim count
count = 0
Response.Write("<table border='1' cellpadding='5' style='color:#fff; border-color:#444;'>")
Response.Write("<tr><th>#</th><th>ID</th><th>Number</th><th>IP</th><th>X (mapleft)</th><th>Y (maptop)</th></tr>")

While Not rs.EOF
    count = count + 1
    Response.Write("<tr>")
    Response.Write("<td>" & count & "</td>")
    Response.Write("<td>" & rs("printerid") & "</td>")
    Response.Write("<td>" & Server.HTMLEncode(rs("machinenumber")) & "</td>")
    Response.Write("<td>" & Server.HTMLEncode(rs("ipaddress")) & "</td>")
    Response.Write("<td>" & rs("mapleft") & "</td>")
    Response.Write("<td>" & rs("maptop") & "</td>")
    Response.Write("</tr>")
    rs.MoveNext
Wend

Response.Write("</table>")
Response.Write("<p><strong>Total printers with map coordinates: " & count & "</strong></p>")

rs.Close
objConn.Close
%>

<h2>Map Configuration:</h2>
<ul>
<li>Map bounds: [[0,0], [2550,3300]]</li>
<li>Expected coordinate range: X: 0-3300, Y: 0-2550</li>
<li>All coordinates above should be within these bounds</li>
</ul>

<p><a href="networkmap.asp" style="color:#4fc3f7;">Back to Network Map</a></p>

</body>
</html>
