<%@ Language=VBScript %> <% 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 %> <% If isLocation Then %>
<%=Server.HTMLEncode(machineNumber)%>
<% Else %>
<%=Server.HTMLEncode(modelName)%>
<% If machineImage <> "" Then %> <% End If %>
*<%=Server.HTMLEncode(machineNumber)%>*
<% End If %>