Added : Workstation Crossover

This commit is contained in:
e025532
2024-09-17 12:17:31 +02:00
parent 4aa584caeb
commit d339cb10d8
2 changed files with 243 additions and 1 deletions

View File

@@ -50,13 +50,22 @@
</li>
<li>
<a href="#HyperV" data-bs-toggle="collapse" class="nav-link px-0 align-middle">
<i class="fs-6 bi bi-calendar text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7">Hyper-V</span><i class="bi bi-caret-down"></i> </a>
<i class="fs-6 bi bi-pc text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7">Hyper-V</span><i class="bi bi-caret-down"></i> </a>
<ul class="collapse nav flex-column ms-1" id="HyperV" data-bs-parent="#menu">
<li class="w-100">
<a href="/Hyper-V/clusters.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- Hyper-V Clusters</span></a>
</li>
</ul>
</li>
<li>
<a href="#Workstation" data-bs-toggle="collapse" class="nav-link px-0 align-middle">
<i class="fs-6 bi bi-pc-display-horizontal text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7">Workstations</span><i class="bi bi-caret-down"></i> </a>
<ul class="collapse nav flex-column ms-1" id="Workstation" data-bs-parent="#menu">
<li class="w-100">
<a href="/workstation/globalcrossover.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- Crossover</span></a>
</li>
</ul>
</li>
<br>
<br>
<li>

View File

