Commit 31e78466 authored by Laurent Joly's avatar Laurent Joly
Browse files

maintenance_gestion_sql.php nouvelle page

parent 71e38f00
<?php
/**
* Maintenance gestion de la base sql
* @Projet LCS / SambaEdu
* @auteurs Laurent Joly
* @note
* @Licence Distribue sous la licence GPL
*/
// loading libs and init
include "entete.inc.php";
include "ihm.inc.php";
include "wpkg_lib.php";
include "wpkg_libsql.php";
$login = isauth();
if (! $login) {
echo "<script language=\"JavaScript\" type=\"text/javascript\">\n<!--\n";
$request = '/wpkg/index.php';
echo "top.location.href = '/auth.php?request=" . rawurlencode($request) . "';\n";
echo "//-->\n</script>\n";
exit();
}
if (! have_right($config, "computer_is_admin"))
die(gettext("Vous n'avez pas les droits suffisants pour acc&#233;der &#224; cette fonction") . "</BODY></HTML>");
// HTMLpurifier
$conf = HTMLPurifier_Config::createDefault();
$purifier = new HTMLPurifier($conf);
$page_id=2;
include("maintenance_top.php");
function maintenance_sql_info_postes($config)
{
$wpkg_link = connexion_db_wpkg($config);
$query = mysqli_prepare($wpkg_link, "SELECT count(*) as nb FROM `postes`");
mysqli_stmt_execute($query);
mysqli_stmt_bind_result($query, $res_nb);
mysqli_stmt_store_result($query);
mysqli_stmt_fetch($query);
$tab = array("nb"=>$res_nb);
mysqli_stmt_close($query);
deconnexion_db_wpkg($wpkg_link);
return $tab;
}
function maintenance_sql_info_poste_app($config)
{
$wpkg_link = connexion_db_wpkg($config);
$query = mysqli_prepare($wpkg_link, "SELECT count(*) as nb, count(distinct id_poste) as nb_postes, count(distinct id_app) as nb_appli FROM `poste_app`");
mysqli_stmt_execute($query);
mysqli_stmt_bind_result($query, $res_nb,$res_nb_postes,$res_nb_appli);
mysqli_stmt_store_result($query);
mysqli_stmt_fetch($query);
$tab = array("nb"=>$res_nb,"nb_postes"=>$res_nb_postes,"nb_appli"=>$res_nb_appli);
mysqli_stmt_close($query);
deconnexion_db_wpkg($wpkg_link);
return $tab;
}
function maintenance_sql_info_parc_profile($config)
{
$wpkg_link = connexion_db_wpkg($config);
$query = mysqli_prepare($wpkg_link, "SELECT count(*) as nb, count(distinct id_poste) as nb_postes, count(distinct id_parc) as nb_parcs FROM `parc_profile`");
mysqli_stmt_execute($query);
mysqli_stmt_bind_result($query, $res_nb,$res_nb_postes,$res_nb_parcs);
mysqli_stmt_store_result($query);
mysqli_stmt_fetch($query);
$tab = array("nb"=>$res_nb,"nb_postes"=>$res_nb_postes,"nb_parcs"=>$res_nb_parcs);
mysqli_stmt_close($query);
deconnexion_db_wpkg($wpkg_link);
return $tab;
}
function maintenance_sql_info_parc($config)
{
$wpkg_link = connexion_db_wpkg($config);
$query = mysqli_prepare($wpkg_link, "SELECT count(*) as nb FROM `parc`");
mysqli_stmt_execute($query);
mysqli_stmt_bind_result($query, $res_nb);
mysqli_stmt_store_result($query);
mysqli_stmt_fetch($query);
$tab = array("nb"=>$res_nb);
mysqli_stmt_close($query);
deconnexion_db_wpkg($wpkg_link);
return $tab;
}
function maintenance_sql_info_journal_app($config)
{
$wpkg_link = connexion_db_wpkg($config);
$query = mysqli_prepare($wpkg_link, "SELECT count(*) as nb, count(distinct id_app) as nb_appli FROM `journal_app`");
mysqli_stmt_execute($query);
mysqli_stmt_bind_result($query, $res_nb,$res_nb_appli);
mysqli_stmt_store_result($query);
mysqli_stmt_fetch($query);
$tab = array("nb"=>$res_nb,"nb_appli"=>$res_nb_appli);
mysqli_stmt_close($query);
deconnexion_db_wpkg($wpkg_link);
return $tab;
}
function maintenance_sql_info_depot_applications($config)
{
$wpkg_link = connexion_db_wpkg($config);
$query = mysqli_prepare($wpkg_link, "SELECT count(*) as nb, count(distinct MD5(id_nom_app)) as nb_appli, count(distinct id_depot) as nb_depots FROM `depot_applications`");
mysqli_stmt_execute($query);
mysqli_stmt_bind_result($query, $res_nb,$res_nb_appli,$res_nb_depots);
mysqli_stmt_store_result($query);
mysqli_stmt_fetch($query);
$tab = array("nb"=>$res_nb,"nb_depots"=>$res_nb_depots,"nb_appli"=>$res_nb_appli);
mysqli_stmt_close($query);
deconnexion_db_wpkg($wpkg_link);
return $tab;
}
function maintenance_sql_info_depot($config)
{
$wpkg_link = connexion_db_wpkg($config);
$query = mysqli_prepare($wpkg_link, "SELECT count(*) as nb FROM `depot`");
mysqli_stmt_execute($query);
mysqli_stmt_bind_result($query, $res_nb);
mysqli_stmt_store_result($query);
mysqli_stmt_fetch($query);
$tab = array("nb"=>$res_nb);
mysqli_stmt_close($query);
deconnexion_db_wpkg($wpkg_link);
return $tab;
}
function maintenance_sql_info_dependance($config)
{
$wpkg_link = connexion_db_wpkg($config);
$query = mysqli_prepare($wpkg_link, "SELECT count(*) as nb, count(distinct id_app) as nb_appli, count(distinct id_app_requise) as nb_app_requises FROM `dependance`");
mysqli_stmt_execute($query);
mysqli_stmt_bind_result($query, $res_nb,$res_nb_appli,$res_nb_app_requises);
mysqli_stmt_store_result($query);
mysqli_stmt_fetch($query);
$tab = array("nb"=>$res_nb,"nb_appli"=>$res_nb_appli,"nb_appli_requises"=>$res_nb_app_requises);
mysqli_stmt_close($query);
deconnexion_db_wpkg($wpkg_link);
return $tab;
}
function maintenance_sql_info_applications_profile($config)
{
$wpkg_link = connexion_db_wpkg($config);
$query = mysqli_prepare($wpkg_link, "SELECT count(*) as nb, count(distinct id_appli) as nb_appli, count(distinct id_entite, type_entite) as nb_appareils FROM `applications_profile`");
mysqli_stmt_execute($query);
mysqli_stmt_bind_result($query, $res_nb,$res_nb_appli,$res_nb_appareils);
mysqli_stmt_store_result($query);
mysqli_stmt_fetch($query);
$tab = array("nb"=>$res_nb,"nb_appareils"=>$res_nb_appareils,"nb_appli"=>$res_nb_appli);
mysqli_stmt_close($query);
deconnexion_db_wpkg($wpkg_link);
return $tab;
}function maintenance_sql_info_applications($config)
{
$wpkg_link = connexion_db_wpkg($config);
$query = mysqli_prepare($wpkg_link, "SELECT count(*) as nb, count(distinct MD5(id_nom_app)) as nb_appli FROM `applications`");
mysqli_stmt_execute($query);
mysqli_stmt_bind_result($query, $res_nb,$res_nb_appli);
mysqli_stmt_store_result($query);
mysqli_stmt_fetch($query);
$tab = array("nb"=>$res_nb,"nb_appli"=>$res_nb_appli);
mysqli_stmt_close($query);
deconnexion_db_wpkg($wpkg_link);
return $tab;
}
echo "Table postes : <br />";
$stat_sql_postes=maintenance_sql_info_postes($config);
echo "Nombre total d'entrées : ".number_format($stat_sql_postes["nb"], 0, ',', ' ')."<br />";
echo "<br />";
echo "Table poste_app : <br />";
$stat_sql_poste_app=maintenance_sql_info_poste_app($config);
echo "Nombre total d'entrées : ".number_format($stat_sql_poste_app["nb"], 0, ',', ' ')."<br />";
echo "Nombre total de postes : ".number_format($stat_sql_poste_app["nb_postes"], 0, ',', ' ')."<br />";
echo "Nombre total d'applications : ".number_format($stat_sql_poste_app["nb_appli"], 0, ',', ' ')."<br />";
echo "<br />";
echo "Table parc_profile : <br />";
$stat_sql_parc_profile=maintenance_sql_info_parc_profile($config);
echo "Nombre total d'entrées : ".number_format($stat_sql_parc_profile["nb"], 0, ',', ' ')."<br />";
echo "Nombre total de postes : ".number_format($stat_sql_parc_profile["nb_postes"], 0, ',', ' ')."<br />";
echo "Nombre total de parcs : ".number_format($stat_sql_parc_profile["nb_parcs"], 0, ',', ' ')."<br />";
echo "<br />";
echo "Table parc : <br />";
$stat_sql_parc=maintenance_sql_info_parc($config);
echo "Nombre total d'entrées : ".number_format($stat_sql_parc["nb"], 0, ',', ' ')."<br />";
echo "<br />";
echo "Table journal_app : <br />";
$stat_sql_journal_app=maintenance_sql_info_journal_app($config);
echo "Nombre total d'entrées : ".number_format($stat_sql_journal_app["nb"], 0, ',', ' ')."<br />";
echo "Nombre total d'applications : ".number_format($stat_sql_journal_app["nb_appli"], 0, ',', ' ')."<br />";
echo "<br />";
echo "Table depot_applications : <br />";
$stat_sql_depot_applications=maintenance_sql_info_depot_applications($config);
echo "Nombre total d'entrées : ".number_format($stat_sql_depot_applications["nb"], 0, ',', ' ')."<br />";
echo "Nombre total d'applications : ".number_format($stat_sql_depot_applications["nb_appli"], 0, ',', ' ')."<br />";
echo "Nombre total de dépôts : ".number_format($stat_sql_depot_applications["nb_depots"], 0, ',', ' ')."<br />";
echo "<br />";
echo "Table depot : <br />";
$stat_sql_depot=maintenance_sql_info_depot($config);
echo "Nombre total d'entrées : ".number_format($stat_sql_depot["nb"], 0, ',', ' ')."<br />";
echo "<br />";
echo "Table dependance : <br />";
$stat_sql_dependance=maintenance_sql_info_dependance($config);
echo "Nombre total d'entrées : ".number_format($stat_sql_dependance["nb"], 0, ',', ' ')."<br />";
echo "Nombre total d'applications : ".number_format($stat_sql_dependance["nb_appli"], 0, ',', ' ')."<br />";
echo "Nombre total d'applications requises : ".number_format($stat_sql_dependance["nb_appli_requises"], 0, ',', ' ')."<br />";
echo "<br />";
echo "Table applications_profile : <br />";
$stat_sql_applications_profile=maintenance_sql_info_applications_profile($config);
echo "Nombre total d'entrées : ".number_format($stat_sql_applications_profile["nb"], 0, ',', ' ')."<br />";
echo "Nombre total d'appareils : ".number_format($stat_sql_applications_profile["nb_appareils"], 0, ',', ' ')."<br />";
echo "Nombre total d'applications : ".number_format($stat_sql_applications_profile["nb_appli"], 0, ',', ' ')."<br />";
echo "<br />";
echo "Table applications : <br />";
$stat_sql_applications=maintenance_sql_info_applications($config);
echo "Nombre total d'entrées : ".number_format($stat_sql_applications["nb"], 0, ',', ' ')."<br />";
echo "Nombre total d'applications : ".number_format($stat_sql_applications["nb_appli"], 0, ',', ' ')."<br />";
echo "<br />";
include ("pdp.inc.php");
?>
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