Standardize ASP filenames: remove underscores
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)
This commit is contained in:
@@ -60,7 +60,7 @@ If errorType <> "" Then
|
|||||||
End If
|
End If
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<form method="post" action="./saveapplication_direct.asp">
|
<form method="post" action="./saveapplicationdirect.asp">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="appname">Application Name <span class="text-danger">*</span></label>
|
<label for="appname">Application Name <span class="text-danger">*</span></label>
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ Else
|
|||||||
End If
|
End If
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<form id="scanForm" method="post" action="./savedevice_direct.asp">
|
<form id="scanForm" method="post" action="./savedevicedirect.asp">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="serialnumber">Serial Number</label>
|
<label for="serialnumber">Serial Number</label>
|
||||||
<input
|
<input
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form method="post" action="./addlink_direct.asp">
|
<form method="post" action="./addlinkdirect.asp">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="shortdescription">Description <span class="text-danger">*</span></label>
|
<label for="shortdescription">Description <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="shortdescription" name="shortdescription"
|
<input type="text" class="form-control" id="shortdescription" name="shortdescription"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: addlink_direct.asp
|
' FILE: addlinkdirect.asp
|
||||||
' PURPOSE: Add knowledge base article with nested entity creation (topic, support team, app owner)
|
' PURPOSE: Add knowledge base article with nested entity creation (topic, support team, app owner)
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form method="post" action="./savemachine_direct.asp" id="addMachineForm">
|
<form method="post" action="./savemachinedirect.asp" id="addMachineForm">
|
||||||
|
|
||||||
<!-- Tab Navigation -->
|
<!-- Tab Navigation -->
|
||||||
<ul class="nav nav-tabs nav-tabs-primary top-icon" role="tablist">
|
<ul class="nav nav-tabs nav-tabs-primary top-icon" role="tablist">
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form method="post" action="./savemodel_direct.asp" id="modelForm">
|
<form method="post" action="./savemodeldirect.asp" id="modelForm">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="modelnumber">Model Number <span class="text-danger">*</span></label>
|
<label for="modelnumber">Model Number <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="modelnumber" name="modelnumber"
|
<input type="text" class="form-control" id="modelnumber" name="modelnumber"
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form method="post" action="./savenotification_direct.asp">
|
<form method="post" action="./savenotificationdirect.asp">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="notification">Message <span class="text-danger">*</span></label>
|
<label for="notification">Message <span class="text-danger">*</span></label>
|
||||||
<textarea class="form-control" id="notification" name="notification" rows="3"
|
<textarea class="form-control" id="notification" name="notification" rows="3"
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form method="post" action="./saveprinter_direct.asp">
|
<form method="post" action="./saveprinterdirect.asp">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="modelid">Model <span class="text-danger">*</span></label>
|
<label for="modelid">Model <span class="text-danger">*</span></label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<form method="post" action="./addsubnetbackend_direct.asp">
|
<form method="post" action="./addsubnetbackenddirect.asp">
|
||||||
<th scope="row"><input class="form-control" type="text" name="vlan" size="4"></th>
|
<th scope="row"><input class="form-control" type="text" name="vlan" size="4"></th>
|
||||||
<td><select name="subnettypeid" class="btn btn-light px-3">
|
<td><select name="subnettypeid" class="btn btn-light px-3">
|
||||||
<%
|
<%
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: addsubnetbackend_direct.asp
|
' FILE: addsubnetbackenddirect.asp
|
||||||
' PURPOSE: Create new subnet with IP address calculations
|
' PURPOSE: Create new subnet with IP address calculations
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
||||||
@@ -57,7 +57,7 @@ Else
|
|||||||
End If
|
End If
|
||||||
%>
|
%>
|
||||||
|
|
||||||
<form id="scanForm" method="post" action="./saveusb_direct.asp">
|
<form id="scanForm" method="post" action="./saveusbdirect.asp">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="serialnumber">Serial Number</label>
|
<label for="serialnumber">Serial Number</label>
|
||||||
<input
|
<input
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form method="post" action="./savevendor_direct.asp" id="vendorForm">
|
<form method="post" action="./savevendordirect.asp" id="vendorForm">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="vendor">Manufacturer Name <span class="text-danger">*</span></label>
|
<label for="vendor">Manufacturer Name <span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="vendor" name="vendor"
|
<input type="text" class="form-control" id="vendor" name="vendor"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
' Admin utility to clear all cache (Zabbix, Dropdowns, Lists)
|
' Admin utility to clear all cache (Zabbix, Dropdowns, Lists)
|
||||||
' Usage: admin_clear_cache.asp?confirm=yes&type=all|zabbix|dropdown|list
|
' Usage: adminclearcache.asp?confirm=yes&type=all|zabbix|dropdown|list
|
||||||
%>
|
%>
|
||||||
<!--#include file="./includes/header.asp"-->
|
<!--#include file="./includes/header.asp"-->
|
||||||
<!--#include file="./includes/sql.asp"-->
|
<!--#include file="./includes/sql.asp"-->
|
||||||
@@ -139,7 +139,7 @@ Else
|
|||||||
Response.Write("<div class='info' style='margin-top:30px;'>")
|
Response.Write("<div class='info' style='margin-top:30px;'>")
|
||||||
Response.Write("<strong>🖨️ Clear Individual Printer Cache</strong>")
|
Response.Write("<strong>🖨️ Clear Individual Printer Cache</strong>")
|
||||||
Response.Write("<p>To clear cache for a specific printer, enter its IP address:</p>")
|
Response.Write("<p>To clear cache for a specific printer, enter its IP address:</p>")
|
||||||
Response.Write("<form method='get' action='admin_clear_cache.asp'>")
|
Response.Write("<form method='get' action='adminclearcache.asp'>")
|
||||||
Response.Write("<input type='hidden' name='confirm' value='yes'>")
|
Response.Write("<input type='hidden' name='confirm' value='yes'>")
|
||||||
Response.Write("<input type='hidden' name='type' value='printer'>")
|
Response.Write("<input type='hidden' name='type' value='printer'>")
|
||||||
Response.Write("<div class='form-group'>")
|
Response.Write("<div class='form-group'>")
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<%@ Language="VBScript" %>
|
<%@ Language="VBScript" %>
|
||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: api_usb.asp
|
' FILE: apiusb.asp
|
||||||
' PURPOSE: API endpoints for USB device operations
|
' PURPOSE: API endpoints for USB device operations
|
||||||
' SECURITY: Parameterized queries, JSON output
|
' SECURITY: Parameterized queries, JSON output
|
||||||
' CREATED: 2025-12-07
|
' CREATED: 2025-12-07
|
||||||
@@ -100,7 +100,7 @@ End If
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form id="checkinForm" method="post" action="./savecheckin_usb.asp">
|
<form id="checkinForm" method="post" action="./savecheckinusb.asp">
|
||||||
<input type="hidden" id="checkoutid" name="checkoutid" value="">
|
<input type="hidden" id="checkoutid" name="checkoutid" value="">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -242,7 +242,7 @@ $(document).ready(function() {
|
|||||||
$('#loadingArea').show();
|
$('#loadingArea').show();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: './api_usb.asp',
|
url: './apiusb.asp',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
data: { action: 'checkin_lookup', serial: serial },
|
data: { action: 'checkin_lookup', serial: serial },
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
@@ -268,7 +268,7 @@ $(document).ready(function() {
|
|||||||
} else {
|
} else {
|
||||||
var errorHtml = '<strong>' + (data.error || 'Error looking up USB') + '</strong>';
|
var errorHtml = '<strong>' + (data.error || 'Error looking up USB') + '</strong>';
|
||||||
if (data.error && data.error.indexOf('not currently checked out') >= 0) {
|
if (data.error && data.error.indexOf('not currently checked out') >= 0) {
|
||||||
errorHtml += '<br><br>To checkout this USB, use <a href="./checkout_usb.asp?serial=' + encodeURIComponent(serial) + '">Checkout</a>.';
|
errorHtml += '<br><br>To checkout this USB, use <a href="./checkoutusb.asp?serial=' + encodeURIComponent(serial) + '">Checkout</a>.';
|
||||||
}
|
}
|
||||||
$('#errorMessage').html(errorHtml);
|
$('#errorMessage').html(errorHtml);
|
||||||
$('#errorArea').show();
|
$('#errorArea').show();
|
||||||
@@ -97,7 +97,7 @@ End If
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form id="checkoutForm" method="post" action="./savecheckout_usb.asp">
|
<form id="checkoutForm" method="post" action="./savecheckoutusb.asp">
|
||||||
<input type="hidden" id="machineid" name="machineid" value="">
|
<input type="hidden" id="machineid" name="machineid" value="">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@@ -240,7 +240,7 @@ $(document).ready(function() {
|
|||||||
$('#loadingArea').show();
|
$('#loadingArea').show();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: './api_usb.asp',
|
url: './apiusb.asp',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
data: { action: 'lookup', serial: serial },
|
data: { action: 'lookup', serial: serial },
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
@@ -252,7 +252,7 @@ $(document).ready(function() {
|
|||||||
$('#errorMessage').html('<strong>USB is currently checked out!</strong><br>' +
|
$('#errorMessage').html('<strong>USB is currently checked out!</strong><br>' +
|
||||||
'Checked out by: ' + data.current_holder + '<br>' +
|
'Checked out by: ' + data.current_holder + '<br>' +
|
||||||
'Since: ' + data.checkout_time + '<br><br>' +
|
'Since: ' + data.checkout_time + '<br><br>' +
|
||||||
'Please use <a href="./checkin_usb.asp?serial=' + encodeURIComponent(serial) + '">Check-in</a> first.');
|
'Please use <a href="./checkinusb.asp?serial=' + encodeURIComponent(serial) + '">Check-in</a> first.');
|
||||||
$('#errorArea').show();
|
$('#errorArea').show();
|
||||||
} else {
|
} else {
|
||||||
// Available - show checkout form
|
// Available - show checkout form
|
||||||
@@ -96,8 +96,8 @@
|
|||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<nav aria-label="breadcrumb">
|
<nav aria-label="breadcrumb">
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li class="breadcrumb-item"><a href="network_devices.asp">Network Devices</a></li>
|
<li class="breadcrumb-item"><a href="networkdevices.asp">Network Devices</a></li>
|
||||||
<li class="breadcrumb-item"><a href="network_devices.asp?filter=Access Point">Access Pointes</a></li>
|
<li class="breadcrumb-item"><a href="networkdevices.asp?filter=Access Point">Access Pointes</a></li>
|
||||||
<li class="breadcrumb-item active"><%If isNewRecord Then Response.Write("Add Access Point") Else Response.Write("Edit Access Point")%></li>
|
<li class="breadcrumb-item active"><%If isNewRecord Then Response.Write("Add Access Point") Else Response.Write("Edit Access Point")%></li>
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -114,7 +114,7 @@
|
|||||||
</h5>
|
</h5>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<form method="post" action="save_network_device.asp">
|
<form method="post" action="savenetworkdevice.asp">
|
||||||
<input type="hidden" name="type" value="accesspoint">
|
<input type="hidden" name="type" value="accesspoint">
|
||||||
<input type="hidden" name="id" value="<%=accesspointid%>">
|
<input type="hidden" name="id" value="<%=accesspointid%>">
|
||||||
|
|
||||||
@@ -360,7 +360,7 @@
|
|||||||
<i class="zmdi zmdi-save"></i>
|
<i class="zmdi zmdi-save"></i>
|
||||||
<%If isNewRecord Then Response.Write("Add Access Point") Else Response.Write("Save Changes")%>
|
<%If isNewRecord Then Response.Write("Add Access Point") Else Response.Write("Save Changes")%>
|
||||||
</button>
|
</button>
|
||||||
<a href="network_devices.asp?filter=Access Point" class="btn btn-secondary">
|
<a href="networkdevices.asp?filter=Access Point" class="btn btn-secondary">
|
||||||
<i class="zmdi zmdi-close"></i> Cancel
|
<i class="zmdi zmdi-close"></i> Cancel
|
||||||
</a>
|
</a>
|
||||||
<%If Not isNewRecord Then%>
|
<%If Not isNewRecord Then%>
|
||||||
@@ -408,7 +408,7 @@ function confirmDelete() {
|
|||||||
if (confirm('Are you sure you want to delete this accesspoint? This action cannot be undone.')) {
|
if (confirm('Are you sure you want to delete this accesspoint? This action cannot be undone.')) {
|
||||||
var form = document.createElement('form');
|
var form = document.createElement('form');
|
||||||
form.method = 'POST';
|
form.method = 'POST';
|
||||||
form.action = 'save_network_device.asp';
|
form.action = 'savenetworkdevice.asp';
|
||||||
|
|
||||||
var typeInput = document.createElement('input');
|
var typeInput = document.createElement('input');
|
||||||
typeInput.type = 'hidden';
|
typeInput.type = 'hidden';
|
||||||
|
|||||||
@@ -118,8 +118,8 @@
|
|||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<nav aria-label="breadcrumb">
|
<nav aria-label="breadcrumb">
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li class="breadcrumb-item"><a href="network_devices.asp">Network Devices</a></li>
|
<li class="breadcrumb-item"><a href="networkdevices.asp">Network Devices</a></li>
|
||||||
<li class="breadcrumb-item"><a href="network_devices.asp?filter=Camera">Cameras</a></li>
|
<li class="breadcrumb-item"><a href="networkdevices.asp?filter=Camera">Cameras</a></li>
|
||||||
<li class="breadcrumb-item active"><%If isNewRecord Then Response.Write("Add Camera") Else Response.Write("Edit Camera")%></li>
|
<li class="breadcrumb-item active"><%If isNewRecord Then Response.Write("Add Camera") Else Response.Write("Edit Camera")%></li>
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
</h5>
|
</h5>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<form method="post" action="save_network_device.asp">
|
<form method="post" action="savenetworkdevice.asp">
|
||||||
<input type="hidden" name="type" value="camera">
|
<input type="hidden" name="type" value="camera">
|
||||||
<input type="hidden" name="id" value="<%=cameraid%>">
|
<input type="hidden" name="id" value="<%=cameraid%>">
|
||||||
|
|
||||||
@@ -466,7 +466,7 @@
|
|||||||
<i class="zmdi zmdi-save"></i>
|
<i class="zmdi zmdi-save"></i>
|
||||||
<%If isNewRecord Then Response.Write("Add Camera") Else Response.Write("Save Changes")%>
|
<%If isNewRecord Then Response.Write("Add Camera") Else Response.Write("Save Changes")%>
|
||||||
</button>
|
</button>
|
||||||
<a href="network_devices.asp?filter=Camera" class="btn btn-secondary">
|
<a href="networkdevices.asp?filter=Camera" class="btn btn-secondary">
|
||||||
<i class="zmdi zmdi-close"></i> Cancel
|
<i class="zmdi zmdi-close"></i> Cancel
|
||||||
</a>
|
</a>
|
||||||
<%If Not isNewRecord Then%>
|
<%If Not isNewRecord Then%>
|
||||||
@@ -514,7 +514,7 @@ function confirmDelete() {
|
|||||||
if (confirm('Are you sure you want to delete this camera? This action cannot be undone.')) {
|
if (confirm('Are you sure you want to delete this camera? This action cannot be undone.')) {
|
||||||
var form = document.createElement('form');
|
var form = document.createElement('form');
|
||||||
form.method = 'POST';
|
form.method = 'POST';
|
||||||
form.action = 'save_network_device.asp';
|
form.action = 'savenetworkdevice.asp';
|
||||||
|
|
||||||
var typeInput = document.createElement('input');
|
var typeInput = document.createElement('input');
|
||||||
typeInput.type = 'hidden';
|
typeInput.type = 'hidden';
|
||||||
|
|||||||
@@ -75,8 +75,8 @@
|
|||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<nav aria-label="breadcrumb">
|
<nav aria-label="breadcrumb">
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li class="breadcrumb-item"><a href="network_devices.asp">Network Devices</a></li>
|
<li class="breadcrumb-item"><a href="networkdevices.asp">Network Devices</a></li>
|
||||||
<li class="breadcrumb-item"><a href="network_devices.asp?filter=IDF">IDFs</a></li>
|
<li class="breadcrumb-item"><a href="networkdevices.asp?filter=IDF">IDFs</a></li>
|
||||||
<li class="breadcrumb-item active"><%If isNewRecord Then Response.Write("Add IDF") Else Response.Write("Edit IDF")%></li>
|
<li class="breadcrumb-item active"><%If isNewRecord Then Response.Write("Add IDF") Else Response.Write("Edit IDF")%></li>
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
</h5>
|
</h5>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<form method="post" action="save_network_device.asp">
|
<form method="post" action="savenetworkdevice.asp">
|
||||||
<input type="hidden" name="type" value="idf">
|
<input type="hidden" name="type" value="idf">
|
||||||
<input type="hidden" name="id" value="<%=idfid%>">
|
<input type="hidden" name="id" value="<%=idfid%>">
|
||||||
|
|
||||||
@@ -166,7 +166,7 @@
|
|||||||
<i class="zmdi zmdi-save"></i>
|
<i class="zmdi zmdi-save"></i>
|
||||||
<%If isNewRecord Then Response.Write("Add IDF") Else Response.Write("Save Changes")%>
|
<%If isNewRecord Then Response.Write("Add IDF") Else Response.Write("Save Changes")%>
|
||||||
</button>
|
</button>
|
||||||
<a href="network_devices.asp?filter=IDF" class="btn btn-secondary">
|
<a href="networkdevices.asp?filter=IDF" class="btn btn-secondary">
|
||||||
<i class="zmdi zmdi-close"></i> Cancel
|
<i class="zmdi zmdi-close"></i> Cancel
|
||||||
</a>
|
</a>
|
||||||
<%If Not isNewRecord Then%>
|
<%If Not isNewRecord Then%>
|
||||||
@@ -215,7 +215,7 @@ function confirmDelete() {
|
|||||||
// Submit delete request
|
// Submit delete request
|
||||||
var form = document.createElement('form');
|
var form = document.createElement('form');
|
||||||
form.method = 'POST';
|
form.method = 'POST';
|
||||||
form.action = 'save_network_device.asp';
|
form.action = 'savenetworkdevice.asp';
|
||||||
|
|
||||||
var typeInput = document.createElement('input');
|
var typeInput = document.createElement('input');
|
||||||
typeInput.type = 'hidden';
|
typeInput.type = 'hidden';
|
||||||
|
|||||||
@@ -92,8 +92,8 @@
|
|||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<nav aria-label="breadcrumb">
|
<nav aria-label="breadcrumb">
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li class="breadcrumb-item"><a href="network_devices.asp">Network Devices</a></li>
|
<li class="breadcrumb-item"><a href="networkdevices.asp">Network Devices</a></li>
|
||||||
<li class="breadcrumb-item"><a href="network_devices.asp?filter=Server">Servers</a></li>
|
<li class="breadcrumb-item"><a href="networkdevices.asp?filter=Server">Servers</a></li>
|
||||||
<li class="breadcrumb-item active"><%If isNewRecord Then Response.Write("Add Server") Else Response.Write("Edit Server")%></li>
|
<li class="breadcrumb-item active"><%If isNewRecord Then Response.Write("Add Server") Else Response.Write("Edit Server")%></li>
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
</h5>
|
</h5>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<form method="post" action="save_network_device.asp">
|
<form method="post" action="savenetworkdevice.asp">
|
||||||
<input type="hidden" name="type" value="server">
|
<input type="hidden" name="type" value="server">
|
||||||
<input type="hidden" name="id" value="<%=serverid%>">
|
<input type="hidden" name="id" value="<%=serverid%>">
|
||||||
|
|
||||||
@@ -356,7 +356,7 @@
|
|||||||
<i class="zmdi zmdi-save"></i>
|
<i class="zmdi zmdi-save"></i>
|
||||||
<%If isNewRecord Then Response.Write("Add Server") Else Response.Write("Save Changes")%>
|
<%If isNewRecord Then Response.Write("Add Server") Else Response.Write("Save Changes")%>
|
||||||
</button>
|
</button>
|
||||||
<a href="network_devices.asp?filter=Server" class="btn btn-secondary">
|
<a href="networkdevices.asp?filter=Server" class="btn btn-secondary">
|
||||||
<i class="zmdi zmdi-close"></i> Cancel
|
<i class="zmdi zmdi-close"></i> Cancel
|
||||||
</a>
|
</a>
|
||||||
<%If Not isNewRecord Then%>
|
<%If Not isNewRecord Then%>
|
||||||
@@ -404,7 +404,7 @@ function confirmDelete() {
|
|||||||
if (confirm('Are you sure you want to delete this server? This action cannot be undone.')) {
|
if (confirm('Are you sure you want to delete this server? This action cannot be undone.')) {
|
||||||
var form = document.createElement('form');
|
var form = document.createElement('form');
|
||||||
form.method = 'POST';
|
form.method = 'POST';
|
||||||
form.action = 'save_network_device.asp';
|
form.action = 'savenetworkdevice.asp';
|
||||||
|
|
||||||
var typeInput = document.createElement('input');
|
var typeInput = document.createElement('input');
|
||||||
typeInput.type = 'hidden';
|
typeInput.type = 'hidden';
|
||||||
|
|||||||
@@ -92,8 +92,8 @@
|
|||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<nav aria-label="breadcrumb">
|
<nav aria-label="breadcrumb">
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li class="breadcrumb-item"><a href="network_devices.asp">Network Devices</a></li>
|
<li class="breadcrumb-item"><a href="networkdevices.asp">Network Devices</a></li>
|
||||||
<li class="breadcrumb-item"><a href="network_devices.asp?filter=switch">switchs</a></li>
|
<li class="breadcrumb-item"><a href="networkdevices.asp?filter=switch">switchs</a></li>
|
||||||
<li class="breadcrumb-item active"><%If isNewRecord Then Response.Write("Add switch") Else Response.Write("Edit switch")%></li>
|
<li class="breadcrumb-item active"><%If isNewRecord Then Response.Write("Add switch") Else Response.Write("Edit switch")%></li>
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
</h5>
|
</h5>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<form method="post" action="save_network_device.asp">
|
<form method="post" action="savenetworkdevice.asp">
|
||||||
<input type="hidden" name="type" value="switch">
|
<input type="hidden" name="type" value="switch">
|
||||||
<input type="hidden" name="id" value="<%=switchid%>">
|
<input type="hidden" name="id" value="<%=switchid%>">
|
||||||
|
|
||||||
@@ -356,7 +356,7 @@
|
|||||||
<i class="zmdi zmdi-save"></i>
|
<i class="zmdi zmdi-save"></i>
|
||||||
<%If isNewRecord Then Response.Write("Add switch") Else Response.Write("Save Changes")%>
|
<%If isNewRecord Then Response.Write("Add switch") Else Response.Write("Save Changes")%>
|
||||||
</button>
|
</button>
|
||||||
<a href="network_devices.asp?filter=switch" class="btn btn-secondary">
|
<a href="networkdevices.asp?filter=switch" class="btn btn-secondary">
|
||||||
<i class="zmdi zmdi-close"></i> Cancel
|
<i class="zmdi zmdi-close"></i> Cancel
|
||||||
</a>
|
</a>
|
||||||
<%If Not isNewRecord Then%>
|
<%If Not isNewRecord Then%>
|
||||||
@@ -404,7 +404,7 @@ function confirmDelete() {
|
|||||||
if (confirm('Are you sure you want to delete this switch? This action cannot be undone.')) {
|
if (confirm('Are you sure you want to delete this switch? This action cannot be undone.')) {
|
||||||
var form = document.createElement('form');
|
var form = document.createElement('form');
|
||||||
form.method = 'POST';
|
form.method = 'POST';
|
||||||
form.action = 'save_network_device.asp';
|
form.action = 'savenetworkdevice.asp';
|
||||||
|
|
||||||
var typeInput = document.createElement('input');
|
var typeInput = document.createElement('input');
|
||||||
typeInput.type = 'hidden';
|
typeInput.type = 'hidden';
|
||||||
|
|||||||
@@ -260,7 +260,7 @@
|
|||||||
|
|
||||||
<div class="tab-pane" id="edit">
|
<div class="tab-pane" id="edit">
|
||||||
<h5 class="mb-3">Edit Application</h5>
|
<h5 class="mb-3">Edit Application</h5>
|
||||||
<form method="post" action="./editapplication_direct.asp">
|
<form method="post" action="./editapplicationdirect.asp">
|
||||||
<input type="hidden" name="appid" value="<%=Server.HTMLEncode(rs("appid"))%>">
|
<input type="hidden" name="appid" value="<%=Server.HTMLEncode(rs("appid"))%>">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
' Validate inputs
|
' Validate inputs
|
||||||
If deviceType = "" Or deviceId = "" Or Not IsNumeric(deviceId) Or CLng(deviceId) < 1 Then
|
If deviceType = "" Or deviceId = "" Or Not IsNumeric(deviceId) Or CLng(deviceId) < 1 Then
|
||||||
Response.Redirect("network_devices.asp")
|
Response.Redirect("networkdevices.asp")
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
tableName = "idfs"
|
tableName = "idfs"
|
||||||
idField = "idfid"
|
idField = "idfid"
|
||||||
editUrl = "deviceidf.asp?id=" & deviceId
|
editUrl = "deviceidf.asp?id=" & deviceId
|
||||||
listUrl = "network_devices.asp?filter=IDF"
|
listUrl = "networkdevices.asp?filter=IDF"
|
||||||
strSQL = "SELECT i.idfid, i.idfname, i.description, i.maptop, i.mapleft, i.isactive, " & _
|
strSQL = "SELECT i.idfid, i.idfname, i.description, i.maptop, i.mapleft, i.isactive, " & _
|
||||||
"NULL AS vendor, NULL AS modelnumber, NULL AS serialnumber, NULL AS ipaddress, NULL AS macaddress, 'IDF' AS devicetype " & _
|
"NULL AS vendor, NULL AS modelnumber, NULL AS serialnumber, NULL AS ipaddress, NULL AS macaddress, 'IDF' AS devicetype " & _
|
||||||
"FROM idfs i WHERE i.idfid = " & CLng(deviceId)
|
"FROM idfs i WHERE i.idfid = " & CLng(deviceId)
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
tableName = "servers"
|
tableName = "servers"
|
||||||
idField = "serverid"
|
idField = "serverid"
|
||||||
editUrl = "deviceserver.asp?id=" & deviceId
|
editUrl = "deviceserver.asp?id=" & deviceId
|
||||||
listUrl = "network_devices.asp?filter=Server"
|
listUrl = "networkdevices.asp?filter=Server"
|
||||||
strSQL = "SELECT s.*, v.vendor, m.modelnumber, s.serialnumber, s.ipaddress, NULL AS macaddress, NULL AS idfname, 'Server' AS devicetype, " & _
|
strSQL = "SELECT s.*, v.vendor, m.modelnumber, s.serialnumber, s.ipaddress, NULL AS macaddress, NULL AS idfname, 'Server' AS devicetype, " & _
|
||||||
"s.servername AS devicename " & _
|
"s.servername AS devicename " & _
|
||||||
"FROM servers s " & _
|
"FROM servers s " & _
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
tableName = "switches"
|
tableName = "switches"
|
||||||
idField = "switchid"
|
idField = "switchid"
|
||||||
editUrl = "deviceswitch.asp?id=" & deviceId
|
editUrl = "deviceswitch.asp?id=" & deviceId
|
||||||
listUrl = "network_devices.asp?filter=Switch"
|
listUrl = "networkdevices.asp?filter=Switch"
|
||||||
strSQL = "SELECT s.*, v.vendor, m.modelnumber, s.serialnumber, s.ipaddress, NULL AS macaddress, NULL AS idfname, 'Switch' AS devicetype, " & _
|
strSQL = "SELECT s.*, v.vendor, m.modelnumber, s.serialnumber, s.ipaddress, NULL AS macaddress, NULL AS idfname, 'Switch' AS devicetype, " & _
|
||||||
"s.switchname AS devicename " & _
|
"s.switchname AS devicename " & _
|
||||||
"FROM switches s " & _
|
"FROM switches s " & _
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
tableName = "cameras"
|
tableName = "cameras"
|
||||||
idField = "cameraid"
|
idField = "cameraid"
|
||||||
editUrl = "devicecamera.asp?id=" & deviceId
|
editUrl = "devicecamera.asp?id=" & deviceId
|
||||||
listUrl = "network_devices.asp?filter=Camera"
|
listUrl = "networkdevices.asp?filter=Camera"
|
||||||
strSQL = "SELECT c.*, v.vendor, m.modelnumber, c.serialnumber, c.ipaddress, c.macaddress, i.idfname, 'Camera' AS devicetype, " & _
|
strSQL = "SELECT c.*, v.vendor, m.modelnumber, c.serialnumber, c.ipaddress, c.macaddress, i.idfname, 'Camera' AS devicetype, " & _
|
||||||
"c.cameraname AS devicename " & _
|
"c.cameraname AS devicename " & _
|
||||||
"FROM cameras c " & _
|
"FROM cameras c " & _
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
tableName = "accesspoints"
|
tableName = "accesspoints"
|
||||||
idField = "apid"
|
idField = "apid"
|
||||||
editUrl = "deviceaccesspoint.asp?id=" & deviceId
|
editUrl = "deviceaccesspoint.asp?id=" & deviceId
|
||||||
listUrl = "network_devices.asp?filter=Access Point"
|
listUrl = "networkdevices.asp?filter=Access Point"
|
||||||
strSQL = "SELECT ap.apid, ap.apname AS devicename, ap.modelid, ap.serialnumber, ap.ipaddress, ap.description, ap.maptop, ap.mapleft, ap.isactive, " & _
|
strSQL = "SELECT ap.apid, ap.apname AS devicename, ap.modelid, ap.serialnumber, ap.ipaddress, ap.description, ap.maptop, ap.mapleft, ap.isactive, " & _
|
||||||
"v.vendor, m.modelnumber, NULL AS macaddress, NULL AS idfname, NULL AS idfid, 'Access Point' AS devicetype " & _
|
"v.vendor, m.modelnumber, NULL AS macaddress, NULL AS idfname, NULL AS idfid, 'Access Point' AS devicetype " & _
|
||||||
"FROM accesspoints ap " & _
|
"FROM accesspoints ap " & _
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
"LEFT JOIN vendors v ON m.vendorid = v.vendorid " & _
|
"LEFT JOIN vendors v ON m.vendorid = v.vendorid " & _
|
||||||
"WHERE ap.apid = " & CLng(deviceId)
|
"WHERE ap.apid = " & CLng(deviceId)
|
||||||
Case Else
|
Case Else
|
||||||
Response.Redirect("network_devices.asp")
|
Response.Redirect("networkdevices.asp")
|
||||||
Response.End
|
Response.End
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
If rs.EOF Then
|
If rs.EOF Then
|
||||||
rs.Close
|
rs.Close
|
||||||
Set rs = Nothing
|
Set rs = Nothing
|
||||||
Response.Redirect("network_devices.asp")
|
Response.Redirect("networkdevices.asp")
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -431,7 +431,7 @@ $(document).ready(function() {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var deviceId = $(this).data('deviceid');
|
var deviceId = $(this).data('deviceid');
|
||||||
var deviceType = $(this).data('devicetype');
|
var deviceType = $(this).data('devicetype');
|
||||||
window.open('network_map.asp', '_blank');
|
window.open('networkmap.asp', '_blank');
|
||||||
});
|
});
|
||||||
|
|
||||||
$popup.on('mouseenter', function() {});
|
$popup.on('mouseenter', function() {});
|
||||||
|
|||||||
@@ -168,7 +168,7 @@
|
|||||||
<a href="javascript:void();" data-target="#applications" data-toggle="pill" class="nav-link"><i class="zmdi zmdi-apps"></i> <span class="hidden-xs">Applications</span></a>
|
<a href="javascript:void();" data-target="#applications" data-toggle="pill" class="nav-link"><i class="zmdi zmdi-apps"></i> <span class="hidden-xs">Applications</span></a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="./machine_edit.asp?machineid=<%=Server.HTMLEncode(machineid)%>" class="nav-link" style="background: linear-gradient(45deg, #667eea 0%, #764ba2 100%); color: white;"><i class="zmdi zmdi-edit"></i> <span class="hidden-xs">Edit Machine</span></a>
|
<a href="./machineedit.asp?machineid=<%=Server.HTMLEncode(machineid)%>" class="nav-link" style="background: linear-gradient(45deg, #667eea 0%, #764ba2 100%); color: white;"><i class="zmdi zmdi-edit"></i> <span class="hidden-xs">Edit Machine</span></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content p-3">
|
<div class="tab-content p-3">
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div style="margin-bottom:15px;">
|
<div style="margin-bottom:15px;">
|
||||||
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:15px;">
|
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:15px;">
|
||||||
<h5 class="card-title" style="margin:0;"><a href="./machine_map.asp" target="_blank"><i class='zmdi zmdi-map' title='Show Machine Map'></i></a> Machines</h5>
|
<h5 class="card-title" style="margin:0;"><a href="./machinemap.asp" target="_blank"><i class='zmdi zmdi-map' title='Show Machine Map'></i></a> Machines</h5>
|
||||||
<div>
|
<div>
|
||||||
<a href="./addmachine.asp" class="btn btn-primary">
|
<a href="./addmachine.asp" class="btn btn-primary">
|
||||||
<i class="zmdi zmdi-plus-circle"></i> Add Machine
|
<i class="zmdi zmdi-plus-circle"></i> Add Machine
|
||||||
|
|||||||
@@ -189,7 +189,7 @@
|
|||||||
IF rs("installpath") & "" <> "" THEN
|
IF rs("installpath") & "" <> "" THEN
|
||||||
response.write ("<a href='./" & Server.HTMLEncode(rs("installpath") & "") & "' title='Download Specific Installer'><i class='zmdi zmdi-download' style='font-size:1.2rem; color:#007bff;'></i> <span style='color:#007bff;'>Specific Installer</span></a>")
|
response.write ("<a href='./" & Server.HTMLEncode(rs("installpath") & "") & "' title='Download Specific Installer'><i class='zmdi zmdi-download' style='font-size:1.2rem; color:#007bff;'></i> <span style='color:#007bff;'>Specific Installer</span></a>")
|
||||||
ELSE
|
ELSE
|
||||||
response.write ("<a href='./install_printer.asp?printerid=" & Server.HTMLEncode(printerid) & "' title='Download Universal Driver Installer'><i class='zmdi zmdi-download' style='font-size:1.2rem; color:#28a745;'></i> <span style='color:#28a745;'>Universal Installer</span></a>")
|
response.write ("<a href='./installprinter.asp?printerid=" & Server.HTMLEncode(printerid) & "' title='Download Universal Driver Installer'><i class='zmdi zmdi-download' style='font-size:1.2rem; color:#28a745;'></i> <span style='color:#28a745;'>Universal Installer</span></a>")
|
||||||
END IF
|
END IF
|
||||||
%>
|
%>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:15px;">
|
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:15px;">
|
||||||
<h5 class="card-title" style="margin:0;">
|
<h5 class="card-title" style="margin:0;">
|
||||||
<a href="./printermap.asp" target="_blank"><i class='zmdi zmdi-map' title='Show Printer Map' style='color:#fff;'></i></a>  <a href="./tonerreport.asp" target="_blank"><i class='zmdi zmdi-collection-image text-yellow' title='Low Toner Report'></i></a>  <a href="./printer_installer_map.asp" target="_blank"><i class='zmdi zmdi-download' title='Printer Installer Map' style='color:#fff;'></i></a>    Printers
|
<a href="./printermap.asp" target="_blank"><i class='zmdi zmdi-map' title='Show Printer Map' style='color:#fff;'></i></a>  <a href="./tonerreport.asp" target="_blank"><i class='zmdi zmdi-collection-image text-yellow' title='Low Toner Report'></i></a>  <a href="./printerinstallermap.asp" target="_blank"><i class='zmdi zmdi-download' title='Printer Installer Map' style='color:#fff;'></i></a>    Printers
|
||||||
</h5>
|
</h5>
|
||||||
<div>
|
<div>
|
||||||
<a href="./addprinter.asp" class="btn btn-primary">
|
<a href="./addprinter.asp" class="btn btn-primary">
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
If installpath <> "" Then
|
If installpath <> "" Then
|
||||||
Response.write("<td><a href='./" & installpath & "'><i class='zmdi zmdi-download' title='Click to Download Specific Installer' style='color:#fff;'></i></a></td>")
|
Response.write("<td><a href='./" & installpath & "'><i class='zmdi zmdi-download' title='Click to Download Specific Installer' style='color:#fff;'></i></a></td>")
|
||||||
Else
|
Else
|
||||||
Response.write("<td><a href='./install_printer.asp?printerid=" & printer & "'><i class='zmdi zmdi-download' title='Click to Download Universal Driver Installer' style='color:#fff;'></i></a></td>")
|
Response.write("<td><a href='./installprinter.asp?printerid=" & printer & "'><i class='zmdi zmdi-download' title='Click to Download Universal Driver Installer' style='color:#fff;'></i></a></td>")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' ID column
|
' ID column
|
||||||
|
|||||||
@@ -497,7 +497,7 @@ End If
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<a href="./usb_history.asp?sso=<%=Server.URLEncode(sso)%>" class="btn btn-outline-primary btn-sm">
|
<a href="./usbhistory.asp?sso=<%=Server.URLEncode(sso)%>" class="btn btn-outline-primary btn-sm">
|
||||||
<i class="zmdi zmdi-open-in-new"></i> View Full History
|
<i class="zmdi zmdi-open-in-new"></i> View Full History
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -88,7 +88,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<form method="post" action="./updatesubnet_direct.asp?subnetid=<%Response.Write(subnetid)%>">
|
<form method="post" action="./updatesubnetdirect.asp?subnetid=<%Response.Write(subnetid)%>">
|
||||||
<th scope="row"><input class="form-control" type="text" name="vlan" size="4" value="<%Response.Write(rs("vlan"))%>"></th>
|
<th scope="row"><input class="form-control" type="text" name="vlan" size="4" value="<%Response.Write(rs("vlan"))%>"></th>
|
||||||
<td><select name="subnettypeid" class="btn btn-light px-3">
|
<td><select name="subnettypeid" class="btn btn-light px-3">
|
||||||
<option value="<%Response.Write(rs("subnettypeid"))%>"><%Response.Write(rs("subnettype"))%></option>
|
<option value="<%Response.Write(rs("subnettypeid"))%>"><%Response.Write(rs("subnettype"))%></option>
|
||||||
|
|||||||
@@ -54,7 +54,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<form method="post" action="./addsubnetbackend_direct.asp">
|
<form method="post" action="./addsubnetbackenddirect.asp">
|
||||||
<th scope="row"><input class="form-control" type="text" name="vlan" size="4"></th>
|
<th scope="row"><input class="form-control" type="text" name="vlan" size="4"></th>
|
||||||
<td><select name="subnettypeid" class="btn btn-light px-3">
|
<td><select name="subnettypeid" class="btn btn-light px-3">
|
||||||
<%
|
<%
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
<BR>
|
<BR>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h5 class="card-title"><a href="./network_map.asp" target="_blank"><i class='zmdi zmdi-map' title='Show Network Infrastructure Map'></i></a>  Subnet Details</h5>
|
<h5 class="card-title"><a href="./networkmap.asp" target="_blank"><i class='zmdi zmdi-map' title='Show Network Infrastructure Map'></i></a>  Subnet Details</h5>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
@@ -66,10 +66,10 @@
|
|||||||
<i class="zmdi zmdi-time"></i> Checked Out
|
<i class="zmdi zmdi-time"></i> Checked Out
|
||||||
</a>
|
</a>
|
||||||
<% End If %>
|
<% End If %>
|
||||||
<a href="./checkout_usb.asp" class="btn btn-primary btn-sm">
|
<a href="./checkoutusb.asp" class="btn btn-primary btn-sm">
|
||||||
<i class="zmdi zmdi-arrow-right"></i> Checkout
|
<i class="zmdi zmdi-arrow-right"></i> Checkout
|
||||||
</a>
|
</a>
|
||||||
<a href="./checkin_usb.asp" class="btn btn-secondary btn-sm">
|
<a href="./checkinusb.asp" class="btn btn-secondary btn-sm">
|
||||||
<i class="zmdi zmdi-arrow-left"></i> Check-in
|
<i class="zmdi zmdi-arrow-left"></i> Check-in
|
||||||
</a>
|
</a>
|
||||||
<a href="./addusb.asp" class="btn btn-success btn-sm">
|
<a href="./addusb.asp" class="btn btn-success btn-sm">
|
||||||
@@ -165,15 +165,15 @@
|
|||||||
<td><%=Server.HTMLEncode(checkoutTime)%></td>
|
<td><%=Server.HTMLEncode(checkoutTime)%></td>
|
||||||
<td>
|
<td>
|
||||||
<% If IsNull(checkoutId) Then %>
|
<% If IsNull(checkoutId) Then %>
|
||||||
<a href="./checkout_usb.asp?serial=<%=Server.URLEncode(serialNum)%>" class="btn btn-sm btn-primary" title="Checkout this USB">
|
<a href="./checkoutusb.asp?serial=<%=Server.URLEncode(serialNum)%>" class="btn btn-sm btn-primary" title="Checkout this USB">
|
||||||
<i class="zmdi zmdi-arrow-right"></i>
|
<i class="zmdi zmdi-arrow-right"></i>
|
||||||
</a>
|
</a>
|
||||||
<% Else %>
|
<% Else %>
|
||||||
<a href="./checkin_usb.asp?serial=<%=Server.URLEncode(serialNum)%>" class="btn btn-sm btn-success" title="Check-in this USB">
|
<a href="./checkinusb.asp?serial=<%=Server.URLEncode(serialNum)%>" class="btn btn-sm btn-success" title="Check-in this USB">
|
||||||
<i class="zmdi zmdi-arrow-left"></i>
|
<i class="zmdi zmdi-arrow-left"></i>
|
||||||
</a>
|
</a>
|
||||||
<% End If %>
|
<% End If %>
|
||||||
<a href="./usb_history.asp?machineid=<%=machineId%>" class="btn btn-sm btn-secondary" title="View history">
|
<a href="./usbhistory.asp?machineid=<%=machineId%>" class="btn btn-sm btn-secondary" title="View history">
|
||||||
<i class="zmdi zmdi-time"></i>
|
<i class="zmdi zmdi-time"></i>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: editapplication_direct.asp
|
' FILE: editapplicationdirect.asp
|
||||||
' PURPOSE: Edit application with nested entity creation
|
' PURPOSE: Edit application with nested entity creation
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
||||||
@@ -194,7 +194,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form method="post" action="./updatedevice_direct.asp" id="editDeviceForm">
|
<form method="post" action="./updatedevicedirect.asp" id="editDeviceForm">
|
||||||
<input type="hidden" name="machineid" value="<%=machineid%>">
|
<input type="hidden" name="machineid" value="<%=machineid%>">
|
||||||
|
|
||||||
<!-- Tab Navigation -->
|
<!-- Tab Navigation -->
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form method="post" action="./updatelink_direct.asp">
|
<form method="post" action="./updatelinkdirect.asp">
|
||||||
<input type="hidden" name="linkid" value="<%=linkid%>">
|
<input type="hidden" name="linkid" value="<%=linkid%>">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
<%
|
|
||||||
Response.Write("TEST OK")
|
|
||||||
%>
|
|
||||||
305
editmacine.asp
305
editmacine.asp
@@ -1,305 +0,0 @@
|
|||||||
<%
|
|
||||||
'=============================================================================
|
|
||||||
' FILE: editmacine.asp
|
|
||||||
' PURPOSE: Edit machine information with nested entity creation
|
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
|
||||||
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
|
||||||
' REFACTORED: 2025-10-27 - Removed machinetypeid (now inherited from models table)
|
|
||||||
' NOTE: File has typo in name (macine vs machine) - preserved for compatibility
|
|
||||||
' NOTE: Machines now inherit machinetypeid from their model. Each model has one machine type.
|
|
||||||
'=============================================================================
|
|
||||||
%><html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="./style.css" type="text/css">
|
|
||||||
<!--#include file="./includes/sql.asp"-->
|
|
||||||
<!--#include file="./includes/validation.asp"-->
|
|
||||||
<!--#include file="./includes/db_helpers.asp"-->
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div class="page">
|
|
||||||
<%
|
|
||||||
'=============================================================================
|
|
||||||
' SECURITY: Validate machineid from querystring
|
|
||||||
'=============================================================================
|
|
||||||
Dim machineid
|
|
||||||
machineid = GetSafeInteger("QS", "machineid", 0, 1, 999999)
|
|
||||||
|
|
||||||
If machineid = 0 Then
|
|
||||||
Response.Write("<div class='alert alert-danger'>Error: Invalid machine ID.</div>")
|
|
||||||
Response.Write("<a href='displaymachines.asp'>Go back</a>")
|
|
||||||
objConn.Close
|
|
||||||
Response.End
|
|
||||||
End If
|
|
||||||
|
|
||||||
'=============================================================================
|
|
||||||
' SECURITY: Get and validate all form inputs
|
|
||||||
'=============================================================================
|
|
||||||
Dim modelid, businessunitid, printerid, mapleft, maptop
|
|
||||||
modelid = GetSafeString("FORM", "modelid", "", 1, 50, "")
|
|
||||||
businessunitid = GetSafeString("FORM", "businessunitid", "", 1, 50, "")
|
|
||||||
printerid = GetSafeInteger("FORM", "printerid", 0, 0, 999999)
|
|
||||||
mapleft = GetSafeInteger("FORM", "mapleft", 0, 0, 9999)
|
|
||||||
maptop = GetSafeInteger("FORM", "maptop", 0, 0, 9999)
|
|
||||||
|
|
||||||
' Get form inputs for new business unit
|
|
||||||
Dim newbusinessunit
|
|
||||||
newbusinessunit = GetSafeString("FORM", "newbusinessunitname", "", 0, 50, "")
|
|
||||||
|
|
||||||
' Get form inputs for new model
|
|
||||||
Dim newmodelnumber, newvendorid, newmodelimage, newmodelmachinetypeid
|
|
||||||
newmodelnumber = GetSafeString("FORM", "newmodelnumber", "", 0, 255, "")
|
|
||||||
newvendorid = GetSafeString("FORM", "newvendorid", "", 0, 50, "")
|
|
||||||
newmodelimage = GetSafeString("FORM", "newmodelimage", "", 0, 255, "")
|
|
||||||
newmodelmachinetypeid = GetSafeString("FORM", "newmodelmachinetypeid", "", 0, 50, "")
|
|
||||||
|
|
||||||
' Get form inputs for new vendor
|
|
||||||
Dim newvendorname
|
|
||||||
newvendorname = GetSafeString("FORM", "newvendorname", "", 0, 50, "")
|
|
||||||
|
|
||||||
'=============================================================================
|
|
||||||
' Validate required fields
|
|
||||||
'=============================================================================
|
|
||||||
If modelid <> "new" And (Not IsNumeric(modelid)) Then
|
|
||||||
Response.Write("<div class='alert alert-danger'>Error: Invalid model ID.</div>")
|
|
||||||
Response.Write("<a href='displaymachine.asp?machineid=" & Server.HTMLEncode(machineid) & "'>Go back</a>")
|
|
||||||
objConn.Close
|
|
||||||
Response.End
|
|
||||||
End If
|
|
||||||
|
|
||||||
If businessunitid <> "new" And (Not IsNumeric(businessunitid)) Then
|
|
||||||
Response.Write("<div class='alert alert-danger'>Error: Invalid business unit ID.</div>")
|
|
||||||
Response.Write("<a href='displaymachine.asp?machineid=" & Server.HTMLEncode(machineid) & "'>Go back</a>")
|
|
||||||
objConn.Close
|
|
||||||
Response.End
|
|
||||||
End If
|
|
||||||
|
|
||||||
'=============================================================================
|
|
||||||
' SECURITY: Handle new business unit creation with parameterized query
|
|
||||||
'=============================================================================
|
|
||||||
If businessunitid = "new" Then
|
|
||||||
If Len(newbusinessunit) = 0 Then
|
|
||||||
Response.Write("<div class='alert alert-danger'>New business unit name is required</div>")
|
|
||||||
Response.Write("<a href='displaymachine.asp?machineid=" & Server.HTMLEncode(machineid) & "'>Go back</a>")
|
|
||||||
objConn.Close
|
|
||||||
Response.End
|
|
||||||
End If
|
|
||||||
|
|
||||||
' Insert new business unit using parameterized query
|
|
||||||
Dim sqlNewBU
|
|
||||||
sqlNewBU = "INSERT INTO businessunits (businessunit, isactive) VALUES (?, 1)"
|
|
||||||
|
|
||||||
On Error Resume Next
|
|
||||||
Dim cmdNewBU
|
|
||||||
Set cmdNewBU = Server.CreateObject("ADODB.Command")
|
|
||||||
cmdNewBU.ActiveConnection = objConn
|
|
||||||
cmdNewBU.CommandText = sqlNewBU
|
|
||||||
cmdNewBU.CommandType = 1
|
|
||||||
cmdNewBU.Parameters.Append cmdNewBU.CreateParameter("@businessunit", 200, 1, 50, newbusinessunit)
|
|
||||||
cmdNewBU.Execute
|
|
||||||
|
|
||||||
If Err.Number <> 0 Then
|
|
||||||
Response.Write("<div class='alert alert-danger'>Error creating new business unit: " & Server.HTMLEncode(Err.Description) & "</div>")
|
|
||||||
Response.Write("<a href='displaymachine.asp?machineid=" & Server.HTMLEncode(machineid) & "'>Go back</a>")
|
|
||||||
objConn.Close
|
|
||||||
Response.End
|
|
||||||
End If
|
|
||||||
|
|
||||||
' Get the newly created business unit ID
|
|
||||||
Dim rsNewBU
|
|
||||||
Set rsNewBU = objConn.Execute("SELECT LAST_INSERT_ID() AS newid")
|
|
||||||
businessunitid = 0
|
|
||||||
If Not rsNewBU.EOF Then
|
|
||||||
If Not IsNull(rsNewBU("newid")) Then
|
|
||||||
businessunitid = CLng(rsNewBU("newid"))
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
rsNewBU.Close
|
|
||||||
Set rsNewBU = Nothing
|
|
||||||
Set cmdNewBU = Nothing
|
|
||||||
On Error Goto 0
|
|
||||||
End If
|
|
||||||
|
|
||||||
|
|
||||||
'=============================================================================
|
|
||||||
' SECURITY: Handle new model creation with parameterized query
|
|
||||||
'=============================================================================
|
|
||||||
If modelid = "new" Then
|
|
||||||
If Len(newmodelnumber) = 0 Then
|
|
||||||
Response.Write("<div class='alert alert-danger'>New model number is required</div>")
|
|
||||||
Response.Write("<a href='displaymachine.asp?machineid=" & Server.HTMLEncode(machineid) & "'>Go back</a>")
|
|
||||||
objConn.Close
|
|
||||||
Response.End
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Len(newvendorid) = 0 Then
|
|
||||||
Response.Write("<div class='alert alert-danger'>Vendor is required for new model</div>")
|
|
||||||
Response.Write("<a href='displaymachine.asp?machineid=" & Server.HTMLEncode(machineid) & "'>Go back</a>")
|
|
||||||
objConn.Close
|
|
||||||
Response.End
|
|
||||||
End If
|
|
||||||
|
|
||||||
If Len(newmodelmachinetypeid) = 0 Or Not IsNumeric(newmodelmachinetypeid) Then
|
|
||||||
Response.Write("<div class='alert alert-danger'>Machine type is required for new model</div>")
|
|
||||||
Response.Write("<a href='displaymachine.asp?machineid=" & Server.HTMLEncode(machineid) & "'>Go back</a>")
|
|
||||||
objConn.Close
|
|
||||||
Response.End
|
|
||||||
End If
|
|
||||||
|
|
||||||
' Handle new vendor creation (nested)
|
|
||||||
If newvendorid = "new" Then
|
|
||||||
If Len(newvendorname) = 0 Then
|
|
||||||
Response.Write("<div class='alert alert-danger'>New vendor name is required</div>")
|
|
||||||
Response.Write("<a href='displaymachine.asp?machineid=" & Server.HTMLEncode(machineid) & "'>Go back</a>")
|
|
||||||
objConn.Close
|
|
||||||
Response.End
|
|
||||||
End If
|
|
||||||
|
|
||||||
' Insert new vendor using parameterized query
|
|
||||||
Dim sqlNewVendor
|
|
||||||
sqlNewVendor = "INSERT INTO vendors (vendor, isactive, isprinter, ispc, ismachine) VALUES (?, 1, 0, 0, 1)"
|
|
||||||
|
|
||||||
On Error Resume Next
|
|
||||||
Dim cmdNewVendor
|
|
||||||
Set cmdNewVendor = Server.CreateObject("ADODB.Command")
|
|
||||||
cmdNewVendor.ActiveConnection = objConn
|
|
||||||
cmdNewVendor.CommandText = sqlNewVendor
|
|
||||||
cmdNewVendor.CommandType = 1
|
|
||||||
cmdNewVendor.Parameters.Append cmdNewVendor.CreateParameter("@vendor", 200, 1, 50, newvendorname)
|
|
||||||
cmdNewVendor.Execute
|
|
||||||
|
|
||||||
If Err.Number <> 0 Then
|
|
||||||
Response.Write("<div class='alert alert-danger'>Error creating new vendor: " & Server.HTMLEncode(Err.Description) & "</div>")
|
|
||||||
Response.Write("<a href='displaymachine.asp?machineid=" & Server.HTMLEncode(machineid) & "'>Go back</a>")
|
|
||||||
objConn.Close
|
|
||||||
Response.End
|
|
||||||
End If
|
|
||||||
|
|
||||||
' Get the newly created vendor ID
|
|
||||||
Dim rsNewVendor
|
|
||||||
Set rsNewVendor = objConn.Execute("SELECT LAST_INSERT_ID() AS newid")
|
|
||||||
newvendorid = 0
|
|
||||||
If Not rsNewVendor.EOF Then
|
|
||||||
If Not IsNull(rsNewVendor("newid")) Then
|
|
||||||
newvendorid = CLng(rsNewVendor("newid"))
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
rsNewVendor.Close
|
|
||||||
Set rsNewVendor = Nothing
|
|
||||||
Set cmdNewVendor = Nothing
|
|
||||||
On Error Goto 0
|
|
||||||
End If
|
|
||||||
|
|
||||||
' Set default image if not specified
|
|
||||||
If newmodelimage = "" Then
|
|
||||||
newmodelimage = "default.png"
|
|
||||||
End If
|
|
||||||
|
|
||||||
' Insert new model using parameterized query (including machinetypeid)
|
|
||||||
Dim sqlNewModel
|
|
||||||
sqlNewModel = "INSERT INTO models (modelnumber, vendorid, machinetypeid, image, isactive) VALUES (?, ?, ?, ?, 1)"
|
|
||||||
|
|
||||||
On Error Resume Next
|
|
||||||
Dim cmdNewModel
|
|
||||||
Set cmdNewModel = Server.CreateObject("ADODB.Command")
|
|
||||||
cmdNewModel.ActiveConnection = objConn
|
|
||||||
cmdNewModel.CommandText = sqlNewModel
|
|
||||||
cmdNewModel.CommandType = 1
|
|
||||||
cmdNewModel.Parameters.Append cmdNewModel.CreateParameter("@modelnumber", 200, 1, 255, newmodelnumber)
|
|
||||||
cmdNewModel.Parameters.Append cmdNewModel.CreateParameter("@vendorid", 3, 1, , CLng(newvendorid))
|
|
||||||
cmdNewModel.Parameters.Append cmdNewModel.CreateParameter("@machinetypeid", 3, 1, , CLng(newmodelmachinetypeid))
|
|
||||||
cmdNewModel.Parameters.Append cmdNewModel.CreateParameter("@image", 200, 1, 255, newmodelimage)
|
|
||||||
cmdNewModel.Execute
|
|
||||||
|
|
||||||
If Err.Number <> 0 Then
|
|
||||||
Response.Write("<div class='alert alert-danger'>Error creating new model: " & Server.HTMLEncode(Err.Description) & "</div>")
|
|
||||||
Response.Write("<a href='displaymachine.asp?machineid=" & Server.HTMLEncode(machineid) & "'>Go back</a>")
|
|
||||||
objConn.Close
|
|
||||||
Response.End
|
|
||||||
End If
|
|
||||||
|
|
||||||
' Get the newly created model ID
|
|
||||||
Dim rsNewModel
|
|
||||||
Set rsNewModel = objConn.Execute("SELECT LAST_INSERT_ID() AS newid")
|
|
||||||
modelid = 0
|
|
||||||
If Not rsNewModel.EOF Then
|
|
||||||
If Not IsNull(rsNewModel("newid")) Then
|
|
||||||
modelid = CLng(rsNewModel("newid"))
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
rsNewModel.Close
|
|
||||||
Set rsNewModel = Nothing
|
|
||||||
Set cmdNewModel = Nothing
|
|
||||||
On Error Goto 0
|
|
||||||
End If
|
|
||||||
|
|
||||||
'=============================================================================
|
|
||||||
' SECURITY: Update machine using parameterized query
|
|
||||||
'=============================================================================
|
|
||||||
' Build UPDATE statement with parameterized query
|
|
||||||
' NOTE: machinetypeid is now inherited from models table and doesn't need to be updated
|
|
||||||
Dim strSQL, paramCount
|
|
||||||
paramCount = 0
|
|
||||||
|
|
||||||
strSQL = "UPDATE machines SET modelnumberid = ?, businessunitid = ?"
|
|
||||||
paramCount = 2
|
|
||||||
|
|
||||||
' Add optional printerid
|
|
||||||
If printerid > 0 Then
|
|
||||||
strSQL = strSQL & ", printerid = ?"
|
|
||||||
paramCount = paramCount + 1
|
|
||||||
End If
|
|
||||||
|
|
||||||
' Add optional map coordinates
|
|
||||||
If mapleft > 0 And maptop > 0 Then
|
|
||||||
strSQL = strSQL & ", mapleft = ?, maptop = ?"
|
|
||||||
paramCount = paramCount + 2
|
|
||||||
End If
|
|
||||||
|
|
||||||
strSQL = strSQL & " WHERE machineid = ?"
|
|
||||||
|
|
||||||
On Error Resume Next
|
|
||||||
Dim cmdUpdate
|
|
||||||
Set cmdUpdate = Server.CreateObject("ADODB.Command")
|
|
||||||
cmdUpdate.ActiveConnection = objConn
|
|
||||||
cmdUpdate.CommandText = strSQL
|
|
||||||
cmdUpdate.CommandType = 1
|
|
||||||
|
|
||||||
' Add parameters in order
|
|
||||||
cmdUpdate.Parameters.Append cmdUpdate.CreateParameter("@modelnumberid", 3, 1, , CLng(modelid))
|
|
||||||
cmdUpdate.Parameters.Append cmdUpdate.CreateParameter("@businessunitid", 3, 1, , CLng(businessunitid))
|
|
||||||
|
|
||||||
If printerid > 0 Then
|
|
||||||
cmdUpdate.Parameters.Append cmdUpdate.CreateParameter("@printerid", 3, 1, , CLng(printerid))
|
|
||||||
End If
|
|
||||||
|
|
||||||
If mapleft > 0 And maptop > 0 Then
|
|
||||||
cmdUpdate.Parameters.Append cmdUpdate.CreateParameter("@mapleft", 3, 1, , CLng(mapleft))
|
|
||||||
cmdUpdate.Parameters.Append cmdUpdate.CreateParameter("@maptop", 3, 1, , CLng(maptop))
|
|
||||||
End If
|
|
||||||
|
|
||||||
cmdUpdate.Parameters.Append cmdUpdate.CreateParameter("@machineid", 3, 1, , CLng(machineid))
|
|
||||||
|
|
||||||
cmdUpdate.Execute
|
|
||||||
|
|
||||||
If Err.Number <> 0 Then
|
|
||||||
Response.Write("<div class='alert alert-danger'>Error: " & Server.HTMLEncode(Err.Description) & "</div>")
|
|
||||||
Response.Write("<a href='displaymachine.asp?machineid=" & Server.HTMLEncode(machineid) & "'>Go back</a>")
|
|
||||||
Set cmdUpdate = Nothing
|
|
||||||
objConn.Close
|
|
||||||
Response.End
|
|
||||||
End If
|
|
||||||
|
|
||||||
Set cmdUpdate = Nothing
|
|
||||||
On Error Goto 0
|
|
||||||
%>
|
|
||||||
<meta http-equiv="refresh" content="0; url=./displaymachine.asp?machineid=<%=Server.HTMLEncode(machineid)%>">
|
|
||||||
<%
|
|
||||||
'=============================================================================
|
|
||||||
' CLEANUP
|
|
||||||
'=============================================================================
|
|
||||||
objConn.Close
|
|
||||||
%>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form method="post" action="./updatenotification_direct.asp">
|
<form method="post" action="./updatenotificationdirect.asp">
|
||||||
<input type="hidden" name="notificationid" value="<%=notificationid%>">
|
<input type="hidden" name="notificationid" value="<%=notificationid%>">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ End If
|
|||||||
|
|
||||||
<li class="sidebar-header">Admin</li>
|
<li class="sidebar-header">Admin</li>
|
||||||
<li><a href="./displaysubnets.asp"><i class="zmdi zmdi-network text-danger"></i><span>Network</span></a></li>
|
<li><a href="./displaysubnets.asp"><i class="zmdi zmdi-network text-danger"></i><span>Network</span></a></li>
|
||||||
<li><a href="./network_devices.asp"><i class="zmdi zmdi-device-hub text-info"></i><span>Network Devices</span></a></li>
|
<li><a href="./networkdevices.asp"><i class="zmdi zmdi-device-hub text-info"></i><span>Network Devices</span></a></li>
|
||||||
<li><a href="./displaypcs.asp"><i class="zmdi zmdi-desktop-windows text-primary"></i><span>PC Admin</span></a></li>
|
<li><a href="./displaypcs.asp"><i class="zmdi zmdi-desktop-windows text-primary"></i><span>PC Admin</span></a></li>
|
||||||
<li><a href="./displayusb.asp"><i class="zmdi zmdi-usb text-purple"></i><span>USB Devices</span></a></li>
|
<li><a href="./displayusb.asp"><i class="zmdi zmdi-usb text-purple"></i><span>USB Devices</span></a></li>
|
||||||
<li><a href="./displaynotifications.asp"><i class="zmdi zmdi zmdi-notifications-none text-success"></i><span>Notifications</span></a></li>
|
<li><a href="./displaynotifications.asp"><i class="zmdi zmdi zmdi-notifications-none text-success"></i><span>Notifications</span></a></li>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ Function GetPrinterDataCached(hostIP)
|
|||||||
Dim http
|
Dim http
|
||||||
Set http = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
|
Set http = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
|
||||||
' True = async (doesn't block user)
|
' True = async (doesn't block user)
|
||||||
http.Open "GET", "http://localhost/refresh_zabbix_cache.asp?ip=" & Server.URLEncode(hostIP), True
|
http.Open "GET", "http://localhost/refreshzabbixcache.asp?ip=" & Server.URLEncode(hostIP), True
|
||||||
http.Send
|
http.Send
|
||||||
Set http = Nothing
|
Set http = Nothing
|
||||||
On Error Goto 0
|
On Error Goto 0
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!--#include file="./includes/sql.asp"-->
|
<!--#include file="./includes/sql.asp"-->
|
||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: insert_all_printer_machines.asp
|
' FILE: insertallprintermachines.asp
|
||||||
' PURPOSE: Insert ALL printer machines from printers table
|
' PURPOSE: Insert ALL printer machines from printers table
|
||||||
' CREATED: 2025-10-20
|
' CREATED: 2025-10-20
|
||||||
'
|
'
|
||||||
@@ -212,7 +212,7 @@ If executeInsert <> True And CLng(totalToInsert) > 0 Then
|
|||||||
Response.Write("<div style='background:#d1ecf1; padding:15px; margin:10px 0; border:1px solid #bee5eb;'>")
|
Response.Write("<div style='background:#d1ecf1; padding:15px; margin:10px 0; border:1px solid #bee5eb;'>")
|
||||||
Response.Write("<h3>Ready to Execute?</h3>")
|
Response.Write("<h3>Ready to Execute?</h3>")
|
||||||
Response.Write("<p>This will insert <strong>" & totalToInsert & " printer machine(s)</strong> into the database.</p>")
|
Response.Write("<p>This will insert <strong>" & totalToInsert & " printer machine(s)</strong> into the database.</p>")
|
||||||
Response.Write("<form method='get' action='insert_all_printer_machines.asp'>")
|
Response.Write("<form method='get' action='insertallprintermachines.asp'>")
|
||||||
Response.Write("<input type='hidden' name='execute' value='1'>")
|
Response.Write("<input type='hidden' name='execute' value='1'>")
|
||||||
Response.Write("<button type='submit' style='background:#28a745; color:white; padding:10px 20px; font-size:16px; border:none; cursor:pointer; border-radius:5px;'>")
|
Response.Write("<button type='submit' style='background:#28a745; color:white; padding:10px 20px; font-size:16px; border:none; cursor:pointer; border-radius:5px;'>")
|
||||||
Response.Write("✓ Execute INSERT for All " & totalToInsert & " Printers")
|
Response.Write("✓ Execute INSERT for All " & totalToInsert & " Printers")
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
<%@ Language=VBScript %>
|
<%@ Language=VBScript %>
|
||||||
<!--#include file="./includes/sql.asp"-->
|
<!--#include file="./includes/sql.asp"-->
|
||||||
<%
|
<%
|
||||||
' install_printer.asp
|
' installprinter.asp
|
||||||
' Generates a batch file to install printer(s)
|
' Generates a batch file to install printer(s)
|
||||||
' - If printer has installpath: downloads and runs specific .exe
|
' - If printer has installpath: downloads and runs specific .exe
|
||||||
' - If no installpath: downloads universal PrinterInstaller.exe
|
' - If no installpath: downloads universal PrinterInstaller.exe
|
||||||
' Usage: install_printer.asp?printer=GuardDesk-HIDDTC
|
' Usage: installprinter.asp?printer=GuardDesk-HIDDTC
|
||||||
|
|
||||||
Dim printerNames, printerIds, printerArray, i, fileName
|
Dim printerNames, printerIds, printerArray, i, fileName
|
||||||
printerNames = Request.QueryString("printer")
|
printerNames = Request.QueryString("printer")
|
||||||
@@ -80,7 +80,7 @@ If printerIds <> "" Or printerNames <> "" Then
|
|||||||
|
|
||||||
' Determine printer name to use
|
' Determine printer name to use
|
||||||
' Prefer Windows Name from database if it's already in standardized format (contains dashes)
|
' Prefer Windows Name from database if it's already in standardized format (contains dashes)
|
||||||
' Otherwise generate standardized name (same logic as api_printers.asp)
|
' Otherwise generate standardized name (same logic as apiprinters.asp)
|
||||||
Dim machineAlias, machineNumber, machineName, cleanMachine, cleanModel, shortDescription, standardName
|
Dim machineAlias, machineNumber, machineName, cleanMachine, cleanModel, shortDescription, standardName
|
||||||
|
|
||||||
' Check if printerwindowsname is already standardized (contains dashes, not just spaces)
|
' Check if printerwindowsname is already standardized (contains dashes, not just spaces)
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<!--#include file="./includes/header.asp"-->
|
<!--#include file="./includes/header.asp"-->
|
||||||
<!--#include file="./includes/sql.asp"-->
|
<!--#include file="./includes/sql.asp"-->
|
||||||
<title>Machine Map Editor - ShopDB</title>
|
<title>Machine Map Editor - ShopDB</title>
|
||||||
<!-- Leaflet CSS (local copy like machine_map.asp) -->
|
<!-- Leaflet CSS (local copy like machinemap.asp) -->
|
||||||
<link rel="stylesheet" href="./leaflet/leaflet.css" />
|
<link rel="stylesheet" href="./leaflet/leaflet.css" />
|
||||||
<style>
|
<style>
|
||||||
.editor-container {
|
.editor-container {
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
<h4 class="page-title">Machine Map Editor</h4>
|
<h4 class="page-title">Machine Map Editor</h4>
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li class="breadcrumb-item"><a href="index.asp">Dashboard</a></li>
|
<li class="breadcrumb-item"><a href="index.asp">Dashboard</a></li>
|
||||||
<li class="breadcrumb-item"><a href="machine_map.asp">Machine Map</a></li>
|
<li class="breadcrumb-item"><a href="machinemap.asp">Machine Map</a></li>
|
||||||
<li class="breadcrumb-item active">Editor</li>
|
<li class="breadcrumb-item active">Editor</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
@@ -221,7 +221,7 @@ Set rsMT = Nothing
|
|||||||
<script src="assets/plugins/simplebar/js/simplebar.js"></script>
|
<script src="assets/plugins/simplebar/js/simplebar.js"></script>
|
||||||
<script src="assets/js/sidebar-menu.js"></script>
|
<script src="assets/js/sidebar-menu.js"></script>
|
||||||
<script src="assets/js/app-script.js"></script>
|
<script src="assets/js/app-script.js"></script>
|
||||||
<!-- Leaflet JS (local copy like machine_map.asp) -->
|
<!-- Leaflet JS (local copy like machinemap.asp) -->
|
||||||
<script src="./leaflet/leaflet.js"></script>
|
<script src="./leaflet/leaflet.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -230,7 +230,7 @@ var theme = '<%=theme%>';
|
|||||||
var lightThemes = ['bg-theme11', 'bg-theme13'];
|
var lightThemes = ['bg-theme11', 'bg-theme13'];
|
||||||
var mapImageUrl = lightThemes.includes(theme) ? './images/sitemap2025-light.png' : './images/sitemap2025-dark.png';
|
var mapImageUrl = lightThemes.includes(theme) ? './images/sitemap2025-light.png' : './images/sitemap2025-dark.png';
|
||||||
|
|
||||||
// Machine type colors (exact copy from machine_map.asp)
|
// Machine type colors (exact copy from machinemap.asp)
|
||||||
var machineTypeColors = {
|
var machineTypeColors = {
|
||||||
'1': '#4CAF50', // CNC
|
'1': '#4CAF50', // CNC
|
||||||
'2': '#2196F3', // Grinder
|
'2': '#2196F3', // Grinder
|
||||||
@@ -309,7 +309,7 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function initMap() {
|
function initMap() {
|
||||||
// Create map with simple CRS (same as machine_map.asp)
|
// Create map with simple CRS (same as machinemap.asp)
|
||||||
map = L.map('map', {
|
map = L.map('map', {
|
||||||
crs: L.CRS.Simple,
|
crs: L.CRS.Simple,
|
||||||
minZoom: -3,
|
minZoom: -3,
|
||||||
@@ -319,7 +319,7 @@ function initMap() {
|
|||||||
var bounds = [[0, 0], [2550, 3300]];
|
var bounds = [[0, 0], [2550, 3300]];
|
||||||
L.imageOverlay(mapImageUrl, bounds).addTo(map);
|
L.imageOverlay(mapImageUrl, bounds).addTo(map);
|
||||||
map.fitBounds(bounds);
|
map.fitBounds(bounds);
|
||||||
map.setView([1275, 1650], -2.3); // Match machine_map.asp zoom level
|
map.setView([1275, 1650], -2.3); // Match machinemap.asp zoom level
|
||||||
|
|
||||||
// Add markers for all machines with positions
|
// Add markers for all machines with positions
|
||||||
machines.forEach(function(m) {
|
machines.forEach(function(m) {
|
||||||
@@ -339,7 +339,7 @@ function addMarker(machine) {
|
|||||||
className: ''
|
className: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
// Convert database Y (top-down) to Leaflet Y (bottom-up) - same as machine_map.asp
|
// Convert database Y (top-down) to Leaflet Y (bottom-up) - same as machinemap.asp
|
||||||
var leafletY = 2550 - machine.top;
|
var leafletY = 2550 - machine.top;
|
||||||
var marker = L.marker([leafletY, machine.left], {
|
var marker = L.marker([leafletY, machine.left], {
|
||||||
icon: icon,
|
icon: icon,
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:15px;">
|
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:15px;">
|
||||||
<h5 class="card-title" style="margin:0;">
|
<h5 class="card-title" style="margin:0;">
|
||||||
<a href="./network_map.asp" target="_blank"><i class='zmdi zmdi-map' title='Show Network Map'></i></a>    Network Devices
|
<a href="./networkmap.asp" target="_blank"><i class='zmdi zmdi-map' title='Show Network Map'></i></a>    Network Devices
|
||||||
</h5>
|
</h5>
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
||||||
@@ -55,37 +55,37 @@
|
|||||||
%>
|
%>
|
||||||
<ul class="nav nav-tabs" style="margin-bottom:20px;">
|
<ul class="nav nav-tabs" style="margin-bottom:20px;">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <%If filterType="all" Then Response.Write("active")%>" href="network_devices.asp?filter=all">
|
<a class="nav-link <%If filterType="all" Then Response.Write("active")%>" href="networkdevices.asp?filter=all">
|
||||||
All Devices
|
All Devices
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <%If filterType="Access Point" Then Response.Write("active")%>" href="network_devices.asp?filter=Access Point">
|
<a class="nav-link <%If filterType="Access Point" Then Response.Write("active")%>" href="networkdevices.asp?filter=Access Point">
|
||||||
<i class="zmdi zmdi-wifi"></i> Access Points
|
<i class="zmdi zmdi-wifi"></i> Access Points
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <%If filterType="Camera" Then Response.Write("active")%>" href="network_devices.asp?filter=Camera">
|
<a class="nav-link <%If filterType="Camera" Then Response.Write("active")%>" href="networkdevices.asp?filter=Camera">
|
||||||
<i class="zmdi zmdi-videocam"></i> Cameras
|
<i class="zmdi zmdi-videocam"></i> Cameras
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <%If filterType="IDF" Then Response.Write("active")%>" href="network_devices.asp?filter=IDF">
|
<a class="nav-link <%If filterType="IDF" Then Response.Write("active")%>" href="networkdevices.asp?filter=IDF">
|
||||||
<i class="zmdi zmdi-city-alt"></i> IDFs
|
<i class="zmdi zmdi-city-alt"></i> IDFs
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <%If filterType="Printer" Then Response.Write("active")%>" href="network_devices.asp?filter=Printer">
|
<a class="nav-link <%If filterType="Printer" Then Response.Write("active")%>" href="networkdevices.asp?filter=Printer">
|
||||||
<i class="zmdi zmdi-print"></i> Printers
|
<i class="zmdi zmdi-print"></i> Printers
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <%If filterType="Server" Then Response.Write("active")%>" href="network_devices.asp?filter=Server">
|
<a class="nav-link <%If filterType="Server" Then Response.Write("active")%>" href="networkdevices.asp?filter=Server">
|
||||||
<i class="zmdi zmdi-storage"></i> Servers
|
<i class="zmdi zmdi-storage"></i> Servers
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link <%If filterType="Switch" Then Response.Write("active")%>" href="network_devices.asp?filter=Switch">
|
<a class="nav-link <%If filterType="Switch" Then Response.Write("active")%>" href="networkdevices.asp?filter=Switch">
|
||||||
<i class="zmdi zmdi-device-hub"></i> Switches
|
<i class="zmdi zmdi-device-hub"></i> Switches
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@@ -386,7 +386,7 @@ while not rs.eof
|
|||||||
} else if (sourceTable === 'idfs') {
|
} else if (sourceTable === 'idfs') {
|
||||||
detailUrl = './displayidf.asp?id=' + machineId;
|
detailUrl = './displayidf.asp?id=' + machineId;
|
||||||
} else {
|
} else {
|
||||||
detailUrl = './network_devices.asp';
|
detailUrl = './networkdevices.asp';
|
||||||
}
|
}
|
||||||
|
|
||||||
var popupContent = '<div style="background:#1f1f1f; color:#fff; min-width:250px; border-radius:4px; overflow:hidden;">' +
|
var popupContent = '<div style="background:#1f1f1f; color:#fff; min-width:250px; border-radius:4px; overflow:hidden;">' +
|
||||||
@@ -56,7 +56,7 @@ objConn.Close
|
|||||||
<li>All coordinates above should be within these bounds</li>
|
<li>All coordinates above should be within these bounds</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p><a href="network_map.asp" style="color:#4fc3f7;">Back to Network Map</a></p>
|
<p><a href="networkmap.asp" style="color:#4fc3f7;">Back to Network Map</a></p>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -391,7 +391,7 @@ function downloadInstaller() {
|
|||||||
|
|
||||||
// Pass printer IDs for reliable lookup (names are generated dynamically and may not match DB)
|
// Pass printer IDs for reliable lookup (names are generated dynamically and may not match DB)
|
||||||
var printerParam = printerIds.join(',');
|
var printerParam = printerIds.join(',');
|
||||||
window.location.href = 'install_printer.asp?printerid=' + encodeURIComponent(printerParam);
|
window.location.href = 'installprinter.asp?printerid=' + encodeURIComponent(printerParam);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<!--#include file="./includes/sql.asp"-->
|
<!--#include file="./includes/sql.asp"-->
|
||||||
<%
|
<%
|
||||||
' printer_links_generator.asp
|
' printerlinksgenerator.asp
|
||||||
' Generates installation links for all printers in the database
|
' Generates installation links for all printers in the database
|
||||||
' Shows both single-click launcher links and direct installer command-line parameters
|
' Shows both single-click launcher links and direct installer command-line parameters
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ Do While Not rs.EOF
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
' Generate URLs
|
' Generate URLs
|
||||||
webLink = "https://tsgwp00525.rd.ds.ge.com/shopdb/install_printer.asp?printer=" & Server.URLEncode(printerName)
|
webLink = "https://tsgwp00525.rd.ds.ge.com/shopdb/installprinter.asp?printer=" & Server.URLEncode(printerName)
|
||||||
cmdLine = "PrinterInstaller.exe /PRINTER=" & printerName
|
cmdLine = "PrinterInstaller.exe /PRINTER=" & printerName
|
||||||
|
|
||||||
' Output table row
|
' Output table row
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: saveapplication_direct.asp
|
' FILE: saveapplicationdirect.asp
|
||||||
' PURPOSE: Create new application with nested entity creation
|
' PURPOSE: Create new application with nested entity creation
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: savecheckin_usb.asp
|
' FILE: savecheckinusb.asp
|
||||||
' PURPOSE: Process USB check-in request
|
' PURPOSE: Process USB check-in request
|
||||||
' SECURITY: Parameterized queries, input validation
|
' SECURITY: Parameterized queries, input validation
|
||||||
' CREATED: 2025-12-07
|
' CREATED: 2025-12-07
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
' Validate checkoutid
|
' Validate checkoutid
|
||||||
If checkoutid = "" Or Not IsNumeric(checkoutid) Then
|
If checkoutid = "" Or Not IsNumeric(checkoutid) Then
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "Invalid checkout ID.", "checkin_usb.asp"
|
ShowError "Invalid checkout ID.", "checkinusb.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
wipedValue = 1
|
wipedValue = 1
|
||||||
Else
|
Else
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "You must confirm the USB has been wiped before check-in.", "checkin_usb.asp"
|
ShowError "You must confirm the USB has been wiped before check-in.", "checkinusb.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
Set rsCheck = Nothing
|
Set rsCheck = Nothing
|
||||||
Set cmdCheck = Nothing
|
Set cmdCheck = Nothing
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "Checkout record not found or already checked in.", "checkin_usb.asp"
|
ShowError "Checkout record not found or already checked in.", "checkinusb.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -104,6 +104,6 @@
|
|||||||
updateErr = Err.Description
|
updateErr = Err.Description
|
||||||
Set cmdUpdate = Nothing
|
Set cmdUpdate = Nothing
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "Error checking in USB: " & Server.HTMLEncode(updateErr), "checkin_usb.asp"
|
ShowError "Error checking in USB: " & Server.HTMLEncode(updateErr), "checkinusb.asp"
|
||||||
End If
|
End If
|
||||||
%>
|
%>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: savecheckout_usb.asp
|
' FILE: savecheckoutusb.asp
|
||||||
' PURPOSE: Process USB checkout request
|
' PURPOSE: Process USB checkout request
|
||||||
' SECURITY: Parameterized queries, input validation
|
' SECURITY: Parameterized queries, input validation
|
||||||
' CREATED: 2025-12-07
|
' CREATED: 2025-12-07
|
||||||
@@ -18,14 +18,14 @@
|
|||||||
' Validate machineid
|
' Validate machineid
|
||||||
If machineid = "" Or Not IsNumeric(machineid) Then
|
If machineid = "" Or Not IsNumeric(machineid) Then
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "Invalid USB device ID.", "checkout_usb.asp"
|
ShowError "Invalid USB device ID.", "checkoutusb.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Validate SSO - must be 9 digits
|
' Validate SSO - must be 9 digits
|
||||||
If sso = "" Or Len(sso) <> 9 Then
|
If sso = "" Or Len(sso) <> 9 Then
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "SSO must be exactly 9 digits.", "checkout_usb.asp"
|
ShowError "SSO must be exactly 9 digits.", "checkoutusb.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
c = Mid(sso, i, 1)
|
c = Mid(sso, i, 1)
|
||||||
If c < "0" Or c > "9" Then
|
If c < "0" Or c > "9" Then
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "SSO must contain only digits.", "checkout_usb.asp"
|
ShowError "SSO must contain only digits.", "checkoutusb.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
Set rsCheck = Nothing
|
Set rsCheck = Nothing
|
||||||
Set cmdCheck = Nothing
|
Set cmdCheck = Nothing
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "USB device not found.", "checkout_usb.asp"
|
ShowError "USB device not found.", "checkoutusb.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
|
|
||||||
If isCheckedOut > 0 Then
|
If isCheckedOut > 0 Then
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "USB device '" & Server.HTMLEncode(serialnumber) & "' is already checked out.", "checkout_usb.asp"
|
ShowError "USB device '" & Server.HTMLEncode(serialnumber) & "' is already checked out.", "checkoutusb.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -121,6 +121,6 @@
|
|||||||
insertErr = Err.Description
|
insertErr = Err.Description
|
||||||
Set cmdInsert = Nothing
|
Set cmdInsert = Nothing
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "Error checking out USB: " & Server.HTMLEncode(insertErr), "checkout_usb.asp"
|
ShowError "Error checking out USB: " & Server.HTMLEncode(insertErr), "checkoutusb.asp"
|
||||||
End If
|
End If
|
||||||
%>
|
%>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: savedevice_direct.asp
|
' FILE: savedevicedirect.asp
|
||||||
' PURPOSE: Create new PC with minimal required fields (PC-only scanner)
|
' PURPOSE: Create new PC with minimal required fields (PC-only scanner)
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' UPDATED: 2025-12-09 - All PCs use machinetypeid 33, pctypeid determines type
|
' UPDATED: 2025-12-09 - All PCs use machinetypeid 33, pctypeid determines type
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: savemachine_direct.asp
|
' FILE: savemachinedirect.asp
|
||||||
' PURPOSE: Create new machine with nested entity creation (vendor, model, business unit)
|
' PURPOSE: Create new machine with nested entity creation (vendor, model, business unit)
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
' FILE: savemachineedit.asp
|
' FILE: savemachineedit.asp
|
||||||
' PURPOSE: Update existing machine with nested entity creation (vendor, model, business unit)
|
' PURPOSE: Update existing machine with nested entity creation (vendor, model, business unit)
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' CREATED: 2025-11-07 - Based on savemachine_direct.asp
|
' CREATED: 2025-11-07 - Based on savemachinedirect.asp
|
||||||
' NOTE: Machines now inherit machinetypeid from their model. Each model has one machine type.
|
' NOTE: Machines now inherit machinetypeid from their model. Each model has one machine type.
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
%>
|
%>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: savemodel_direct.asp
|
' FILE: savemodeldirect.asp
|
||||||
' PURPOSE: Create new model with optional vendor creation
|
' PURPOSE: Create new model with optional vendor creation
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: save_network_device.asp
|
' FILE: savenetworkdevice.asp
|
||||||
' PURPOSE: Universal save endpoint for all network devices (IDF, Server, Switch, Camera, Access Point)
|
' PURPOSE: Universal save endpoint for all network devices (IDF, Server, Switch, Camera, Access Point)
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' UPDATED: 2025-11-11 - Updated for Phase 3 Migration (machines table)
|
' UPDATED: 2025-11-11 - Updated for Phase 3 Migration (machines table)
|
||||||
@@ -21,7 +21,7 @@ isDelete = Trim(Request.Form("delete"))
|
|||||||
' Validate device type
|
' Validate device type
|
||||||
If deviceType <> "idf" And deviceType <> "server" And deviceType <> "switch" And deviceType <> "camera" And deviceType <> "accesspoint" Then
|
If deviceType <> "idf" And deviceType <> "server" And deviceType <> "switch" And deviceType <> "camera" And deviceType <> "accesspoint" Then
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "Invalid device type.", "network_devices.asp"
|
ShowError "Invalid device type.", "networkdevices.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ End If
|
|||||||
If deviceId = "" Then deviceId = "0"
|
If deviceId = "" Then deviceId = "0"
|
||||||
If Not IsNumeric(deviceId) Then
|
If Not IsNumeric(deviceId) Then
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "Invalid device ID.", "network_devices.asp"
|
ShowError "Invalid device ID.", "networkdevices.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -39,27 +39,27 @@ Select Case deviceType
|
|||||||
Case "idf"
|
Case "idf"
|
||||||
machineTypeId = 17
|
machineTypeId = 17
|
||||||
nameField = "idfname"
|
nameField = "idfname"
|
||||||
redirectUrl = "network_devices.asp?filter=IDF"
|
redirectUrl = "networkdevices.asp?filter=IDF"
|
||||||
deviceDisplayName = "IDF"
|
deviceDisplayName = "IDF"
|
||||||
Case "server"
|
Case "server"
|
||||||
machineTypeId = 20
|
machineTypeId = 20
|
||||||
nameField = "servername"
|
nameField = "servername"
|
||||||
redirectUrl = "network_devices.asp?filter=Server"
|
redirectUrl = "networkdevices.asp?filter=Server"
|
||||||
deviceDisplayName = "Server"
|
deviceDisplayName = "Server"
|
||||||
Case "switch"
|
Case "switch"
|
||||||
machineTypeId = 19
|
machineTypeId = 19
|
||||||
nameField = "switchname"
|
nameField = "switchname"
|
||||||
redirectUrl = "network_devices.asp?filter=Switch"
|
redirectUrl = "networkdevices.asp?filter=Switch"
|
||||||
deviceDisplayName = "Switch"
|
deviceDisplayName = "Switch"
|
||||||
Case "camera"
|
Case "camera"
|
||||||
machineTypeId = 18
|
machineTypeId = 18
|
||||||
nameField = "cameraname"
|
nameField = "cameraname"
|
||||||
redirectUrl = "network_devices.asp?filter=Camera"
|
redirectUrl = "networkdevices.asp?filter=Camera"
|
||||||
deviceDisplayName = "Camera"
|
deviceDisplayName = "Camera"
|
||||||
Case "accesspoint"
|
Case "accesspoint"
|
||||||
machineTypeId = 16
|
machineTypeId = 16
|
||||||
nameField = "apname"
|
nameField = "apname"
|
||||||
redirectUrl = "network_devices.asp?filter=Access Point"
|
redirectUrl = "networkdevices.asp?filter=Access Point"
|
||||||
deviceDisplayName = "Access Point"
|
deviceDisplayName = "Access Point"
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
@@ -98,14 +98,14 @@ End If
|
|||||||
' Validate name field (required for all)
|
' Validate name field (required for all)
|
||||||
If deviceName = "" Then
|
If deviceName = "" Then
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError deviceDisplayName & " name is required.", "network_devices.asp"
|
ShowError deviceDisplayName & " name is required.", "networkdevices.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Validate field lengths
|
' Validate field lengths
|
||||||
If Len(deviceName) > 100 Or Len(description) > 255 Then
|
If Len(deviceName) > 100 Or Len(description) > 255 Then
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "Field length exceeded.", "network_devices.asp"
|
ShowError "Field length exceeded.", "networkdevices.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -143,13 +143,13 @@ If modelid = "new" Then
|
|||||||
' Validate required fields for new model
|
' Validate required fields for new model
|
||||||
If newmodelnumber = "" Then
|
If newmodelnumber = "" Then
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "Model number is required.", "network_devices.asp"
|
ShowError "Model number is required.", "networkdevices.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If newvendorid = "" Then
|
If newvendorid = "" Then
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "Vendor is required for new model.", "network_devices.asp"
|
ShowError "Vendor is required for new model.", "networkdevices.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ If modelid = "new" Then
|
|||||||
If newvendorid = "new" Then
|
If newvendorid = "new" Then
|
||||||
If newvendorname = "" Then
|
If newvendorname = "" Then
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "Vendor name is required.", "network_devices.asp"
|
ShowError "Vendor name is required.", "networkdevices.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ If modelid = "new" Then
|
|||||||
vendorErr = Err.Description
|
vendorErr = Err.Description
|
||||||
Set cmdNewVendor = Nothing
|
Set cmdNewVendor = Nothing
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "Error creating vendor: " & vendorErr, "network_devices.asp"
|
ShowError "Error creating vendor: " & vendorErr, "networkdevices.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -215,7 +215,7 @@ If modelid = "new" Then
|
|||||||
modelErr = Err.Description
|
modelErr = Err.Description
|
||||||
Set cmdNewModel = Nothing
|
Set cmdNewModel = Nothing
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "Error creating model: " & modelErr, "network_devices.asp"
|
ShowError "Error creating model: " & modelErr, "networkdevices.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -251,7 +251,7 @@ If deviceType = "camera" Then
|
|||||||
' Validate required fields for new IDF
|
' Validate required fields for new IDF
|
||||||
If newidfname = "" Then
|
If newidfname = "" Then
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "IDF name is required.", "network_devices.asp"
|
ShowError "IDF name is required.", "networkdevices.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -274,7 +274,7 @@ If deviceType = "camera" Then
|
|||||||
idfErr = Err.Description
|
idfErr = Err.Description
|
||||||
Set cmdNewIdf = Nothing
|
Set cmdNewIdf = Nothing
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "Error creating IDF: " & idfErr, "network_devices.asp"
|
ShowError "Error creating IDF: " & idfErr, "networkdevices.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -291,7 +291,7 @@ If deviceType = "camera" Then
|
|||||||
' Validate required idfid for cameras
|
' Validate required idfid for cameras
|
||||||
If idfid = "" Or Not IsNumeric(idfid) Or CLng(idfid) < 1 Then
|
If idfid = "" Or Not IsNumeric(idfid) Or CLng(idfid) < 1 Then
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "IDF location is required for cameras.", "network_devices.asp"
|
ShowError "IDF location is required for cameras.", "networkdevices.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -349,7 +349,7 @@ If deviceId = "0" Then
|
|||||||
saveErr = Err.Description
|
saveErr = Err.Description
|
||||||
Set cmdDevice = Nothing
|
Set cmdDevice = Nothing
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "Error saving device: " & saveErr, "network_devices.asp"
|
ShowError "Error saving device: " & saveErr, "networkdevices.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
Set cmdDevice = Nothing
|
Set cmdDevice = Nothing
|
||||||
@@ -387,7 +387,7 @@ Else
|
|||||||
updateErr = Err.Description
|
updateErr = Err.Description
|
||||||
Set cmdDevice = Nothing
|
Set cmdDevice = Nothing
|
||||||
objConn.Close
|
objConn.Close
|
||||||
ShowError "Error updating device: " & updateErr, "network_devices.asp"
|
ShowError "Error updating device: " & updateErr, "networkdevices.asp"
|
||||||
Response.End
|
Response.End
|
||||||
End If
|
End If
|
||||||
Set cmdDevice = Nothing
|
Set cmdDevice = Nothing
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: savenotification_direct.asp
|
' FILE: savenotificationdirect.asp
|
||||||
' PURPOSE: Create new notification
|
' PURPOSE: Create new notification
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: saveprinter_direct.asp
|
' FILE: saveprinterdirect.asp
|
||||||
' PURPOSE: Create printer with nested entity creation (vendor, model)
|
' PURPOSE: Create printer with nested entity creation (vendor, model)
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: saveusb_direct.asp
|
' FILE: saveusbdirect.asp
|
||||||
' PURPOSE: Create new USB device in machines table
|
' PURPOSE: Create new USB device in machines table
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' CREATED: 2025-12-07
|
' CREATED: 2025-12-07
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: savevendor_direct.asp
|
' FILE: savevendordirect.asp
|
||||||
' PURPOSE: Create new vendor with type flags
|
' PURPOSE: Create new vendor with type flags
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
||||||
@@ -272,7 +272,7 @@ Set rs = Nothing
|
|||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content p-3">
|
<div class="tab-content p-3">
|
||||||
<div class="tab-pane" id="additem">
|
<div class="tab-pane" id="additem">
|
||||||
<form method="post" action="./addlink_direct.asp">
|
<form method="post" action="./addlinkdirect.asp">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-lg-3 col-form-label form-control-label">Description:</label>
|
<label class="col-lg-3 col-form-label form-control-label">Description:</label>
|
||||||
<div class="col-lg-9">
|
<div class="col-lg-9">
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ This guide covers all database changes made on December 10, 2025 that need to be
|
|||||||
3. Fix backwards Controls relationships (Equipment->PC to PC->Equipment)
|
3. Fix backwards Controls relationships (Equipment->PC to PC->Equipment)
|
||||||
4. Propagate controller assignments to dualpath machines
|
4. Propagate controller assignments to dualpath machines
|
||||||
5. Sync equipment data between dualpath partners
|
5. Sync equipment data between dualpath partners
|
||||||
|
6. ASP filename standardization (remove underscores)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -582,6 +583,7 @@ Pull the latest code from Gitea which includes:
|
|||||||
- Updated table names in all ASP files
|
- Updated table names in all ASP files
|
||||||
- New dualpath propagation functions in `includes/db_helpers.asp`
|
- New dualpath propagation functions in `includes/db_helpers.asp`
|
||||||
- Updated save pages that call propagation functions
|
- Updated save pages that call propagation functions
|
||||||
|
- Renamed ASP files (underscores removed)
|
||||||
|
|
||||||
```cmd
|
```cmd
|
||||||
cd C:\inetpub\wwwroot\shopdb
|
cd C:\inetpub\wwwroot\shopdb
|
||||||
@@ -590,6 +592,58 @@ git pull origin master
|
|||||||
|
|
||||||
Or copy files manually from a prepared deployment package.
|
Or copy files manually from a prepared deployment package.
|
||||||
|
|
||||||
|
**IMPORTANT:** After git pull, verify the old underscore files were deleted. If they still exist, remove them manually:
|
||||||
|
|
||||||
|
```cmd
|
||||||
|
REM These old files should no longer exist after git pull
|
||||||
|
REM If they do, delete them:
|
||||||
|
del addlink_direct.asp
|
||||||
|
del addsubnetbackend_direct.asp
|
||||||
|
del admin_clear_cache.asp
|
||||||
|
del api_businessunits.asp
|
||||||
|
del api_printers.asp
|
||||||
|
del api_shopfloor.asp
|
||||||
|
del api_usb.asp
|
||||||
|
del bulk_update_notification_types.asp
|
||||||
|
del check_duplicate_printers.asp
|
||||||
|
del check_printer_machines_count.asp
|
||||||
|
del checkin_usb.asp
|
||||||
|
del checkout_usb.asp
|
||||||
|
del cleanup_duplicate_printers_execute.asp
|
||||||
|
del displaylocation_device.asp
|
||||||
|
del editapplication_direct.asp
|
||||||
|
del insert_all_printer_machines.asp
|
||||||
|
del install_printer.asp
|
||||||
|
del machine_edit.asp
|
||||||
|
del machine_map.asp
|
||||||
|
del machine_map_editor.asp
|
||||||
|
del network_devices.asp
|
||||||
|
del network_map.asp
|
||||||
|
del network_map_debug.asp
|
||||||
|
del printer_installer_map.asp
|
||||||
|
del printer_links_generator.asp
|
||||||
|
del printer_lookup.asp
|
||||||
|
del quickadd_application.asp
|
||||||
|
del refresh_zabbix_cache.asp
|
||||||
|
del save_network_device.asp
|
||||||
|
del saveapplication_direct.asp
|
||||||
|
del savecheckin_usb.asp
|
||||||
|
del savecheckout_usb.asp
|
||||||
|
del savedevice_direct.asp
|
||||||
|
del savemachine_direct.asp
|
||||||
|
del savemodel_direct.asp
|
||||||
|
del savenotification_direct.asp
|
||||||
|
del saveprinter_direct.asp
|
||||||
|
del saveusb_direct.asp
|
||||||
|
del savevendor_direct.asp
|
||||||
|
del updatedevice_direct.asp
|
||||||
|
del updatelink_direct.asp
|
||||||
|
del updatenotification_direct.asp
|
||||||
|
del updatepc_direct.asp
|
||||||
|
del updatesubnet_direct.asp
|
||||||
|
del usb_history.asp
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Step 8: Start IIS
|
## Step 8: Start IIS
|
||||||
@@ -657,12 +711,15 @@ iisreset /start
|
|||||||
| Category | Change | Script |
|
| Category | Change | Script |
|
||||||
|----------|--------|--------|
|
|----------|--------|--------|
|
||||||
| Naming | Rename 6 tables (snake_case to camelCase) | naming_convention_fix/*.sql |
|
| Naming | Rename 6 tables (snake_case to camelCase) | naming_convention_fix/*.sql |
|
||||||
|
| Naming | Rename 17 columns in compliance tables | naming_convention_fix/07_*.sql |
|
||||||
| Naming | Recreate 9 views with new table names | naming_convention_fix/04_*.sql |
|
| Naming | Recreate 9 views with new table names | naming_convention_fix/04_*.sql |
|
||||||
|
| Naming | Rename 45 ASP files (remove underscores) | naming_convention_fix/09_*.sh |
|
||||||
| Relationships | Fix backwards Controls relationships | fix_dualpath_controller_relationships.sql |
|
| Relationships | Fix backwards Controls relationships | fix_dualpath_controller_relationships.sql |
|
||||||
| Relationships | Propagate controllers to dualpath machines | fix_dualpath_controller_relationships.sql |
|
| Relationships | Propagate controllers to dualpath machines | fix_dualpath_controller_relationships.sql |
|
||||||
| Data Sync | Sync equipment data between dualpath pairs | sync_dualpath_equipment_data.sql |
|
| Data Sync | Sync equipment data between dualpath pairs | sync_dualpath_equipment_data.sql |
|
||||||
| ASP Files | Update table references in 10 ASP files | git pull |
|
| ASP Files | Update table references in 10+ ASP files | git pull |
|
||||||
| ASP Files | Add dualpath propagation functions | git pull |
|
| ASP Files | Add dualpath propagation functions | git pull |
|
||||||
|
| ASP Files | Delete 6 test/duplicate files | git pull |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -674,6 +731,9 @@ All scripts are in `/sql/` directory:
|
|||||||
|--------|---------|
|
|--------|---------|
|
||||||
| `naming_convention_fix/03_rename_tables.sql` | Table renames |
|
| `naming_convention_fix/03_rename_tables.sql` | Table renames |
|
||||||
| `naming_convention_fix/04_drop_and_recreate_views.sql` | View recreation |
|
| `naming_convention_fix/04_drop_and_recreate_views.sql` | View recreation |
|
||||||
|
| `naming_convention_fix/07_fix_compliance_columns.sql` | Compliance column renames |
|
||||||
|
| `naming_convention_fix/09_rename_asp_files.sh` | ASP filename renames (Linux) |
|
||||||
|
| `naming_convention_fix/09_rename_asp_files.ps1` | ASP filename renames (Windows) |
|
||||||
| `fix_dualpath_controller_relationships.sql` | Fix relationship direction + propagate |
|
| `fix_dualpath_controller_relationships.sql` | Fix relationship direction + propagate |
|
||||||
| `sync_dualpath_equipment_data.sql` | Sync equipment data between dualpath pairs |
|
| `sync_dualpath_equipment_data.sql` | Sync equipment data between dualpath pairs |
|
||||||
|
|
||||||
|
|||||||
93
sql/naming_convention_fix/08_asp_filename_renames.md
Normal file
93
sql/naming_convention_fix/08_asp_filename_renames.md
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
# ASP Filename Rename Plan
|
||||||
|
|
||||||
|
## Naming Convention
|
||||||
|
- All lowercase
|
||||||
|
- No underscores (use concatenated words like `displaymachine.asp`)
|
||||||
|
- Pattern: `[action][entity].asp` or `[action][entity]direct.asp` for form handlers
|
||||||
|
|
||||||
|
## Files to Rename
|
||||||
|
|
||||||
|
### Remove underscores from direct handlers
|
||||||
|
| Old Name | New Name |
|
||||||
|
|----------|----------|
|
||||||
|
| addlink_direct.asp | addlinkdirect.asp |
|
||||||
|
| addsubnetbackend_direct.asp | addsubnetbackenddirect.asp |
|
||||||
|
| editapplication_direct.asp | editapplicationdirect.asp |
|
||||||
|
| saveapplication_direct.asp | saveapplicationdirect.asp |
|
||||||
|
| savedevice_direct.asp | savedevicedirect.asp |
|
||||||
|
| savemachine_direct.asp | savemachinedirect.asp |
|
||||||
|
| savemodel_direct.asp | savemodeldirect.asp |
|
||||||
|
| save_network_device.asp | savenetworkdevice.asp |
|
||||||
|
| savenotification_direct.asp | savenotificationdirect.asp |
|
||||||
|
| saveprinter_direct.asp | saveprinterdirect.asp |
|
||||||
|
| saveusb_direct.asp | saveusbdirect.asp |
|
||||||
|
| savevendor_direct.asp | savevendordirect.asp |
|
||||||
|
| updatedevice_direct.asp | updatedevicedirect.asp |
|
||||||
|
| updatelink_direct.asp | updatelinkdirect.asp |
|
||||||
|
| updatenotification_direct.asp | updatenotificationdirect.asp |
|
||||||
|
| updatepc_direct.asp | updatepcdirect.asp |
|
||||||
|
| updatesubnet_direct.asp | updatesubnetdirect.asp |
|
||||||
|
|
||||||
|
### Remove underscores from USB files
|
||||||
|
| Old Name | New Name |
|
||||||
|
|----------|----------|
|
||||||
|
| checkin_usb.asp | checkinusb.asp |
|
||||||
|
| checkout_usb.asp | checkoutusb.asp |
|
||||||
|
| savecheckin_usb.asp | savecheckinusb.asp |
|
||||||
|
| savecheckout_usb.asp | savecheckoutusb.asp |
|
||||||
|
| usb_history.asp | usbhistory.asp |
|
||||||
|
|
||||||
|
### Remove underscores from API files
|
||||||
|
| Old Name | New Name |
|
||||||
|
|----------|----------|
|
||||||
|
| api_businessunits.asp | apibusinessunits.asp |
|
||||||
|
| api_printers.asp | apiprinters.asp |
|
||||||
|
| api_shopfloor.asp | apishopfloor.asp |
|
||||||
|
| api_usb.asp | apiusb.asp |
|
||||||
|
|
||||||
|
### Remove underscores from machine/map files
|
||||||
|
| Old Name | New Name |
|
||||||
|
|----------|----------|
|
||||||
|
| machine_edit.asp | machineedit.asp |
|
||||||
|
| machine_map.asp | machinemap.asp |
|
||||||
|
| machine_map_editor.asp | machinemapeditor.asp |
|
||||||
|
| network_devices.asp | networkdevices.asp |
|
||||||
|
| network_map.asp | networkmap.asp |
|
||||||
|
| network_map_debug.asp | networkmapdebug.asp |
|
||||||
|
|
||||||
|
### Remove underscores from printer files
|
||||||
|
| Old Name | New Name |
|
||||||
|
|----------|----------|
|
||||||
|
| check_duplicate_printers.asp | checkduplicateprinters.asp |
|
||||||
|
| check_printer_machines_count.asp | checkprintermachinescount.asp |
|
||||||
|
| cleanup_duplicate_printers_execute.asp | cleanupduplicateprintersexecute.asp |
|
||||||
|
| insert_all_printer_machines.asp | insertallprintermachines.asp |
|
||||||
|
| install_printer.asp | installprinter.asp |
|
||||||
|
| printer_installer_map.asp | printerinstallermap.asp |
|
||||||
|
| printer_links_generator.asp | printerlinksgenerator.asp |
|
||||||
|
| printer_lookup.asp | printerlookup.asp |
|
||||||
|
|
||||||
|
### Remove underscores from other files
|
||||||
|
| Old Name | New Name |
|
||||||
|
|----------|----------|
|
||||||
|
| admin_clear_cache.asp | adminclearcache.asp |
|
||||||
|
| bulk_update_notification_types.asp | bulkupdatenotificationtypes.asp |
|
||||||
|
| displaylocation_device.asp | displaylocationdevice.asp |
|
||||||
|
| quickadd_application.asp | quickaddapplication.asp |
|
||||||
|
| refresh_zabbix_cache.asp | refreshzabbixcache.asp |
|
||||||
|
|
||||||
|
### Fix typo
|
||||||
|
| Old Name | New Name |
|
||||||
|
|----------|----------|
|
||||||
|
| editmacine.asp | (DELETE - duplicate of editmachine.asp) |
|
||||||
|
|
||||||
|
### Test files to DELETE (not rename)
|
||||||
|
- editmachine_test.asp
|
||||||
|
- test_asp.asp
|
||||||
|
- test_db.asp
|
||||||
|
- test_switch_query.asp
|
||||||
|
- test_with_includes.asp
|
||||||
|
|
||||||
|
## Total Changes
|
||||||
|
- **49 files to rename**
|
||||||
|
- **6 files to delete**
|
||||||
200
sql/naming_convention_fix/09_rename_asp_files.ps1
Normal file
200
sql/naming_convention_fix/09_rename_asp_files.ps1
Normal file
@@ -0,0 +1,200 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Renames ASP files to remove underscores and updates all internal references.
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
This script:
|
||||||
|
1. Renames ASP files from snake_case to concatenated lowercase
|
||||||
|
2. Updates all references in ASP, JS, and include files
|
||||||
|
3. Deletes test files
|
||||||
|
|
||||||
|
.PARAMETER Execute
|
||||||
|
Actually perform the renames. Without this, runs in dry-run mode.
|
||||||
|
|
||||||
|
.EXAMPLE
|
||||||
|
.\09_rename_asp_files.ps1 # Dry run - shows what would change
|
||||||
|
.\09_rename_asp_files.ps1 -Execute # Actually performs the renames
|
||||||
|
#>
|
||||||
|
|
||||||
|
param(
|
||||||
|
[switch]$Execute
|
||||||
|
)
|
||||||
|
|
||||||
|
$shopdbPath = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
|
||||||
|
|
||||||
|
# Define rename mappings (old -> new)
|
||||||
|
$renames = @{
|
||||||
|
# Direct handlers
|
||||||
|
"addlink_direct.asp" = "addlinkdirect.asp"
|
||||||
|
"addsubnetbackend_direct.asp" = "addsubnetbackenddirect.asp"
|
||||||
|
"editapplication_direct.asp" = "editapplicationdirect.asp"
|
||||||
|
"saveapplication_direct.asp" = "saveapplicationdirect.asp"
|
||||||
|
"savedevice_direct.asp" = "savedevicedirect.asp"
|
||||||
|
"savemachine_direct.asp" = "savemachinedirect.asp"
|
||||||
|
"savemodel_direct.asp" = "savemodeldirect.asp"
|
||||||
|
"save_network_device.asp" = "savenetworkdevice.asp"
|
||||||
|
"savenotification_direct.asp" = "savenotificationdirect.asp"
|
||||||
|
"saveprinter_direct.asp" = "saveprinterdirect.asp"
|
||||||
|
"saveusb_direct.asp" = "saveusbdirect.asp"
|
||||||
|
"savevendor_direct.asp" = "savevendordirect.asp"
|
||||||
|
"updatedevice_direct.asp" = "updatedevicedirect.asp"
|
||||||
|
"updatelink_direct.asp" = "updatelinkdirect.asp"
|
||||||
|
"updatenotification_direct.asp" = "updatenotificationdirect.asp"
|
||||||
|
"updatepc_direct.asp" = "updatepcdirect.asp"
|
||||||
|
"updatesubnet_direct.asp" = "updatesubnetdirect.asp"
|
||||||
|
|
||||||
|
# USB files
|
||||||
|
"checkin_usb.asp" = "checkinusb.asp"
|
||||||
|
"checkout_usb.asp" = "checkoutusb.asp"
|
||||||
|
"savecheckin_usb.asp" = "savecheckinusb.asp"
|
||||||
|
"savecheckout_usb.asp" = "savecheckoutusb.asp"
|
||||||
|
"usb_history.asp" = "usbhistory.asp"
|
||||||
|
|
||||||
|
# API files
|
||||||
|
"api_businessunits.asp" = "apibusinessunits.asp"
|
||||||
|
"api_printers.asp" = "apiprinters.asp"
|
||||||
|
"api_shopfloor.asp" = "apishopfloor.asp"
|
||||||
|
"api_usb.asp" = "apiusb.asp"
|
||||||
|
|
||||||
|
# Machine/map files
|
||||||
|
"machine_edit.asp" = "machineedit.asp"
|
||||||
|
"machine_map.asp" = "machinemap.asp"
|
||||||
|
"machine_map_editor.asp" = "machinemapeditor.asp"
|
||||||
|
"network_devices.asp" = "networkdevices.asp"
|
||||||
|
"network_map.asp" = "networkmap.asp"
|
||||||
|
"network_map_debug.asp" = "networkmapdebug.asp"
|
||||||
|
|
||||||
|
# Printer files
|
||||||
|
"check_duplicate_printers.asp" = "checkduplicateprinters.asp"
|
||||||
|
"check_printer_machines_count.asp" = "checkprintermachinescount.asp"
|
||||||
|
"cleanup_duplicate_printers_execute.asp" = "cleanupduplicateprintersexecute.asp"
|
||||||
|
"insert_all_printer_machines.asp" = "insertallprintermachines.asp"
|
||||||
|
"install_printer.asp" = "installprinter.asp"
|
||||||
|
"printer_installer_map.asp" = "printerinstallermap.asp"
|
||||||
|
"printer_links_generator.asp" = "printerlinksgenerator.asp"
|
||||||
|
"printer_lookup.asp" = "printerlookup.asp"
|
||||||
|
|
||||||
|
# Other files
|
||||||
|
"admin_clear_cache.asp" = "adminclearcache.asp"
|
||||||
|
"bulk_update_notification_types.asp" = "bulkupdatenotificationtypes.asp"
|
||||||
|
"displaylocation_device.asp" = "displaylocationdevice.asp"
|
||||||
|
"quickadd_application.asp" = "quickaddapplication.asp"
|
||||||
|
"refresh_zabbix_cache.asp" = "refreshzabbixcache.asp"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Files to delete
|
||||||
|
$deleteFiles = @(
|
||||||
|
"editmacine.asp"
|
||||||
|
"editmachine_test.asp"
|
||||||
|
"test_asp.asp"
|
||||||
|
"test_db.asp"
|
||||||
|
"test_switch_query.asp"
|
||||||
|
"test_with_includes.asp"
|
||||||
|
)
|
||||||
|
|
||||||
|
Write-Host "ASP File Rename Script" -ForegroundColor Cyan
|
||||||
|
Write-Host "======================" -ForegroundColor Cyan
|
||||||
|
Write-Host ""
|
||||||
|
|
||||||
|
if (-not $Execute) {
|
||||||
|
Write-Host "DRY RUN MODE - No changes will be made" -ForegroundColor Yellow
|
||||||
|
Write-Host "Run with -Execute to apply changes" -ForegroundColor Yellow
|
||||||
|
Write-Host ""
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get all files to search for references
|
||||||
|
$searchFiles = @()
|
||||||
|
$searchFiles += Get-ChildItem -Path $shopdbPath -Filter "*.asp" -File
|
||||||
|
$searchFiles += Get-ChildItem -Path "$shopdbPath\includes" -Filter "*.asp" -File -ErrorAction SilentlyContinue
|
||||||
|
$searchFiles += Get-ChildItem -Path "$shopdbPath\js" -Filter "*.js" -File -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
Write-Host "Found $($searchFiles.Count) files to search for references" -ForegroundColor Gray
|
||||||
|
Write-Host ""
|
||||||
|
|
||||||
|
# Step 1: Update all references in files
|
||||||
|
Write-Host "STEP 1: Updating references in files..." -ForegroundColor Green
|
||||||
|
$totalReplacements = 0
|
||||||
|
|
||||||
|
foreach ($file in $searchFiles) {
|
||||||
|
$content = Get-Content -Path $file.FullName -Raw -ErrorAction SilentlyContinue
|
||||||
|
if (-not $content) { continue }
|
||||||
|
|
||||||
|
$originalContent = $content
|
||||||
|
$fileChanged = $false
|
||||||
|
|
||||||
|
foreach ($oldName in $renames.Keys) {
|
||||||
|
$newName = $renames[$oldName]
|
||||||
|
if ($content -match [regex]::Escape($oldName)) {
|
||||||
|
$content = $content -replace [regex]::Escape($oldName), $newName
|
||||||
|
$fileChanged = $true
|
||||||
|
$totalReplacements++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($fileChanged) {
|
||||||
|
Write-Host " Updated: $($file.Name)" -ForegroundColor White
|
||||||
|
if ($Execute) {
|
||||||
|
Set-Content -Path $file.FullName -Value $content -NoNewline
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host " Total replacements: $totalReplacements" -ForegroundColor Cyan
|
||||||
|
Write-Host ""
|
||||||
|
|
||||||
|
# Step 2: Rename the files
|
||||||
|
Write-Host "STEP 2: Renaming files..." -ForegroundColor Green
|
||||||
|
$renamedCount = 0
|
||||||
|
|
||||||
|
foreach ($oldName in $renames.Keys) {
|
||||||
|
$newName = $renames[$oldName]
|
||||||
|
$oldPath = Join-Path $shopdbPath $oldName
|
||||||
|
$newPath = Join-Path $shopdbPath $newName
|
||||||
|
|
||||||
|
if (Test-Path $oldPath) {
|
||||||
|
Write-Host " $oldName -> $newName" -ForegroundColor White
|
||||||
|
if ($Execute) {
|
||||||
|
Rename-Item -Path $oldPath -NewName $newName
|
||||||
|
}
|
||||||
|
$renamedCount++
|
||||||
|
} else {
|
||||||
|
Write-Host " SKIP: $oldName (not found)" -ForegroundColor DarkGray
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host " Files to rename: $renamedCount" -ForegroundColor Cyan
|
||||||
|
Write-Host ""
|
||||||
|
|
||||||
|
# Step 3: Delete test files
|
||||||
|
Write-Host "STEP 3: Deleting test/duplicate files..." -ForegroundColor Green
|
||||||
|
$deletedCount = 0
|
||||||
|
|
||||||
|
foreach ($fileName in $deleteFiles) {
|
||||||
|
$filePath = Join-Path $shopdbPath $fileName
|
||||||
|
if (Test-Path $filePath) {
|
||||||
|
Write-Host " DELETE: $fileName" -ForegroundColor Red
|
||||||
|
if ($Execute) {
|
||||||
|
Remove-Item -Path $filePath -Force
|
||||||
|
}
|
||||||
|
$deletedCount++
|
||||||
|
} else {
|
||||||
|
Write-Host " SKIP: $fileName (not found)" -ForegroundColor DarkGray
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host " Files to delete: $deletedCount" -ForegroundColor Cyan
|
||||||
|
Write-Host ""
|
||||||
|
|
||||||
|
# Summary
|
||||||
|
Write-Host "SUMMARY" -ForegroundColor Cyan
|
||||||
|
Write-Host "=======" -ForegroundColor Cyan
|
||||||
|
Write-Host " References updated: $totalReplacements"
|
||||||
|
Write-Host " Files renamed: $renamedCount"
|
||||||
|
Write-Host " Files deleted: $deletedCount"
|
||||||
|
Write-Host ""
|
||||||
|
|
||||||
|
if (-not $Execute) {
|
||||||
|
Write-Host "This was a DRY RUN. Run with -Execute to apply changes." -ForegroundColor Yellow
|
||||||
|
} else {
|
||||||
|
Write-Host "Changes applied successfully!" -ForegroundColor Green
|
||||||
|
}
|
||||||
177
sql/naming_convention_fix/09_rename_asp_files.sh
Executable file
177
sql/naming_convention_fix/09_rename_asp_files.sh
Executable file
@@ -0,0 +1,177 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Renames ASP files to remove underscores and updates all internal references.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# ./09_rename_asp_files.sh # Dry run - shows what would change
|
||||||
|
# ./09_rename_asp_files.sh --execute # Actually performs the renames
|
||||||
|
#
|
||||||
|
|
||||||
|
SHOPDB_PATH="/home/camp/projects/windows/shopdb"
|
||||||
|
EXECUTE=false
|
||||||
|
|
||||||
|
if [ "$1" == "--execute" ]; then
|
||||||
|
EXECUTE=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "ASP File Rename Script"
|
||||||
|
echo "======================"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if [ "$EXECUTE" != "true" ]; then
|
||||||
|
echo "DRY RUN MODE - No changes will be made"
|
||||||
|
echo "Run with --execute to apply changes"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Define rename mappings
|
||||||
|
declare -A RENAMES=(
|
||||||
|
# Direct handlers
|
||||||
|
["addlink_direct.asp"]="addlinkdirect.asp"
|
||||||
|
["addsubnetbackend_direct.asp"]="addsubnetbackenddirect.asp"
|
||||||
|
["editapplication_direct.asp"]="editapplicationdirect.asp"
|
||||||
|
["saveapplication_direct.asp"]="saveapplicationdirect.asp"
|
||||||
|
["savedevice_direct.asp"]="savedevicedirect.asp"
|
||||||
|
["savemachine_direct.asp"]="savemachinedirect.asp"
|
||||||
|
["savemodel_direct.asp"]="savemodeldirect.asp"
|
||||||
|
["save_network_device.asp"]="savenetworkdevice.asp"
|
||||||
|
["savenotification_direct.asp"]="savenotificationdirect.asp"
|
||||||
|
["saveprinter_direct.asp"]="saveprinterdirect.asp"
|
||||||
|
["saveusb_direct.asp"]="saveusbdirect.asp"
|
||||||
|
["savevendor_direct.asp"]="savevendordirect.asp"
|
||||||
|
["updatedevice_direct.asp"]="updatedevicedirect.asp"
|
||||||
|
["updatelink_direct.asp"]="updatelinkdirect.asp"
|
||||||
|
["updatenotification_direct.asp"]="updatenotificationdirect.asp"
|
||||||
|
["updatepc_direct.asp"]="updatepcdirect.asp"
|
||||||
|
["updatesubnet_direct.asp"]="updatesubnetdirect.asp"
|
||||||
|
|
||||||
|
# USB files
|
||||||
|
["checkin_usb.asp"]="checkinusb.asp"
|
||||||
|
["checkout_usb.asp"]="checkoutusb.asp"
|
||||||
|
["savecheckin_usb.asp"]="savecheckinusb.asp"
|
||||||
|
["savecheckout_usb.asp"]="savecheckoutusb.asp"
|
||||||
|
["usb_history.asp"]="usbhistory.asp"
|
||||||
|
|
||||||
|
# API files
|
||||||
|
["api_businessunits.asp"]="apibusinessunits.asp"
|
||||||
|
["api_printers.asp"]="apiprinters.asp"
|
||||||
|
["api_shopfloor.asp"]="apishopfloor.asp"
|
||||||
|
["api_usb.asp"]="apiusb.asp"
|
||||||
|
|
||||||
|
# Machine/map files
|
||||||
|
["machine_edit.asp"]="machineedit.asp"
|
||||||
|
["machine_map.asp"]="machinemap.asp"
|
||||||
|
["machine_map_editor.asp"]="machinemapeditor.asp"
|
||||||
|
["network_devices.asp"]="networkdevices.asp"
|
||||||
|
["network_map.asp"]="networkmap.asp"
|
||||||
|
["network_map_debug.asp"]="networkmapdebug.asp"
|
||||||
|
|
||||||
|
# Printer files
|
||||||
|
["check_duplicate_printers.asp"]="checkduplicateprinters.asp"
|
||||||
|
["check_printer_machines_count.asp"]="checkprintermachinescount.asp"
|
||||||
|
["cleanup_duplicate_printers_execute.asp"]="cleanupduplicateprintersexecute.asp"
|
||||||
|
["insert_all_printer_machines.asp"]="insertallprintermachines.asp"
|
||||||
|
["install_printer.asp"]="installprinter.asp"
|
||||||
|
["printer_installer_map.asp"]="printerinstallermap.asp"
|
||||||
|
["printer_links_generator.asp"]="printerlinksgenerator.asp"
|
||||||
|
["printer_lookup.asp"]="printerlookup.asp"
|
||||||
|
|
||||||
|
# Other files
|
||||||
|
["admin_clear_cache.asp"]="adminclearcache.asp"
|
||||||
|
["bulk_update_notification_types.asp"]="bulkupdatenotificationtypes.asp"
|
||||||
|
["displaylocation_device.asp"]="displaylocationdevice.asp"
|
||||||
|
["quickadd_application.asp"]="quickaddapplication.asp"
|
||||||
|
["refresh_zabbix_cache.asp"]="refreshzabbixcache.asp"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Files to delete
|
||||||
|
DELETE_FILES=(
|
||||||
|
"editmacine.asp"
|
||||||
|
"editmachine_test.asp"
|
||||||
|
"test_asp.asp"
|
||||||
|
"test_db.asp"
|
||||||
|
"test_switch_query.asp"
|
||||||
|
"test_with_includes.asp"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Step 1: Update all references in files
|
||||||
|
echo "STEP 1: Updating references in files..."
|
||||||
|
TOTAL_REPLACEMENTS=0
|
||||||
|
|
||||||
|
for OLD_NAME in "${!RENAMES[@]}"; do
|
||||||
|
NEW_NAME="${RENAMES[$OLD_NAME]}"
|
||||||
|
|
||||||
|
# Find files containing the old name
|
||||||
|
FILES_WITH_REF=$(grep -rl "$OLD_NAME" "$SHOPDB_PATH"/*.asp "$SHOPDB_PATH"/includes/*.asp "$SHOPDB_PATH"/js/*.js 2>/dev/null)
|
||||||
|
|
||||||
|
if [ -n "$FILES_WITH_REF" ]; then
|
||||||
|
for FILE in $FILES_WITH_REF; do
|
||||||
|
echo " Updating $OLD_NAME -> $NEW_NAME in $(basename $FILE)"
|
||||||
|
if [ "$EXECUTE" == "true" ]; then
|
||||||
|
sed -i "s/$OLD_NAME/$NEW_NAME/g" "$FILE"
|
||||||
|
fi
|
||||||
|
TOTAL_REPLACEMENTS=$((TOTAL_REPLACEMENTS + 1))
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo " Total file updates: $TOTAL_REPLACEMENTS"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Step 2: Rename the files
|
||||||
|
echo "STEP 2: Renaming files..."
|
||||||
|
RENAMED_COUNT=0
|
||||||
|
|
||||||
|
for OLD_NAME in "${!RENAMES[@]}"; do
|
||||||
|
NEW_NAME="${RENAMES[$OLD_NAME]}"
|
||||||
|
OLD_PATH="$SHOPDB_PATH/$OLD_NAME"
|
||||||
|
NEW_PATH="$SHOPDB_PATH/$NEW_NAME"
|
||||||
|
|
||||||
|
if [ -f "$OLD_PATH" ]; then
|
||||||
|
echo " $OLD_NAME -> $NEW_NAME"
|
||||||
|
if [ "$EXECUTE" == "true" ]; then
|
||||||
|
mv "$OLD_PATH" "$NEW_PATH"
|
||||||
|
fi
|
||||||
|
RENAMED_COUNT=$((RENAMED_COUNT + 1))
|
||||||
|
else
|
||||||
|
echo " SKIP: $OLD_NAME (not found)"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo " Files to rename: $RENAMED_COUNT"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Step 3: Delete test files
|
||||||
|
echo "STEP 3: Deleting test/duplicate files..."
|
||||||
|
DELETED_COUNT=0
|
||||||
|
|
||||||
|
for FILE_NAME in "${DELETE_FILES[@]}"; do
|
||||||
|
FILE_PATH="$SHOPDB_PATH/$FILE_NAME"
|
||||||
|
|
||||||
|
if [ -f "$FILE_PATH" ]; then
|
||||||
|
echo " DELETE: $FILE_NAME"
|
||||||
|
if [ "$EXECUTE" == "true" ]; then
|
||||||
|
rm -f "$FILE_PATH"
|
||||||
|
fi
|
||||||
|
DELETED_COUNT=$((DELETED_COUNT + 1))
|
||||||
|
else
|
||||||
|
echo " SKIP: $FILE_NAME (not found)"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo " Files to delete: $DELETED_COUNT"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Summary
|
||||||
|
echo "SUMMARY"
|
||||||
|
echo "======="
|
||||||
|
echo " Files updated: $TOTAL_REPLACEMENTS"
|
||||||
|
echo " Files renamed: $RENAMED_COUNT"
|
||||||
|
echo " Files deleted: $DELETED_COUNT"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if [ "$EXECUTE" != "true" ]; then
|
||||||
|
echo "This was a DRY RUN. Run with --execute to apply changes."
|
||||||
|
else
|
||||||
|
echo "Changes applied successfully!"
|
||||||
|
fi
|
||||||
10
test_asp.asp
10
test_asp.asp
@@ -1,10 +0,0 @@
|
|||||||
<%@ Language=VBScript %>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head><title>ASP Test</title></head>
|
|
||||||
<body>
|
|
||||||
<h1>ASP Test Page</h1>
|
|
||||||
<p>Current Time: <%=Now()%></p>
|
|
||||||
<p>ASP is working!</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
22
test_db.asp
22
test_db.asp
@@ -1,22 +0,0 @@
|
|||||||
<%@ Language=VBScript %>
|
|
||||||
<!--#include file="./includes/sql.asp"-->
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head><title>DB Test</title></head>
|
|
||||||
<body>
|
|
||||||
<h1>Database Test Page</h1>
|
|
||||||
<%
|
|
||||||
On Error Resume Next
|
|
||||||
Dim rs
|
|
||||||
Set rs = objConn.Execute("SELECT COUNT(*) AS cnt FROM machines WHERE machinetypeid = 31")
|
|
||||||
If Err.Number <> 0 Then
|
|
||||||
Response.Write("<p style='color:red'>ERROR: " & Server.HTMLEncode(Err.Description) & "</p>")
|
|
||||||
Else
|
|
||||||
Response.Write("<p style='color:green'>Query successful! Switch count: " & rs("cnt") & "</p>")
|
|
||||||
End If
|
|
||||||
rs.Close
|
|
||||||
Set rs = Nothing
|
|
||||||
objConn.Close
|
|
||||||
%>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
<%@ Language=VBScript %>
|
|
||||||
<!--#include file="./includes/sql.asp"-->
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head><title>Switch Query Test</title></head>
|
|
||||||
<body>
|
|
||||||
<h1>Switch Query Test</h1>
|
|
||||||
<%
|
|
||||||
On Error Resume Next
|
|
||||||
Dim switchid, rs, switchname, modelid, serialnumber, ipaddress, description, maptop, mapleft, isactive, vendorname, modelnumber
|
|
||||||
switchid = 5411
|
|
||||||
|
|
||||||
Dim strSQL
|
|
||||||
strSQL = "SELECT mac.machineid, mac.alias AS switchname, mac.modelnumberid AS modelid, " & _
|
|
||||||
"mac.serialnumber, mac.machinenotes AS description, mac.maptop, mac.mapleft, mac.isactive, " & _
|
|
||||||
"m.modelnumber, v.vendor, c.address AS ipaddress " & _
|
|
||||||
"FROM machines mac " & _
|
|
||||||
"LEFT JOIN models m ON mac.modelnumberid = m.modelnumberid " & _
|
|
||||||
"LEFT JOIN vendors v ON m.vendorid = v.vendorid " & _
|
|
||||||
"LEFT JOIN communications c ON mac.machineid = c.machineid AND c.isprimary = 1 AND c.comstypeid = 1 " & _
|
|
||||||
"WHERE mac.machineid = " & switchid & " AND mac.machinetypeid = 31"
|
|
||||||
|
|
||||||
Set rs = objConn.Execute(strSQL)
|
|
||||||
|
|
||||||
If Err.Number <> 0 Then
|
|
||||||
Response.Write("<p style='color:red'>Query ERROR: " & Server.HTMLEncode(Err.Description) & "</p>")
|
|
||||||
ElseIf rs.EOF Then
|
|
||||||
Response.Write("<p style='color:orange'>Switch not found</p>")
|
|
||||||
Else
|
|
||||||
' Apply NULL handling
|
|
||||||
If Not IsNull(rs("switchname")) Then switchname = rs("switchname") Else switchname = ""
|
|
||||||
If Not IsNull(rs("modelid")) Then modelid = rs("modelid") Else modelid = ""
|
|
||||||
If Not IsNull(rs("serialnumber")) Then serialnumber = rs("serialnumber") Else serialnumber = ""
|
|
||||||
If Not IsNull(rs("ipaddress")) Then ipaddress = rs("ipaddress") Else ipaddress = ""
|
|
||||||
If Not IsNull(rs("description")) Then description = rs("description") Else description = ""
|
|
||||||
If Not IsNull(rs("maptop")) Then maptop = rs("maptop") Else maptop = ""
|
|
||||||
If Not IsNull(rs("mapleft")) Then mapleft = rs("mapleft") Else mapleft = ""
|
|
||||||
If Not IsNull(rs("isactive")) Then isactive = rs("isactive") Else isactive = 1
|
|
||||||
If Not IsNull(rs("vendor")) Then vendorname = rs("vendor") Else vendorname = ""
|
|
||||||
If Not IsNull(rs("modelnumber")) Then modelnumber = rs("modelnumber") Else modelnumber = ""
|
|
||||||
|
|
||||||
Response.Write("<p style='color:green'>SUCCESS! Data loaded:</p>")
|
|
||||||
Response.Write("<ul>")
|
|
||||||
Response.Write("<li>Name: " & Server.HTMLEncode(switchname) & "</li>")
|
|
||||||
Response.Write("<li>Model ID: " & Server.HTMLEncode(modelid) & "</li>")
|
|
||||||
Response.Write("<li>Serial: " & Server.HTMLEncode(serialnumber) & "</li>")
|
|
||||||
Response.Write("<li>IP: " & Server.HTMLEncode(ipaddress) & "</li>")
|
|
||||||
Response.Write("<li>Description: " & Server.HTMLEncode(description) & "</li>")
|
|
||||||
Response.Write("<li>Map Top: " & Server.HTMLEncode(maptop) & "</li>")
|
|
||||||
Response.Write("<li>Map Left: " & Server.HTMLEncode(mapleft) & "</li>")
|
|
||||||
Response.Write("<li>Active: " & Server.HTMLEncode(isactive) & "</li>")
|
|
||||||
Response.Write("<li>Vendor: " & Server.HTMLEncode(vendorname) & "</li>")
|
|
||||||
Response.Write("<li>Model: " & Server.HTMLEncode(modelnumber) & "</li>")
|
|
||||||
Response.Write("</ul>")
|
|
||||||
End If
|
|
||||||
|
|
||||||
rs.Close
|
|
||||||
Set rs = Nothing
|
|
||||||
objConn.Close
|
|
||||||
%>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<!--#include file="./includes/header.asp"-->
|
|
||||||
<!--#include file="./includes/sql.asp"-->
|
|
||||||
<!--#include file="./includes/validation.asp"-->
|
|
||||||
<title>Test With Includes</title>
|
|
||||||
</head>
|
|
||||||
<%
|
|
||||||
Dim theme
|
|
||||||
theme = Request.Cookies("theme")
|
|
||||||
IF theme = "" THEN
|
|
||||||
theme="bg-theme1"
|
|
||||||
END IF
|
|
||||||
|
|
||||||
Dim switchid, rs, switchname
|
|
||||||
switchid = 5411
|
|
||||||
|
|
||||||
Dim strSQL
|
|
||||||
strSQL = "SELECT mac.alias AS switchname FROM machines mac WHERE mac.machineid = " & switchid
|
|
||||||
Set rs = objConn.Execute(strSQL)
|
|
||||||
|
|
||||||
If Not rs.EOF Then
|
|
||||||
If Not IsNull(rs("switchname")) Then switchname = rs("switchname") Else switchname = ""
|
|
||||||
Else
|
|
||||||
switchname = "NOT FOUND"
|
|
||||||
End If
|
|
||||||
|
|
||||||
rs.Close
|
|
||||||
Set rs = Nothing
|
|
||||||
%>
|
|
||||||
|
|
||||||
<body class="bg-theme <%=theme%>">
|
|
||||||
<h1>Test With Includes</h1>
|
|
||||||
<p>Switch Name: <%=Server.HTMLEncode(switchname)%></p>
|
|
||||||
<%
|
|
||||||
objConn.Close
|
|
||||||
%>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -903,7 +903,7 @@
|
|||||||
|
|
||||||
// Call clear cache endpoint
|
// Call clear cache endpoint
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: './admin_clear_cache.asp?confirm=yes&type=zabbix&ajax=1',
|
url: './adminclearcache.asp?confirm=yes&type=zabbix&ajax=1',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
success: function() {
|
success: function() {
|
||||||
// Reload page after cache cleared
|
// Reload page after cache cleared
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
' FILE: savemachineedit.asp
|
' FILE: savemachineedit.asp
|
||||||
' PURPOSE: Update existing machine with nested entity creation (vendor, model, business unit)
|
' PURPOSE: Update existing machine with nested entity creation (vendor, model, business unit)
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' CREATED: 2025-11-07 - Based on savemachine_direct.asp
|
' CREATED: 2025-11-07 - Based on savemachinedirect.asp
|
||||||
' NOTE: Machines now inherit machinetypeid from their model. Each model has one machine type.
|
' NOTE: Machines now inherit machinetypeid from their model. Each model has one machine type.
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
%>
|
%>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: updatelink_direct.asp
|
' FILE: updatelinkdirect.asp
|
||||||
' PURPOSE: Update knowledge base article with nested entity creation (topic, support team, app owner)
|
' PURPOSE: Update knowledge base article with nested entity creation (topic, support team, app owner)
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: updatenotification_direct.asp
|
' FILE: updatenotificationdirect.asp
|
||||||
' PURPOSE: Update existing notification
|
' PURPOSE: Update existing notification
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: updatepc_direct.asp
|
' FILE: updatepcdirect.asp
|
||||||
' PURPOSE: Update PC/device with optional vendor and model creation
|
' PURPOSE: Update PC/device with optional vendor and model creation
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<%
|
<%
|
||||||
'=============================================================================
|
'=============================================================================
|
||||||
' FILE: updatesubnet_direct.asp
|
' FILE: updatesubnetdirect.asp
|
||||||
' PURPOSE: Update existing subnet with IP address calculations
|
' PURPOSE: Update existing subnet with IP address calculations
|
||||||
' SECURITY: Parameterized queries, HTML encoding, input validation
|
' SECURITY: Parameterized queries, HTML encoding, input validation
|
||||||
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
' UPDATED: 2025-10-27 - Migrated to secure patterns
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
</h5>
|
</h5>
|
||||||
<div>
|
<div>
|
||||||
<% If filterMachineId <> "" Or filterSSO <> "" Then %>
|
<% If filterMachineId <> "" Or filterSSO <> "" Then %>
|
||||||
<a href="./usb_history.asp" class="btn btn-secondary btn-sm">
|
<a href="./usbhistory.asp" class="btn btn-secondary btn-sm">
|
||||||
<i class="zmdi zmdi-close"></i> Clear Filters
|
<i class="zmdi zmdi-close"></i> Clear Filters
|
||||||
</a>
|
</a>
|
||||||
<% End If %>
|
<% End If %>
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
%>
|
%>
|
||||||
<tr class="<%=statusClass%>">
|
<tr class="<%=statusClass%>">
|
||||||
<td>
|
<td>
|
||||||
<a href="./usb_history.asp?machineid=<%=rs("machineid")%>" title="Filter by this device">
|
<a href="./usbhistory.asp?machineid=<%=rs("machineid")%>" title="Filter by this device">
|
||||||
<code><%=Server.HTMLEncode(serialNum)%></code>
|
<code><%=Server.HTMLEncode(serialNum)%></code>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
@@ -193,7 +193,7 @@
|
|||||||
<i class="zmdi zmdi-info zmdi-hc-2x"></i><br>
|
<i class="zmdi zmdi-info zmdi-hc-2x"></i><br>
|
||||||
No checkout history found.
|
No checkout history found.
|
||||||
<% If filterMachineId <> "" Or filterSSO <> "" Then %>
|
<% If filterMachineId <> "" Or filterSSO <> "" Then %>
|
||||||
<br><a href="./usb_history.asp">Show all history</a>
|
<br><a href="./usbhistory.asp">Show all history</a>
|
||||||
<% End If %>
|
<% End If %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
Reference in New Issue
Block a user