"; /** * * */ // $f->displaysubtitle(__("Nombre d'emplacements / nature")); // Récupération du nombre total d'emplacements $sql = "select count(*) as sum FROM ".DB_PREFIXE."emplacement"; $total = $f->db->getone($sql); $f->addToLog("app/widget_supervision.php: db->getone(\"".$sql."\");", VERBOSE_MODE); $f->isDatabaseError($total); // Récupération du nombre d'emplacements par nature $sql = "select nature, count(*) as sum from ".DB_PREFIXE."emplacement group by nature order by nature"; $res =& $f->db->query($sql); $f->addToLog("app/widget_supervision.php: db->query(\"".$sql."\");", VERBOSE_MODE); $f->isDatabaseError($res); // Affichage du tableau résultat echo ""; // Composition de la ligne $table_line = " "; // Compteur de ligne pour les odd/even du tableau $k = 1; // Boucle sur chaque ligne résultat while ($row =& $res->fetchrow(DB_FETCHMODE_ASSOC)) { // Affichage de la ligne printf($table_line, ($k%2 == true ? "odd": "even"), __($row["nature"]), $row["sum"]); $k++; } // Affichage d'une ligne total printf($table_line, "total", __("total"), $total); // Fermeture du tableau echo "
%s %s
"; /** * */ // $sql = "select cimetiere.cimetierelib, nature, count(*) as sum FROM ".DB_PREFIXE."emplacement LEFT JOIN ".DB_PREFIXE."voie ON emplacement.voie=voie.voie LEFT JOIN ".DB_PREFIXE."zone ON voie.zone=zone.zone LEFT JOIN ".DB_PREFIXE."cimetiere ON zone.cimetiere=cimetiere.cimetiere group by cimetiere.cimetierelib, nature order by cimetiere.cimetierelib, nature"; $res =& $f->db->query($sql); $f->addToLog("app/widget_supervision.php: db->query(\"".$sql."\");", VERBOSE_MODE); $f->isDatabaseError($res); // if ($res->numrows() != 0) { // $f->displaysubtitle(__("Nombre d'emplacements / cimetière / nature")); // echo "
"; // $cimetiere = ""; while ($row =& $res->fetchrow(DB_FETCHMODE_ASSOC)) { // if ($cimetiere != $row["cimetierelib"]) { if ($cimetiere != "") { // Fermeture du tableau echo ""; echo "
"; } // $cimetiere = $row["cimetierelib"]; // echo "

"; echo ""; // echo $row["cimetierelib"]; // echo ""; echo "

"; // echo "
"; // Affichage du tableau résultat echo ""; // Compteur de ligne pour les odd/even du tableau $k = 1; } // Affichage de la ligne printf($table_line, ($k%2 == true ? "odd": "even"), __($row["nature"]), $row["sum"]); $k++; } // Fermeture du tableau echo "
"; echo "
"; // echo ""; echo "
"; } /** * Les éléments suivants ne servent pas dans le widget mais font partie de la * supervision pour l'administrateur. Il suffit d'appeler l'url : * ../app/widget_supervision.php?more pour obtenir des informations * supplémentaires */ if (isset($_GET["more"])) { /** * * */ // $sql = "select count(*) as sum FROM ".DB_PREFIXE."dossier"; $total = $f->db->getone($sql); $f->addToLog("app/widget_supervision.php: db->getone(\"".$sql."\");", VERBOSE_MODE); $f->isDatabaseError($total); echo "

DOSSIERS => ".$total."

"; // $sql = "select dossier.typedossier, count(*) as sum FROM ".DB_PREFIXE."dossier LEFT JOIN ".DB_PREFIXE."emplacement ON dossier.emplacement=emplacement.emplacement LEFT JOIN ".DB_PREFIXE."voie ON emplacement.voie=voie.voie LEFT JOIN ".DB_PREFIXE."zone ON voie.zone=zone.zone LEFT JOIN ".DB_PREFIXE."cimetiere ON zone.cimetiere=cimetiere.cimetiere group by dossier.typedossier"; $res =& $f->db->query($sql); $res =& $f->db->query($sql); $f->addToLog("app/widget_supervision.php: db->query(\"".$sql."\");", VERBOSE_MODE); $f->isDatabaseError($res); // echo ""; echo "
"; /** * * */ // $sql = "select count(*) as sum FROM ".DB_PREFIXE."defunt"; $total = $f->db->getone($sql); $f->addToLog("app/widget_supervision.php: db->getone(\"".$sql."\");", VERBOSE_MODE); $f->isDatabaseError($total); echo "

DEFUNTS => ".$total."

"; $f->displaysubtitle(__("Nombre de défunts / cimetière / nature")); // $sql = "select cimetiere.cimetierelib, emplacement.nature, count(*) as sum FROM ".DB_PREFIXE."defunt LEFT JOIN ".DB_PREFIXE."emplacement ON defunt.emplacement=emplacement.emplacement LEFT JOIN ".DB_PREFIXE."voie ON emplacement.voie=voie.voie LEFT JOIN ".DB_PREFIXE."zone ON voie.zone=zone.zone LEFT JOIN ".DB_PREFIXE."cimetiere ON zone.cimetiere=cimetiere.cimetiere group by cimetiere.cimetierelib, emplacement.nature order by cimetiere.cimetierelib, emplacement.nature"; $res =& $f->db->query($sql); $f->addToLog("app/widget_supervision.php: db->query(\"".$sql."\");", VERBOSE_MODE); $f->isDatabaseError($res); // echo ""; echo "
"; /** * */ // $sql = "select count(*) as sum FROM ".DB_PREFIXE."autorisation"; $total = $f->db->getone($sql); $f->addToLog("app/widget_supervision.php: db->getone(\"".$sql."\");", VERBOSE_MODE); $f->isDatabaseError($total); echo "

CONTACTS => ".$total."

"; // $f->displaysubtitle(__("Nombre de contacts / cimetière / nature")); // $sql = "select cimetiere.cimetierelib, emplacement.nature, count(*) as sum FROM ".DB_PREFIXE."autorisation LEFT JOIN ".DB_PREFIXE."emplacement ON autorisation.emplacement=emplacement.emplacement LEFT JOIN ".DB_PREFIXE."voie ON emplacement.voie=voie.voie LEFT JOIN ".DB_PREFIXE."zone ON voie.zone=zone.zone LEFT JOIN ".DB_PREFIXE."cimetiere ON zone.cimetiere=cimetiere.cimetiere group by cimetiere.cimetierelib, emplacement.nature order by cimetiere.cimetierelib, emplacement.nature"; $res =& $f->db->query($sql); $f->addToLog("app/widget_supervision.php: db->query(\"".$sql."\");", VERBOSE_MODE); $f->isDatabaseError($res); // echo ""; } /** * */ // echo "\n";