Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 1185 → Rev 1186

/trunk/client/bottin/bibliotheque/annuaire.fonct.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: annuaire.fonct.php,v 1.4 2006-04-10 14:01:36 florian Exp $
// CVS : $Id: annuaire.fonct.php,v 1.5 2007-01-04 16:34:31 alexandre_tb Exp $
/**
* Fonctions du module annuaire
*
31,7 → 31,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.4 $
*@version $Revision: 1.5 $
// +------------------------------------------------------------------------------------------------------+
*/
 
97,11 → 97,15
'</tr>'."\n" );
$squelette->setElementTemplate( '<tr>'."\n".'<td colspan=2 style="padding:5px;">{label}{element}</td>'."\n".'</tr>'."\n", 'bouton_rechercher');
$option_type=array ('0' => INS_PERSONNES_OU_STRUCTURES,
'1' => INS_PERSONNES,
'2' => INS_STRUCTURES);
$form->addElement('select', 'nom_type', INS_JE_RECHERCHE, $option_type);
// La liste deroulante pour choisir entre structure et individus
// uniquement si la constante INS_FORMULAIRE_STRUCTURE vaut 1
if (INS_FORMULAIRE_STRUCTURE == 1) {
$option_type=array ('0' => INS_PERSONNES_OU_STRUCTURES,
'1' => INS_PERSONNES,
'2' => INS_STRUCTURES);
$form->addElement('select', 'nom_type', INS_JE_RECHERCHE, $option_type);
}
//requete pour recuperer la liste des pays
$requete = 'SELECT '.INS_CHAMPS_ID_PAYS.', '.INS_CHAMPS_LABEL_PAYS.' FROM '.INS_TABLE_PAYS.' WHERE '.INS_CHAMPS_I18N_PAYS.'="fr-FR"';
$resultat = $GLOBALS['ins_db']->query($requete) ;
137,6 → 141,11
//affichage du formulaire
$res .=$form->toHtml();
include_once INS_CHEMIN_APPLI.'/bibliotheque/bottin.class.php';
// On ajoute la liste des lettres cliquables
$lettre = new lettresAlphabet($GLOBALS['ins_url']) ;
$res .= $lettre->toHMTL();
//on teste si l'on affiche le resultat de la recherche ou
if (isset($_POST['nom_type'])) {
$requete = 'SELECT '.INS_CHAMPS_ID.', '.INS_CHAMPS_NOM.', '.INS_CHAMPS_PRENOM.', '.INS_CHAMPS_VILLE.', '.INS_CHAMPS_CODE_POSTAL;
176,6 → 185,9
' OR '.INS_CHAMPS_SIGLE_STRUCTURE.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
' OR '.INS_CHAMPS_DESCRIPTION.' LIKE "%'.$_POST['nom_annuaire'].'%") ';
}
if (isset($_GET['lettre'])) {
$requete .= 'AND '.INS_CHAMPS_NOM.'like "'.$_GET['lettre'].'%"';
}
if (!$req_where) $requete .= '1';
$requete .=' ORDER BY '.INS_CHAMPS_NOM;
$resultat = $GLOBALS['ins_db']->query($requete);
293,6 → 305,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.4 2006/04/10 14:01:36 florian
* uniformisation de l'appli bottin: plus qu'un fichier de fonctions
*
* Revision 1.3 2006/04/04 12:23:05 florian
* modifs affichage fiches, généricité de la carto, modification totale de l'appli annuaire
*