Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 433 → Rev 434

/trunk/client/integrateur_wikini/bibliotheque/adwi_wikini.fonct.php
New file
0,0 → 1,167
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of Papyrus. |
// | |
// | Foobar is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | Foobar is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with Foobar; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: adwi_wikini.fonct.php,v 1.1 2005-08-25 08:59:12 ddelon Exp $
/**
* Contient les fonctions de l'application gestion des Wikini
*
*
*
*
*@package Admin_Wikini
*@subpackage Fonctions
//Auteur original :
*@author David Delon <david.delon@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE de FONCTIONS |
// +------------------------------------------------------------------------------------------------------+
 
/* CRUD */
 
/**
*
* D du CRUD
* @return
*/
 
function adwi_supprimer_wikini($id_wikini, &$db) {
$requete = "delete from gen_wikini where gewi_id_wikini =$id_wikini" ;
$resultat = $db->query ($requete) ;
}
 
/**
*
*
* @return
*/
 
function adwi_valeurs_par_defaut($id_wikini, &$db) {
// requete sur gen_wikin
$requete = "select * from gen_wikini where gewi_id_wikini=$id_wikini" ;
$resultat = $db->query ($requete) ;
if (DB::isError ($resultat)) {
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(), E_USER_WARNING) ;
return ;
}
$tableau_retour = array () ;
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
$tableau_retour['code_alpha_wikini'] = $ligne->gewi_code_alpha_wikini;
$tableau_retour['bdd_hote'] = $ligne->gewi_bdd_hote ;
$tableau_retour['bdd_nom'] = $ligne->gewi_bdd_nom;
$tableau_retour['bdd_utilisateur'] = $ligne->gewi_bdd_utilisateur;
$tableau_retour['bdd_mdp'] = $ligne->gewi_bdd_mdp;
$tableau_retour['table_prefix'] = $ligne->gewi_table_prefix ;
$tableau_retour['page'] = $ligne->gewi_page;
$tableau_retour['description'] = $ligne->gewi_description ;
unset ($requete, $resultat);
return $tableau_retour ;
}
 
/**
*
* C du CRUD
* @return
*/
 
 
function insertion ($valeur, &$db) {
// Calcul dernier identifiant
$id_wikini_bdd = SQL_obtenirNouveauId ($db, 'gen_wikini', 'gewi_id_wikini') ;
$requete = "insert into gen_wikini set gewi_id_wikini ="
.$id_wikini_bdd.","
.requete_gewi_wikini($valeur) ;
$resultat = $db->query ($requete) ;
if (DB::isError ($resultat)) {
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
}
}
 
/**
*
* U du CRUD
* @return
*/
 
 
function mise_a_jour ($valeur, &$db) {
$requete = "update gen_wikini set ".requete_gewi_wikini($valeur)
.' where gewi_id_wikini ='.$GLOBALS['id_wikini'] ;
$resultat = $db->query ($requete) ;
if (DB::isError ($resultat)) {
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
}
}
 
/**
*
* Formate code sql pour insertion à partir des valeurs entrees dans le formulaire
*
* @return string un morceau de code SQL
*/
 
function requete_gewi_wikini (&$valeur) {
return 'gewi_code_alpha_wikini ="'.$valeur['code_alpha_wikini'].'", '
.'gewi_bdd_hote ="'.$valeur['bdd_hote'].'", '
.'gewi_bdd_nom="'.$valeur['bdd_nom'].'", '
.'gewi_bdd_utilisateur ="'.$valeur['bdd_utilisateur'].'", '
.'gewi_bdd_mdp="'.$valeur['bdd_mdp'].'", '
.'gewi_table_prefix="'.$valeur['table_prefix'].'", '
.'gewi_description="'.$valeur['description'].'", '
.'gewi_page="'.$valeur['page'].'"';
}
 
 
// +------------------------------------------------------------------------------------------------------+
// | PIED du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2005/03/09 10:44:04 jpm
* Mise au norme du nom du fichier.
*
* Revision 1.2 2005/03/09 10:40:33 alex
* version initiale
*
* Revision 1.1 2004/12/13 18:07:28 alex
* version initiale
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>