2010-04-27 07:20:30 +00:00
< ? php
2010-04-26 14:46:13 +00:00
if ( isset ( $_REQUEST [ 'action' ]) && $_REQUEST [ 'action' ] == 'delete' ) {
2010-05-21 09:21:21 +00:00
$message = 'Erreur lors de la suppression du compte utilisateur !' ;
2010-04-26 14:46:13 +00:00
try {
2010-05-21 09:21:21 +00:00
$tabOptions = array ( 'delete' => true );
2010-04-26 14:46:13 +00:00
$O = $client -> setInfosLogin ( $_REQUEST [ 'login' ], $tabOptions );
//action=delete&login=bpanaccione&idUti=3
2010-05-21 09:21:21 +00:00
if ( $O [ 'result' ] == 1 ){
$message = 'Compte "' . $_REQUEST [ 'login' ] . '" supprimé !' ;
}
2010-04-26 14:46:13 +00:00
} catch ( SoapFault $fault ) {
2010-05-21 09:21:21 +00:00
$message = 'Erreur SOAP lors de la suppression du compte utilisateur !' ;
2010-04-26 14:46:13 +00:00
}
} elseif ( isset ( $_REQUEST [ 'action' ]) && $_REQUEST [ 'action' ] == 'activate' ) {
2010-05-21 09:21:21 +00:00
$message = 'Erreur lors de l\'activation du compte utilisateur !' ;
2010-04-26 14:46:13 +00:00
try {
2010-05-21 09:21:21 +00:00
$tabOptions = array ( 'actif' => true );
2010-04-26 14:46:13 +00:00
$O = $client -> setInfosLogin ( $_REQUEST [ 'login' ], $tabOptions );
2010-05-21 09:21:21 +00:00
if ( $O [ 'result' ] == 1 ){
$message = 'Compte "' . $_REQUEST [ 'login' ] . '" activé !' ;
}
2010-04-26 14:46:13 +00:00
} catch ( SoapFault $fault ) {
2010-05-21 09:21:21 +00:00
$message = 'Erreur SOAP lors de l\'activation du compte utilisateur !' ;
2009-02-17 13:14:53 +00:00
}
2010-04-26 14:46:13 +00:00
} elseif ( isset ( $_REQUEST [ 'action' ]) && $_REQUEST [ 'action' ] == 'unactivate' ) {
2010-05-21 09:21:21 +00:00
$message = 'Erreur lors de la désactivation du compte utilisateur !' ;
2010-04-26 14:46:13 +00:00
try {
2010-05-21 09:21:21 +00:00
$tabOptions = array ( 'actif' => false );
2010-04-26 14:46:13 +00:00
$O = $client -> setInfosLogin ( $_REQUEST [ 'login' ], $tabOptions );
2010-05-21 09:21:21 +00:00
if ( $O [ 'result' ] == 1 ){
$message = 'Compte "' . $_REQUEST [ 'login' ] . '" désactivé !' ;
}
2010-04-26 14:46:13 +00:00
} catch ( SoapFault $fault ) {
2010-05-21 09:21:21 +00:00
$message = 'Erreur SOAP lors de la désactivation du compte utilisateur !' ;
2010-04-26 14:46:13 +00:00
}
}
2009-02-17 13:14:53 +00:00
/** Utilisation du WS **/
try {
$O = $client -> getListeUtilisateurs ( $_SESSION [ 'tabInfo' ][ 'login' ]);
2010-05-21 09:21:21 +00:00
$utilisateurs = $O [ 'results' ];
2009-02-17 13:14:53 +00:00
} catch ( SoapFault $fault ) {
2009-07-21 07:17:54 +00:00
require_once 'soaperror.php' ;
2009-02-26 17:16:11 +00:00
processSoapFault ( $client , $fault , $tabInfo );
2009-02-17 13:14:53 +00:00
die ();
}
?>
2010-04-13 08:21:31 +00:00
2009-07-16 16:12:17 +00:00
< style type = " text/css " >
2010-05-21 12:41:55 +00:00
#utilisateur { width:100%; border-collapse:collapse; margin:0;}
2009-07-16 16:12:17 +00:00
#utilisateur tr.titre td { background-color: #D9EEF1; font-weight:bold; }
#utilisateur tr.border td { border:1px dashed #939393; padding:5px; margin:0;}
</ style >
2009-09-10 15:31:37 +00:00
< div id = " center " >
< h1 > ADMINISTRATION </ h1 >
2010-04-13 08:21:31 +00:00
< ? php
// --------------------------------------------------------------------------- //
// Relevé de consommation complet
// --------------------------------------------------------------------------- //
?>
2010-02-10 17:27:03 +00:00
< h2 > Relevé de consommation complet </ h2 >
2010-04-13 08:21:31 +00:00
& nbsp ;
< ? php
if ( $_SESSION [ 'tabInfo' ][ 'profil' ] == 'SuperAdministrateur' ) {
print '<label title="Renvoi les logs de tous les clients.' .
' Avec le détails le téléchargement peut être long.">' .
'Tous les clients</label>' ;
print '<input type="checkbox" name="telechargementjsCase2" value="1"/>' ;
}
?>
2010-05-07 15:48:45 +00:00
< input type = " hidden " name = " page " value = " <?= $page ?> " />
2010-04-13 08:21:31 +00:00
< label > Détails </ label >
< input type = " checkbox " name = " telechargementjsCase " value = " 1 " class = " noborder " />
< select name = " telechargementjsMenu " >
< option value = " invalide " > Mois / Année </ option >
< ? php
for ( $i = 1 ; $i <= 12 ; ++ $i ) {
$date = date ( 'm' , mktime ( 0 , 0 , 0 , date ( 'm' ) - $i , 1 , date ( 'Y' ))) . '/' .
date ( 'Y' , mktime ( 0 , 0 , 0 , date ( 'm' ) - $i , 1 , date ( 'Y' )));
print '<option value="' . $date . '">' . $date . '</option>' ;
}
?>
</ select >
2010-07-15 14:47:27 +00:00
< a href = " ./?page=telechargement " id = " telechargementjs " > Ok </ a >
2010-04-13 08:21:31 +00:00
< div id = " telechargementjsMsg " class = " infoData last " ></ div >
2009-09-10 15:31:37 +00:00
2010-04-13 08:21:31 +00:00
< ? php
// --------------------------------------------------------------------------- //
// Liste des profils utilisateurs
// --------------------------------------------------------------------------- //
?>
2009-09-10 15:31:37 +00:00
< h2 > Liste des profils utilisateurs </ h2 >
2010-05-21 12:41:55 +00:00
< div class = " blockh2 " >
2009-09-10 15:31:37 +00:00
< table id = " utilisateur " >
< ? php
if ( isset ( $message ) && $message != '' )
{
?>
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td colspan = " 5 " class = " StyleInfoData " align = " center " >< h3 >< ? = $message ; ?> </h3></td>
</ tr >
< ? php
}
?>
< tr class = " border titre " >
2009-07-16 16:12:17 +00:00
< td class = " StyleInfoLib " > Login </ td >
< td class = " StyleInfoLib " > Actions </ td >
< td class = " StyleInfoLib " > Actif </ td >
< td class = " StyleInfoLib " > Informations </ td >
2010-02-10 17:27:03 +00:00
< td class = " StyleInfoLib " > Référence </ td >
2009-09-10 15:31:37 +00:00
</ tr >
< ? php
foreach ( $utilisateurs as $uti )
{
?>
< tr class = " border " >
2009-07-16 16:12:17 +00:00
< td class = " StyleInfoData " >< ? = $uti [ 'login' ] ?> </td>
< td align = " center " valign = " middle " >
2010-04-28 09:08:29 +00:00
< a href = " /?page=moncompte&idEntreprise=<?= $idEntreprise ?>&siret=<?= $siret ?>&login=<?= $uti['login'] ?>&idUti=<?= $uti['idUti'] ?>&referer=administration " >
< img src = " /img/edit0.gif " title = " Editer le profil utilisateur " width = " 16 " height = " 16 " />
</ a >
< a href = " Javascript:if (confirm('Voulez-vous supprimer le compte de <?= $uti['login'] ?>')) { document.location.href='/?page=administration&idEntreprise=<?= $idEntreprise ?>&siret=<?= $siret ?>&action=delete&login=<?= $uti['login'] ?>&idUti=<?= $uti['idUti'] ?>'} " >
< img src = " /img/delete.gif " title = " Supprimer le profil utilisateur " width = " 11 " height = " 11 " /></ a >
2009-07-16 16:12:17 +00:00
</ td >
< td class = " StyleInfoData " >< ?
2010-02-10 17:27:03 +00:00
if ( $uti [ 'actif' ] == 1 ) { ?> <a href="Javascript:if (confirm('Voulez-vous désactiver le compte de <?=$uti['login']?>')){document.location.href='/?page=administration&idEntreprise=<?=$idEntreprise?>&siret=<?=$siret?>&action=unactivate&login=<?=$uti['login']?>&idUti=<?=$uti['idUti']?>'}" title="Désactiver le profil utilisateur"><u><font color="green">Oui</font></u></a><? }
2009-07-16 16:12:17 +00:00
else { ?> <a href="Javascript:if (confirm('Voulez-vous activer le compte de <?=$uti['login']?>')) {document.location.href='/?page=administration&idEntreprise=<?=$idEntreprise?>&siret=<?=$siret?>&action=activate&login=<?=$uti['login']?>&idUti=<?=$uti['idUti']?>'}" title="Activer le profil utilisateur"><u><font color="red" >Non</font></u></a><? } ?></td>
< td class = " StyleInfoData " >
< ? = $uti [ 'nom' ] ?> <?=$uti['prenom']?> <br/>
< a href = " mailto:<?= $uti['email'] ?> " >< ? = str_replace ( ';' , '<br/>' , $uti [ 'email' ]) ?> </a>
2009-02-17 13:14:53 +00:00
</ td >
2010-04-26 14:46:13 +00:00
< td class = " StyleInfoData " >< ? = $uti [ 'reference' ] ?> </td>
2009-02-17 13:14:53 +00:00
</ tr >
2009-09-10 15:31:37 +00:00
< ? php
}
?>
< tr >< td colspan = " 5 " >& nbsp ; </ td ></ tr >
< tr >
2009-07-17 13:16:09 +00:00
< td colspan = " 5 " align = " center " >
2010-05-21 09:21:21 +00:00
< form name = " form_admin " action = " ./?page=moncompte&action=new&referer=administration " method = " post " >
2010-04-28 09:08:29 +00:00
< input type = " submit " value = " Créer un profil utilisateur " />
</ form >
</ td >
2009-09-10 15:31:37 +00:00
</ tr >
2009-07-16 16:12:17 +00:00
</ table >
2010-05-21 12:41:55 +00:00
</ div >
2009-09-10 15:31:37 +00:00
< ? php
if ( $_SESSION [ 'tabInfo' ][ 'profil' ] == 'SuperAdministrateur' )
{
?>
< h2 > Gestion des clients </ h2 >
< table >
< tr >
< td width = " 30 " >& nbsp ; </ td >
< td >< a href = " ./index.php?page=administration_client " > Liste des clients </ a ></ td >
</ tr >
< tr >
< td width = " 30 " >& nbsp ; </ td >
2010-05-27 13:58:36 +00:00
< td >< a href = " ./index.php?page=administration_client&action=newclient " > Création d ' un nouveau client </ a ></ td >
2009-09-10 15:31:37 +00:00
</ tr >
</ table >
< ? php
}
?>
</ div >