".__("divers")." -> ".__("entreprise"); 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."entreprise LEFT JOIN ".DB_PREFIXE."om_collectivite ON entreprise.om_collectivite=om_collectivite.om_collectivite "; // SELECT $champAffiche = array( 'entreprise.entreprise as "'.__("entreprise").'"', 'entreprise.nomentreprise as "'.__("nomentreprise").'"', 'entreprise.pf as "'.__("pf").'"', 'entreprise.adresse1 as "'.__("adresse1").'"', 'entreprise.adresse2 as "'.__("adresse2").'"', 'entreprise.cp as "'.__("cp").'"', 'entreprise.ville as "'.__("ville").'"', 'entreprise.telephone as "'.__("telephone").'"', 'entreprise.courriel as "'.__("courriel").'"', 'entreprise.numero_habilitation as "'.__("numero_habilitation").'"', 'to_char(entreprise.date_fin_validite_habilitation ,\'DD/MM/YYYY\') as "'.__("date_fin_validite_habilitation").'"', ); // if ($_SESSION['niveau'] == '2') { array_push($champAffiche, "om_collectivite.libelle as \"".__("collectivite")."\""); } // $champNonAffiche = array( 'entreprise.om_collectivite as "'.__("om_collectivite").'"', ); // $champRecherche = array( 'entreprise.entreprise as "'.__("entreprise").'"', 'entreprise.nomentreprise as "'.__("nomentreprise").'"', 'entreprise.pf as "'.__("pf").'"', 'entreprise.adresse1 as "'.__("adresse1").'"', 'entreprise.adresse2 as "'.__("adresse2").'"', 'entreprise.cp as "'.__("cp").'"', 'entreprise.ville as "'.__("ville").'"', 'entreprise.telephone as "'.__("telephone").'"', 'entreprise.courriel as "'.__("courriel").'"', 'entreprise.numero_habilitation as "'.__("numero_habilitation").'"', ); // if ($_SESSION['niveau'] == '2') { array_push($champRecherche, "om_collectivite.libelle as \"".__("collectivite")."\""); } $tri="ORDER BY entreprise.nomentreprise ASC NULLS LAST"; $edition="entreprise"; /** * Gestion de la clause WHERE => $selection */ // Filtre listing standard if ($_SESSION["niveau"] == "2") { // Filtre MULTI $selection = ""; } else { // Filtre MONO $selection = " WHERE (entreprise.om_collectivite = '".$_SESSION["collectivite"]."') "; } // Liste des clés étrangères avec leurs éventuelles surcharges $foreign_keys_extended = array( "om_collectivite" => array("om_collectivite", ), ); // Filtre listing sous formulaire - om_collectivite if (in_array($retourformulaire, $foreign_keys_extended["om_collectivite"])) { if ($_SESSION["niveau"] == "2") { // Filtre MULTI $selection = " WHERE (entreprise.om_collectivite = ".intval($idxformulaire).") "; } else { // Filtre MONO $selection = " WHERE (entreprise.om_collectivite = '".$_SESSION["collectivite"]."') AND (entreprise.om_collectivite = ".intval($idxformulaire).") "; } } /** * Gestion SOUSFORMULAIRE => $sousformulaire */ $sousformulaire = array( //'travaux', );