<?php
/*
Copyright (C) 2007 Mercier Benjamin

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.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 
*/
$ListTable = $MySql->Select ("*", "ftp", "Utilisateur='".$_SESSION['Utilisateur']."'", "", "", "", "");
$CountEnregistrement = count ($ListTable);
if ( $ListTable == FALSE ) { $CountEnregistrement = 0; }

?>
<h3>
Récapitulatif de vos comptes Ftp
<a style="border: 0px;" href="http://doc.kelio.org/publier_ses_fichiers"><img style="vertical-align:middle; border: 0px;" src="image/icons/question.png" alt="Aide" title="Aide" /></a>
</h3>
<p>
Actuellement, vous avez <?php echo $CountEnregistrement ; ?> compte(s)<?php if ($_SESSION['Offre']['Ftp'] != '-1'):?> ftp sur <?php echo $_SESSION['Offre']['Ftp']; ?> autorisé(s)<?php endif;?>.
</p>
<p>
Passez votre souris sur le commentaire pour le voir en entier.<br />
Idem pour le chemin</p>
<p>
Le statut "Création ..." signifie que votre compte FTP est en attente de création par notre robot. <br />
Normalement, cette opération prend moins d'une heure.<br />
Il en est de meme pour le statut "Suppression ...".</p>
<p><strong>Le dossier de publication de votre domaine <?php echo $_SESSION['Utilisateur']; ?>.kelio.org est /public</strong></p>

<div style="border:#006633 1px solid; width: 90%; margin: auto; margin-top: 15px;">
<table style="width:100%">
<tr>
<td class="Tableau1" style="text-align: center; width: 20%;"><strong>Nom</strong></td>
<td class="Tableau1" style="text-align: center; width: 15%;"><strong>Date</strong></td>
<td class="Tableau1" style="text-align: center; width: 10%;"><strong>Statut</strong></td>
<td class="Tableau1" style="text-align: center; width: 15%;"><strong>Mot de passe</strong></td>
<td class="Tableau1" style="text-align: center; width: 20%;"><strong>Chemin</strong></td>
<td class="Tableau1" style="text-align: center; width: 20%;"><strong>Commentaire</strong></td>
</tr>
<?php

if ( $ListTable == FALSE )
	{
	echo '<tr><td class="Tableau1" style="text-align: center; width: 100%;" colspan="6">Aucun compte ftp pour le moment</td></tr>';
	}
else
	{
	for ($i=0; $i < $CountEnregistrement; $i++)
		{
		if ( $ListTable[$i]["Status"] == "1" )
			{
			$Status = "Creation";
			}
		elseif ( $ListTable[$i]["Status"] == "2" )
			{
			$Status = "Activé";
			}
		elseif ( $ListTable[$i]["Status"] == "3" )
			{
			$Status = "Suppression";
			}
		else
			{
			$Status = "Erreur";
			}
			
		if ( strlen($ListTable[$i]["Chemin"]) > 16 )
			{
			$Chemin = substr ($ListTable[$i]["Chemin"], 0, 16)." ...";
			}
		else
			{
			$Chemin = $ListTable[$i]["Chemin"];
			}
			
		if ( strlen($ListTable[$i]["Commentaire"]) > 16 )
			{
			$Commentaire = substr ($ListTable[$i]["Commentaire"], 0, 16)." ...";
			}
		elseif ( strlen($ListTable[$i]["Commentaire"]) == 0 )
			{
			$Commentaire = "-";
			}
		else
			{
			$Commentaire = $ListTable[$i]["Commentaire"];
			}
		
		echo '
		<tr>
		<td class="Tableau1" style="text-align: center;">'.$ListTable[$i]["Nom"].'</td>
		<td class="Tableau1" style="text-align: center;"><span style="cursor: pointer" title="'.date ("d-m-Y H:i:s",$ListTable[$i]["DateDeCreation"]).'">'.date("d-m-Y", $ListTable[$i]["DateDeCreation"]).'</span></td>
		<td class="Tableau1" style="text-align: center;">'.$Status.'</td>
		<td class="Tableau1" style="text-align: center;">'.$ListTable[$i]["Password"].'</td>
		<td class="Tableau1" style="text-align: center;"><span style="cursor: pointer" title="'.$ListTable[$i]["Chemin"].'">'.$Chemin.'</span></td>
		<td class="Tableau1" style="text-align: center;"><span style="cursor: pointer" title="'.$ListTable[$i]["Commentaire"].'">'.$Commentaire.'</span></td>
		</tr>' ;
		
		}
	}		

?>
</table>
</div>
