Subversion Repositories Applications.papyrus

Rev

Rev 1143 | Rev 1499 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1143 Rev 1153
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: pap_menu.fonct.php,v 1.29 2006-12-12 13:32:58 jp_milcent Exp $
22
// CVS : $Id: pap_menu.fonct.php,v 1.30 2006-12-12 17:19:58 jp_milcent Exp $
23
/**
23
/**
24
* Bibliothèque de fonction sur le rendu.
24
* Bibliothèque de fonction sur le rendu.
25
*
25
*
26
* Cette bibliothèque contient des fonctions utilisé par le rendu des pages de Papyrus.
26
* Cette bibliothèque contient des fonctions utilisé par le rendu des pages de Papyrus.
27
*
27
*
Line 30... Line 30...
30
//Auteur original :
30
//Auteur original :
31
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
31
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
32
//Autres auteurs :
32
//Autres auteurs :
33
*@author        Alexandre GRANIER <alexadandre@tela-botanica.org>
33
*@author        Alexandre GRANIER <alexadandre@tela-botanica.org>
34
*@copyright     Tela-Botanica 2000-2004
34
*@copyright     Tela-Botanica 2000-2004
35
*@version       $Revision: 1.29 $ $Date: 2006-12-12 13:32:58 $
35
*@version       $Revision: 1.30 $ $Date: 2006-12-12 17:19:58 $
36
// +------------------------------------------------------------------------------------------------------+
36
// +------------------------------------------------------------------------------------------------------+
37
*/
37
*/
Line 38... Line 38...
38
 
38
 
39
// +------------------------------------------------------------------------------------------------------+
39
// +------------------------------------------------------------------------------------------------------+
Line 551... Line 551...
551
    // Recherche des informations sur les menus en fonctions des mots clés
551
    // Recherche des informations sur les menus en fonctions des mots clés
552
    $requete =  'SELECT DISTINCT * '.
552
    $requete =  'SELECT DISTINCT * '.
553
                'FROM gen_menu '.
553
                'FROM gen_menu '.
554
                'WHERE ';
554
                'WHERE ';
555
    for ($i = 0; $i < count($tab_mots); $i++) {
555
    for ($i = 0; $i < count($tab_mots); $i++) {
-
 
556
        if ($tab_mots[$i] != '') {
556
        if ($i == 0) {
557
	        if ($i == 0) {
557
            $requete .= 'gm_mots_cles LIKE "%'.$tab_mots[$i].'%" ';
558
	            $requete .= 'gm_mots_cles LIKE "%'.$tab_mots[$i].'%" ';
558
        } else {
559
	        } else {
559
            $requete .= $condition.' gm_mots_cles LIKE "%'.$tab_mots[$i].'%" ';
560
	            $requete .= $condition.' gm_mots_cles LIKE "%'.$tab_mots[$i].'%" ';
-
 
561
	        }
560
        }
562
        }
561
    }
563
    }
562
    if (count($tab_mots) != 0) $requete .= 'AND ' ;
564
    if (count($tab_mots) != 0 && $tab_cat[0] != '') {
-
 
565
    	$requete .= 'AND ' ;
-
 
566
    }
563
    for ($i = 0; $i < count($tab_cat); $i++) {
567
    for ($i = 0; $i < count($tab_cat); $i++) {
-
 
568
        if ($tab_cat[$i] != '') {
564
        if ($i == 0) {
569
	        if ($i == 0) {
565
            $requete .= 'gm_categorie LIKE "%'.$tab_cat[$i].'%" ';
570
	            $requete .= 'gm_categorie LIKE "%'.$tab_cat[$i].'%" ';
566
        } else {
571
	        } else {
567
            $requete .= $condition2.' gm_categorie LIKE "%'.$tab_cat[$i].'%" ';
572
	            $requete .= $condition2.' gm_categorie LIKE "%'.$tab_cat[$i].'%" ';
-
 
573
	        }
568
        }
574
        }
569
    }
575
    }
570
    $requete .= 'ORDER BY gm_date_creation '.$ordre;
576
    $requete .= 'ORDER BY gm_date_creation '.$ordre;
571
    $aso_info =& $db->getAssoc($requete, false, array(), $mode, $groupe);
577
    $aso_info =& $db->getAssoc($requete, false, array(), $mode, $groupe);
572
    (PEAR::isError($aso_info)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $aso_info->getMessage(), $requete)) : '';
578
    (PEAR::isError($aso_info)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $aso_info->getMessage(), $requete)) : '';
Line 644... Line 650...
644
                'AND gmc_bool_dernier = 1 '.
650
                'AND gmc_bool_dernier = 1 '.
645
                $site.
651
                $site.
646
                $type_modif.
652
                $type_modif.
647
                $categorie.
653
                $categorie.
648
                'ORDER BY gmc_date_modification DESC';
654
                'ORDER BY gmc_date_modification DESC';
649
 
655
	
650
    $aso_info =& $db->getAssoc($requete, false, array(), $mode, $groupe);
656
    $aso_info =& $db->getAssoc($requete, false, array(), $mode, $groupe);
651
    (PEAR::isError($aso_info)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $aso_info->getMessage(), $requete)) : '';
657
    (PEAR::isError($aso_info)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $aso_info->getMessage(), $requete)) : '';
Line 652... Line 658...
652
 
658
 
653
    return $aso_info;
659
    return $aso_info;
Line 920... Line 926...
920
 
926
 
921
 
927
 
-
 
928
 
-
 
929
/* +--Fin du code ---------------------------------------------------------------------------------------+
-
 
930
* $Log: not supported by cvs2svn $
922
 
931
* Revision 1.29  2006/12/12 13:32:58  jp_milcent
923
/* +--Fin du code ---------------------------------------------------------------------------------------+
932
* Mise en forme.
924
* $Log: not supported by cvs2svn $
933
*
925
* Revision 1.28  2006/12/08 20:13:57  jp_milcent
934
* Revision 1.28  2006/12/08 20:13:57  jp_milcent
926
* Mise en allias de GEN_rechercherMenuCode(), remplacée par GEN_retournerIdMenuParCodeNum().
935
* Mise en allias de GEN_rechercherMenuCode(), remplacée par GEN_retournerIdMenuParCodeNum().