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
ee4de7a9
Commit
ee4de7a9
authored
Feb 08, 2022
by
Laurent Joly
Browse files
maintenance_gestion_poste.php
page en place pour la consultation
parent
809888c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
sources/var/www/sambaedu/wpkg/maintenance_gestion_poste.php
View file @
ee4de7a9
<?php
/**
* Maintenance
g
es
t
ion des postes
* Maintenance
suppr
es
s
ion 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
)
{
...
...
@@ -260,7 +309,7 @@ foreach ($liste_poste as $nom_poste => $lp)
echo
"</td>"
;
echo
"<td align='center'>"
.
$lp
[
"nb_appli"
]
.
"</td>"
;
echo
"<td align='center'>"
.
$lp
[
"nb_appli_installed"
]
.
"</td>"
;
$rapport_date
=
date
(
'd/m/Y'
,
strtotime
(
$lp
[
"date_modification_poste"
]));
$rapport_date
=
date
(
'd/m/Y'
,
strtotime
(
$lp
[
"date_modification_poste"
]));
$rapport_time
=
date
(
'H:i:s'
,
strtotime
(
$lp
[
"date_modification_poste"
]));
echo
"<td align='center'><a href='log.php?logfile="
.
$lp
[
"file_rapport_poste"
]
.
"' target='rapport_poste' style='color: "
.
$lnk
.
"'>"
.
$rapport_date
.
" à "
.
$rapport_time
.
"</a></td>"
;
echo
"<td align='center'>"
.
$lp
[
"IP_poste"
]
.
"</td>"
;
...
...
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