Commit ee4de7a9 authored by Laurent Joly's avatar Laurent Joly
Browse files

maintenance_gestion_poste.php

page en place pour la consultation
parent 809888c6
<?php
/**
* Maintenance gestion des postes
* Maintenance suppression des postes
* @Projet LCS / SambaEdu
* @auteurs Laurent Joly
......@@ -46,19 +46,28 @@ else
$page_id=1;
include("maintenance_top.php");
echo "<form method='get' action=''>\n";
echo "</form>\n";
function maintenance_liste_poste($config)
function maintenance_liste_poste($config,$flag,$uuid)
{
$wpkg_link = connexion_db_wpkg($config);
if ($flag!=-1)
$query_flag="AND p.flag_poste=".($flag+0);
else
$query_flag="";
$query_uuid="";
switch($uuid)
{
case 0:
$query_uuid=" AND (p.uuid_poste is NULL OR p.uuid_poste like 'DELETE%')";
break;
case 1:
$query_uuid=" AND (p.uuid_poste is not NULL AND p.uuid_poste not like 'DELETE%')";
break;
}
$query = mysqli_prepare($wpkg_link, "SELECT p.id_poste, p.nom_poste, p.OS_poste, p.date_rapport_poste, p.ip_poste, p.mac_address_poste, p.file_log_poste, p.file_rapport_poste, p.date_modification_poste, p.flag_poste, p.uuid_poste, count(distinct pa.id_app) as nb_appli, sum(pa.statut_poste_app='Installed') as nb_appli_installed
FROM (`postes` p)
LEFT JOIN (`poste_app` pa) ON pa.id_poste=p.id_poste
WHERE 1=1
WHERE 1=1 ".$query_flag.$query_uuid."
GROUP BY p.nom_poste ASC
ORDER BY p.date_modification_poste ASC");
mysqli_stmt_execute($query);
......@@ -91,7 +100,7 @@ function maintenance_liste_poste($config)
return $tab;
}
$liste_poste=maintenance_liste_poste($config);
$liste_poste=maintenance_liste_poste($config,$get_flag,$get_uuid);
$tri_poste = array();
$tri_flag = array();
......@@ -154,51 +163,91 @@ if ($liste_poste) {
}
echo "<table cellspadding='2' cellspacing='1' border='0' align='center' bgcolor='black'>\n";
echo "<tr style='color:white'>";
echo "<tr style='color:white'>\n";
echo "<th width='120' rowspan='2'><a href='?tri=";
if ($tri == 0)
echo "1";
else
echo "0";
echo "' style='color:" . $regular_lnk . "'>Nom du poste</a></th>";
echo "<th width='50' rowspan='2'>OS</th>";
echo "<th width='120' rowspan='2'><a href='?tri=";
echo "' style='color:" . $regular_lnk . "'>Nom du poste</a></th>\n";
echo "<th width='50' rowspan='2'>OS</th>\n";
echo "<th width='120'><a href='?tri=";
if ($tri == 2)
echo "3";
else
echo "2";
echo "' style='color:" . $regular_lnk . "'>Statut</a></th>";
echo "<th width='180' colspan='2'>Nombre d'applications</th>";
echo "' style='color:" . $regular_lnk . "'>Statut</a></th>\n";
echo "<th width='180' colspan='2'>Nombre d'applications</th>\n";
echo "<th width='200' rowspan='2'><a href='?tri=";
if ($tri == 6)
echo "7";
else
echo "6";
echo "' style='color:" . $regular_lnk . "'>Date du dernier rapport</a></th>";
echo "' style='color:" . $regular_lnk . "'>Date du dernier rapport</a></th>\n";
echo "<th width='120' rowspan='2'><a href='?tri=";
if ($tri == 8)
echo "9";
else
echo "8";
echo "' style='color:" . $regular_lnk . "'>Adresse IP</a></th>";
echo "' style='color:" . $regular_lnk . "'>Adresse IP</a></th>\n";
echo "<th width='160' rowspan='2'><a href='?tri=";
if ($tri == 10)
echo "11";
else
echo "10";
echo "' style='color:" . $regular_lnk . "'>Adresse mac</a></th>";
echo "<th width='160' rowspan='2'>Uuid machine</a></th>";
echo "' style='color:" . $regular_lnk . "'>Adresse mac</a></th>\n";
echo "<th width='160'>Uuid machine</a></th>\n";
echo "</tr>\n";
echo "<tr style='color:white'>";
echo "<th width='90'>Total</th>";
echo "<form method='get' action=''>\n";
echo "<tr style='color:white'>\n";
echo "<th>";
echo " <select name='flag' onchange='submit()'>";
echo " <option value='-1'";
if ($get_flag==-1)
echo " selected";
echo ">Tout</option>";
echo " <option value='0'";
if ($get_flag==0)
echo " selected";
echo ">Non protégé</option>";
echo " <option value='1'";
if ($get_flag==1)
echo " selected";
echo ">Protégé</option>";
echo " <option value='2'";
if ($get_flag==2)
echo " selected";
echo ">Autre</option>";
echo " </select>";
echo "</th>\n";
echo "<th width='90'>Total</th>\n";
echo "<th width='90'><a href='?tri=";
if ($tri == 4)
echo "5";
else
echo "4";
echo "' style='color:" . $regular_lnk . "'>Installées</a></th>";
echo "' style='color:" . $regular_lnk . "'>Installées</a></th>\n";
echo "<th>";
echo " <select name='uuid' onchange='submit()'>";
echo " <option value='-1'";
if ($get_uuid==-1)
echo " selected";
echo ">Tout</option>";
echo " <option value='0'";
if ($get_uuid==0)
echo " selected";
echo ">Inconnu</option>";
echo " <option value='1'";
if ($get_uuid==1)
echo " selected";
echo ">Connu</option>";
echo " </select>";
echo "</th>\n";
echo "</tr>\n";
echo "<input type='hidden' name='tri' value='" . $tri . "'>\n";
echo "</form>\n";
foreach ($liste_poste as $nom_poste => $lp)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment