Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
SambaEdu
sambaedu-wpkg
Commits
1545de34
Commit
1545de34
authored
Feb 09, 2022
by
Laurent Joly
Browse files
Update maintenance_gestion_sql.php
parent
5148ea93
Changes
1
Hide whitespace changes
Inline
Side-by-side
sources/var/www/sambaedu/wpkg/maintenance_gestion_sql.php
View file @
1545de34
...
...
@@ -167,7 +167,7 @@ function maintenance_sql_info_applications($config)
function
maintenance_sql_orphelin_poste_app
(
$config
)
{
$wpkg_link
=
connexion_db_wpkg
(
$config
);
$query
=
mysqli_prepare
(
$wpkg_link
,
"SELECT count(
*
) as nb
$query
=
mysqli_prepare
(
$wpkg_link
,
"SELECT count(
distinct id_poste_rapport
) as nb
FROM (`poste_app` pa)
LEFT JOIN (`postes` p) ON p.id_poste=pa.id_poste
LEFT JOIN (`applications` a) ON a.id_app=pa.id_app
...
...
@@ -193,6 +193,24 @@ function maintenance_sql_doublon_poste_app($config)
deconnexion_db_wpkg
(
$wpkg_link
);
return
$tab
;
}
function
maintenance_sql_orphelin_parc_profile
(
$config
)
{
$wpkg_link
=
connexion_db_wpkg
(
$config
);
$query
=
mysqli_prepare
(
$wpkg_link
,
"SELECT count(distinct id_parc_profile) as nb
FROM (`parc_profile` pp)
LEFT JOIN (`postes` po) ON po.id_poste=pp.id_poste
LEFT JOIN (`parc` pa) ON pp.id_parc=pa.id_parc
WHERE po.id_poste is NULL or pa.id_parc is NULL"
);
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
;
}
echo
"Table postes : <br />"
;
$stat_sql_postes
=
maintenance_sql_info_postes
(
$config
);
...
...
@@ -210,9 +228,11 @@ echo "Nombre total d'entrées en double: ".number_format($stat_sql_poste_app_dou
echo
"<br />"
;
echo
"Table parc_profile : <br />"
;
$stat_sql_parc_profile
=
maintenance_sql_info_parc_profile
(
$config
);
$stat_sql_parc_profile_orphelin
=
maintenance_sql_orphelin_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
"Nombre total d'entrées orphelines: "
.
number_format
(
$stat_sql_parc_profile_orphelin
[
"nb"
],
0
,
','
,
' '
)
.
"<br />"
;
echo
"<br />"
;
echo
"Table parc : <br />"
;
$stat_sql_parc
=
maintenance_sql_info_parc
(
$config
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment