".__("divers")." -> ".__("tarif"); if(!isset($premier)) $premier=''; if(!isset($tricolsf)) $tricolsf=''; if(!isset($premiersf)) $premiersf=''; if(!isset($selection)) $selection=''; if(!isset($retourformulaire)) $retourformulaire=''; if (!isset($idxformulaire)) { $idxformulaire = ''; } if (!isset($tricol)) { $tricol = ''; } if (!isset($valide)) { $valide = ''; } // FROM $table = DB_PREFIXE."tarif LEFT JOIN ".DB_PREFIXE."om_collectivite ON tarif.om_collectivite=om_collectivite.om_collectivite LEFT JOIN ".DB_PREFIXE."sepulture_type ON tarif.sepulture_type=sepulture_type.sepulture_type "; // SELECT $champAffiche = array( 'tarif.tarif as "'.__("tarif").'"', 'tarif.annee as "'.__("annee").'"', 'tarif.origine as "'.__("origine").'"', 'tarif.terme as "'.__("terme").'"', 'tarif.duree as "'.__("duree").'"', 'tarif.nature as "'.__("nature").'"', 'sepulture_type.libelle as "'.__("sepulture_type").'"', 'tarif.montant as "'.__("montant").'"', 'tarif.monnaie as "'.__("monnaie").'"', ); // if ($_SESSION['niveau'] == '2') { array_push($champAffiche, "om_collectivite.libelle as \"".__("collectivite")."\""); } // $champNonAffiche = array( 'tarif.om_collectivite as "'.__("om_collectivite").'"', ); // $champRecherche = array( 'tarif.tarif as "'.__("tarif").'"', 'tarif.annee as "'.__("annee").'"', 'tarif.origine as "'.__("origine").'"', 'tarif.terme as "'.__("terme").'"', 'tarif.duree as "'.__("duree").'"', 'tarif.nature as "'.__("nature").'"', 'sepulture_type.libelle as "'.__("sepulture_type").'"', 'tarif.montant as "'.__("montant").'"', 'tarif.monnaie as "'.__("monnaie").'"', ); // if ($_SESSION['niveau'] == '2') { array_push($champRecherche, "om_collectivite.libelle as \"".__("collectivite")."\""); } $tri="ORDER BY tarif.annee ASC NULLS LAST"; $edition="tarif"; /** * Gestion de la clause WHERE => $selection */ // Filtre listing standard if ($_SESSION["niveau"] == "2") { // Filtre MULTI $selection = ""; } else { // Filtre MONO $selection = " WHERE (tarif.om_collectivite = '".$_SESSION["collectivite"]."') "; } // Liste des clés étrangères avec leurs éventuelles surcharges $foreign_keys_extended = array( "om_collectivite" => array("om_collectivite", ), "sepulture_type" => array("sepulture_type", ), ); // Filtre listing sous formulaire - om_collectivite if (in_array($retourformulaire, $foreign_keys_extended["om_collectivite"])) { if ($_SESSION["niveau"] == "2") { // Filtre MULTI $selection = " WHERE (tarif.om_collectivite = ".intval($idxformulaire).") "; } else { // Filtre MONO $selection = " WHERE (tarif.om_collectivite = '".$_SESSION["collectivite"]."') AND (tarif.om_collectivite = ".intval($idxformulaire).") "; } } // Filtre listing sous formulaire - sepulture_type if (in_array($retourformulaire, $foreign_keys_extended["sepulture_type"])) { if ($_SESSION["niveau"] == "2") { // Filtre MULTI $selection = " WHERE (tarif.sepulture_type = ".intval($idxformulaire).") "; } else { // Filtre MONO $selection = " WHERE (tarif.om_collectivite = '".$_SESSION["collectivite"]."') AND (tarif.sepulture_type = ".intval($idxformulaire).") "; } }