Subversion Repositories Applications.bazar

Compare Revisions

Ignore whitespace Rev 143 → Rev 144

/trunk/bibliotheque/bazar.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: bazar.fonct.php,v 1.52 2006-07-25 13:05:00 alexandre_tb Exp $
// CVS : $Id: bazar.fonct.php,v 1.53 2006-07-25 13:24:44 florian Exp $
/**
*
* Fonctions du module bazar
31,7 → 31,7
*@author Florian Schmitt <florian@ecole-et-nature.org>
//Autres auteurs :
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.52 $ $Date: 2006-07-25 13:05:00 $
*@version $Revision: 1.53 $ $Date: 2006-07-25 13:24:44 $
// +------------------------------------------------------------------------------------------------------+
*/
 
701,7 → 701,7
//cas des images
elseif ($tableau[$i]['type']=='image') {
if (isset($_FILES['image']['name']) && $_FILES['image']['name']!='') {
baz_insertion_image($GLOBALS['_BAZAR_']['id_fiche']);
$requete .= baz_insertion_image($GLOBALS['_BAZAR_']['id_fiche']);
}
}
//cas des dates
826,11 → 826,11
/** baz_insertion_image() - inserer une image a une fiche
*
* @global integer L'identifiant de la fiche
* @return void
* @return string requete SQL
*/
function baz_insertion_image($idfiche) {
//verification de la presence de ce fichier
$requete = 'SELECT bf_id_fiche FROM bazar_fiche WHERE bf_url_image="'.$_FILES['image']['name'].'"';
$requete = 'SELECT bf_id_fiche FROM bazar_fiche WHERE bf_url_image="'.$_FILES['image']['name'].'" AND bf_id_fiche!='.$idfiche;
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
839,25 → 839,7
$chemin_destination=BAZ_CHEMIN_APPLI.'upload/'.$_FILES['image']['name'];
move_uploaded_file($_FILES['image']['tmp_name'], $chemin_destination);
}
//verification de l'existence de la fiche
$requete = 'SELECT bf_id_fiche FROM bazar_fiche WHERE bf_id_fiche='.$idfiche;
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat)) {
echo ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
if ($resultat->numRows()==0) {
//creation d'une fiche temporaire avec l'image
$requete = 'INSERT INTO bazar_fiche SET bf_id_fiche='.$idfiche.', bf_ce_nature='.$GLOBALS['_BAZAR_']['id_typeannonce'].', bf_ce_utilisateur='.$GLOBALS['id_user'].', bf_date_creation_fiche=NOW(), bf_url_image="'.$_FILES['image']['name'].'", '.
'bf_titre="annonce temporaire"';
}
else {
$requete='UPDATE bazar_fiche SET bf_url_image="'.$_FILES['image']['name'].'" WHERE bf_id_fiche='.$idfiche;
}
$resultat = $GLOBALS['_BAZAR_']['db']->query($requete) ;
if (DB::isError($resultat)) {
die ($resultat->getMessage().$resultat->getDebugInfo()) ;
}
return;
return 'bf_url_image="'.$_FILES['image']['name'].'", ' ;
}
 
 
1221,6 → 1203,9
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.52 2006/07/25 13:05:00 alexandre_tb
* Remplacement d un die par un echo
*
* Revision 1.51 2006/07/18 14:17:32 alexandre_tb
* Ajout d'un formulaire d identification
*