Fix displayprofile.asp to work with production employees database
- Restored original structure using wjf_employees-sql.asp include - Added USB History tab with separate shopdb connection - Fixed 500 error caused by trying to handle missing employees DB - Employee profile now works on production, USB history gracefully degrades if shopdb unavailable - Added DataTables for USB checkout history display - Uses 12-hour date format (MM/DD/YYYY h:mm AM/PM) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!--#include file="./includes/header.asp"-->
|
||||
<!--#include file="./includes/sql.asp"-->
|
||||
<!--#include file="./includes/wjf_employees-sql.asp"-->
|
||||
<!-- DataTables CSS -->
|
||||
<link rel="stylesheet" href="assets/plugins/datatables/dataTables.bootstrap4.min.css">
|
||||
</head>
|
||||
@@ -13,22 +13,19 @@
|
||||
theme="bg-theme1"
|
||||
END IF
|
||||
|
||||
' Get SSO parameter
|
||||
Dim ssoParam
|
||||
ssoParam = Trim(Request.QueryString("sso"))
|
||||
|
||||
' Validate SSO - must be 9 digits
|
||||
Dim validSSO
|
||||
validSSO = False
|
||||
If ssoParam <> "" And Len(ssoParam) = 9 And IsNumeric(ssoParam) Then
|
||||
validSSO = True
|
||||
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>
|
||||
<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">
|
||||
@@ -38,49 +35,245 @@
|
||||
<!--End topbar header-->
|
||||
<div class="clearfix"></div>
|
||||
|
||||
|
||||
<div class="content-wrapper">
|
||||
<div class="container-fluid">
|
||||
|
||||
<%
|
||||
If Not validSSO Then
|
||||
%>
|
||||
<div class="row mt-3">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<i class="zmdi zmdi-alert-circle zmdi-hc-4x text-warning"></i>
|
||||
<h4 class="mt-3">Invalid SSO</h4>
|
||||
<p class="text-muted">Please provide a valid 9-digit SSO number.</p>
|
||||
<a href="./default.asp" class="btn btn-primary">Go to Dashboard</a>
|
||||
<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
|
||||
' Look up person in appowners table
|
||||
Dim cmdOwner, rsOwner, personName
|
||||
Dim ownerSQL
|
||||
ownerSQL = "SELECT appowner FROM appowners WHERE sso = ? AND isactive = 1"
|
||||
|
||||
Set cmdOwner = Server.CreateObject("ADODB.Command")
|
||||
cmdOwner.ActiveConnection = objConn
|
||||
cmdOwner.CommandText = ownerSQL
|
||||
cmdOwner.CommandType = 1
|
||||
cmdOwner.Parameters.Append cmdOwner.CreateParameter("@sso", 200, 1, 20, ssoParam)
|
||||
|
||||
Set rsOwner = cmdOwner.Execute
|
||||
|
||||
If Not rsOwner.EOF Then
|
||||
personName = rsOwner("appowner") & ""
|
||||
Else
|
||||
personName = ""
|
||||
End If
|
||||
|
||||
rsOwner.Close
|
||||
Set rsOwner = Nothing
|
||||
Set cmdOwner = Nothing
|
||||
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
|
||||
@@ -92,38 +285,40 @@ Else
|
||||
"FROM usb_checkouts WHERE sso = ?"
|
||||
|
||||
Set cmdStats = Server.CreateObject("ADODB.Command")
|
||||
cmdStats.ActiveConnection = objConn
|
||||
cmdStats.ActiveConnection = objConnShopdb
|
||||
cmdStats.CommandText = statsSQL
|
||||
cmdStats.CommandType = 1
|
||||
cmdStats.Parameters.Append cmdStats.CreateParameter("@sso", 200, 1, 20, ssoParam)
|
||||
cmdStats.Parameters.Append cmdStats.CreateParameter("@sso", 200, 1, 20, sso)
|
||||
|
||||
On Error Resume Next
|
||||
Set rsStats = cmdStats.Execute
|
||||
|
||||
If Not rsStats.EOF Then
|
||||
If IsNull(rsStats("total_checkouts")) Or rsStats("total_checkouts") = "" Then
|
||||
If Err.Number = 0 And Not rsStats.EOF Then
|
||||
If IsNull(rsStats("total_checkouts")) Then
|
||||
totalCheckouts = 0
|
||||
Else
|
||||
totalCheckouts = CLng(rsStats("total_checkouts"))
|
||||
totalCheckouts = CLng(rsStats("total_checkouts") & "")
|
||||
End If
|
||||
|
||||
If IsNull(rsStats("active_checkouts")) Or rsStats("active_checkouts") = "" Then
|
||||
If IsNull(rsStats("active_checkouts")) Then
|
||||
activeCheckouts = 0
|
||||
Else
|
||||
activeCheckouts = CLng(rsStats("active_checkouts"))
|
||||
activeCheckouts = CLng(rsStats("active_checkouts") & "")
|
||||
End If
|
||||
|
||||
If IsNull(rsStats("avg_duration")) Or rsStats("avg_duration") = "" Then
|
||||
If IsNull(rsStats("avg_duration")) Then
|
||||
avgDuration = 0
|
||||
Else
|
||||
avgDuration = CLng(rsStats("avg_duration"))
|
||||
avgDuration = CLng(rsStats("avg_duration") & "")
|
||||
End If
|
||||
Else
|
||||
totalCheckouts = 0
|
||||
activeCheckouts = 0
|
||||
avgDuration = 0
|
||||
End If
|
||||
On Error Goto 0
|
||||
|
||||
rsStats.Close
|
||||
If Not rsStats Is Nothing Then rsStats.Close
|
||||
Set rsStats = Nothing
|
||||
Set cmdStats = Nothing
|
||||
|
||||
@@ -137,89 +332,47 @@ Else
|
||||
avgDurationText = Int(avgDuration / 1440) & "d " & Int((avgDuration Mod 1440) / 60) & "h"
|
||||
End If
|
||||
%>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-12">
|
||||
<!-- Profile Header -->
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div style="display: flex; align-items: center;">
|
||||
<div style="width: 80px; height: 80px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 20px;">
|
||||
<i class="zmdi zmdi-account zmdi-hc-3x" style="color: white;"></i>
|
||||
</div>
|
||||
<div>
|
||||
<% If personName <> "" Then %>
|
||||
<h3 style="margin: 0;"><%=Server.HTMLEncode(personName)%></h3>
|
||||
<p class="text-muted" style="margin: 5px 0 0 0;">SSO: <code><%=Server.HTMLEncode(ssoParam)%></code></p>
|
||||
<% Else %>
|
||||
<h3 style="margin: 0;">SSO: <code><%=Server.HTMLEncode(ssoParam)%></code></h3>
|
||||
<p class="text-muted" style="margin: 5px 0 0 0;">User not found in directory</p>
|
||||
<% 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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<!-- USB Stats Cards -->
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<i class="zmdi zmdi-usb zmdi-hc-3x text-primary"></i>
|
||||
<h2 class="mt-2"><%=totalCheckouts%></h2>
|
||||
<p class="text-muted">Total USB Checkouts</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<div class="col-md-4 text-center">
|
||||
<div class="p-2 border rounded">
|
||||
<% If activeCheckouts > 0 Then %>
|
||||
<i class="zmdi zmdi-time zmdi-hc-3x text-warning"></i>
|
||||
<i class="zmdi zmdi-time zmdi-hc-2x text-warning"></i>
|
||||
<% Else %>
|
||||
<i class="zmdi zmdi-check-circle zmdi-hc-3x text-success"></i>
|
||||
<i class="zmdi zmdi-check-circle zmdi-hc-2x text-success"></i>
|
||||
<% End If %>
|
||||
<h2 class="mt-2"><%=activeCheckouts%></h2>
|
||||
<p class="text-muted">Currently Checked Out</p>
|
||||
<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="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body text-center">
|
||||
<i class="zmdi zmdi-timer zmdi-hc-3x text-info"></i>
|
||||
<h2 class="mt-2"><%=avgDurationText%></h2>
|
||||
<p class="text-muted">Avg Checkout Duration</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">
|
||||
<i class="zmdi zmdi-time"></i> USB Checkout History
|
||||
</h5>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="historyTable" class="table table-hover table-striped">
|
||||
<table id="usbTable" class="table table-sm table-hover table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">USB Serial</th>
|
||||
<th scope="col">USB Name</th>
|
||||
<th scope="col">Checkout Time</th>
|
||||
<th scope="col">Check-in Time</th>
|
||||
<th scope="col">Duration</th>
|
||||
<th scope="col">Wiped</th>
|
||||
<th scope="col">Reason</th>
|
||||
<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
|
||||
@@ -232,29 +385,31 @@ Else
|
||||
"ORDER BY uc.checkout_time DESC"
|
||||
|
||||
Set cmdHistory = Server.CreateObject("ADODB.Command")
|
||||
cmdHistory.ActiveConnection = objConn
|
||||
cmdHistory.ActiveConnection = objConnShopdb
|
||||
cmdHistory.CommandText = historySQL
|
||||
cmdHistory.CommandType = 1
|
||||
cmdHistory.Parameters.Append cmdHistory.CreateParameter("@sso", 200, 1, 20, ssoParam)
|
||||
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
|
||||
|
||||
While Not rsHistory.EOF
|
||||
If Not rsHistory Is Nothing Then
|
||||
Do While Not rsHistory.EOF
|
||||
rowCount = rowCount + 1
|
||||
Dim serialNum, usbAlias, checkoutTime, checkinTime, durationMinutes, reason
|
||||
Dim serialNum, usbAlias, checkoutTime, checkinTime, durationMinutes
|
||||
Dim durationText, wipedText, statusClass
|
||||
|
||||
serialNum = rsHistory("serialnumber") & ""
|
||||
usbAlias = rsHistory("alias") & ""
|
||||
reason = rsHistory("checkout_reason") & ""
|
||||
|
||||
If IsNull(rsHistory("duration_minutes")) Or rsHistory("duration_minutes") = "" Then
|
||||
If IsNull(rsHistory("duration_minutes")) Then
|
||||
durationMinutes = 0
|
||||
Else
|
||||
durationMinutes = CLng(rsHistory("duration_minutes"))
|
||||
durationMinutes = CLng(rsHistory("duration_minutes") & "")
|
||||
End If
|
||||
|
||||
' Format checkout time (MM/DD/YYYY h:mm AM/PM)
|
||||
@@ -264,7 +419,7 @@ Else
|
||||
checkoutTime = "-"
|
||||
End If
|
||||
|
||||
' Format check-in time and determine status (MM/DD/YYYY h:mm AM/PM)
|
||||
' 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 = ""
|
||||
@@ -290,72 +445,78 @@ Else
|
||||
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>
|
||||
<a href="./usb_history.asp?machineid=<%=rsHistory("machineid")%>" title="View all checkouts for this device">
|
||||
<code><%=Server.HTMLEncode(serialNum)%></code>
|
||||
</a>
|
||||
</td>
|
||||
<td><%=Server.HTMLEncode(usbAlias)%></td>
|
||||
<td><%=checkoutTime%></td>
|
||||
<td><%=checkinTime%></td>
|
||||
<td><%=deviceDisplay%></td>
|
||||
<td><small><%=checkoutTime%></small></td>
|
||||
<td><small><%=checkinTime%></small></td>
|
||||
<td><%=durationText%></td>
|
||||
<td><%=wipedText%></td>
|
||||
<td>
|
||||
<% If reason <> "" Then %>
|
||||
<span title="<%=Server.HTMLEncode(reason)%>"><%=Server.HTMLEncode(Left(reason, 40))%><% If Len(reason) > 40 Then Response.Write("...") End If %></span>
|
||||
<% Else %>
|
||||
<span class="text-muted">-</span>
|
||||
<% End If %>
|
||||
</td>
|
||||
</tr>
|
||||
<%
|
||||
rsHistory.MoveNext
|
||||
Wend
|
||||
Loop
|
||||
|
||||
rsHistory.Close
|
||||
Set rsHistory = Nothing
|
||||
End If
|
||||
Set cmdHistory = Nothing
|
||||
|
||||
If rowCount = 0 Then
|
||||
%>
|
||||
<tr>
|
||||
<td colspan="7" class="text-center text-muted">
|
||||
<i class="zmdi zmdi-info zmdi-hc-2x"></i><br>
|
||||
No USB checkout history for this SSO.
|
||||
<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-3">
|
||||
<a href="./usb_history.asp?sso=<%=Server.URLEncode(ssoParam)%>" class="btn btn-outline-primary btn-sm">
|
||||
<i class="zmdi zmdi-open-in-new"></i> View in Full History
|
||||
</a>
|
||||
<a href="./displayusb.asp" class="btn btn-outline-secondary btn-sm">
|
||||
<i class="zmdi zmdi-usb"></i> USB Devices
|
||||
<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>
|
||||
|
||||
<%
|
||||
End If ' validSSO
|
||||
%>
|
||||
</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-->
|
||||
@@ -368,32 +529,34 @@ End If ' validSSO
|
||||
</div>
|
||||
</footer>
|
||||
<!--End footer-->
|
||||
</div><!--End wrapper-->
|
||||
</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>
|
||||
<!-- 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>
|
||||
|
||||
<!-- DataTables js -->
|
||||
<script src="assets/plugins/datatables/jquery.dataTables.min.js"></script>
|
||||
<script src="assets/plugins/datatables/dataTables.bootstrap4.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>
|
||||
|
||||
<!-- Custom scripts -->
|
||||
<script src="assets/js/app-script.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() {
|
||||
$('#historyTable').DataTable({
|
||||
"order": [[2, "desc"]], // Sort by checkout time descending
|
||||
"pageLength": 25,
|
||||
$('#usbTable').DataTable({
|
||||
"order": [[1, "desc"]],
|
||||
"pageLength": 10,
|
||||
"lengthMenu": [[10, 25, 50], [10, 25, 50]],
|
||||
"language": {
|
||||
"emptyTable": "No checkout history found"
|
||||
"emptyTable": "No USB checkout history"
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -401,3 +564,6 @@ $(document).ready(function() {
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<%
|
||||
objconn.close
|
||||
%>
|
||||
|
||||
Reference in New Issue
Block a user