96 lines
3.5 KiB
PHP
96 lines
3.5 KiB
PHP
<?
|
|
$siret=trim(preg_replace('/[^0-9]/', '', $_REQUEST['siret']));
|
|
$idEntreprise=trim(preg_replace('/[^0-9]/', '', $_REQUEST['idEntreprise']))*1;
|
|
|
|
if (!$_SESSION['connected'])
|
|
echo ('Vous devez être connecté afin de pouvoir utiliser cette fonctionnalité');
|
|
elseif ($_SESSION['tabInfo']['profil']!='Administrateur' && $_SESSION['tabInfo']['profil']!='SuperAdministrateur') {
|
|
echo ('Vous n\'avez pas les droits nécessaires pour utiliser cette fonctionnalité ('.$_SESSION['tabInfo']['profil'].')');
|
|
$siret=$_REQUEST['siret'];
|
|
}
|
|
else {
|
|
if (!isset($_REQUEST['login']) || $_REQUEST['login']=='') $login=$_SESSION['tabInfo']['login'];
|
|
else $login=$_REQUEST['login'];
|
|
if ($login=='reunicastats') $login='testreunica';
|
|
|
|
if (!isset($_REQUEST['mois']) || $_REQUEST['mois']=='') $mois=date('Y-m', mktime(0, 0, 0, date("m")-1, date("d"), date("Y")));
|
|
else $mois=$_REQUEST['mois'];
|
|
|
|
/** Utilisation du WS **/
|
|
try {
|
|
$O = $client->getStatsUtilisateurs($login, $mois);
|
|
//$stats=$O['results'];
|
|
//print_r($O);
|
|
} catch (SoapFault $fault) {
|
|
require_once 'soaperror.php';
|
|
processSoapFault($client,$fault,$tabInfo);
|
|
die();
|
|
}
|
|
//print_r($O);//utilisateurs);
|
|
?>
|
|
<table width="580" border="0" align="left" bgcolor="#FFFFFF">
|
|
<tr>
|
|
<td colspan="2"><img src="./img/rub_admin.png" width="577" height="36"></td>
|
|
</tr>
|
|
<?
|
|
if ($message<>'') {
|
|
?>
|
|
<tr>
|
|
<td width="30"> </td>
|
|
<td width="550" class="StyleInfoData"><h3><?=$message;?></h3></td>
|
|
</tr>
|
|
<?
|
|
}
|
|
?>
|
|
<tr>
|
|
<td colspan="2"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td width="30"> </td>
|
|
<td width="550" class="StyleInfoLib" align="center"><h3>Statistiques d'utilisation</h3></td>
|
|
</tr>
|
|
<tr>
|
|
<td width="30"> </td>
|
|
<td width="550" align="center"><form name="form_stats" action="./?page=stats&siret=<?=$siret?>&idEntreprise=<?=$idEntreprise?>" method="POST" enctype="multipart/form-data">
|
|
<select name="login" onchange="document.form_stats.submit()">
|
|
<!--<option value="mheitz" <?if ($login=='mheitz') echo 'selected';?>>Marc Heitz</option>
|
|
<option value="jmartory" <?if ($login=='jmartory') echo 'selected';?>>Jérôme Martory</option>
|
|
<option value="ylenaour" <?if ($login=='ylenaour') echo 'selected';?>>Yoann Le Naour</option>-->
|
|
<option value="testreunica" <?if ($login=='testreunica') echo 'selected';?>>REUNICA</option>
|
|
</select>
|
|
<select name="mois" onchange="document.form_stats.submit()"><?
|
|
for($listeMois=200804; $listeMois++; true) {
|
|
?><option value="<?=substr($listeMois,0,4)?>-<?=substr($listeMois,4,2)?>" <?if ($mois==substr($listeMois,0,4).'-'.substr($listeMois,4,2)) echo 'selected';?>><?=substr($listeMois,4,2).'/'.substr($listeMois,0,4)?></option><?
|
|
if ($listeMois*1==date('Ym')*1) break;
|
|
elseif (substr($listeMois,4,2)*1==12)
|
|
$listeMois=(substr($listeMois,0,4)*1+1).'00';
|
|
|
|
|
|
}?>
|
|
</select>
|
|
</form></td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2"> </td>
|
|
</tr>
|
|
<tr>
|
|
<td width="30"> </td>
|
|
<td width="550" align="center"><img src="./graphs/bar1.php?w=575&h=310&login=<?=$login?>&mois=<?=$mois?>&vue=jour" width="550" height="280"/></td>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="30"> </td>
|
|
<td width="550" align="center"><img src="./graphs/bar1.php?w=575&h=310&login=<?=$login?>&mois=<?=$mois?>&vue=jour&payant=1" width="550" height="280"/></td>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="30"> </td>
|
|
<td width="550" align="center"><img src="./graphs/bar1.php?w=575&h=310&login=<?=$login?>&mois=<?=$mois?>&vue=heure" width="550" height="280"/></td>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2"> </td>
|
|
</tr>
|
|
</table><?
|
|
}
|
|
?>
|