- if (preg_match("/^système.*virtu.l/i", $data['sname'])) {
- $nb_virtuels_total += $data['count'];
- } elseif (preg_match("/^réserv.*serveur.*test/i", $data['sname'])) {
- $nb_serveurs_total += $data['count'];
- } elseif (preg_match("/^attrib.*serveur.*production/i", $data['sname'])) {
- $nb_serveurs_total += $data['count'];
- $nb_serveurs_prod += $data['count'];
- } elseif (preg_match("/^réserv.*poste.*mission/i", $data['sname'])) {
- $nb_internes_total += $data['count'];
- } elseif (preg_match("/^attrib.*poste.*interne/i", $data['sname'])) {
- $nb_internes_total += $data['count'];
- $nb_internes_prod += $data['count'];
- } elseif (preg_match("/^réserv.*poste.*stock/i", $data['sname'])) {
- $nb_publics_total += $data['count'];
- } elseif (preg_match("/^attrib.*poste.*public/i", $data['sname'])) {
- $nb_publics_total += $data['count'];
- $nb_publics_prod += $data['count'];
- } elseif (preg_match("/^sortie/i", $data['sname'])) {
- // on ne compte pas les sorties d'inventaire
- } else {
- $nb_autres_total += $data['count'];
+ // on ne compte pas les sorties d'inventaire
+ if (preg_match("/^sortie/i", $data['sname'])) {
+ continue;
+ }
+ // serveurs
+ if (preg_match("/^infra/i", $data['categorie'])) {
+ $nb_serveurs_total++;
+ if (preg_match("/^production/i", $data['utilisation']) &&
+ !preg_match("/panne/i", $data['sname']) ) {
+ $nb_serveurs_prod++;
+ }
+ }
+ // postes internes
+ elseif (preg_match("/^poste.*interne/i", $data['categorie'])) {
+ $nb_internes_total++;
+ if (preg_match("/^production/i", $data['utilisation']) &&
+ !preg_match("/panne/i", $data['sname']) ) {
+ $nb_internes_prod++;
+ }
+ }
+ // postes publics
+ elseif (preg_match("/^poste.*public/i", $data['categorie'])) {
+ $nb_publics_total++;
+ if (preg_match("/^production/i", $data['utilisation']) &&
+ !preg_match("/panne/i", $data['sname']) ) {
+ $nb_publics_prod++;
+ }
+ }
+ // autres
+ else {
+ // machines virtuelles
+ if ($data['virtuel']) {
+ $nb_virtuels_total++;
+ // autres
+ } else {
+ $nb_autres_total++;
+ }