Reporting Portal 1
Reporting Portal 1
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Enhanced Dashboard Layout</title>
<!-- Bootstrap CSS -->
<link
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
rel="stylesheet"
/>
<!-- FontAwesome Icons -->
<link
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/
all.min.css"
rel="stylesheet"
/>
<!-- Select2 CSS -->
<link
href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css"
rel="stylesheet"
/>
/* Default Theme */
body {
background-color: #f4f4f4; /* Light background */
color: #000; /* Black text */
transition: background-color 0.3s, color 0.3s;
margin: 0;
}
.sidebar {
background: #c72c41; /* Vibrant reddish color */
color: #fff; /* White text */
}
.header {
background-color: #c72c41; /* Matching sidebar color */
color: #fff; /* White text */
padding: 10px 20px; /* Adjusted padding */
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
display: flex;
align-items: center;
justify-content: space-between;
}
.header .title {
margin: 0;
font-size: 1.5rem;
font-weight: bold;
color: #fff; /* White text color for title */
}
.header .icons {
display: flex;
align-items: center;
gap: 20px; /* Increased space between icons */
}
.header .icons i {
font-size: 1.5rem; /* Adjust icon size */
}
.card {
background: #fff; /* White background for cards */
color: #000; /* Black text */
border: none;
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
transition: transform 0.3s ease, box-shadow 0.3s ease;
min-height: 200px; /* Ensures all cards are the same height */
display: flex;
flex-direction: column;
justify-content: center;
border-radius: 8px;
}
.card:hover {
transform: translateY(-10px);
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}
.icon-large {
font-size: 2.5rem;
margin-bottom: 15px;
}
.section-title {
margin-bottom: 30px;
font-weight: bold;
font-size: 1.75rem;
color: #c72c41; /* Matching sidebar color */
}
.card h5 {
font-size: 1.2rem;
font-weight: 500;
}
/* Dark Theme */
body.dark-theme {
background-color: #121212; /* Darker background */
color: #e0e0e0; /* Lighter text color for contrast */
}
body.dark-theme .sidebar {
background: #1f1f1f; /* Slightly lighter dark background */
color: #e0e0e0; /* Light text color */
}
body.dark-theme .header {
background-color: #1f1f1f; /* Matching sidebar color */
color: #e0e0e0; /* Light text color */
}
body.dark-theme .card {
background: #2c2c2c; /* Dark card background */
color: #e0e0e0; /* Light card text color */
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4); /* Enhanced shadow */
}
body.dark-theme .card h5 {
color: #f5f5f5; /* Slightly lighter text for card headings */
}
body.dark-theme .section-title {
color: #e74c3c; /* Light red for section titles */
}
/* Sidebar styling */
.sidebar {
height: 100vh;
padding: 20px;
position: fixed;
left: -250px;
top: 0;
width: 250px;
transition: all 0.3s ease;
z-index: 9999; /* Ensures it is above the content */
box-shadow: 4px 0 8px rgba(0, 0, 0, 0.3); /* Stronger shadow effect */
}
.sidebar.open {
left: 0;
}
.sidebar .close-btn {
position: absolute;
top: 15px;
right: 15px;
font-size: 1.5rem;
cursor: pointer;
}
.filter-pane {
position: fixed;
top: 0; /* Start from the top */
right: -300px; /* Hidden by default */
width: 300px; /* Adjust width as needed */
height: 100%; /* Full height of the viewport */
background: white;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
padding: 20px;
transition: right 0.3s ease;
z-index: 10000; /* Ensure it is above other elements */
}
.filter-pane.open {
right: 0; /* Show the filter pane */
}
.filter-pane .close-btn {
position: absolute;
top: 15px;
right: 15px;
font-size: 1.5rem;
cursor: pointer;
color: #c72c41; /* Match the theme color */
}
.content {
transition: margin-left 0.3s ease;
padding: 20px;
z-index: 1; /* Below the sidebar */
}
.profile-img {
width: 120px;
height: 120px;
border-radius: 50%;
border: 4px solid #fff;
box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
margin-bottom: 15px;
}
.quick-links a {
color: #fff; /* White text in sidebar */
text-decoration: none;
display: block;
margin-bottom: 10px;
font-size: 1rem;
}
.quick-links a:hover {
text-decoration: underline;
color: #f5a623; /* Light orange for contrast */
}
/* Header Styling */
header {
padding: 15px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
header i {
cursor: pointer;
}
.sidebar .menu-heading {
font-weight: bold;
font-size: 1.2rem;
margin-bottom: 20px;
}
/* Iframe Container */
.iframe-container {
display: none; /* Hidden initially */
width: 100%;
height: calc(100vh - 60px); /* Full height minus header */
margin: 0; /* Space for the header */
padding: 0;
}
.iframe-container iframe {
width: 100%;
height: 100%;
border: none;
}
.sidebar {
width: 200px;
}
.content.open {
margin-left: 0;
}
}
</style>
</head>
<body>
<!-- Header -->
<header class="header">
<i class="fas fa-bars fa-lg" id="menu-toggle"></i>
<h1 class="title">MAQ Reporting Portal</h1>
<div class="icons">
<i class="fas fa-home fa-lg" id="home-icon" style="display: none;"></i>
<i class="fas fa-filter fa-lg" id="filter-icon"></i>
<i class="fas fa-bookmark fa-lg" id="bookmark-icon"></i>
<i class="fas fa-sun fa-lg" id="theme-toggle"></i>
</div>
</header>
<div class="container-fluid">
<div class="row">
<!-- Sidebar Section -->
<nav class="sidebar" id="sidebar">
<!-- Close Button -->
<span class="close-btn" id="close-btn">×</span>
<div class="text-center">
<img
src="https://via.placeholder.com/120"
alt="Profile Picture"
class="profile-img"
/>
<h4>Chirag</h4>
<p>Software Engineer 2</p>
</div>
<div class="quick-links mt-4">
<div class="menu-heading">Quick Links</div>
<a href="#">MySpace</a>
<a href="#">Learning Portal</a>
<a href="#">Project Review Tracker</a>
</div>
</nav>
document
.getElementById("close-btn")
.addEventListener("click", function () {
document.getElementById("sidebar").classList.remove("open");
document.getElementById("main-content").classList.remove("open");
});
document
.getElementById("theme-toggle")
.addEventListener("click", function () {
document.body.classList.toggle("dark-theme");
this.classList.toggle("fa-sun");
this.classList.toggle("fa-moon");
});
$(document).ready(function () {
// Initialize Select2 on each dropdown
$('#supervisorName').select2({
placeholder: "Select Supervisor",
allowClear: true
});
$('#managerName').select2({
placeholder: "Select Manager",
allowClear: true
});
$('#employeeName').select2({
placeholder: "Select Employee",
allowClear: true
});
// Toggle sidebar
$("#menu-toggle").click(function () {
$("#sidebar").toggleClass("open");
$(".content").toggleClass("open");
});
// Close sidebar
$("#close-btn").click(function () {
$("#sidebar").removeClass("open");
$(".content").removeClass("open");
});
// Show the iframe container and home icon when a card is clicked (open report)
$("#learning-card").click(function () {
$("#iframe-container").show(); // Show the iframe
showHomeIcon(); // Show home icon
});
// Example: Hide iframe and home icon on page load (if no report is open)
$(window).on("load", function () {
$("#iframe-container").hide(); // Initially hide the iframe
hideHomeIcon(); // Initially hide the home icon
});
});
if (supervisor) {
// Ensure to encode the column name properly for the supervisor
filterQuery += `&$filter=EmployeesMaster/Supervisor eq '$
{encodeURIComponent(supervisor)}'`;
}
if (manager) {
// Ensure to encode the column name properly for the manager
if (filterQuery) {
filterQuery += ` and `; // Use 'and' if there's already a supervisor
filter
} else {
filterQuery += `&$filter=`; // Start filter query if it’s empty
}
filterQuery += `EmployeesMaster/Manager eq '$
{encodeURIComponent(manager)}'`; // Add manager filter
}
if (employee) {
// Ensure to encode the column name properly for the employee
if (filterQuery) {
filterQuery += ` and `; // Use 'and' if there are already filters
} else {
filterQuery += `&$filter=`; // Start filter query if it’s empty
}
filterQuery += `EmployeesMaster/EmployeeName eq '$
{encodeURIComponent(employee)}'`; // Add employee filter
}
document.getElementById("managerName").addEventListener("change", function () {
updateReport(); // Update the report with the selected manager filter
});
document.getElementById("employeeName").addEventListener("change", function () {
updateReport(); // Update the report with the selected employee filter
});
// When the "Learning Tracker Dashboard" card is clicked, ensure that the report is
displayed with the current filter
document.getElementById("learning-card").addEventListener("click", function () {
document.getElementById("iframe-container").style.display = "block";
// Call the updateReport function to apply the current filter to the report
updateReport();
});
// Fetch the list of supervisors from the backend and populate the dropdown
function fetchSupervisors() {
fetch('http://localhost:3000/api/supervisors') // Update with your server's URL
if deployed
.then(response => response.json())
.then(data => {
const supervisorDropdown = document.getElementById('supervisorName');
// Fetch the list of managers from the backend and populate the dropdown
function fetchManagers() {
fetch('http://localhost:3000/api/managers') // Update with your server's URL if
deployed
.then(response => response.json())
.then(data => {
const managerDropdown = document.getElementById('managerName');
// Fetch the list of employee names from the backend and populate the dropdown
function fetchEmployeeNames() {
fetch('http://localhost:3000/api/employeename') // Update with your server's URL
if deployed
.then(response => response.json())
.then(data => {
const employeeDropdown = document.getElementById('employeeName'); // Ensure
you have an element with this ID