<?PHP
// ------------------------------------------------------------------------- //
// <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 //
// ------------------------------------------------------------------------- //

/**
* Page update de la partie Admin
* @author	Georges Caldeira <gcaldeira@anemalab.org>
* @package	GaneshaAdmin
*/
	/**
	* include des fichiers + verification de la cnx
	*/
	include_once("anema.inc.php");

	debugf(__FILE__);

	/**#@+
    * @access public
	* @ignore
	*/
	define('ACTION',	$HTTP_GET_VARS['action'])	;
	define('ACTION',	(isset($HTTP_GET_VARS['action'])?$HTTP_GET_VARS['action']:''))	;	
	define('PAGE',		HTTP_ADMIN."update.php?menu=3&connexion=".$gconnexionid)	;
	/**#@-*/
	
/**
* Gestion de la page option de l'admin
* @author	Georges Caldeira <gcaldeira@anemalab.org>
* @access	public
* @package	GaneshaAdmin
*/
class PageUpdateAdmin {
		
	/**
	* Affiche la liste des societes
	* @access	public
	*/
     function liste() { 
	 	global $color3, $gconnexionid ;
	 	$file = ReadUpdateDirectory() ;
	    GetTitre('UPDATE');
	    if ( count($file) == 0 ) {
	    	BR(4);
	    	put('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Pas de fichiers Update !!!</b>');
	    	BR(4);
	    } else {
			BeginBorder('90%',$color3);	    
			BR();
		    for($i=0;$i<count($file);$i++) {    	
		    	$url = HTTP_UPDATE.$file[$i].'?connexion='.$gconnexionid.'&command=';
		    	$desc   = '<a href="javascript:void(0);" onclick="openWindow(\''.$url.'description\',\'update\',\'scrollbars=yes,width=700,height=590\')" class="student">Description</a>' ;
		    	$update = '<a href="javascript:void(0);" onclick="openWindow(\''.$url.'update\',\'update\',\'scrollbars=yes,width=700,height=590\')" class="student">Lancer la mise à jour</a>' ;	    	
		    	$delete = '<a class="student" href="'.PAGE.'&action=delete&file='.urlencode($file[$i]).'">Supprimer le fichier</a>' 	;
		    	$cl_del = " onClick=\"openWindow('".$delete."','update','scrollbars=yes,width=700,height=590')\" ";
		    	put('&nbsp;&nbsp;'.IMG_RIGHT.'&nbsp;<b>['.$file[$i].']</b>&nbsp;&nbsp;') ;
		    	put('&nbsp;&nbsp;'.$desc.'&nbsp;&nbsp;|') 	;
		    	put('&nbsp;&nbsp;'.$update.'&nbsp;&nbsp;|') ;
		    	put('&nbsp;&nbsp;'.$delete.' <br>') 		;
		    }
			BR();
	        CloseBorder();        
	    }
        GoTop();
     }

	/**
	* Supprime un item de la table
	* @access	public
	*/
	function del() {
		global $HTTP_GET_VARS ;
		$file = (isset($HTTP_GET_VARS['file'])?urldecode($HTTP_GET_VARS['file']):'')	;	
		if ( $file != '' && @is_file(RP_UPDATE.$file) ) {
			unlink(RP_UPDATE.$file); 
		}
	}

	/**
	* Affiche un formulaire pour modifier une societe
	* @access	public
	*/
     function modif() { 
     }

	/**
	* Affiche un formulaire pour une societe
	* @access	public
	*/
	function add() {	
	}

	/**
	* Traitement des variables POST et redirection
	* @access	public
	*/	
	function traite_post() {
	}

	/**
	* Traitement des variables GET et redirection
	* @access	public
	*/		
	function traite_get() {
	}

} // class 


/**
* Instance de la classe PageUpdateAdmin
* @var	object	PageUpdateAdmin
*/
$ClsPageAdmin = new PageUpdateAdmin ;

	
	// Affichage de la page
	pageAdmin();

?>