Files
keliopanel-v1/0.7.1/panel/module/email/recapitulatif.php
2016-02-21 01:33:05 +01:00

207 lines
6.6 KiB
PHP
Executable File

<?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.
*/
$ListCompte = $MySql->Select ("*", "email", "Utilisateur='".$_SESSION['Utilisateur']."' AND Type='compte'", "", "", "", "");
$ListAlias = $MySql->Select ("*", "email", "Utilisateur='".$_SESSION['Utilisateur']."' AND Type='alias'", "", "", "", "");
$CountCompte = count($ListCompte);
$CountAlias = count ($ListAlias);
if ( $ListCompte == FALSE ) { $CountCompte = 0; }
if ( $ListAlias == FALSE ) { $CountAlias = 0; }
?>
<h3>Récapitulatif de comptes et alias e-mail
<a style="border: 0px;" href="http://wiki.kelio.org/doku.php?id=doc_panel:email"><img style="vertical-align:middle; border: 0px;" src="image/icons/question.png" alt="Aide" title="Aide" /></a>
</h3>
<br />
Actuellement, vous avez <?php echo $CountCompte; ?> compte(s) email et <?php echo $CountAlias; ?> alias.
<br />
Passez votre souris sur le commentaire pour le voir en entier.<br /><br />
Le statut "Création" signifie que votre compte/alias 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".
<br /><br />
<h4>Liste des comptes email</h4>
<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: 25%;"><strong>Commentaire</strong></td>
</tr>
<?php
if ( $ListCompte == FALSE )
{
echo '
<tr>
<td colspan="6" class="Tableau1" style="text-align:center"><strong>Il n\'y a aucun email pour le moment.</strong></td>
</tr>';
}
else
{
for ($i=0; $i < $CountCompte; $i++)
{
if ( $ListCompte[$i]["Status"] == "1" )
{
$Status = "Creation";
}
elseif ( $ListCompte[$i]["Status"] == "2" )
{
$Status = "Activé";
}
elseif ( $ListCompte[$i]["Status"] == "3" )
{
$Status = "Suppression";
}
else
{
$Status = "Erreur";
}
if ( strlen($ListCompte[$i]["Commentaire"]) > 19 )
{
$Commentaire = substr ($ListCompte[$i]["Commentaire"], 0, 19)." ...";
}
elseif ( strlen($ListCompte[$i]["Commentaire"]) == 0 )
{
$Commentaire = "-";
}
else
{
$Commentaire = $ListCompte[$i]["Commentaire"];
}
if ( strlen($ListCompte[$i]["Nom"]) > 16 )
{
$Nom = substr ($ListCompte[$i]["Nom"], 0, 16)." ...";
}
else
{
$Nom = $ListCompte[$i]["Nom"];
}
echo '
<tr>
<td class="Tableau1" style="text-align: center;"><span style="cursor:pointer;" title="'.$ListCompte[$i]["Nom"].'">'.$Nom.'</span></td>
<td class="Tableau1" style="text-align: center;"><span style="cursor: pointer" title="'.date ("d-m-Y H:i:s",$ListCompte[$i]["DateDeCreation"]).'">'.date("d-m-Y", $ListCompte[$i]["DateDeCreation"]).'</span></td>
<td class="Tableau1" style="text-align: center;">'.$Status.'</td>
<td class="Tableau1" style="text-align: center;">'.$ListCompte[$i]["Password"].'</td>
<td class="Tableau1" style="text-align: center;">'.$Commentaire.'</td>
</tr>';
}
}
?>
</table>
</div>
<br />
<h4>Liste des alias email</h4>
<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: 25%;"><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: 25%;"><strong>Destination</strong></td>
<td class="Tableau1" style="text-align: center; width: 25%;"><strong>Commentaire</strong></td>
</tr>
<?php
if ( $ListAlias == FALSE )
{
echo '
<tr>
<td colspan="6" class="Tableau1" style="text-align:center"><strong>Il n\'y a aucun alias pour le moment.</strong></td>
</tr>';
}
else
{
for ($i=0; $i < $CountAlias; $i++)
{
if ( $ListAlias[$i]["Status"] == "1" )
{
$Status = "Creation";
}
elseif ( $ListAlias[$i]["Status"] == "2" )
{
$Status = "Activé";
}
elseif ( $ListAlias[$i]["Status"] == "3" )
{
$Status = "Suppression";
}
else
{
$Status = "Erreur";
}
if ( strlen($ListAlias[$i]["Nom"]) > 16 )
{
$Nom = substr ($ListAlias[$i]["Nom"], 0, 16)." ...";
}
else
{
$Nom = $ListAlias[$i]["Nom"];
}
if ( strlen($ListAlias[$i]["Pointage"]) > 16 )
{
$Pointage = substr ($ListAlias[$i]["Pointage"], 0, 16)." ...";
}
else
{
$Pointage = $ListAlias[$i]["Pointage"];
}
if ( strlen($ListAlias[$i]["Commentaire"]) > 16 )
{
$Commentaire = substr ($ListCompte[$i]["Commentaire"], 0, 16)." ...";
}
elseif ( strlen($ListAlias[$i]["Commentaire"]) == 0 )
{
$Commentaire = "-";
}
else
{
$Commentaire = $ListAlias[$i]["Commentaire"];
}
echo '
<tr>
<td class="Tableau1" style="text-align: center;"><span style="cursor:pointer;" title="'.$ListAlias[$i]["Nom"].'">'.$Nom.'</span></td>
<td class="Tableau1" style="text-align: center;"><span style="cursor: pointer" title="'.date ("d-m-Y H:i:s",$ListAlias[$i]["DateDeCreation"]).'">'.date("d-m-Y", $ListAlias[$i]["DateDeCreation"]).'</span></td>
<td class="Tableau1" style="text-align: center;">'.$Status.'</td>
<td class="Tableau1" style="text-align: center;"><span style="cursor:pointer;" title="'.$ListAlias[$i]["Pointage"].'">'.$Pointage.'</span></td>
<td class="Tableau1" style="text-align: center;"><span style="cursor:pointer;" title="'.$ListAlias[$i]["Commentaire"].'">'.$Commentaire.'</span></td>
</tr>';
}
}
?>
</table>
</div>