Database changes applied: - machine_overrides -> machineoverrides - pc_comm_config -> commconfig - pc_dnc_config -> dncconfig - pc_dualpath_assignments -> dualpathassignments - pc_network_interfaces -> networkinterfaces - usb_checkouts -> usbcheckouts ASP files updated (10 files): - api.asp, api_usb.asp - displaypc.asp, displaysubnet.asp, displaymachine.asp - displayusb.asp, displayprofile.asp - usb_history.asp, savecheckin_usb.asp, savecheckout_usb.asp 9 views recreated with new table references. Tested and verified working on dev environment. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
570 lines
23 KiB
Plaintext
570 lines
23 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<!--#include file="./includes/header.asp"-->
|
|
<!--#include file="./includes/wjf_employees-sql.asp"-->
|
|
<!-- DataTables CSS -->
|
|
<link rel="stylesheet" href="assets/plugins/datatables/dataTables.bootstrap4.min.css">
|
|
</head>
|
|
|
|
<%
|
|
theme = Request.Cookies("theme")
|
|
IF theme = "" THEN
|
|
theme="bg-theme1"
|
|
END IF
|
|
|
|
sso = Request.Querystring("sso")
|
|
%>
|
|
|
|
<body class="bg-theme <%Response.Write(theme)%>">
|
|
|
|
<!-- start loader -->
|
|
<div id="pageloader-overlay" class="visible incoming">
|
|
<div class="loader-wrapper-outer">
|
|
<div class="loader-wrapper-inner">
|
|
<div class="loader"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end loader -->
|
|
<!-- Start wrapper-->
|
|
<div id="wrapper">
|
|
<!--#include file="./includes/leftsidebar.asp"-->
|
|
<!--Start topbar header-->
|
|
<!--#include file="./includes/topbarheader.asp"-->
|
|
<!--End topbar header-->
|
|
<div class="clearfix"></div>
|
|
|
|
|
|
<div class="content-wrapper">
|
|
<div class="container-fluid">
|
|
|
|
<div class="row mt-3">
|
|
<div class="col-lg-4">
|
|
<div class="card profile-card-1">
|
|
<div class="card-img-block">
|
|
|
|
<%
|
|
|
|
strSQL = "SELECT * from employees WHERE SSO="&sso
|
|
set rs = objconn.Execute(strSQL)
|
|
if rs.eof THEN
|
|
strSQL = "SELECT * from employees WHERE SSO=1"
|
|
set rs = objconn.Execute(strSQL)
|
|
END IF
|
|
|
|
%>
|
|
|
|
<img class="img-fluid" src="https://tsgwp00525.rd.ds.ge.com/EmployeeDBAPP/images/<%Response.Write(rs("Picture"))%>" alt="Card image cap">
|
|
</div>
|
|
<div class="card-body pt-5">
|
|
<h5 class="card-title"><%Response.Write(rs("First_Name"))%> <%Response.Write(rs("Last_Name"))%></h5>
|
|
</div>
|
|
<%
|
|
' Easter Egg for SSO 570005354
|
|
Dim showEasterEgg
|
|
showEasterEgg = False
|
|
On Error Resume Next
|
|
IF IsNumeric(sso) THEN
|
|
IF CLng(sso) = 570005354 THEN
|
|
showEasterEgg = True
|
|
END IF
|
|
END IF
|
|
On Error Goto 0
|
|
|
|
IF showEasterEgg THEN
|
|
%>
|
|
<div class="card-body border-top border-light">
|
|
<div class="text-center mb-3">
|
|
<h6 class="text-warning"><i class="zmdi zmdi-star"></i> ACHIEVEMENT UNLOCKED <i class="zmdi zmdi-star"></i></h6>
|
|
<small class="text-muted">Secret Developer Stats</small>
|
|
</div>
|
|
<div class="media align-items-center">
|
|
<div><i class="zmdi zmdi-coffee" style="font-size: 40px; color: #8B4513;"></i></div>
|
|
<div class="media-body text-left ml-3">
|
|
<div class="progress-wrapper">
|
|
<p>Caffeine Consumption<span class="float-right">147%</span></p>
|
|
<div class="progress" style="height: 5px;">
|
|
<div class="progress-bar bg-warning" style="width:100%"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
<div class="media align-items-center">
|
|
<div><i class="zmdi zmdi-bug" style="font-size: 40px; color: #28a745;"></i></div>
|
|
<div class="media-body text-left ml-3">
|
|
<div class="progress-wrapper">
|
|
<p>Bug Fixing Speed<span class="float-right">95%</span></p>
|
|
<div class="progress" style="height: 5px;">
|
|
<div class="progress-bar bg-success" style="width:95%"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
<div class="media align-items-center">
|
|
<div><i class="zmdi zmdi-code" style="font-size: 40px; color: #17a2b8;"></i></div>
|
|
<div class="media-body text-left ml-3">
|
|
<div class="progress-wrapper">
|
|
<p>Google-Fu<span class="float-right">99%</span></p>
|
|
<div class="progress" style="height: 5px;">
|
|
<div class="progress-bar bg-info" style="width:99%"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
<div class="media align-items-center">
|
|
<div><i class="zmdi zmdi-storage" style="font-size: 40px; color: #007bff;"></i></div>
|
|
<div class="media-body text-left ml-3">
|
|
<div class="progress-wrapper">
|
|
<p>Database Tinkering<span class="float-right">88%</span></p>
|
|
<div class="progress" style="height: 5px;">
|
|
<div class="progress-bar bg-primary" style="width:88%"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
<div class="media align-items-center">
|
|
<div><i class="zmdi zmdi-fire" style="font-size: 40px; color: #dc3545;"></i></div>
|
|
<div class="media-body text-left ml-3">
|
|
<div class="progress-wrapper">
|
|
<p>Debugging<span class="float-right">100%</span></p>
|
|
<div class="progress" style="height: 5px;">
|
|
<div class="progress-bar bg-danger" style="width:100%"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
<div class="media align-items-center">
|
|
<div><i class="zmdi zmdi-shield-check" style="font-size: 40px; color: #ffc107;"></i></div>
|
|
<div class="media-body text-left ml-3">
|
|
<div class="progress-wrapper">
|
|
<p>Production Deployment Courage<span class="float-right">73%</span></p>
|
|
<div class="progress" style="height: 5px;">
|
|
<div class="progress-bar bg-warning" style="width:73%"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
<div class="text-center mt-3">
|
|
<span class="badge badge-danger m-1">Legacy Code Archaeologist</span>
|
|
<span class="badge badge-info m-1">Documentation Writer (Rare!)</span>
|
|
</div>
|
|
</div>
|
|
<%
|
|
ELSE
|
|
%>
|
|
<div class="card-body border-top border-light">
|
|
<div class="media align-items-center">
|
|
<div>
|
|
<img src="./images/skills/atm.jpg" class="skill-img" alt="Advanced Technical Machinist">
|
|
</div>
|
|
<div class="media-body text-left ml-3">
|
|
<div class="progress-wrapper">
|
|
<p>Advanced Technical Machinist<span class="float-right">100%</span></p>
|
|
<div class="progress" style="height: 5px;">
|
|
<div class="progress-bar" style="width:100%"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
<div class="media align-items-center">
|
|
<div><img src="assets/images/timeline/bootstrap-4.svg" class="skill-img" alt="skill img"></div>
|
|
<div class="media-body text-left ml-3">
|
|
<div class="progress-wrapper">
|
|
<p>Bootstrap 4 <span class="float-right">50%</span></p>
|
|
<div class="progress" style="height: 5px;">
|
|
<div class="progress-bar" style="width:50%"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
<div class="media align-items-center">
|
|
<div><img src="assets/images/timeline/angular-icon.svg" class="skill-img" alt="skill img"></div>
|
|
<div class="media-body text-left ml-3">
|
|
<div class="progress-wrapper">
|
|
<p>AngularJS <span class="float-right">70%</span></p>
|
|
<div class="progress" style="height: 5px;">
|
|
<div class="progress-bar" style="width:70%"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
<div class="media align-items-center">
|
|
<div><img src="assets/images/timeline/react.svg" class="skill-img" alt="skill img"></div>
|
|
<div class="media-body text-left ml-3">
|
|
<div class="progress-wrapper">
|
|
<p>React JS <span class="float-right">35%</span></p>
|
|
<div class="progress" style="height: 5px;">
|
|
<div class="progress-bar" style="width:35%"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<%
|
|
END IF
|
|
%>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-lg-8">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<ul class="nav nav-tabs nav-tabs-primary top-icon nav-justified">
|
|
<li class="nav-item">
|
|
<a href="javascript:void();" data-target="#profile" data-toggle="pill" class="nav-link active"><i class="icon-user"></i> <span class="hidden-xs">Profile</span></a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a href="javascript:void();" data-target="#usbhistory" data-toggle="pill" class="nav-link"><i class="zmdi zmdi-usb"></i> <span class="hidden-xs">USB History</span></a>
|
|
</li>
|
|
</ul>
|
|
<div class="tab-content p-3">
|
|
<div class="tab-pane active" id="profile">
|
|
<h5 class="mb-3">Profile</h5>
|
|
<div class="row">
|
|
<div class="col-md-3">
|
|
<h6><%Response.Write(rs("First_Name"))%> <%Response.Write(rs("Last_Name"))%></h6>
|
|
<h6>SSO</h6>
|
|
<h6>Shift</h6>
|
|
<h6>Role</h6>
|
|
<h6>Team</h6>
|
|
<h6>PayNo</h6>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<h6> <h6>
|
|
<h6><%Response.Write(rs("SSO"))%></h6>
|
|
<h6><%Response.Write(rs("shift"))%></h6>
|
|
<h6><%Response.Write(rs("Role"))%></h6>
|
|
<h6><%Response.Write(rs("Team"))%></h6>
|
|
<h6><%Response.Write(rs("Payno"))%></h6>
|
|
</div>
|
|
</div>
|
|
<!--/row-->
|
|
</div>
|
|
|
|
<div class="tab-pane" id="usbhistory">
|
|
<h5 class="mb-3"><i class="zmdi zmdi-usb"></i> USB Checkout History</h5>
|
|
<%
|
|
' Connect to shopdb for USB history
|
|
Dim objConnShopdb, shopdbAvailable
|
|
shopdbAvailable = False
|
|
|
|
On Error Resume Next
|
|
Set objConnShopdb = Server.CreateObject("ADODB.Connection")
|
|
objConnShopdb.ConnectionString = "Driver={MySQL ODBC 9.4 Unicode Driver};" & _
|
|
"Server=192.168.122.1;Port=3306;Database=shopdb;" & _
|
|
"User=570005354;Password=570005354;Option=3;"
|
|
objConnShopdb.Open
|
|
If Err.Number = 0 Then
|
|
shopdbAvailable = True
|
|
Else
|
|
Err.Clear
|
|
End If
|
|
On Error Goto 0
|
|
|
|
If shopdbAvailable And IsNumeric(sso) Then
|
|
' Get USB checkout statistics
|
|
Dim cmdStats, rsStats
|
|
Dim totalCheckouts, activeCheckouts, avgDuration
|
|
Dim statsSQL
|
|
statsSQL = "SELECT " & _
|
|
"COUNT(*) AS total_checkouts, " & _
|
|
"SUM(CASE WHEN checkin_time IS NULL THEN 1 ELSE 0 END) AS active_checkouts, " & _
|
|
"AVG(TIMESTAMPDIFF(MINUTE, checkout_time, COALESCE(checkin_time, NOW()))) AS avg_duration " & _
|
|
"FROM usbcheckouts WHERE sso = ?"
|
|
|
|
Set cmdStats = Server.CreateObject("ADODB.Command")
|
|
cmdStats.ActiveConnection = objConnShopdb
|
|
cmdStats.CommandText = statsSQL
|
|
cmdStats.CommandType = 1
|
|
cmdStats.Parameters.Append cmdStats.CreateParameter("@sso", 200, 1, 20, sso)
|
|
|
|
On Error Resume Next
|
|
Set rsStats = cmdStats.Execute
|
|
|
|
If Err.Number = 0 And Not rsStats.EOF Then
|
|
If IsNull(rsStats("total_checkouts")) Then
|
|
totalCheckouts = 0
|
|
Else
|
|
totalCheckouts = CLng(rsStats("total_checkouts") & "")
|
|
End If
|
|
|
|
If IsNull(rsStats("active_checkouts")) Then
|
|
activeCheckouts = 0
|
|
Else
|
|
activeCheckouts = CLng(rsStats("active_checkouts") & "")
|
|
End If
|
|
|
|
If IsNull(rsStats("avg_duration")) Then
|
|
avgDuration = 0
|
|
Else
|
|
avgDuration = CLng(rsStats("avg_duration") & "")
|
|
End If
|
|
Else
|
|
totalCheckouts = 0
|
|
activeCheckouts = 0
|
|
avgDuration = 0
|
|
End If
|
|
On Error Goto 0
|
|
|
|
If Not rsStats Is Nothing Then rsStats.Close
|
|
Set rsStats = Nothing
|
|
Set cmdStats = Nothing
|
|
|
|
' Format average duration
|
|
Dim avgDurationText
|
|
If avgDuration < 60 Then
|
|
avgDurationText = avgDuration & " min"
|
|
ElseIf avgDuration < 1440 Then
|
|
avgDurationText = Int(avgDuration / 60) & "h " & (avgDuration Mod 60) & "m"
|
|
Else
|
|
avgDurationText = Int(avgDuration / 1440) & "d " & Int((avgDuration Mod 1440) / 60) & "h"
|
|
End If
|
|
%>
|
|
<!-- USB Stats Row -->
|
|
<div class="row mb-3">
|
|
<div class="col-md-4 text-center">
|
|
<div class="p-2 border rounded">
|
|
<i class="zmdi zmdi-usb zmdi-hc-2x text-primary"></i>
|
|
<h4 class="mt-1 mb-0"><%=totalCheckouts%></h4>
|
|
<small class="text-muted">Total Checkouts</small>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4 text-center">
|
|
<div class="p-2 border rounded">
|
|
<% If activeCheckouts > 0 Then %>
|
|
<i class="zmdi zmdi-time zmdi-hc-2x text-warning"></i>
|
|
<% Else %>
|
|
<i class="zmdi zmdi-check-circle zmdi-hc-2x text-success"></i>
|
|
<% End If %>
|
|
<h4 class="mt-1 mb-0"><%=activeCheckouts%></h4>
|
|
<small class="text-muted">Currently Out</small>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4 text-center">
|
|
<div class="p-2 border rounded">
|
|
<i class="zmdi zmdi-timer zmdi-hc-2x text-info"></i>
|
|
<h4 class="mt-1 mb-0"><%=avgDurationText%></h4>
|
|
<small class="text-muted">Avg Duration</small>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="table-responsive">
|
|
<table id="usbTable" class="table table-sm table-hover table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>USB Device</th>
|
|
<th>Checkout</th>
|
|
<th>Check-in</th>
|
|
<th>Duration</th>
|
|
<th>Wiped</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<%
|
|
' Get USB checkout history for this SSO
|
|
Dim cmdHistory, rsHistory
|
|
Dim historySQL
|
|
historySQL = "SELECT uc.*, m.serialnumber, m.alias, " & _
|
|
"TIMESTAMPDIFF(MINUTE, uc.checkout_time, COALESCE(uc.checkin_time, NOW())) AS duration_minutes " & _
|
|
"FROM usbcheckouts uc " & _
|
|
"JOIN machines m ON uc.machineid = m.machineid " & _
|
|
"WHERE uc.sso = ? " & _
|
|
"ORDER BY uc.checkout_time DESC"
|
|
|
|
Set cmdHistory = Server.CreateObject("ADODB.Command")
|
|
cmdHistory.ActiveConnection = objConnShopdb
|
|
cmdHistory.CommandText = historySQL
|
|
cmdHistory.CommandType = 1
|
|
cmdHistory.Parameters.Append cmdHistory.CreateParameter("@sso", 200, 1, 20, sso)
|
|
|
|
On Error Resume Next
|
|
Set rsHistory = cmdHistory.Execute
|
|
On Error Goto 0
|
|
|
|
Dim rowCount
|
|
rowCount = 0
|
|
|
|
If Not rsHistory Is Nothing Then
|
|
Do While Not rsHistory.EOF
|
|
rowCount = rowCount + 1
|
|
Dim serialNum, usbAlias, checkoutTime, checkinTime, durationMinutes
|
|
Dim durationText, wipedText, statusClass
|
|
|
|
serialNum = rsHistory("serialnumber") & ""
|
|
usbAlias = rsHistory("alias") & ""
|
|
|
|
If IsNull(rsHistory("duration_minutes")) Then
|
|
durationMinutes = 0
|
|
Else
|
|
durationMinutes = CLng(rsHistory("duration_minutes") & "")
|
|
End If
|
|
|
|
' Format checkout time (MM/DD/YYYY h:mm AM/PM)
|
|
If Not IsNull(rsHistory("checkout_time")) Then
|
|
checkoutTime = Month(rsHistory("checkout_time")) & "/" & Day(rsHistory("checkout_time")) & "/" & Year(rsHistory("checkout_time")) & " " & FormatDateTime(rsHistory("checkout_time"), 3)
|
|
Else
|
|
checkoutTime = "-"
|
|
End If
|
|
|
|
' Format check-in time and determine status
|
|
If Not IsNull(rsHistory("checkin_time")) Then
|
|
checkinTime = Month(rsHistory("checkin_time")) & "/" & Day(rsHistory("checkin_time")) & "/" & Year(rsHistory("checkin_time")) & " " & FormatDateTime(rsHistory("checkin_time"), 3)
|
|
statusClass = ""
|
|
Else
|
|
checkinTime = "<span class='badge badge-warning'>Still Out</span>"
|
|
statusClass = "table-warning"
|
|
End If
|
|
|
|
' Format duration
|
|
If durationMinutes < 60 Then
|
|
durationText = durationMinutes & " min"
|
|
ElseIf durationMinutes < 1440 Then
|
|
durationText = Int(durationMinutes / 60) & "h " & (durationMinutes Mod 60) & "m"
|
|
Else
|
|
durationText = Int(durationMinutes / 1440) & "d " & Int((durationMinutes Mod 1440) / 60) & "h"
|
|
End If
|
|
|
|
' Format wiped status
|
|
If IsNull(rsHistory("was_wiped")) Then
|
|
wipedText = "-"
|
|
ElseIf rsHistory("was_wiped") = 1 Then
|
|
wipedText = "<span class='badge badge-success'>Yes</span>"
|
|
Else
|
|
wipedText = "<span class='badge badge-danger'>No</span>"
|
|
End If
|
|
|
|
' Build device display
|
|
Dim deviceDisplay
|
|
If usbAlias <> "" And usbAlias <> serialNum Then
|
|
deviceDisplay = Server.HTMLEncode(serialNum) & "<br><small class='text-muted'>" & Server.HTMLEncode(usbAlias) & "</small>"
|
|
Else
|
|
deviceDisplay = Server.HTMLEncode(serialNum)
|
|
End If
|
|
%>
|
|
<tr class="<%=statusClass%>">
|
|
<td><%=deviceDisplay%></td>
|
|
<td><small><%=checkoutTime%></small></td>
|
|
<td><small><%=checkinTime%></small></td>
|
|
<td><%=durationText%></td>
|
|
<td><%=wipedText%></td>
|
|
</tr>
|
|
<%
|
|
rsHistory.MoveNext
|
|
Loop
|
|
|
|
rsHistory.Close
|
|
Set rsHistory = Nothing
|
|
End If
|
|
Set cmdHistory = Nothing
|
|
|
|
If rowCount = 0 Then
|
|
%>
|
|
<tr>
|
|
<td colspan="5" class="text-center text-muted">
|
|
<i class="zmdi zmdi-info"></i> No USB checkout history
|
|
</td>
|
|
</tr>
|
|
<%
|
|
End If
|
|
|
|
' Close shopdb connection
|
|
objConnShopdb.Close
|
|
Set objConnShopdb = Nothing
|
|
Else
|
|
' ShopDB not available
|
|
%>
|
|
<div class="alert alert-info">
|
|
<i class="zmdi zmdi-info"></i> USB checkout history not available.
|
|
</div>
|
|
<%
|
|
End If
|
|
%>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="mt-2">
|
|
<a href="./usb_history.asp?sso=<%=Server.URLEncode(sso)%>" class="btn btn-outline-primary btn-sm">
|
|
<i class="zmdi zmdi-open-in-new"></i> View Full History
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!--start overlay-->
|
|
<div class="overlay toggle-menu"></div>
|
|
<!--end overlay-->
|
|
|
|
</div>
|
|
<!-- End container-fluid-->
|
|
</div><!--End content-wrapper-->
|
|
<!--Start Back To Top Button-->
|
|
<a href="javaScript:void();" class="back-to-top"><i class="fa fa-angle-double-up"></i> </a>
|
|
<!--End Back To Top Button-->
|
|
|
|
<!--Start footer-->
|
|
<footer class="footer">
|
|
<div class="container">
|
|
<div class="text-center">
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
<!--End footer-->
|
|
</div><!--End wrapper-->
|
|
|
|
|
|
<!-- Bootstrap core JavaScript-->
|
|
<script src="assets/js/jquery.min.js"></script>
|
|
<script src="assets/js/popper.min.js"></script>
|
|
<script src="assets/js/bootstrap.min.js"></script>
|
|
|
|
<!-- simplebar js -->
|
|
<script src="assets/plugins/simplebar/js/simplebar.js"></script>
|
|
<!-- sidebar-menu js -->
|
|
<script src="assets/js/sidebar-menu.js"></script>
|
|
|
|
<!-- DataTables js -->
|
|
<script src="assets/plugins/datatables/jquery.dataTables.min.js"></script>
|
|
<script src="assets/plugins/datatables/dataTables.bootstrap4.min.js"></script>
|
|
|
|
<!-- Custom scripts -->
|
|
<script src="assets/js/app-script.js"></script>
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('#usbTable').DataTable({
|
|
"order": [[1, "desc"]],
|
|
"pageLength": 10,
|
|
"lengthMenu": [[10, 25, 50], [10, 25, 50]],
|
|
"language": {
|
|
"emptyTable": "No USB checkout history"
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|
|
<%
|
|
objconn.close
|
|
%>
|