Subversion Repositories Applications.papyrus

Rev

Rev 301 | Rev 923 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
301 jpm 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of Papyrus.                                                                        |
9
// |                                                                                                      |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
11
// | it under the terms of the GNU General Public License as published by                                 |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
13
// | (at your option) any later version.                                                                  |
14
// |                                                                                                      |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
18
// | GNU General Public License for more details.                                                         |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
462 florian 24
// CVS : $Id: adap_application.fonct.php,v 1.2 2005-09-23 15:02:38 florian Exp $
301 jpm 25
/**
26
* Contient les fonctions de l'appli admin_auth
27
*
28
*
29
*
30
*
31
*@package Admin_auth
32
*@subpackage Fonctions
33
//Auteur original :
34
*@author        Alexandre Granier <alexandre@tela-botanica.org>
35
//Autres auteurs :
36
*@author        Aucun
37
*@copyright     Tela-Botanica 2000-2004
462 florian 38
*@version       $Revision: 1.2 $
301 jpm 39
// +------------------------------------------------------------------------------------------------------+
40
*/
41
 
42
// +------------------------------------------------------------------------------------------------------+
43
// |                                           LISTE de FONCTIONS                                         |
44
// +------------------------------------------------------------------------------------------------------+
45
 
46
/**
47
 *
48
 *
49
 * @return
50
 */
51
 
52
function adap_supprimer_application($id_appl, &$db) {
462 florian 53
    $requete = 'delete from gen_application where gap_id_application='.$id_appl;
301 jpm 54
    $resultat = $db->query ($requete) ;
55
}
56
 
57
/**
58
 *
59
 *
60
 * @return
61
 */
62
 
63
function adap_valeurs_par_defaut ($id_appl, &$db) {
64
    // requete sur gen_site_auth
65
 
462 florian 66
    $requete = 'select * from gen_application where gap_id_application='.$id_appl ;
301 jpm 67
    $resultat = $db->query ($requete) ;
68
    if (DB::isError ($resultat)) {
69
        trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(), E_USER_WARNING) ;
70
        return ;
71
    }
72
    $tableau_retour = array () ;
73
    $ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
74
    $tableau_retour['nom_appl'] = $ligne->gap_nom ;
75
    $tableau_retour['description'] = $ligne->gap_description ;
76
    $tableau_retour['chemin'] = $ligne->gap_chemin ;
77
    $tableau_retour['applette'] = $ligne->gap_bool_applette ;
78
    unset ($requete, $resultat) ;
79
    return $tableau_retour ;
80
}
81
 
82
/**
83
 *
84
 *
85
 * @return
86
 */
87
 
88
function insertion ($valeur, &$db) {
89
    $id_appl_bdd = SQL_obtenirNouveauId ($db, 'gen_application', 'gap_id_application') ;
90
    $requete = "insert into gen_application set gap_id_application="
91
                .$id_appl_bdd.","
92
                .requete_site_appl($valeur) ;
93
    $resultat = $db->query ($requete) ;
94
    if (DB::isError ($resultat)) {
95
        trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
96
    }
97
}
98
 
99
/**
100
 *
101
 *
102
 * @return
103
 */
104
 
105
function mise_a_jour ($valeur, &$db) {
106
    $requete = "update gen_application set ".requete_site_appl($valeur)
107
                .' where gap_id_application='.$GLOBALS['id_appl'] ;
108
    $resultat = $db->query ($requete) ;
109
    if (DB::isError ($resultat)) {
110
        trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
111
    }
112
}
113
 
114
/**
115
 *
116
 *
117
 * @return  string  un morceau de code SQL
118
 */
119
 
120
function requete_site_appl (&$valeur) {
462 florian 121
	if (!isset($valeur['applette'])) {$valeur['applette']=0;}
122
	return   'gap_nom="'.$valeur['nom_appl'].'", '
123
	        .'gap_description="'.$valeur['description'].'", '
124
		.'gap_chemin="'.$valeur['chemin'].'", '
125
		.'gap_bool_applette="'.$valeur['applette'].'"';
301 jpm 126
}
127
 
128
 
129
// +------------------------------------------------------------------------------------------------------+
130
// |                                            PIED du PROGRAMME                                         |
131
// +------------------------------------------------------------------------------------------------------+
132
 
133
 
134
/* +--Fin du code ----------------------------------------------------------------------------------------+
135
*
136
* $Log: not supported by cvs2svn $
462 florian 137
* Revision 1.1  2005/03/09 10:44:04  jpm
138
* Mise au norme du nom du fichier.
139
*
301 jpm 140
* Revision 1.2  2005/03/09 10:40:33  alex
141
* version initiale
142
*
143
* Revision 1.1  2004/12/13 18:07:28  alex
144
* version initiale
145
*
146
*
147
* +-- Fin du code ----------------------------------------------------------------------------------------+
148
*/
149
?>