2, 'Filters' => array( array('Field' => $Field_List, 'Label'=>'Recherche', 'Type'=>'Find' , 'Width' => 200, 'Var' => 'Find' , 'Quot'=>1, 'Fill' => ''), array('Field' => 'Valide' , 'Label'=>'Etat' , 'Type'=>'Combo', 'Width' => 100, 'Var' => 'CB_Valide', 'Quot'=>1, 'Fill' => $Tab_Etats), ), ); // Paramètres des champs $Fields = array( array('Field'=>'ID_tilisateur', 'Label'=>'ID' , 'Align'=>'center', 'Type'=>'Text' , 'Width' => 50), array('Field'=>'EntPart' , 'Label'=>'Type' , 'Align'=>'left' , 'Type'=>'Text' , 'Width' => 50), array('Field'=>'Valide' , 'Label'=>'Valide' , 'Align'=>'center', 'Type'=>'YesNo', 'Width' => 50), array('Field'=>'NomPrenom' , 'Label'=>'Nom' , 'Align'=>'left' , 'Type'=>'Func' , 'Width' => 150 , 'Func'=>'F_Lien'), array('Field'=>'Nom_societe' , 'Label'=>'Société', 'Align'=>'center', 'Type'=>'Text' , 'Width' => 100), array('Field'=>'Tel' , 'Label'=>'Tel' , 'Align'=>'center', 'Type'=>'Tel' , 'Width' => 110), array('Field'=>'Fax' , 'Label'=>'Fax' , 'Align'=>'center', 'Type'=>'Tel' , 'Width' => 110), array('Field'=>'Email' , 'Label'=>'Email' , 'Align'=>'center', 'Type'=>'Email', 'Width' => 100), array('Field'=>'Code_postal' , 'Label'=>'CP' , 'Align'=>'center', 'Type'=>'Text' , 'Width' => 50), array('Field'=>'Ville' , 'Label'=>'Ville' , 'Align'=>'center', 'Type'=>'Text' , 'Width' => 100), ); // Fonction 1 : Lien sur l'utilisateur function F_Lien($records) { GLOBAL $CB_Valide, $Find; $ID = $records["ID_Utilisateur"]; $NomPrenom = $records["NomPrenom"]; // Lien d'accès à la fiche de l'utilisateur $Lien = "index.php?ID=$ID&Find=$Find&CB_Valide=$CB_Valide"; return '' . $NomPrenom . ''; } // Paramètres de la table à afficher $Table = array('Link' => '', 'Title' => "Utilisateurs", 'Icon' => $ROOT . _ICODEF, 'NbLines' => 20, 'NumLine' => true, 'ButtonNew' => 'Nouvel utilisateur', 'LinkNew' => "&BNew=1", 'Order' => 'Nom', 'Sense' => 'ASC', 'Output' => 'Echo', 'Fields' => $Fields, 'Filters' => $Filters, 'Params' => NULL, // Fonctions (Rapports) 'FuncHeader'=> Header(), 'FuncFooter'=> Footer(), 'FuncLink' => "", 'Functions' => 'Print_HTML,Export_CSV', ); // Inclusion de l'affichage de la table sous forme de tableau include ($ROOT . _LIBS_PATH . "DB_Table.inc"); } // Si un utilisateur a été sélectionné, affichage du formulaire d'édition if (isset($_REQUEST['ID']) || $Insertion) { if (!$Insertion) $ID = $_REQUEST['ID']; else $ID = 0; // mode affichage par défaut if ($Insertion) $Mode = 'I'; else $Mode = 'A'; // Paramètres des champs $Fields = array( array('Field'=>'' , 'Label'=>'Utilisateur' , 'Type'=>'Para' , 'Icon'=>'../IMAGES/Gribou.gif'), array('Field'=>'EntPart' , 'Label'=>'Type' , 'Type'=>'ComboS' , 'Cols'=> 1, 'Fill'=>$Tab_EntPart), array('Field'=>'Valide' , 'Label'=>'Valide' , 'Type'=>'Check' , 'Cols'=> 1, 'Tag' =>''), array('Field'=>'Login' , 'Label'=>'Identifiant' , 'Type'=>'Text' , 'Cols'=> 1, 'Tag' =>'size = "30"'), array('Field'=>'Password' , 'Label'=>'Mot de passe' , 'Type'=>'Passwd' , 'Cols'=> 1, 'Tag' =>'size = "30"'), array('Field'=>'Titre' , 'Label'=>'Titre' , 'Type'=>'ComboS' , 'Cols'=> 1, 'Fill'=>$Tab_Titres), array('Field'=>'Prenom' , 'Label'=>'Prénom' , 'Type'=>'Text' , 'Cols'=> 1, 'Tag' =>'size = "30"'), array('Field'=>'Nom' , 'Label'=>'Nom' , 'Type'=>'Text' , 'Cols'=> 1, 'Tag' =>'size = "30"'), array('Field'=>'Tel' , 'Label'=>'Téléphone 1' , 'Type'=>'Text' , 'Cols'=> 1, 'Tag' =>'size = "30"'), array('Field'=>'Fax' , 'Label'=>'Fax' , 'Type'=>'Text' , 'Cols'=> 1, 'Tag' =>'size = "20"'), array('Field'=>'Tel_2' , 'Label'=>'Téléphone 2' , 'Type'=>'Text' , 'Cols'=> 1, 'Tag' =>'size = "20"'), array('Field'=>'Adresse' , 'Label'=>'Adresse' , 'Type'=>'Text' , 'Cols'=> 1, 'Tag' =>'size = "30"'), array('Field'=>'Code_postal' , 'Label'=>'Code Postal' , 'Type'=>'Text' , 'Cols'=> 1, 'Tag' =>'size = "5" maxlength = "5"'), array('Field'=>'Ville' , 'Label'=>'Ville' , 'Type'=>'Text' , 'Cols'=> 1, 'Tag' =>'size = "30"'), array('Field'=>'Pays' , 'Label'=>'Pays' , 'Type'=>'Text' , 'Cols'=> 1, 'Tag' =>'size = "30"'), array('Field'=>'Email' , 'Label'=>'Email 1' , 'Type'=>'Text' , 'Cols'=> 1, 'Tag' =>'size = "50"'), array('Field'=>'Fonction' , 'Label'=>'Fonction' , 'Type'=>'Text' , 'Cols'=> 1, 'Tag' =>'size = "30"'), array('Field'=>'' , 'Label'=>'Société' , 'Type'=>'Para' , 'Icon'=>'../IMAGES/Gribou.gif'), array('Field'=>'Nom_societe' , 'Label'=>'Societé' , 'Type'=>'Text' , 'Cols'=> 1, 'Tag' =>'size = "50"'), array('Field'=>'TVA_Intra' , 'Label'=>'TVA Intracomm.' , 'Type'=>'Text' , 'Cols'=> 1, 'Tag' =>'size = "20"'), array('Field'=>'Siret' , 'Label'=>'Siret ' , 'Type'=>'Text' , 'Cols'=> 2, 'Tag' =>'size = "30" maxlength = "14"'), array('Field'=>'' , 'Label'=>'Informations' , 'Type'=>'Para' , 'Icon'=>'../IMAGES/Gribou.gif'), array('Field'=>'Commentaire' , 'Label'=>'Commentaire' , 'Type'=>'Area' , 'Cols'=> 2, 'Tag' =>'rows="4" cols="120"'), ); // Paramètres des tests d'intégrité $Checks = array( array('Field'=>'EntPart' , 'Type'=>'NotEmpty') , array('Field'=>'Password' , 'Type'=>'NotEmpty') , array('Field'=>'Titre' , 'Type'=>'NotEmpty') , array('Field'=>'Prenom' , 'Type'=>'NotEmpty') , array('Field'=>'Nom' , 'Type'=>'NotEmpty') , array('Field'=>'Tel' , 'Type'=>'NotEmpty') , array('Field'=>'Email' , 'Type'=>'NotEmpty') , array('Field'=>'Adresse' , 'Type'=>'NotEmpty') , array('Field'=>'Code_postal' , 'Type'=>'Len_Num' , 'Param' => 5), array('Field'=>'Ville' , 'Type'=>'NotEmpty') , array('Field'=>'Pays' , 'Type'=>'NotEmpty') , ); // Si Insertion, Test du login if ($Insertion) $Checks[] = array('Field'=>'Login', 'Type'=>'NotExists'); else $Checks[] = array('Field'=>'Login', 'Type'=>'NotEmpty'); // Si l'utilisateur est une société if (isset($_REQUEST['EntPart']) && ($_REQUEST['EntPart'] == 'Ent')) { $Checks[] = array('Field'=>'Nom_societe', 'Type'=>'NotEmpty'); } // Si une suppression est demandée, Aucun test ne sera effectué if (isset($_REQUEST['BDelete'])) $Checks = NULL; // Paramètres à garder $Params = array('Find', 'CB_Valide'); if ($Insertion) $Params[] = 'BNew'; // Paramètres de la table à afficher $Edit = array( 'Link' => '', 'Valid' => 'Valider', 'Modify' => 'Modifier', 'Cancel' => 'Annuler', 'Return' => "", 'Delete' => 'Supprimer', 'TableName' => 'utilisateur', 'IndexName' => 'ID_Utilisateur', 'IndexValue' => $ID, 'Mode' => $Mode, 'Title' => "Modification d'un profil", 'Icon' => $ROOT . _ICODEF, 'NbCols' => 2, 'Output' => 'Echo', 'Fields' => $Fields, 'Checks' => $Checks, 'Params' => $Params, ); // Inclusion de l'affichage du formulaire include ($ROOT . _LIBS_PATH . "DB_Edit.inc"); } ?>