<?PHP
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------------+
// | <G a n e s h a> - Free Web Based Training System                           |
// +----------------------------------------------------------------------------+
// | <G a n e s h a> - Plate-forme de téléformation gratuite et en open source  |
// +----------------------------------------------------------------------------|
// | Copyright (C) 2001-2003  Anéma Formation  <http://www.anema.fr/>           |
// +----------------------------------------------------------------------------+
// |           Developer : Georges CALDEIRA <gcaldeira@anemalab.org>            |
// +----------------------------------------------------------------------------+
// |              Infos on project <http://anemalab.org/>                       |
// +----------------------------------------------------------------------------+
// | This program 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.                                        |
// |                                                                            |
// | This program 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 this program; if not, write to the Free Software                |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   |
// +----------------------------------------------------------------------------+

/**
* Definition de la class pour la gestion des couleurs.
* @author	Georges Caldeira <gcaldeira@anemalab.org>
* @package	GaneshaClass
*/

/**
* Fournit une API pour gerer les skins.
* @author	Georges Caldeira <gcaldeira@anemalab.org>
* @access	public
* @package	GaneshaClass
*/
class Color {

	/**
	* Met a jour le nouveau skin d'un membre
	* @param	integer	$idu	Id du membre
	* @param	integer	$skin	Valeur du nouveau skin
	* @access	public
	*/
	function Set($idu,$skin) {
	 global $gskin, $db ;
		$sSQL = "UPDATE membres SET skin='".$skin."' WHERE id=".$idu ;
		$db->query($sSQL)	;
		$gskin = $skin		;
		LoadSkin($gskin)	;
	}

	/**
	* Positionne le skin d'un membre
	* @param	integer	$idu	 Id du membre
	* @access	public
	*/
	function Read($idu) { 
	 global $guserid, $gskin, $TBL, $db ;
		$sSQL = "SELECT skin FROM ".$TBL['membres']." WHERE id=".$idu ;
		$db->query($sSQL)	;
		$db->next_record()	;
		$gskin = $db->f(0)	;
		LoadSkin($gskin)	;
	}

} // class Color

/**
* Instance de la classe Color
* @var	object	Color
*/
$ClsColor = new Color ;

?>