434 |
ddelon |
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 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
24 |
// CVS : $Id: adwi_wikini.fonct.php,v 1.1 2005-08-25 08:59:12 ddelon Exp $
|
|
|
25 |
/**
|
|
|
26 |
* Contient les fonctions de l'application gestion des Wikini
|
|
|
27 |
*
|
|
|
28 |
*
|
|
|
29 |
*
|
|
|
30 |
*
|
|
|
31 |
*@package Admin_Wikini
|
|
|
32 |
*@subpackage Fonctions
|
|
|
33 |
//Auteur original :
|
|
|
34 |
*@author David Delon <david.delon@tela-botanica.org>
|
|
|
35 |
//Autres auteurs :
|
|
|
36 |
*@author Aucun
|
|
|
37 |
*@copyright Tela-Botanica 2000-2004
|
|
|
38 |
*@version $Revision: 1.1 $
|
|
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
40 |
*/
|
|
|
41 |
|
|
|
42 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
43 |
// | LISTE de FONCTIONS |
|
|
|
44 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
45 |
|
|
|
46 |
/* CRUD */
|
|
|
47 |
|
|
|
48 |
/**
|
|
|
49 |
*
|
|
|
50 |
* D du CRUD
|
|
|
51 |
* @return
|
|
|
52 |
*/
|
|
|
53 |
|
|
|
54 |
function adwi_supprimer_wikini($id_wikini, &$db) {
|
|
|
55 |
$requete = "delete from gen_wikini where gewi_id_wikini =$id_wikini" ;
|
|
|
56 |
$resultat = $db->query ($requete) ;
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
/**
|
|
|
60 |
*
|
|
|
61 |
*
|
|
|
62 |
* @return
|
|
|
63 |
*/
|
|
|
64 |
|
|
|
65 |
function adwi_valeurs_par_defaut($id_wikini, &$db) {
|
|
|
66 |
|
|
|
67 |
// requete sur gen_wikin
|
|
|
68 |
|
|
|
69 |
$requete = "select * from gen_wikini where gewi_id_wikini=$id_wikini" ;
|
|
|
70 |
$resultat = $db->query ($requete) ;
|
|
|
71 |
if (DB::isError ($resultat)) {
|
|
|
72 |
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(), E_USER_WARNING) ;
|
|
|
73 |
return ;
|
|
|
74 |
}
|
|
|
75 |
$tableau_retour = array () ;
|
|
|
76 |
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
|
|
|
77 |
|
|
|
78 |
$tableau_retour['code_alpha_wikini'] = $ligne->gewi_code_alpha_wikini;
|
|
|
79 |
$tableau_retour['bdd_hote'] = $ligne->gewi_bdd_hote ;
|
|
|
80 |
$tableau_retour['bdd_nom'] = $ligne->gewi_bdd_nom;
|
|
|
81 |
$tableau_retour['bdd_utilisateur'] = $ligne->gewi_bdd_utilisateur;
|
|
|
82 |
$tableau_retour['bdd_mdp'] = $ligne->gewi_bdd_mdp;
|
|
|
83 |
$tableau_retour['table_prefix'] = $ligne->gewi_table_prefix ;
|
|
|
84 |
$tableau_retour['page'] = $ligne->gewi_page;
|
|
|
85 |
$tableau_retour['description'] = $ligne->gewi_description ;
|
|
|
86 |
|
|
|
87 |
unset ($requete, $resultat);
|
|
|
88 |
return $tableau_retour ;
|
|
|
89 |
}
|
|
|
90 |
|
|
|
91 |
/**
|
|
|
92 |
*
|
|
|
93 |
* C du CRUD
|
|
|
94 |
* @return
|
|
|
95 |
*/
|
|
|
96 |
|
|
|
97 |
|
|
|
98 |
function insertion ($valeur, &$db) {
|
|
|
99 |
|
|
|
100 |
// Calcul dernier identifiant
|
|
|
101 |
|
|
|
102 |
$id_wikini_bdd = SQL_obtenirNouveauId ($db, 'gen_wikini', 'gewi_id_wikini') ;
|
|
|
103 |
$requete = "insert into gen_wikini set gewi_id_wikini ="
|
|
|
104 |
.$id_wikini_bdd.","
|
|
|
105 |
.requete_gewi_wikini($valeur) ;
|
|
|
106 |
$resultat = $db->query ($requete) ;
|
|
|
107 |
if (DB::isError ($resultat)) {
|
|
|
108 |
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
|
|
|
109 |
}
|
|
|
110 |
}
|
|
|
111 |
|
|
|
112 |
/**
|
|
|
113 |
*
|
|
|
114 |
* U du CRUD
|
|
|
115 |
* @return
|
|
|
116 |
*/
|
|
|
117 |
|
|
|
118 |
|
|
|
119 |
function mise_a_jour ($valeur, &$db) {
|
|
|
120 |
$requete = "update gen_wikini set ".requete_gewi_wikini($valeur)
|
|
|
121 |
.' where gewi_id_wikini ='.$GLOBALS['id_wikini'] ;
|
|
|
122 |
$resultat = $db->query ($requete) ;
|
|
|
123 |
if (DB::isError ($resultat)) {
|
|
|
124 |
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
|
|
|
125 |
}
|
|
|
126 |
}
|
|
|
127 |
|
|
|
128 |
/**
|
|
|
129 |
*
|
|
|
130 |
* Formate code sql pour insertion à partir des valeurs entrees dans le formulaire
|
|
|
131 |
*
|
|
|
132 |
* @return string un morceau de code SQL
|
|
|
133 |
*/
|
|
|
134 |
|
|
|
135 |
function requete_gewi_wikini (&$valeur) {
|
|
|
136 |
return 'gewi_code_alpha_wikini ="'.$valeur['code_alpha_wikini'].'", '
|
|
|
137 |
.'gewi_bdd_hote ="'.$valeur['bdd_hote'].'", '
|
|
|
138 |
.'gewi_bdd_nom="'.$valeur['bdd_nom'].'", '
|
|
|
139 |
.'gewi_bdd_utilisateur ="'.$valeur['bdd_utilisateur'].'", '
|
|
|
140 |
.'gewi_bdd_mdp="'.$valeur['bdd_mdp'].'", '
|
|
|
141 |
.'gewi_table_prefix="'.$valeur['table_prefix'].'", '
|
|
|
142 |
.'gewi_description="'.$valeur['description'].'", '
|
|
|
143 |
.'gewi_page="'.$valeur['page'].'"';
|
|
|
144 |
}
|
|
|
145 |
|
|
|
146 |
|
|
|
147 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
148 |
// | PIED du PROGRAMME |
|
|
|
149 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
150 |
|
|
|
151 |
|
|
|
152 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
153 |
*
|
|
|
154 |
* $Log: not supported by cvs2svn $
|
|
|
155 |
* Revision 1.1 2005/03/09 10:44:04 jpm
|
|
|
156 |
* Mise au norme du nom du fichier.
|
|
|
157 |
*
|
|
|
158 |
* Revision 1.2 2005/03/09 10:40:33 alex
|
|
|
159 |
* version initiale
|
|
|
160 |
*
|
|
|
161 |
* Revision 1.1 2004/12/13 18:07:28 alex
|
|
|
162 |
* version initiale
|
|
|
163 |
*
|
|
|
164 |
*
|
|
|
165 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
166 |
*/
|
|
|
167 |
?>
|