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

Update maintenance_gestion_poste.php : nettoyage

parent 17f5e78b
......@@ -61,60 +61,6 @@ echo " }\n";
echo " }\n";
echo "</script>\n";
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 ".$query_flag.$query_uuid."
GROUP BY p.nom_poste ASC
ORDER BY p.date_modification_poste ASC");
mysqli_stmt_execute($query);
mysqli_stmt_bind_result($query, $res_id_poste, $res_nom_poste, $res_OS_poste, $res_date_rapport_poste, $res_ip_poste, $res_mac_address_poste, $res_file_log_poste, $res_file_rapport_poste, $res_date_modification_poste, $res_flag_poste, $res_uuid_poste, $res_nb_appli, $res_nb_appli_installed);
mysqli_stmt_store_result($query);
$num_rows = mysqli_stmt_num_rows($query);
$tab = array();
if ($num_rows != 0) {
while (mysqli_stmt_fetch($query))
{
$tab[strtolower($res_nom_poste)] = array(
"id" => $res_id_poste,
"nom_poste" => strtolower($res_nom_poste),
"OS_poste" => $res_OS_poste,
"date_rapport_poste" => $res_date_rapport_poste,
"IP_poste" => $res_ip_poste,
"mac_address_poste" => $res_mac_address_poste,
"file_log_poste" => $res_file_log_poste,
"file_rapport_poste" => $res_file_rapport_poste,
"date_modification_poste" => $res_date_modification_poste,
"uuid_poste" => $res_uuid_poste,
"flag_poste" => $res_flag_poste,
"nb_appli_installed" => $res_nb_appli_installed,
"nb_appli" => $res_nb_appli
);
}
}
mysqli_stmt_close($query);
deconnexion_db_wpkg($wpkg_link);
return $tab;
}
$liste_poste=maintenance_liste_poste($config,$get_flag,$get_uuid);
$tri_poste = array();
......
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