Remove test.php and enhance null safety and sorting across components

- Deleted `test.php` as it was no longer in use.
- Enhanced null safety checks in `Inventory.php`, `StdOut-detail.php`, `Backups.php`, and `SwitchsSAN.php` to prevent potential warnings.
- Refactored `SwitchsSAN.php` to improve sorting logic for ports based on errors, vFabric, and Port ID.
- Added seasonal snow effect script in `all.php` with toggle functionality for user engagement.
- Updated navigation bar (`navbar.html`) to include a new VIO page link.
- Introduced a new `VIO.php` page to display VIO monitoring details with table export and sorting features.
This commit is contained in:
2026-03-31 11:33:57 +02:00
parent d5b45dbc22
commit 10c228f255
47 changed files with 950 additions and 702 deletions

View File

@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Page Title -->
<title>Web Infra Reports</title>
<title>Web Infra Reports IT</title>
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
<!-- JQuery -->
@@ -84,7 +84,7 @@
echo "</div><hr style='border-top: 3px solid black'>";
// Active Directory
echo "<h3><span class='font-weight-bold'>Active Directory</span></h3>" ;
echo "<h3><span class='font-weight-bold'>$w_ad</span></h3>" ;
echo "<div class='row'>";
if(isset($row['AD'])){
if($row['AD']=="Y"){
@@ -96,17 +96,17 @@
echo "<div class='col-md-3'><div class='input-group'><span class='input-group-text'><i class='bi bi-pencil-square text-primary'></i></span><input type='text' class='form-control' id='AD' name ='AD' placeholder='Missing' maxlength = '20'></div></div>";
}
if(isset($row['ADlu'])){
echo "<div class='col-md-2 text-end text-bottom'><b>Last Logon</b></div>";
echo "<div class='col-md-2 text-end text-bottom'><b>$w_adlu</b></div>";
$date1=date_create($row['ADlu']);
$diff=date_diff($date1,date_create(date("Y-m-d")));
if($diff->format("%R%a") > 60){
echo "<div class='col-md-3'><input type='text' class='form-control bg-danger text-white' disabled value='".$row['ADlu']." (".abs($diff->format("%R%a"))." days)'></div>";
echo "<div class='col-md-3'><input type='text' class='form-control bg-danger text-white' disabled value='".$row['ADlu']." (".abs($diff->format("%R%a"))." $w_days)'></div>";
}else{
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['ADlu']." (".abs($diff->format("%R%a"))." days)'></div>";
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['ADlu']." (".abs($diff->format("%R%a"))." $w_days)'></div>";
}
}else{
if(!(isset($row['AD']) && $row['AD'] !=="Y")){
echo "<div class='col-md-2 text-end text-bottom'><b>Last Logon</b></div>";
echo "<div class='col-md-2 text-end text-bottom'><b>$w_adlu</b></div>";
echo "<div class='col-md-3'><input type='text' class='form-control bg-warning' disabled value='Missing'></div>";
}
}
@@ -143,15 +143,15 @@
$date1=date_create($row['GLPIlu']);
$diff=date_diff($date1,date_create(date("Y-m-d")));
if(isset($row['GLPIlu']) && $row['GLPIlu'] !== ''){
echo "<div class='col-md-2 text-end text-bottom'><b>Last Inventory</b></div>";
echo "<div class='col-md-2 text-end text-bottom'><b>$w_filu</b></div>";
if($diff->format("%R%a") > 7){
echo "<div class='col-md-3'><input type='text' class='form-control bg-danger text-white' disabled value='".$row['GLPIlu']." (".abs($diff->format("%R%a"))." days)'></div>";
echo "<div class='col-md-3'><input type='text' class='form-control bg-danger text-white' disabled value='".$row['GLPIlu']." (".abs($diff->format("%R%a"))." $w_days)'></div>";
}else{
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['GLPIlu']." (".abs($diff->format("%R%a"))." days)'></div>";
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['GLPIlu']." (".abs($diff->format("%R%a"))." $w_days)'></div>";
}
}else{
if(!(isset($row['FI']) && $row['FI'] !=="Y")){
echo "<div class='col-md-2 text-end text-bottom'><b>Last Inventory</b></div>";
echo "<div class='col-md-2 text-end text-bottom'><b>$w_filu</b></div>";
echo "<div class='col-md-3'><input type='text' class='form-control bg-warning' disabled value='Missing'></div>";
}
}
@@ -171,17 +171,17 @@
echo "<div class='col-md-3'><div class='input-group'><span class='input-group-text'><i class='bi bi-pencil-square text-primary'></i></span><input type='text' class='form-control' id='SCCM' name ='SCCM' placeholder='Missing' maxlength = '20'></div></div>";
}
if(isset($row['SCCMlu'])){
echo "<div class='col-md-2 text-end text-bottom'><b>Last Heartbeat</b></div>";
echo "<div class='col-md-2 text-end text-bottom'><b>$w_sccmlu</b></div>";
$date1=date_create($row['SCCMlu']);
$diff=date_diff($date1,date_create(date("Y-m-d")));
if($diff->format("%R%a") > 7){
echo "<div class='col-md-3'><input type='text' class='form-control bg-danger text-white' disabled value='".$row['SCCMlu']." (".abs($diff->format("%R%a"))." days)'></div>";
echo "<div class='col-md-3'><input type='text' class='form-control bg-danger text-white' disabled value='".$row['SCCMlu']." (".abs($diff->format("%R%a"))." $w_days)'></div>";
}else{
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['SCCMlu']." (".abs($diff->format("%R%a"))." days)'></div>";
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['SCCMlu']." (".abs($diff->format("%R%a"))." $w_days)'></div>";
}
}else{
if(!(isset($row['SCCM']) && $row['SCCM'] !=="Y")){
echo "<div class='col-md-2 text-end text-bottom'><b>Last Heartbeat</b></div>";
echo "<div class='col-md-2 text-end text-bottom'><b>$w_sccmlu</b></div>";
echo "<div class='col-md-3'><input type='text' class='form-control bg-warning' disabled value='Missing'></div>";
}
}
@@ -204,7 +204,7 @@
echo "</div><br>";
// NBU
echo "<h3><span class='font-weight-bold'>NetBackup</span></h3>" ;
echo "<h3><span class='font-weight-bold'>$w_backup</span></h3>" ;
echo "<div class='row'>";
if(isset($row['NBU'])){
if($row['NBU']=="Y"){
@@ -216,13 +216,13 @@
echo "<div class='col-md-3'><div class='input-group'><span class='input-group-text'><i class='bi bi-pencil-square text-primary'></i></span><input type='text' class='form-control' id='NBU' name ='NBU' placeholder='Missing' maxlength = '20'></div></div>";
}
if(isset($row['NBUlu'])){
echo "<div class='col-md-2 text-end text-bottom'><b>Last Backup</b></div>";
echo "<div class='col-md-2 text-end text-bottom'><b>$w_backuplu</b></div>";
$date1=date_create($row['NBUlu']);
$diff=date_diff($date1,date_create(date("Y-m-d")));
if($diff->format("%R%a") > 30){
echo "<div class='col-md-3'><input type='text' class='form-control bg-danger text-white' disabled value='".$row['NBUlu']." (".abs($diff->format("%R%a"))." days)'></div>";
echo "<div class='col-md-3'><input type='text' class='form-control bg-danger text-white' disabled value='".$row['NBUlu']." (".abs($diff->format("%R%a"))." $w_days)'></div>";
}else{
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['NBUlu']." (".abs($diff->format("%R%a"))." days)'></div>";
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['NBUlu']." (".abs($diff->format("%R%a"))." $w_days)'></div>";
}
}else{
if(!(isset($row['NBU']) && $row['NBU'] !=="Y")){
@@ -283,7 +283,7 @@
?>
<label for="server"></label><input type='text' class='form-control visually-hidden' name="server" id="server" value='<?php echo $_GET['server']; ?>'>
<hr>
<div style="text-align: center;"><button id="button" type="submit" class="btn btn-primary btn-lg"><i class="bi bi-arrow-clockwise"></i><b> Submit</b></button></div>
<div style="text-align: center;"><button id="button" type="submit" class="btn btn-primary btn-lg"><i class="bi bi-arrow-clockwise"></i><b> <?php echo $w_submit; ?></b></button></div>
</form>
</div>

View File

@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Page Title -->
<title>Web Infra Reports</title>
<title>Web Infra Reports IT</title>
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
<!-- JQuery -->

View File

@@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Page Title -->
<title>Web Infra Reports</title>
<title>Web Infra Reports IT</title>
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
<!-- JQuery -->
@@ -39,34 +39,32 @@
<!-- Display -->
<div class="col py-3">
<!-- Page Title -->
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Global Crossover <small>(Updated every 15mn)</small></span></h1>
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_3; ?></span></h1>
<!-- Main content -->
<div class="row" style="zoom: 80%">
<table class='table table-bordered table-hover table-sm' id='t1' data-toggle="table" data-search="true"
data-show-columns="true" data-pagination="true" data-export-types="['xlsx','csv','json']"
data-loading-template="loadingTemplate" data-page-list="[20, 50, 100, All]" data-page-size="Tout"
data-show-columns="true" data-export-types="['xlsx','csv','json']"
data-loading-template="loadingTemplate"
data-show-export="true" data-sortable="true">
<thead>
<tr>
<th data-field="Name" data-sortable="true">Name</th>
<th data-field="OS" data-sortable="true">Operating System</th>
<th data-field="Criticity" data-sortable="true">Criticity</th>
<th data-field="Departement" data-sortable="true" data-visible="false">Departement</th>
<th data-field="AD" data-sortable="true">AD</th>
<th data-field="ADlu" data-sortable="true" data-visible="false">AD Last Logon</th>
<th data-field="Name" data-sortable="true"><?php echo $w_name; ?></th>
<th data-field="OS" data-sortable="true"><?php echo $w_os; ?></th>
<th data-field="Criticity" data-sortable="true"><?php echo $w_crit; ?></th>
<th data-field="AD" data-sortable="true"><?php echo $w_ad; ?></th>
<th data-field="ADlu" data-sortable="true" data-visible="false"><?php echo $w_adlu; ?></th>
<th data-field="GLPI" data-sortable="true">GLPI</th>
<th data-field="GLPIlu" data-sortable="true" data-visible="false" data-footer-formatter="FI">Last FI
Inventory</th>
<th data-field="GLPIlu" data-sortable="true" data-visible="false" data-footer-formatter="FI"><?php echo $w_filu; ?></th>
<th data-field="SCCM" data-sortable="true">SCCM<br></th>
<th data-field="SCCMlu" data-sortable="true" data-visible="false">SCCM Last Heartbeat</th>
<th data-field="SCCMlu" data-sortable="true" data-visible="false"><?php echo $w_sccmlu; ?></th>
<th data-field="NESSUS" data-sortable="true">NESSUS</th>
<th data-field="Backup" data-sortable="true">Backup</th>
<th data-field="NBUlu" data-sortable="true" data-visible="false">Last Backup</th>
<th data-field="Backup" data-sortable="true"><?php echo $w_backup; ?></th>
<th data-field="NBUlu" data-sortable="true" data-visible="false"><?php echo $w_backuplu; ?></th>
<th data-field="SCOM" data-sortable="true">SCOM</th>
<th data-field="Zabbix" data-sortable="true">Zabbix</th>
<th data-field="S1" data-sortable="true">SentinelOne</th>
<th data-field="S1lu" data-sortable="true" data-visible="false">S1 Last Update</th>
<th data-field="S1lu" data-sortable="true" data-visible="false"><?php echo $w_s1lu; ?></th>
</tr>
</thead>
@@ -83,7 +81,7 @@
// Handle filters securely using prepared statements
if (isset($_GET['filter'])) {
$filter = $_GET['filter'];
$filterTitle = "Filter : " . htmlspecialchars($filter) . " non compliant";
$filterTitle = "$w_filter : " . htmlspecialchars($filter) . " $w_nonCompliant";
switch ($filter) {
case "AD":
@@ -227,7 +225,7 @@
echo $serverCell;
echo $osCell;
echo "<td>" . htmlspecialchars($row['crit'] ?? '') . "</td>";
echo "<td>" . htmlspecialchars($row['dpt'] ?? '') . "</td>";
// Use helper function for status columns
echo renderStatusCellWithDate($row['AD'], $row['ADlu'], 45);
@@ -297,7 +295,7 @@
<div class="row flex-nowrap text-center" style="zoom: 80%">
<div class="col"> <!-- CARTE Devices -->
<div class="card border-secondary mb-3">
<div class="card-header text-dark"><b>All Devices</b></div>
<div class="card-header text-dark"><b><?php echo $w_allDevice; ?></b></div>
<a href="/crossover/GlobalCrossover.php">
<div class="card-body">
<h2><span class="badge text-bg-primary font-weight-bold" id="KPIDEVICE"></span></h2>
@@ -307,7 +305,7 @@
</div>
<div class="col"> <!-- CARTE OS -->
<div class="card border-secondary mb-3">
<div class="card-header text-dark"><b>Supported OS</b></div>
<div class="card-header text-dark"><b><?php echo $w_supportedOS; ?></b></div>
<a href="/crossover/GlobalCrossover.php?filter=OS">
<div class="card-body">
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIOS"></span></h2>
@@ -357,7 +355,7 @@
</div>
<div class="col"> <!-- CARTE Backup (NBU + DPM) -->
<div class="card border-secondary mb-3">
<div class="card-header text-dark"><b>Backup</b></div>
<div class="card-header text-dark"><b><?php echo $w_backup; ?></b></div>
<a href="/crossover/GlobalCrossover.php?filter=NBU">
<div class="card-body">
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPINBU"></span></h2>