extranet/www/pages/stats.php

104 lines
3.9 KiB
PHP
Raw Normal View History

<?
$siret=trim(preg_replace('/[^0-9]/', '', $_REQUEST['siret']));
2009-03-11 07:51:18 +00:00
$idEntreprise=trim(preg_replace('/[^0-9]/', '', $_REQUEST['idEntreprise']))*1;
$client = new SoapClient(null, array( 'trace' => 1,
'soap_version' => SOAP_1_1,
'location' => WEBSERVICE_URL,
'uri' => WEBSERVICE_URI,
'login' => $_SESSION['tabInfo']['login'],
'password' => $_SESSION['tabInfo']['password'],
// 'encoding' => 'UTF-8'
));
if (!$_SESSION['connected'])
echo ('Vous devez <20>tre connect<63> afin de pouvoir utiliser cette fonctionnalit<69>');
elseif ($_SESSION['tabInfo']['profil']<>'Administrateur') {
echo ('Vous n\'avez pas les droits n<>cessaires pour utiliser cette fonctionnalit<69> ('.$_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) {
2009-02-26 17:16:11 +00:00
include_once(realpath(dirname(__FILE__).'/../../').'/includes/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">&nbsp;</td>
<td width="550" class="StyleInfoData"><h3><?=$message;?></h3></td>
</tr>
<?
}
?>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td width="550" class="StyleInfoLib" align="center"><h3>Statistiques d'utilisation</h3></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
2009-03-11 07:51:18 +00:00
<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<EFBFBD>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">&nbsp;</td>
</tr>
<tr>
<td width="30">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</td>
</tr>
</table><?
}
?>