Initial Version
This commit is contained in:
112
crossover/Crossover-KPI.js
Normal file
112
crossover/Crossover-KPI.js
Normal file
@@ -0,0 +1,112 @@
|
||||
function dateDiffInDays(a) {
|
||||
const _MS_PER_DAY = 1000 * 60 * 60 * 24;
|
||||
return Math.floor((Date.now() - new Date(a)) / _MS_PER_DAY);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$button.click(function () {
|
||||
$data = $table.bootstrapTable('getData')
|
||||
$dl = $data.length
|
||||
$nSCCM=0; $nAD=0; $nGLPI=0;$nEPO=0;$nNBU=0;$nOS=0;$nSCOM=0;$nZabbix=0;$nS1=0;
|
||||
for( $i=0 ; $i < $dl ; $i++ ){
|
||||
if ($data[$i]['AD'] !== 'Missing') { $nAD++ ; }
|
||||
if ((dateDiffInDays($data[$i]['ADlu'].split(" ")[0]) > 45 || $data[$i]['ADlu'] == 'Missing') && $data[$i]['AD'] !== 'Missing'){ $nAD-- ;}
|
||||
if ($data[$i]['SCCM'] !== 'Missing') { $nSCCM++ ; }
|
||||
if ((dateDiffInDays($data[$i]['SCCMlu'].split(" ")[0]) > 7 || $data[$i]['SCCMlu'] == 'Missing') && $data[$i]['SCCM'] !== 'Missing'){ $nSCCM-- ;}
|
||||
if ($data[$i]['GLPI'] !== 'Missing') { $nGLPI++ ; }
|
||||
if ((dateDiffInDays($data[$i]['GLPIlu'].split(" ")[0]) > 7 || $data[$i]['GLPIlu'] == 'Missing') && $data[$i]['GLPI'] !== 'Missing'){ $nGLPI-- ;}
|
||||
if ($data[$i]['EPO'] !== 'Missing') { $nEPO++ ; }
|
||||
if ((dateDiffInDays($data[$i]['EPOlu'].split(" ")[0]) > 7 || $data[$i]['EPOlu'] == 'Missing') && $data[$i]['EPO'] !== 'Missing'){ $nEPO-- ;}
|
||||
if ($data[$i]['Backup'] !== 'Missing') { $nNBU++ ; }
|
||||
if ((dateDiffInDays($data[$i]['NBUlu'].split(" ")[0]) > 30 || $data[$i]['NBUlu'] == 'Missing') && $data[$i]['Backup'].split(" ")[0] !== 'Missing'){ $nNBU-- ;}
|
||||
if (($data[$i]['OS'].includes('XP') || $data[$i]['OS'].includes('2000') || $data[$i]['OS'].includes('2003') || $data[$i]['OS'].includes('2008') || $data[$i]['OS'].includes('2012') || $data[$i]['OS'].includes('7') || $data[$i]['OS'].includes('Windows NT')) == false && $data[$i]['OS'] !==' ') { $nOS++ ;}
|
||||
if ($data[$i]['SCOM'] !== 'Missing') { $nSCOM++ ; }
|
||||
if ($data[$i]['Zabbix'] !== 'Missing') { $nZabbix++ ; }
|
||||
if ($data[$i]['S1'] !== 'Missing') { $nS1++ ; }
|
||||
if ((dateDiffInDays($data[$i]['S1lu'].split(" ")[0]) > 7 || $data[$i]['S1lu'] == 'Missing') && $data[$i]['S1'] !== 'Missing'){ $nS1-- ;}
|
||||
}
|
||||
|
||||
document.getElementById("KPIAD").innerHTML = Math.round($nAD/$dl*1000)/10 + "%";
|
||||
if(Math.round($nAD/$dl*100) >=90){
|
||||
document.getElementById("KPIAD").className = "badge text-bg-success font-weight-bold";
|
||||
}else if(Math.round($nAD/$dl*100) >=75){
|
||||
document.getElementById("KPIAD").className = "badge text-bg-warning font-weight-bold";
|
||||
}else{
|
||||
document.getElementById("KPIAD").className = "badge text-bg-danger font-weight-bold";
|
||||
}
|
||||
|
||||
document.getElementById("KPIGLPI").innerHTML = Math.round($nGLPI/$dl*1000)/10 + "%";
|
||||
if(Math.round($nGLPI/$dl*100) >=90){
|
||||
document.getElementById("KPIGLPI").className = "badge text-bg-success font-weight-bold";
|
||||
}else if(Math.round($nGLPI/$dl*100) >=75){
|
||||
document.getElementById("KPIGLPI").className = "badge text-bg-warning font-weight-bold";
|
||||
}else{
|
||||
document.getElementById("KPIGLPI").className = "badge text-bg-danger font-weight-bold";
|
||||
}
|
||||
|
||||
document.getElementById("KPISCCM").innerHTML = Math.round($nSCCM/$dl*1000)/10 + "%";
|
||||
if(Math.round($nSCCM/$dl*100) >=90){
|
||||
document.getElementById("KPISCCM").className = "badge text-bg-success font-weight-bold";
|
||||
}else if(Math.round($nSCCM/$dl*100) >=75){
|
||||
document.getElementById("KPISCCM").className = "badge text-bg-warning font-weight-bold";
|
||||
}else{
|
||||
document.getElementById("KPISCCM").className = "badge text-bg-danger font-weight-bold";
|
||||
}
|
||||
|
||||
document.getElementById("KPIEPO").innerHTML = Math.round($nEPO/$dl*1000)/10 + "%";
|
||||
if(Math.round($nEPO/$dl*100) >=90){
|
||||
document.getElementById("KPIEPO").className = "badge text-bg-success font-weight-bold";
|
||||
}else if(Math.round($nEPO/$dl*100) >=75){
|
||||
document.getElementById("KPIEPO").className = "badge text-bg-warning font-weight-bold";
|
||||
}else{
|
||||
document.getElementById("KPIEPO").className = "badge text-bg-danger font-weight-bold";
|
||||
}
|
||||
|
||||
document.getElementById("KPINBU").innerHTML = Math.round($nNBU/$dl*1000)/10 + "%";
|
||||
if(Math.round($nNBU/$dl*100) >=90){
|
||||
document.getElementById("KPINBU").className = "badge text-bg-success font-weight-bold";
|
||||
}else if(Math.round($nNBU/$dl*100) >=75){
|
||||
document.getElementById("KPINBU").className = "badge text-bg-warning font-weight-bold";
|
||||
}else{
|
||||
document.getElementById("KPINBU").className = "badge text-bg-danger font-weight-bold";
|
||||
}
|
||||
|
||||
document.getElementById("KPIOS").innerHTML = Math.round($nOS/$dl*1000)/10 + "%";
|
||||
if(Math.round($nOS/$dl*100) >=90){
|
||||
document.getElementById("KPIOS").className = "badge text-bg-success font-weight-bold";
|
||||
}else if(Math.round($nOS/$dl*100) >=75){
|
||||
document.getElementById("KPIOS").className = "badge text-bg-warning font-weight-bold";
|
||||
}else{
|
||||
document.getElementById("KPIOS").className = "badge text-bg-danger font-weight-bold";
|
||||
}
|
||||
|
||||
document.getElementById("KPISCOM").innerHTML = Math.round($nSCOM/$dl*1000)/10 + "%";
|
||||
if(Math.round($nSCOM/$dl*100) >=90){
|
||||
document.getElementById("KPISCOM").className = "badge text-bg-success font-weight-bold";
|
||||
}else if(Math.round($nSCOM/$dl*100) >=75){
|
||||
document.getElementById("KPISCOM").className = "badge text-bg-warning font-weight-bold";
|
||||
}else{
|
||||
document.getElementById("KPISCOM").className = "badge text-bg-danger font-weight-bold";
|
||||
}
|
||||
|
||||
document.getElementById("KPIzabbix").innerHTML = Math.round($nZabbix/$dl*1000)/10 + "%";
|
||||
if(Math.round($nZabbix/$dl*100) >=90){
|
||||
document.getElementById("KPIzabbix").className = "badge text-bg-success font-weight-bold";
|
||||
}else if(Math.round($nZabbix/$dl*100) >=75){
|
||||
document.getElementById("KPIzabbix").className = "badge text-bg-warning font-weight-bold";
|
||||
}else{
|
||||
document.getElementById("KPIzabbix").className = "badge text-bg-danger font-weight-bold";
|
||||
}
|
||||
|
||||
document.getElementById("KPIS1").innerHTML = Math.round($nS1/$dl*1000)/10 + "%";
|
||||
if(Math.round($nS1/$dl*100) >=90){
|
||||
document.getElementById("KPIS1").className = "badge text-bg-success font-weight-bold";
|
||||
}else if(Math.round($nS1/$dl*100) >=75){
|
||||
document.getElementById("KPIS1").className = "badge text-bg-warning font-weight-bold";
|
||||
}else{
|
||||
document.getElementById("KPIS1").className = "badge text-bg-danger font-weight-bold";
|
||||
}
|
||||
|
||||
document.getElementById("KPIDEVICE").innerHTML = $dl;
|
||||
})
|
||||
})
|
||||
312
crossover/Detail.php
Normal file
312
crossover/Detail.php
Normal file
@@ -0,0 +1,312 @@
|
||||
<!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/db_connect.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">
|
||||
<?php
|
||||
$server = $_GET['server'];
|
||||
DB_ENTRY02();
|
||||
$rs = $conn->query("SELECT * FROM GlobalCrossover where Server = '$server'");
|
||||
|
||||
?>
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $server ;?></span></h1>
|
||||
<br>
|
||||
<!-- Main content -->
|
||||
<div class="container" style="zoom: 80%">
|
||||
<!-- Get DATAs -->
|
||||
<form action="/crossover/Detail2.php" method="POST" id="form">
|
||||
<?php
|
||||
while ($row = mysqli_fetch_array($rs)) {
|
||||
echo "<div class='row'>";
|
||||
// OS
|
||||
echo "<div class='col-md-5'>";
|
||||
if(!isset($row['OS']) || $row['OS'] ==''){$row['OS']='Unknown';}
|
||||
if(preg_match('(XP|2003|Windows NT|2000|2008|7|Unknown)', $row['OS']) == 1) {
|
||||
echo "<h3><span class='badge text-bg-warning font-weight-bold'>OS : ".$row['OS']."</span></h3>";
|
||||
}else{
|
||||
echo "<h3><span class='badge text-bg-success text-white font-weight-bold'>OS : ".$row['OS']."</span></h3>";
|
||||
}
|
||||
echo "</div>";
|
||||
// Type
|
||||
echo "<div class='col-md-2'>";
|
||||
$typ="Unknown";
|
||||
if($row['virtual'] =='Y'){$typ = 'Virtual';}
|
||||
if($row['virtual'] =='N'){$typ = 'Physical';}
|
||||
echo "<h3><span class='badge text-bg-primary font-weight-bold'>Type : $typ</span></h3>";
|
||||
echo "</div>";
|
||||
// Crit
|
||||
echo "<div class='col-md-2'>";
|
||||
if(isset($row['crit'])){
|
||||
echo "<h3><span class='badge text-bg-primary font-weight-bold'>Crit : ".$row['crit']."</span></h3>";
|
||||
}
|
||||
echo "</div>";
|
||||
// Dpt
|
||||
echo "<div class='col-md-3'>";
|
||||
if(isset($row['dpt'])){
|
||||
echo "<h3><span class='badge text-bg-primary font-weight-bold'>".$row['dpt']."</span></h3>";
|
||||
}
|
||||
echo "</div>";
|
||||
|
||||
echo "</div><hr style='border-top: 3px solid black'>";
|
||||
|
||||
// Active Directory
|
||||
echo "<h3><span class='font-weight-bold'>Active Directory</span></h3>" ;
|
||||
echo "<div class='row'>";
|
||||
if(isset($row['AD'])){
|
||||
if($row['AD']=="Y"){
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='OK'></div>";
|
||||
}else{
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-secondary text-white' disabled value='".$row['AD']."'></div>";
|
||||
}
|
||||
}else{
|
||||
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>";
|
||||
$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>";
|
||||
}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>";
|
||||
}
|
||||
}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-3'><input type='text' class='form-control bg-warning' disabled value='Missing'></div>";
|
||||
}
|
||||
}
|
||||
echo "<div class='col-md-4'></div>";
|
||||
echo "</div><br>";
|
||||
|
||||
// GLPI
|
||||
echo "<h3><span class='font-weight-bold'>GLPI</span></h3>" ;
|
||||
echo "<div class='row'>";
|
||||
if(isset($row['GLPI'])){
|
||||
if($row['GLPI']=="Y"){
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white font-weight-bold' disabled value='OK'></div>";
|
||||
}else{
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-secondary font-weight-bold' disabled value='".$row['GLPI']."'></div>";
|
||||
}
|
||||
}else{
|
||||
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='GLPI' name ='GLPI' placeholder='Missing' maxlength = '20'></div></div>";
|
||||
}
|
||||
echo "<div class='col-md-9 text-end'></div>";
|
||||
echo "</div><br>";
|
||||
|
||||
// Fusion Inventory
|
||||
echo "<h3><span class='font-weight-bold'>Fusion Inventory</span></h3>" ;
|
||||
echo "<div class='row'>";
|
||||
if(isset($row['GLPIlu']) && $row['GLPIlu'] !== ''){
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='OK'></div>";
|
||||
}else{
|
||||
if(isset($row['FI'])){
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-secondary text-white' value='".$row['FI']."'></div>";
|
||||
}else{
|
||||
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='FI' name ='FI' placeholder='Missing' maxlength = '20'></div></div>";
|
||||
}
|
||||
}
|
||||
$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>";
|
||||
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>";
|
||||
}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>";
|
||||
}
|
||||
}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-3'><input type='text' class='form-control bg-warning' disabled value='Missing'></div>";
|
||||
}
|
||||
}
|
||||
echo "<div class='col-md-4'></div>";
|
||||
echo "</div><br>";
|
||||
|
||||
// SCCM
|
||||
echo "<h3><span class='font-weight-bold'>SCCM</span></h3>" ;
|
||||
echo "<div class='row'>";
|
||||
if(isset($row['SCCM'])){
|
||||
if($row['SCCM']=="Y"){
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='OK'></div>";
|
||||
}else{
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-secondary text-white' disabled value='".$row['SCCM']."'></div>";
|
||||
}
|
||||
}else{
|
||||
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>";
|
||||
$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>";
|
||||
}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>";
|
||||
}
|
||||
}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-3'><input type='text' class='form-control bg-warning' disabled value='Missing'></div>";
|
||||
}
|
||||
}
|
||||
echo "<div class='col-md-4'></div>";
|
||||
echo "</div><br>";
|
||||
|
||||
// EPO
|
||||
echo "<h3><span class='font-weight-bold'>EPO</span></h3>" ;
|
||||
echo "<div class='row'>";
|
||||
if(isset($row['EPO'])){
|
||||
if($row['EPO']=="Y"){
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='OK'></div>";
|
||||
}else{
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-secondary text-white' disabled value='".$row['EPO']."'></div>";
|
||||
}
|
||||
}else{
|
||||
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='EPO' name ='EPO' Placeholder='Missing' maxlength = '20'></div></div>";
|
||||
}
|
||||
if(isset($row['EPOlu'])){
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>Last Update</b></div>";
|
||||
$date1=date_create($row['EPOlu']);
|
||||
$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['EPOlu']." (".abs($diff->format("%R%a"))." days)'></div>";
|
||||
}else{
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['EPOlu']." (".abs($diff->format("%R%a"))." days)'></div>";
|
||||
}
|
||||
}else{
|
||||
if(!(isset($row['EPO']) && $row['EPO'] !=="Y")){
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>Last Update</b></div>";
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-warning' disabled value='Missing'></div>";
|
||||
}
|
||||
}
|
||||
echo "<div class='col-md-4'></div>";
|
||||
echo "</div><br>";
|
||||
|
||||
// NBU
|
||||
echo "<h3><span class='font-weight-bold'>NetBackup</span></h3>" ;
|
||||
echo "<div class='row'>";
|
||||
if(isset($row['NBU'])){
|
||||
if($row['NBU']=="Y"){
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='OK'></div>";
|
||||
}else{
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-secondary text-white' disabled value='".$row['NBU']."'></div>";
|
||||
}
|
||||
}else{
|
||||
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>";
|
||||
$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>";
|
||||
}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>";
|
||||
}
|
||||
}else{
|
||||
if(!(isset($row['NBU']) && $row['NBU'] !=="Y")){
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>Last Backup</b></div>";
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-warning' disabled value='Missing'></div>";
|
||||
}
|
||||
}
|
||||
echo "<div class='col-md-4'></div>";
|
||||
echo "</div><br>";
|
||||
|
||||
// SCOM
|
||||
echo "<h3><span class='font-weight-bold'>SCOM</span></h3>" ;
|
||||
echo "<div class='row'>";
|
||||
if(isset($row['SCOM'])){
|
||||
if($row['SCOM']=="Y"){
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='OK'></div>";
|
||||
}else{
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-secondary text-white' disabled value='".$row['SCOM']."'></div>";
|
||||
}
|
||||
}else{
|
||||
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='SCOM' name ='SCOM' placeholder='Missing' maxlength = '20'></div></div>";
|
||||
}
|
||||
echo "<div class='col-md-9'></div>";
|
||||
echo "</div><br>";
|
||||
|
||||
// Zabbix
|
||||
echo "<h3><span class='font-weight-bold'>Zabbix</span></h3>" ;
|
||||
echo "<div class='row'>";
|
||||
if(isset($row['zabbix'])){
|
||||
if($row['zabbix']=="Y"){
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='OK'></div>";
|
||||
}else{
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-secondary text-white' disabled value='".$row['zabbix']."'></div>";
|
||||
}
|
||||
}else{
|
||||
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='zabbix' name ='zabbix' placeholder='Missing' maxlength = '20'></div></div>";
|
||||
}
|
||||
echo "<div class='col-md-9'></div>";
|
||||
echo "</div><br>";
|
||||
|
||||
// SentinelOne
|
||||
echo "<h3><span class='font-weight-bold'>SentinelOne</span></h3>" ;
|
||||
echo "<div class='row'>";
|
||||
if(isset($row['S1'])){
|
||||
if($row['S1']=="Y"){
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='OK'></div>";
|
||||
}else{
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-secondary text-white' disabled value='".$row['S1']."'></div>";
|
||||
}
|
||||
}else{
|
||||
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='S1' name ='S1' placeholder='Missing' maxlength = '20'></div></div>";
|
||||
}
|
||||
echo "<div class='col-md-9'></div>";
|
||||
echo "</div><br>";
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
<input type='text' class='form-control visually-hidden' name="server" id="server" value='<?php echo $_GET['server']; ?>'>
|
||||
<hr>
|
||||
<center><button id="button" type="submit" class="btn btn-primary btn-lg"><i class="bi bi-arrow-clockwise"></i><b> Submit</b></button></center>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/switch.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
93
crossover/Detail2.php
Normal file
93
crossover/Detail2.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<!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>
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/include/db_connect.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">
|
||||
<?php
|
||||
//var_dump($_POST);
|
||||
$server = $_POST['server'];
|
||||
// Update Databases
|
||||
DB_ENTRY02();
|
||||
if(isset($_POST['AD']) && $_POST['AD'] !==''){
|
||||
$conn->query("INSERT INTO CrossoverExclusions (server,AD) VALUES ('$server','".substr($_POST['AD'], 0, 20)."') ON DUPLICATE KEY UPDATE AD ='".substr($_POST['AD'], 0, 20)."'");
|
||||
$conn->query("UPDATE GlobalCrossover SET AD='".substr($_POST['AD'], 0, 20)."' where server = '$server'");
|
||||
}
|
||||
if(isset($_POST['GLPI']) && $_POST['GLPI'] !==''){
|
||||
$conn->query("INSERT INTO CrossoverExclusions (server,GLPI) VALUES ('$server','".substr($_POST['GLPI'], 0, 20)."') ON DUPLICATE KEY UPDATE GLPI ='".substr($_POST['GLPI'], 0, 20)."'");
|
||||
$conn->query("UPDATE GlobalCrossover SET GLPI='".substr($_POST['GLPI'], 0, 20)."' where server = '$server'");
|
||||
}
|
||||
if(isset($_POST['FI']) && $_POST['FI'] !==''){
|
||||
$conn->query("INSERT INTO CrossoverExclusions (server,FI) VALUES ('$server','".substr($_POST['FI'], 0, 20)."') ON DUPLICATE KEY UPDATE FI ='".substr($_POST['FI'], 0, 20)."'");
|
||||
$conn->query("UPDATE GlobalCrossover SET FI='".substr($_POST['FI'], 0, 20)."' where server = '$server'");
|
||||
}
|
||||
if(isset($_POST['SCCM']) && $_POST['SCCM'] !==''){
|
||||
$conn->query("INSERT INTO CrossoverExclusions (server,SCCM) VALUES ('$server','".substr($_POST['SCCM'], 0, 20)."') ON DUPLICATE KEY UPDATE SCCM ='".substr($_POST['SCCM'], 0, 20)."'");
|
||||
$conn->query("UPDATE GlobalCrossover SET SCCM='".substr($_POST['SCCM'], 0, 20)."' where server = '$server'");
|
||||
}
|
||||
if(isset($_POST['EPO']) && $_POST['EPO'] !==''){
|
||||
$conn->query("INSERT INTO CrossoverExclusions (server,EPO) VALUES ('$server','".substr($_POST['EPO'], 0, 20)."') ON DUPLICATE KEY UPDATE EPO ='".substr($_POST['EPO'], 0, 20)."'");
|
||||
$conn->query("UPDATE GlobalCrossover SET EPO='".substr($_POST['EPO'], 0, 20)."' where server = '$server'");
|
||||
}
|
||||
if(isset($_POST['NBU']) && $_POST['NBU'] !==''){
|
||||
$conn->query("INSERT INTO CrossoverExclusions (server,NBU) VALUES ('$server','".substr($_POST['NBU'], 0, 20)."') ON DUPLICATE KEY UPDATE NBU ='".substr($_POST['NBU'], 0, 20)."'");
|
||||
$conn->query("UPDATE GlobalCrossover SET NBU='".substr($_POST['NBU'], 0, 20)."' where server = '$server'");
|
||||
}
|
||||
if(isset($_POST['SCOM']) && $_POST['SCOM'] !==''){
|
||||
$conn->query("INSERT INTO CrossoverExclusions (server,SCOM) VALUES ('$server','".substr($_POST['SCOM'], 0, 20)."') ON DUPLICATE KEY UPDATE SCOM ='".substr($_POST['SCOM'], 0, 20)."'");
|
||||
$conn->query("UPDATE GlobalCrossover SET SCOM='".substr($_POST['SCOM'], 0, 20)."' where server = '$server'");
|
||||
}
|
||||
if(isset($_POST['zabbix']) && $_POST['zabbix'] !==''){
|
||||
$conn->query("INSERT INTO CrossoverExclusions (server,zabbix) VALUES ('$server','".substr($_POST['zabbix'], 0, 20)."') ON DUPLICATE KEY UPDATE zabbix ='".substr($_POST['zabbix'], 0, 20)."'");
|
||||
$conn->query("UPDATE GlobalCrossover SET zabbix='".substr($_POST['zabbix'], 0, 20)."' where server = '$server'");
|
||||
}
|
||||
if(isset($_POST['S1']) && $_POST['S1'] !==''){
|
||||
$conn->query("INSERT INTO CrossoverExclusions (server,S1) VALUES ('$server','".substr($_POST['S1'], 0, 20)."') ON DUPLICATE KEY UPDATE S1 ='".substr($_POST['S1'], 0, 20)."'");
|
||||
$conn->query("UPDATE GlobalCrossover SET S1='".substr($_POST['S1'], 0, 20)."' where server = '$server'");
|
||||
}
|
||||
?>
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $server ;?></span></h1>
|
||||
<br>
|
||||
<div class="alert alert-success" role="alert"><h2><center>Exception(s) enregistrée(s) !</center></h2></div>
|
||||
<!-- <meta http-equiv="refresh" content="3;url=/crossover/Detail.php?server=<?php //echo $server ; ?>" /> -->
|
||||
<!-- Main content -->
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
537
crossover/GlobalCrossover - Copie.php
Normal file
537
crossover/GlobalCrossover - Copie.php
Normal file
@@ -0,0 +1,537 @@
|
||||
<!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>
|
||||
|
||||
<!-- 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>
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/include/preloader.inc.html" ; ?> <!-- Preloader -->
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/include/db_connect.php" ; ?> <!-- Database connexion -->
|
||||
<?php //include $_SERVER['DOCUMENT_ROOT']."/include/functions.inc.php" ; ?> <!-- Functions -->
|
||||
<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%;">Global Crossover</span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="row" style="zoom: 80%">
|
||||
<!-- Get DATAs -->
|
||||
<?php
|
||||
// get all departements
|
||||
DB_Data_Read();
|
||||
$sql = "select distinct substring(dpt,1,Charindex('-',dpt)-1) as dpt1 from globalcrossover where dpt like '%-%' order by dpt1";
|
||||
$rs=odbc_exec($conn,$sql);
|
||||
$opt = "<select class='form-select' id='DPT' name='DPT'><option selected></option>";
|
||||
while ($row = odbc_fetch_array($rs)) {
|
||||
if(isset($row['dpt1'])){
|
||||
$opt .= "<option value='".$row['dpt1']."*'%>".$row['dpt1']."<b>*</b></option>" ;
|
||||
}
|
||||
}
|
||||
$opt .= "<option disabled>──────────</option>" ;
|
||||
$sql = "select distinct dpt from globalcrossover where dpt <> '' order by dpt";
|
||||
$rs=odbc_exec($conn,$sql);
|
||||
while ($row = odbc_fetch_array($rs)) {
|
||||
$opt .= "<option value='".$row['dpt']."'>".$row['dpt']."</option>" ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$opt .="</select>" ;
|
||||
|
||||
$vir="checked";$phy="checked";$dpt="";
|
||||
$where = ""; $typ="";
|
||||
if(isset($_GET['AA'])){
|
||||
$aa="checked"; $where .= "crit = 'AA' or ";
|
||||
}else{$aa="unchecked";}
|
||||
if(isset($_GET['A'])){
|
||||
$a="checked"; $where .= "crit = 'A' or ";
|
||||
}else{$a="unchecked";}
|
||||
if(isset($_GET['B'])){
|
||||
$b="checked"; $where .= "crit = 'B' or ";
|
||||
}else{$b="unchecked";}
|
||||
if(isset($_GET['C'])){
|
||||
$c="checked"; $where .= "crit = 'C' or ";
|
||||
}else{$c="unchecked";}
|
||||
if(isset($_GET['no'])){
|
||||
$no="checked"; $where .= "(crit = '' or crit is null) or ";
|
||||
}else{$no="unchecked";}
|
||||
$crit = rtrim($where, "or ");
|
||||
|
||||
if(isset($_GET['PHY'])){
|
||||
$phy="checked";
|
||||
if(!isset($_GET['VIR'])){
|
||||
$typ .= " AND virtual = 'N'";
|
||||
}
|
||||
}else{$phy="unchecked";}
|
||||
|
||||
if(isset($_GET['VIR'])){
|
||||
$vir="checked";
|
||||
if(!isset($_GET['PHY'])){
|
||||
$typ .= " AND virtual = 'Y'";
|
||||
}
|
||||
}else{$vir="unchecked";}
|
||||
|
||||
|
||||
DB_Data_Read();
|
||||
if($crit <> ""){
|
||||
$sql = "SELECT * FROM GlobalCrossover where ($crit) and Server <> '' ";
|
||||
}else{
|
||||
$sql = "SELECT * FROM GlobalCrossover where Server <> '' ";
|
||||
}
|
||||
if($typ <> ""){
|
||||
$sql .= $typ ;
|
||||
}
|
||||
|
||||
if(isset($_GET['DPT']) && $_GET['DPT'] <> ""){
|
||||
$dpt = strtoupper($_GET['DPT']);
|
||||
$d = str_replace('*','',$dpt) ;
|
||||
$sql .= " AND dpt like '$d%' " ;
|
||||
}else{
|
||||
$dpt="";
|
||||
}
|
||||
|
||||
$sql .= " order by Server";
|
||||
//echo $sql ;
|
||||
|
||||
$rs=odbc_exec($conn,$sql);
|
||||
?>
|
||||
|
||||
<!-- Criticity selection -->
|
||||
<form class="row row-cols-lg-auto g-3 align-items-center" action="/crossover/GlobalCrossover.php">
|
||||
<div class="col-12"></div>
|
||||
<div class="col-12 border rounded">
|
||||
<small>
|
||||
<b>Criticity Filter : </b>
|
||||
<div class="form-check form-check-inline form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="AA" <?php echo $aa;?> name="AA" value="1">
|
||||
<label class="form-check-label" for="AA">AA</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="A" <?php echo $a;?> name="A" value="1">
|
||||
<label class="form-check-label" for="A">A</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="B" <?php echo $b;?> name="B" value="1">
|
||||
<label class="form-check-label" for="B">B</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="C" <?php echo $c;?> name="C" value="1">
|
||||
<label class="form-check-label" for="C">C</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="no" <?php echo $no;?> name="no" value="1">
|
||||
<label class="form-check-label" for="no">Empty</label>
|
||||
</div>
|
||||
</small>
|
||||
</div>
|
||||
<div class="col-12"></div>
|
||||
<div class="col-12 border rounded">
|
||||
<small>
|
||||
<b>Type : </b>
|
||||
<div class="form-check form-check-inline form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="PHY" <?php echo $phy;?> name="PHY" value="1">
|
||||
<label class="form-check-label" for="PHY">Physical</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="VIR" <?php echo $vir;?> name="VIR" value="1">
|
||||
<label class="form-check-label" for="VIR">Virtual</label>
|
||||
</div>
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div class="col-12"></div>
|
||||
<div class="col-12">
|
||||
<?php echo str_replace('<option selected></option>','<option selected>'.$dpt.'</option><option></option>',$opt); ?>
|
||||
</div>
|
||||
|
||||
<div class="col-12"></div>
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-primary btn-small ">Apply</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<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="Criticity" data-sortable="true">Criticity</th>
|
||||
<th data-field="Departement" data-sortable="true">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="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="EPO" data-sortable="true">EPO</th>
|
||||
<th data-field="EPOlu" data-sortable="true" data-visible="false">EPO Last Update</th>
|
||||
<th data-field="Backup" data-sortable="true">Backup</th>
|
||||
<th data-field="NBUlu" data-sortable="true" data-visible="false">Last Backup</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;
|
||||
while ($row = odbc_fetch_array($rs)) {
|
||||
$total++ ;
|
||||
echo "<tr>";
|
||||
if(isset($row['AD']) && isset($row['GLPI']) && isset($row['SCCM']) && isset($row['EPO']) && isset($row['NBU'])){
|
||||
echo "<td class='bg-success text-white'><b><a href='\crossover\Detail.php?server=".$row['Server']."' target='_blank' class='link-light'>".$row['Server']."</a></b></td>";
|
||||
$ok++;
|
||||
}else{
|
||||
echo "<td><b><a href='\crossover\Detail.php?server=".$row['Server']."' target='_blank'>".$row['Server']."</a></b></td>";
|
||||
}
|
||||
if($row['OS']){
|
||||
if(preg_match('(XP|2003|Windows NT|2000|2008|7)', $row['OS']) !== 1) {
|
||||
$nOS++;
|
||||
echo "<td>".$row['OS']."</td>";
|
||||
} else {
|
||||
echo "<td class='bg-warning'>".$row['OS']."</td>";
|
||||
}
|
||||
}else{
|
||||
echo "<td class='bg-warning'> </td>";
|
||||
}
|
||||
echo "<td>".$row['crit']."</td>";
|
||||
echo "<td>".$row['dpt']."</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") > 60){
|
||||
echo "<td class='text-success' 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-success'>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'> </td>";
|
||||
$nSCCM++;
|
||||
}else{
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </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-success' 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-success'>OK</td>";
|
||||
$nFI++;
|
||||
echo "<td class='bg-success text-white'>".$row['GLPIlu']."</td>";
|
||||
}else{
|
||||
echo "<td class='text-success' 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-warning'>Missing</td>";
|
||||
}
|
||||
}
|
||||
$nGLPI++;
|
||||
}else{
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </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-success' 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-success'>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'> </td>";
|
||||
$nSCCM++;
|
||||
}else{
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </td>";
|
||||
}
|
||||
}
|
||||
|
||||
// EPO
|
||||
if($row['EPO'] == 'Y'){
|
||||
$date1=date_create($row['EPOlu']);
|
||||
$diff=date_diff($date1,date_create(date("Y-m-d")));
|
||||
if($diff->format("%R%a") > 7){
|
||||
echo "<td class='text-success' 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['EPOlu']." (".$diff->format("%R%a")." days)</td>";
|
||||
}else{
|
||||
echo "<td class='bg-success text-success'>OK</td>";
|
||||
echo "<td class='bg-success text-white'>".$row['EPOlu']."</td>";
|
||||
$nEPO++;
|
||||
}
|
||||
}else{
|
||||
if(isset($row['EPO'])){
|
||||
echo "<td class='bg-secondary'><small>".$row['EPO']."</small></td>";
|
||||
echo "<td class='bg-secondary text-secondary'> </td>";
|
||||
$nEPO++;
|
||||
}else{
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </td>";
|
||||
}
|
||||
}
|
||||
|
||||
// BACKUP
|
||||
if($row['NBU'] == 'Y'){
|
||||
$date1=date_create($row['NBUlu']);
|
||||
$diff=date_diff($date1,date_create(date("Y-m-d")));
|
||||
if($diff->format("%R%a") > 30){
|
||||
echo "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(220,53,69,1) 100%);'>OK (NBU)</td>";
|
||||
echo "<td class='bg-danger text-white'>".$row['NBUlu']." (".$diff->format("%R%a")." days)</td>";
|
||||
}else{
|
||||
echo "<td class='bg-success text-white'>OK (NBU)</td>";
|
||||
echo "<td class='bg-success text-white'>".$row['NBUlu']."</td>";
|
||||
$nNBU++;
|
||||
}
|
||||
}else{
|
||||
if($row['DPM'] == 'Y'){
|
||||
$date1=date_create($row['DPMlu']);
|
||||
$diff=date_diff($date1,date_create(date("Y-m-d")));
|
||||
if($diff->format("%R%a") > 30){
|
||||
echo "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(220,53,69,1) 100%);'>OK (DPM)</td>";
|
||||
echo "<td class='bg-danger text-white'>".$row['DPMlu']." (".$diff->format("%R%a")." days)</td>";
|
||||
}else{
|
||||
echo "<td class='bg-success text-white'>OK (DPM)</td>";
|
||||
echo "<td class='bg-success text-white'>".$row['DPMlu']."</td>";
|
||||
$nDPM++;
|
||||
}
|
||||
}else{
|
||||
if(isset($row['NBU'])){
|
||||
echo "<td class='bg-secondary'><small>".$row['NBU']."</small></td>";
|
||||
echo "<td class='bg-secondary text-secondary'> </td>";
|
||||
}else{
|
||||
if(isset($row['DPM'])){
|
||||
echo "<td class='bg-secondary'><small>".$row['DPM']."</small></td>";
|
||||
echo "<td class='bg-secondary text-secondary'> </td>";
|
||||
}
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </td>";
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
*/
|
||||
echo "</tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<button id="button" type="button" class="btn btn-primary btn-sm invisible"><i class="bi bi-arrow-clockwise"></i><b> Generate KPI</b></button>
|
||||
<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 "><b>Devices</b></div>
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIDEVICE"></span></h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE OS -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header"><b>Supported OS</b></div>
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIOS"></span></h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE AD -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header"><b>AD</b></div>
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIAD"></span></h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE GLPI/FI -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header"><b>GLPI/FI</b></div>
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIGLPI"></span></h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE SCCM -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header"><b>SCCM</b></div>
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPISCCM"></span></h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE EPO -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header"><b>EPO</b></div>
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIEPO"></span></h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE NBU -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header"><b>Backup</b></div>
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPINBU"></span></h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo '<script type="text/javascript">', "$('#button').click();", '</script>' ;?>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
function dateDiffInDays(a) {
|
||||
const _MS_PER_DAY = 1000 * 60 * 60 * 24;
|
||||
return Math.floor((Date.now() - new Date(a)) / _MS_PER_DAY);
|
||||
}
|
||||
|
||||
var $table = $('#t1')
|
||||
var $button = $('#button')
|
||||
|
||||
$(function() {
|
||||
$button.click(function () {
|
||||
$data = $table.bootstrapTable('getData')
|
||||
$dl = $data.length
|
||||
$nSCCM=0; $nAD=0; $nGLPI=0;$nEPO=0;$nNBU=0;$nOS=0;
|
||||
for( $i=0 ; $i < $dl ; $i++ ){
|
||||
if ($data[$i]['AD'] !== 'Missing') { $nAD++ ; }
|
||||
if ((dateDiffInDays($data[$i]['ADlu'].split(" ")[0]) > 60 || $data[$i]['ADlu'] == 'Missing') && $data[$i]['SCCM'] == 'OK'){ $nAD-- ;}
|
||||
if ($data[$i]['SCCM'] !== 'Missing') { $nSCCM++ ; }
|
||||
if ((dateDiffInDays($data[$i]['SCCMlu'].split(" ")[0]) > 7 || $data[$i]['SCCMlu'] == 'Missing') && $data[$i]['SCCM'] == 'OK'){ $nSCCM-- ;}
|
||||
if ($data[$i]['GLPI'] !== 'Missing') { $nGLPI++ ; }
|
||||
if ((dateDiffInDays($data[$i]['GLPIlu'].split(" ")[0]) > 7 || $data[$i]['GLPIlu'] == 'Missing') && $data[$i]['GLPI'] == 'OK'){ $nGLPI-- ;}
|
||||
if ($data[$i]['EPO'] !== 'Missing') { $nEPO++ ; }
|
||||
if ((dateDiffInDays($data[$i]['EPOlu'].split(" ")[0]) > 7 || $data[$i]['EPOlu'] == 'Missing') && $data[$i]['EPO'] == 'OK'){ $nEPO-- ;}
|
||||
if ($data[$i]['Backup'] !== 'Missing') { $nNBU++ ; }
|
||||
if ((dateDiffInDays($data[$i]['NBUlu'].split(" ")[0]) > 30 || $data[$i]['NBUlu'] == 'Missing') && $data[$i]['Backup'].split(" ")[0] == 'OK'){ $nNBU-- ;}
|
||||
if (($data[$i]['OS'].includes('XP') || $data[$i]['OS'].includes('2000') || $data[$i]['OS'].includes('2003') || $data[$i]['OS'].includes('2008') || $data[$i]['OS'].includes('7') || $data[$i]['OS'].includes('Windows NT')) == false) { $nOS++ ;}
|
||||
}
|
||||
|
||||
document.getElementById("KPIAD").innerHTML = Math.round($nAD/$dl*100) + "%";
|
||||
if(Math.round($nAD/$dl*100) >=90){
|
||||
document.getElementById("KPIAD").className = "badge text-bg-success font-weight-bold";
|
||||
}else if(Math.round($nAD/$dl*100) >=75){
|
||||
document.getElementById("KPIAD").className = "badge text-bg-warning font-weight-bold";
|
||||
}else{
|
||||
document.getElementById("KPIAD").className = "badge text-bg-danger font-weight-bold";
|
||||
}
|
||||
|
||||
document.getElementById("KPIGLPI").innerHTML = Math.round($nGLPI/$dl*100) + "%";
|
||||
if(Math.round($nGLPI/$dl*100) >=90){
|
||||
document.getElementById("KPIGLPI").className = "badge text-bg-success font-weight-bold";
|
||||
}else if(Math.round($nGLPI/$dl*100) >=75){
|
||||
document.getElementById("KPIGLPI").className = "badge text-bg-warning font-weight-bold";
|
||||
}else{
|
||||
document.getElementById("KPIGLPI").className = "badge text-bg-danger font-weight-bold";
|
||||
}
|
||||
|
||||
document.getElementById("KPISCCM").innerHTML = Math.round($nSCCM/$dl*100) + "%";
|
||||
if(Math.round($nSCCM/$dl*100) >=90){
|
||||
document.getElementById("KPISCCM").className = "badge text-bg-success font-weight-bold";
|
||||
}else if(Math.round($nSCCM/$dl*100) >=75){
|
||||
document.getElementById("KPISCCM").className = "badge text-bg-warning font-weight-bold";
|
||||
}else{
|
||||
document.getElementById("KPISCCM").className = "badge text-bg-danger font-weight-bold";
|
||||
}
|
||||
|
||||
document.getElementById("KPIEPO").innerHTML = Math.round($nEPO/$dl*100) + "%";
|
||||
if(Math.round($nEPO/$dl*100) >=90){
|
||||
document.getElementById("KPIEPO").className = "badge text-bg-success font-weight-bold";
|
||||
}else if(Math.round($nEPO/$dl*100) >=75){
|
||||
document.getElementById("KPIEPO").className = "badge text-bg-warning font-weight-bold";
|
||||
}else{
|
||||
document.getElementById("KPIEPO").className = "badge text-bg-danger font-weight-bold";
|
||||
}
|
||||
|
||||
document.getElementById("KPINBU").innerHTML = Math.round($nNBU/$dl*100) + "%";
|
||||
if(Math.round($nNBU/$dl*100) >=90){
|
||||
document.getElementById("KPINBU").className = "badge text-bg-success font-weight-bold";
|
||||
}else if(Math.round($nNBU/$dl*100) >=75){
|
||||
document.getElementById("KPINBU").className = "badge text-bg-warning font-weight-bold";
|
||||
}else{
|
||||
document.getElementById("KPINBU").className = "badge text-bg-danger font-weight-bold";
|
||||
}
|
||||
|
||||
document.getElementById("KPIOS").innerHTML = Math.round($nOS/$dl*100) + "%";
|
||||
if(Math.round($nOS/$dl*100) >=90){
|
||||
document.getElementById("KPIOS").className = "badge text-bg-success font-weight-bold";
|
||||
}else if(Math.round($nOS/$dl*100) >=75){
|
||||
document.getElementById("KPIOS").className = "badge text-bg-warning font-weight-bold";
|
||||
}else{
|
||||
document.getElementById("KPIOS").className = "badge text-bg-danger font-weight-bold";
|
||||
}
|
||||
|
||||
document.getElementById("KPIDEVICE").innerHTML = $dl;
|
||||
})
|
||||
})
|
||||
|
||||
$table.on('all.bs.table', function () {
|
||||
var $button = $('#button')
|
||||
$button.click() ;
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<!-- remove preloader after loading -->
|
||||
<script>
|
||||
$(window).on('load', function() {
|
||||
$('.preloader').addClass('preloader-deactivate');
|
||||
});
|
||||
</script>
|
||||
|
||||
478
crossover/GlobalCrossover.php
Normal file
478
crossover/GlobalCrossover.php
Normal file
@@ -0,0 +1,478 @@
|
||||
<!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/db_connect.php"; ?> <!-- Database connexion -->
|
||||
<?php //include $_SERVER['DOCUMENT_ROOT']."/include/functions.inc.php" ; ?> <!-- Functions -->
|
||||
<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%;">Global Crossover</span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="row" style="zoom: 80%">
|
||||
<!-- Get DATAs -->
|
||||
<?php
|
||||
DB_ENTRY02();
|
||||
$result = $conn->query("select * from GlobalCrossover where server not like 'WS%' order by server ");
|
||||
if (isset($_GET['filter'])) {
|
||||
switch ($_GET['filter']) {
|
||||
case "AD":
|
||||
$result = $conn->query("select * from GlobalCrossover where AD is null or (ADlu is not null and DATEDIFF(now(),ADlu) > 45) order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : AD non compliant</span></center></h2>";
|
||||
break;
|
||||
case "OS":
|
||||
$result = $conn->query("select * from GlobalCrossover where OS like '%2003%' or OS like '%2008%' order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : OS non compliant</span></center></h2>";
|
||||
break;
|
||||
case "GLPI":
|
||||
$result = $conn->query("select * from GlobalCrossover where GLPI is null or GLPIlu is null or DATEDIFF(now(),GLPIlu) > 7 order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : GLPI/FI non compliant</span></center></h2>";
|
||||
break;
|
||||
case "SCCM":
|
||||
$result = $conn->query("select * from GlobalCrossover where SCCM is null or (SCCMlu is not null and DATEDIFF(now(),SCCMlu) > 7) order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : SCCM non compliant</span></center></h2>";
|
||||
break;
|
||||
case "EPO":
|
||||
$result = $conn->query("select * from GlobalCrossover where EPO is null or (EPOlu is not null and DATEDIFF(now(),EPOlu) > 7) order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : EPO non compliant</span></center></h2>";
|
||||
break;
|
||||
case "NBU":
|
||||
$result = $conn->query("select * from GlobalCrossover where NBU is null or (NBUlu is not null and DATEDIFF(now(),NBUlu) > 30) order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : Backup non compliant</span></center></h2>";
|
||||
break;
|
||||
case "SCOM":
|
||||
$result = $conn->query("select * from GlobalCrossover where SCOM is null order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : SCOM non compliant</span></center></h2>";
|
||||
break;
|
||||
case "zabbix":
|
||||
$result = $conn->query("select * from GlobalCrossover where zabbix is null order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : Zabbix non compliant</span></center></h2>";
|
||||
break;
|
||||
case "S1":
|
||||
$result = $conn->query("select * from GlobalCrossover where S1 is null or (S1lu is not null and DATEDIFF(now(),S1lu) > 7) order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : SentinelOne non compliant</span></center></h2>";
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<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="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="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="EPO" data-sortable="true">EPO</th>
|
||||
<th data-field="EPOlu" data-sortable="true" data-visible="false">EPO Last Update</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="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>
|
||||
</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;
|
||||
while ($row = mysqli_fetch_array($result)) {
|
||||
$total++;
|
||||
echo "<tr>";
|
||||
if (isset($row['AD']) && isset($row['GLPI']) && isset($row['SCCM']) && isset($row['EPO']) && (isset($row['NBU']) || isset($row['DPM'])) && isset($row['SCOM'])) {
|
||||
echo "<td class='bg-success text-white'><b><a href='\crossover\Detail.php?server=" . $row['Server'] . "' target='_blank' class='link-light'>" . $row['Server'] . "</a></b></td>";
|
||||
//echo "<td class='bg-success text-white'><b>".$row['Server']."</b></td>";
|
||||
$ok++;
|
||||
} else {
|
||||
echo "<td><b><a href='\crossover\Detail.php?server=" . $row['Server'] . "' target='_blank'>" . $row['Server'] . "</a></b></td>";
|
||||
//echo "<td><b>".$row['Server']."</b></td>";
|
||||
}
|
||||
if ($row['OS']) {
|
||||
if (preg_match('(XP|2003|Windows NT|2000|2008|Windows 7|2012)', $row['OS']) !== 1) {
|
||||
$nOS++;
|
||||
echo "<td>" . $row['OS'] . "</td>";
|
||||
} else {
|
||||
echo "<td class='bg-warning'>" . $row['OS'] . "</td>";
|
||||
}
|
||||
} else {
|
||||
echo "<td class='bg-warning'> </td>";
|
||||
}
|
||||
echo "<td>" . $row['crit'] . "</td>";
|
||||
echo "<td>" . $row['dpt'] . "</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'> </td>";
|
||||
$nSCCM++;
|
||||
} else {
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </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'] <> "" || $row['FI'] <> "") {
|
||||
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-warning'>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'> </td>";
|
||||
$nGLPI++;
|
||||
} else {
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </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'> </td>";
|
||||
$nSCCM++;
|
||||
} else {
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </td>";
|
||||
}
|
||||
}
|
||||
|
||||
// EPO
|
||||
if ($row['EPO'] == 'Y') {
|
||||
$date1 = date_create($row['EPOlu']);
|
||||
$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['EPOlu'] . " (" . $diff->format("%R%a") . " days)</td>";
|
||||
} else {
|
||||
echo "<td class='bg-success text-white'>OK</td>";
|
||||
echo "<td class='bg-success text-white'>" . $row['EPOlu'] . "</td>";
|
||||
$nEPO++;
|
||||
}
|
||||
} else {
|
||||
if (isset($row['EPO'])) {
|
||||
echo "<td class='bg-secondary'><small>" . $row['EPO'] . "</small></td>";
|
||||
echo "<td class='bg-secondary text-secondary'> </td>";
|
||||
$nEPO++;
|
||||
} else {
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </td>";
|
||||
}
|
||||
}
|
||||
|
||||
// BACKUP
|
||||
if ($row['NBU'] == 'Y') {
|
||||
$date1 = date_create($row['NBUlu']);
|
||||
$diff = date_diff($date1, date_create(date("Y-m-d")));
|
||||
if ($diff->format("%R%a") > 30) {
|
||||
echo "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(220,53,69,1) 100%);'>OK (NBU)</td>";
|
||||
echo "<td class='bg-danger text-white'>" . $row['NBUlu'] . " (" . $diff->format("%R%a") . " days)</td>";
|
||||
} else {
|
||||
echo "<td class='bg-success text-white'>OK (NBU)</td>";
|
||||
echo "<td class='bg-success text-white'>" . $row['NBUlu'] . "</td>";
|
||||
$nNBU++;
|
||||
}
|
||||
} else {
|
||||
if ($row['DPM'] == 'Y') {
|
||||
$date1 = date_create($row['DPMlu']);
|
||||
$diff = date_diff($date1, date_create(date("Y-m-d")));
|
||||
if ($diff->format("%R%a") > 30) {
|
||||
echo "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(220,53,69,1) 100%);'>OK (DPM)</td>";
|
||||
echo "<td class='bg-danger text-white'>" . $row['DPMlu'] . " (" . $diff->format("%R%a") . " days)</td>";
|
||||
} else {
|
||||
echo "<td class='bg-success text-white'>OK (DPM)</td>";
|
||||
echo "<td class='bg-success text-white'>" . $row['DPMlu'] . "</td>";
|
||||
$nDPM++;
|
||||
}
|
||||
} else {
|
||||
if (isset($row['NBU'])) {
|
||||
echo "<td class='bg-secondary'><small>" . $row['NBU'] . "</small></td>";
|
||||
echo "<td class='bg-secondary text-secondary'> </td>";
|
||||
} else {
|
||||
if (isset($row['DPM'])) {
|
||||
echo "<td class='bg-secondary'><small>" . $row['DPM'] . "</small></td>";
|
||||
echo "<td class='bg-secondary text-secondary'> </td>";
|
||||
}
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </td>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// SCOM
|
||||
if ($row['SCOM'] == 'Y') {
|
||||
echo "<td class='bg-success text-white'>OK</td>";
|
||||
} else {
|
||||
if (isset($row['SCOM'])) {
|
||||
echo "<td class='bg-secondary'><small>" . $row['SCOM'] . "</small></td>";
|
||||
} else {
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
}
|
||||
}
|
||||
|
||||
// zabbix
|
||||
if ($row['zabbix'] == 'Y') {
|
||||
echo "<td class='bg-success text-white'>OK</td>";
|
||||
} else {
|
||||
if (isset($row['zabbix'])) {
|
||||
echo "<td class='bg-secondary'><small>" . $row['zabbix'] . "</small></td>";
|
||||
} else {
|
||||
echo "<td class='bg-warning text-warning'>Missing</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'> </td>";
|
||||
$nS1++;
|
||||
} else {
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </td>";
|
||||
}
|
||||
}
|
||||
echo "</tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<button id="button" type="button" class="btn btn-primary btn-sm invisible"><i
|
||||
class="bi bi-arrow-clockwise"></i><b> Generate KPI</b></button>
|
||||
<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>
|
||||
<a href="/crossover/GlobalCrossover.php">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-primary font-weight-bold" id="KPIDEVICE"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE OS -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>Supported OS</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>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE AD -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>AD</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=AD">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIAD"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE GLPI/FI -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>GLPI/FI</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=GLPI">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIGLPI"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE SCCM -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>SCCM</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=SCCM">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPISCCM"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE EPO -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>EPO</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=EPO">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIEPO"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</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>
|
||||
<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>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE SCOM -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>SCOM</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=SCOM">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPISCOM"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE Zabbix -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>Zabbix</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=zabbix">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIzabbix"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE SentinelOne -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>SentinelOne</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=S1">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIS1"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/switch.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
<script src="/crossover/Crossover-KPI.js"></script>
|
||||
<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');
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () { setTimeout(function () { document.getElementById('button').click(); }, 1000); });
|
||||
</script>
|
||||
|
||||
</HTML>
|
||||
477
crossover/GlobalCrossover2.php
Normal file
477
crossover/GlobalCrossover2.php
Normal file
@@ -0,0 +1,477 @@
|
||||
<!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>
|
||||
|
||||
<!-- 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/db_connect.php"; ?> <!-- Database connexion -->
|
||||
<?php //include $_SERVER['DOCUMENT_ROOT']."/include/functions.inc.php" ; ?> <!-- Functions -->
|
||||
<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%;">Global Crossover</span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="row" style="zoom: 80%">
|
||||
<!-- Get DATAs -->
|
||||
<?php
|
||||
DB_ENTRY02();
|
||||
$result = $conn->query("select * from GlobalCrossover where server not like 'WS%' order by server ");
|
||||
if (isset($_GET['filter'])) {
|
||||
switch ($_GET['filter']) {
|
||||
case "AD":
|
||||
$result = $conn->query("select * from GlobalCrossover where AD is null or (ADlu is not null and DATEDIFF(now(),ADlu) > 45) order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : AD non compliant</span></center></h2>";
|
||||
break;
|
||||
case "OS":
|
||||
$result = $conn->query("select * from GlobalCrossover where OS like '%2003%' or OS like '%2008%' order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : OS non compliant</span></center></h2>";
|
||||
break;
|
||||
case "GLPI":
|
||||
$result = $conn->query("select * from GlobalCrossover where GLPI is null or GLPIlu is null or DATEDIFF(now(),GLPIlu) > 7 order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : GLPI/FI non compliant</span></center></h2>";
|
||||
break;
|
||||
case "SCCM":
|
||||
$result = $conn->query("select * from GlobalCrossover where SCCM is null or (SCCMlu is not null and DATEDIFF(now(),SCCMlu) > 7) order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : SCCM non compliant</span></center></h2>";
|
||||
break;
|
||||
case "EPO":
|
||||
$result = $conn->query("select * from GlobalCrossover where EPO is null or (EPOlu is not null and DATEDIFF(now(),EPOlu) > 7) order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : EPO non compliant</span></center></h2>";
|
||||
break;
|
||||
case "NBU":
|
||||
$result = $conn->query("select * from GlobalCrossover where NBU is null or (NBUlu is not null and DATEDIFF(now(),NBUlu) > 30) order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : Backup non compliant</span></center></h2>";
|
||||
break;
|
||||
case "SCOM":
|
||||
$result = $conn->query("select * from GlobalCrossover where SCOM is null order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : SCOM non compliant</span></center></h2>";
|
||||
break;
|
||||
case "zabbix":
|
||||
$result = $conn->query("select * from GlobalCrossover where zabbix is null order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : Zabbix non compliant</span></center></h2>";
|
||||
break;
|
||||
case "S1":
|
||||
$result = $conn->query("select * from GlobalCrossover where S1 is null or (S1lu is not null and DATEDIFF(now(),S1lu) > 7) order by server");
|
||||
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : SentinelOne non compliant</span></center></h2>";
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<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="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="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="EPO" data-sortable="true">EPO</th>
|
||||
<th data-field="EPOlu" data-sortable="true" data-visible="false">EPO Last Update</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="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>
|
||||
</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;
|
||||
while ($row = mysqli_fetch_array($result)) {
|
||||
$total++;
|
||||
echo "<tr>";
|
||||
if (isset($row['AD']) && isset($row['GLPI']) && isset($row['SCCM']) && isset($row['EPO']) && (isset($row['NBU']) || isset($row['DPM'])) && isset($row['SCOM'])) {
|
||||
echo "<td class='bg-success text-white'><b><a href='\crossover\Detail.php?server=" . $row['Server'] . "' target='_blank' class='link-light'>" . $row['Server'] . "</a></b></td>";
|
||||
//echo "<td class='bg-success text-white'><b>".$row['Server']."</b></td>";
|
||||
$ok++;
|
||||
} else {
|
||||
echo "<td><b><a href='\crossover\Detail.php?server=" . $row['Server'] . "' target='_blank'>" . $row['Server'] . "</a></b></td>";
|
||||
//echo "<td><b>".$row['Server']."</b></td>";
|
||||
}
|
||||
if ($row['OS']) {
|
||||
if (preg_match('(XP|2003|Windows NT|2000|2008|Windows 7|2012)', $row['OS']) !== 1) {
|
||||
$nOS++;
|
||||
echo "<td>" . $row['OS'] . "</td>";
|
||||
} else {
|
||||
echo "<td class='bg-warning'>" . $row['OS'] . "</td>";
|
||||
}
|
||||
} else {
|
||||
echo "<td class='bg-warning'> </td>";
|
||||
}
|
||||
echo "<td>" . $row['crit'] . "</td>";
|
||||
echo "<td>" . $row['dpt'] . "</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'> </td>";
|
||||
$nSCCM++;
|
||||
} else {
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </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'] <> "" || $row['FI'] <> "") {
|
||||
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-warning'>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'> </td>";
|
||||
$nGLPI++;
|
||||
} else {
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </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'> </td>";
|
||||
$nSCCM++;
|
||||
} else {
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </td>";
|
||||
}
|
||||
}
|
||||
|
||||
// EPO
|
||||
if ($row['EPO'] == 'Y') {
|
||||
$date1 = date_create($row['EPOlu']);
|
||||
$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['EPOlu'] . " (" . $diff->format("%R%a") . " days)</td>";
|
||||
} else {
|
||||
echo "<td class='bg-success text-white'>OK</td>";
|
||||
echo "<td class='bg-success text-white'>" . $row['EPOlu'] . "</td>";
|
||||
$nEPO++;
|
||||
}
|
||||
} else {
|
||||
if (isset($row['EPO'])) {
|
||||
echo "<td class='bg-secondary'><small>" . $row['EPO'] . "</small></td>";
|
||||
echo "<td class='bg-secondary text-secondary'> </td>";
|
||||
$nEPO++;
|
||||
} else {
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </td>";
|
||||
}
|
||||
}
|
||||
|
||||
// BACKUP
|
||||
if ($row['NBU'] == 'Y') {
|
||||
$date1 = date_create($row['NBUlu']);
|
||||
$diff = date_diff($date1, date_create(date("Y-m-d")));
|
||||
if ($diff->format("%R%a") > 30) {
|
||||
echo "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(220,53,69,1) 100%);'>OK (NBU)</td>";
|
||||
echo "<td class='bg-danger text-white'>" . $row['NBUlu'] . " (" . $diff->format("%R%a") . " days)</td>";
|
||||
} else {
|
||||
echo "<td class='bg-success text-white'>OK (NBU)</td>";
|
||||
echo "<td class='bg-success text-white'>" . $row['NBUlu'] . "</td>";
|
||||
$nNBU++;
|
||||
}
|
||||
} else {
|
||||
if ($row['DPM'] == 'Y') {
|
||||
$date1 = date_create($row['DPMlu']);
|
||||
$diff = date_diff($date1, date_create(date("Y-m-d")));
|
||||
if ($diff->format("%R%a") > 30) {
|
||||
echo "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(220,53,69,1) 100%);'>OK (DPM)</td>";
|
||||
echo "<td class='bg-danger text-white'>" . $row['DPMlu'] . " (" . $diff->format("%R%a") . " days)</td>";
|
||||
} else {
|
||||
echo "<td class='bg-success text-white'>OK (DPM)</td>";
|
||||
echo "<td class='bg-success text-white'>" . $row['DPMlu'] . "</td>";
|
||||
$nDPM++;
|
||||
}
|
||||
} else {
|
||||
if (isset($row['NBU'])) {
|
||||
echo "<td class='bg-secondary'><small>" . $row['NBU'] . "</small></td>";
|
||||
echo "<td class='bg-secondary text-secondary'> </td>";
|
||||
} else {
|
||||
if (isset($row['DPM'])) {
|
||||
echo "<td class='bg-secondary'><small>" . $row['DPM'] . "</small></td>";
|
||||
echo "<td class='bg-secondary text-secondary'> </td>";
|
||||
}
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </td>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// SCOM
|
||||
if ($row['SCOM'] == 'Y') {
|
||||
echo "<td class='bg-success text-white'>OK</td>";
|
||||
} else {
|
||||
if (isset($row['SCOM'])) {
|
||||
echo "<td class='bg-secondary'><small>" . $row['SCOM'] . "</small></td>";
|
||||
} else {
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
}
|
||||
}
|
||||
|
||||
// zabbix
|
||||
if ($row['zabbix'] == 'Y') {
|
||||
echo "<td class='bg-success text-white'>OK</td>";
|
||||
} else {
|
||||
if (isset($row['zabbix'])) {
|
||||
echo "<td class='bg-secondary'><small>" . $row['zabbix'] . "</small></td>";
|
||||
} else {
|
||||
echo "<td class='bg-warning text-warning'>Missing</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'> </td>";
|
||||
$nS1++;
|
||||
} else {
|
||||
echo "<td class='bg-warning text-warning'>Missing</td>";
|
||||
echo "<td class='bg-warning text-warning'> </td>";
|
||||
}
|
||||
}
|
||||
echo "</tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<button id="button" type="button" class="btn btn-primary btn-sm invisible"><i
|
||||
class="bi bi-arrow-clockwise"></i><b> Generate KPI</b></button>
|
||||
<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>
|
||||
<a href="/crossover/GlobalCrossover.php">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-primary font-weight-bold" id="KPIDEVICE"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE OS -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>Supported OS</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>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE AD -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>AD</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=AD">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIAD"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE GLPI/FI -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>GLPI/FI</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=GLPI">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIGLPI"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE SCCM -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>SCCM</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=SCCM">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPISCCM"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE EPO -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>EPO</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=EPO">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIEPO"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</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>
|
||||
<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>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE SCOM -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>SCOM</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=SCOM">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPISCOM"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE Zabbix -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>Zabbix</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=zabbix">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIzabbix"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE SentinelOne -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>SentinelOne</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=S1">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIS1"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/switch.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
<script src="/crossover/Crossover-KPI.js"></script>
|
||||
<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');
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () { setTimeout(function () { document.getElementById('button').click(); }, 1000); });
|
||||
</script>
|
||||
|
||||
</HTML>
|
||||
Reference in New Issue
Block a user