@@ -0,0 +1,233 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Page Title -->
<title>Web Infra Reports</title>
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
<!-- JQuery -->
<script src="/js/jquery-3.6.1.min.js"></script>
<!-- Bootstrap -->
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/bootstrap-icons/bootstrap-icons.css">
<link rel="stylesheet" href="/css/preloader.css">
<script src="/js/bootstrap.bundle.min.js"></script>
<!-- Bootstrap-tables -->
<link rel="stylesheet" href="/css/bootstrap-table.min.css">
<script src="/js/bootstrap-table.min.js"></script>
<script src="/js/bootstrap-table-fr-FR.min.js"></script>
<script src="/js/tableExport.min.js"></script>
<script src="/js/bootstrap-table-export.min.js"></script>
<script src="/js/libs/js-xlsx/xlsx.core.min.js"></script>
</head>
<body class="bg-light text-dark">
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/preloader.inc.html"; ?> <!-- Preloader -->
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Database connexion -->
<div class="container-fluid">
<div class="row flex-nowrap">
<!-- Left NAVBAR -->
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?> <!-- Left Navbar -->
</div>
<!-- Display -->
<div class="col py-3">
<!-- Page Title -->
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Workstations Crossover</span></h1>
<!-- Main content -->
<div class="row" style="zoom: 80%">
<!-- Get DATAs -->
<?php
$postes = Invoke_Infra("select * from cmdb_crossover_poste order by poste")
?>
<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-height="620" data-show-export="true" data-sortable="true">
<thead>
<th data-field="Name" data-sortable="true">Name</th>
<th data-field="OS" data-sortable="true">Operating System</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="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="SCCM" data-sortable="true">SCCM<br></th>
<th data-field="SCCMlu" data-sortable="true" data-visible="false">SCCM Last Heartbeat</th>
<th data-field="S1" data-sortable="true">SentinelOne<br></th>
<th data-field="S1lu" data-sortable="true" data-visible="false">SentinelOne Last Heartbeat</th>
</thead>
<tbody>
<!-- Display DATAs -->
<?php
$ok = 0;
$total = 0;
$nOS = 0;
$nAD = 0;
$nSCCM = 0;
$nGLPI = 0;
$nFI = 0;
$nEPO = 0;
$nNBU = 0;
$nDPM = 0;
$nS1 = 0;
foreach($postes as $row){
$total++;
echo "<tr>";
if (isset($row['ad']) && isset($row['glpi']) && isset($row['sccm']) && isset($row['s1'])) {
echo "<td class='bg-success text-white'><b>" . $row['poste'] . "</b></td>";
$ok++;
} else {
echo "<td><b>" . $row['poste'] . "</b></td>";
}
if ($row['os']) {
if (preg_match('(7)', $row['os']) !== 1) {
$nOS++;
echo "<td class='bg-success'>" . $row['os'] . "</td>";
} else {
echo "<td class='bg-warning'>Windows 7</td>";
}
} else {
echo "<td class='bg-warning'>&nbsp;</td>";
}
// AD
if ($row['ad'] == 'Y') {
$date1 = date_create($row['adlu']);
$diff = date_diff($date1, date_create(date("Y-m-d")));
if ($diff->format("%R%a") > 45) {
echo "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(220,53,69,1) 100%);'>OK</td>";
echo "<td class='bg-danger text-white'>" . $row['adlu'] . " (" . $diff->format("%R%a") . " days)</td>";
} else {
$nAD++;
echo "<td class='bg-success text-white'>OK</td>";
echo "<td class='bg-success text-white'>" . $row['adlu'] . "</td>";
}
} else {
if (isset($row['ad'])) {
$nAD++;
echo "<td class='bg-secondary'><small>" . $row['ad'] . "</small></td>";
echo "<td class='bg-secondary text-secondary'>&nbsp;</td>";
$nSCCM++;
} else {
echo "<td class='bg-warning text-white'>Missing</td>";
echo "<td class='bg-warning text-white'>&nbsp;</td>";
}
}
// GLPI
if ($row['glpi'] == 'Y') {
$date1 = date_create($row['glpilu']);
$diff = date_diff($date1, date_create(date("Y-m-d")));
if ($diff->format("%R%a") > 7) {
echo "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(220,53,69,1) 100%);'>OK</td>";
echo "<td class='bg-danger text-white'>" . $row['glpilu'] . " (" . $diff->format("%R%a") . " days)</td>";
} else {
if ($row['glpilu'] <> "") {
echo "<td class='bg-success text-white'>OK</td>";
$nFI++;
echo "<td class='bg-success text-white'>" . $row['glpilu'] . "</td>";
} else {
echo "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(255,193,7,1) 100%);'>OK</td>";
echo "<td class='bg-warning text-white'>Missing</td>";
}
}
$nGLPI++;
} else {
if (isset($row['glpi'])) {
echo "<td class='bg-secondary'><small>" . $row['glpi'] . "</small></td>";
echo "<td class='bg-secondary text-secondary'>&nbsp;</td>";
$nGLPI++;
} else {
echo "<td class='bg-warning text-white'>Missing</td>";
echo "<td class='bg-warning text-white'>&nbsp;</td>";
}
}
// SCCM
if ($row['sccm'] == 'Y') {
$date1 = date_create($row['sccmlu']);
$diff = date_diff($date1, date_create(date("Y-m-d")));
if ($diff->format("%R%a") > 7) {
echo "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(220,53,69,1) 100%);'>OK</td>";
echo "<td class='bg-danger text-white'>" . $row['sccmlu'] . " (" . $diff->format("%R%a") . " days)</td>";
} else {
echo "<td class='bg-success text-white'>OK</td>";
echo "<td class='bg-success text-white'>" . $row['sccmlu'] . "</td>";
$nSCCM++;
}
} else {
if (isset($row['sccm'])) {
echo "<td class='bg-secondary'><small>" . $row['sccm'] . "</small></td>";
echo "<td class='bg-secondary text-secondary'>&nbsp;</td>";
$nSCCM++;
} else {
echo "<td class='bg-warning text-white'>Missing</td>";
echo "<td class='bg-warning text-white'>&nbsp;</td>";
}
}
// S1
if ($row['s1'] == 'Y') {
$date1 = date_create($row['s1lu']);
$diff = date_diff($date1, date_create(date("Y-m-d")));
if ($diff->format("%R%a") > 7) {
echo "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(220,53,69,1) 100%);'>OK</td>";
echo "<td class='bg-danger text-white'>" . $row['s1lu'] . " (" . $diff->format("%R%a") . " days)</td>";
} else {
echo "<td class='bg-success text-white'>OK</td>";
echo "<td class='bg-success text-white'>" . $row['s1lu'] . "</td>";
$nS1++;
}
} else {
if (isset($row['s1'])) {
echo "<td class='bg-secondary'><small>" . $row['s1'] . "</small></td>";
echo "<td class='bg-secondary text-secondary'>&nbsp;</td>";
$nSCCM++;
} else {
echo "<td class='bg-warning text-white'>Missing</td>";
echo "<td class='bg-warning text-white'>&nbsp;</td>";
}
}
echo "</tr>";
}
?>
</tbody>
</table>
</div>
<!-- End of main content -->
</div>
</div>
</div>
<script src="/js/switch.js"></script>
</body>
<script>
var $table = $('#t1')
var $button = $('#button')
$table.on('search.bs.table', function () {
var $button = $('#button')
$button.click();
})
$(window).on('load', function () {
$('.preloader').addClass('preloader-deactivate');
});
</script>
</HTML>