177 lines
9.6 KiB
PHP
177 lines
9.6 KiB
PHP
<?php
|
|
include_once(realpath(dirname(__FILE__)) . "/../../../../fonctions/authplugins.php");
|
|
|
|
autorisation("statsplus");
|
|
|
|
?>
|
|
<?php
|
|
include_once(realpath(dirname(__FILE__)) . "/../calc/calc_3mois.php");
|
|
?>
|
|
<p align="right" class="geneva11Reg_3B4B5B"><a href="accueil.php" class="lien04">Accueil </a> <img src="gfx/suivant.gif" width="12" height="9" border="0" />
|
|
<select id="staturl">
|
|
<option value="#"></option><br />
|
|
<option value="module.php?nom=statsplus&graph=ouverture">Ventes par an</option>
|
|
<option value="module.php?nom=statsplus&graph=3mois">Ventes sur 12 mois</option>
|
|
<option value="module.php?nom=statsplus&graph=heures">Ventes par heure</option>
|
|
<option value="module.php?nom=statsplus&graph=jours">Ventes par jour</option>
|
|
<option value="module.php?nom=statsplus&graph=produits">Produits</option>
|
|
<option value="module.php?nom=statsplus&graph=commandes">Commandes</option>
|
|
<option value="module.php?nom=statsplus&graph=clients">Clients</option>
|
|
<option value="module.php?nom=statsplus&graph=paiement">Paiements</option>
|
|
</select>
|
|
<a href="module.php?nom=statsplus" class="lien04">Stats</a> <img src="gfx/suivant.gif" width="12" height="9" border="0" /><a href="#" class="lien04">Stats de ventes sur les 12 derniers mois</a>
|
|
</p>
|
|
<?php
|
|
//-2505600 * 2
|
|
if($_REQUEST['ts'] == "")
|
|
|
|
$ts = mktime(0, 0, 0, date("m"), date("d"), date("Y"))-15033600 * 2;
|
|
|
|
else
|
|
$ts = $_REQUEST['ts'];
|
|
|
|
$tssave = $ts;
|
|
|
|
for($i=0; $i<13; $i++){
|
|
$moisorig = date("m", $tssave);
|
|
while(date("m", $tssave) == $moisorig) $tssave -=1000;
|
|
}
|
|
$avant = $tssave;
|
|
|
|
$tssave = $ts;
|
|
|
|
for($i=0; $i<13; $i++){
|
|
$moisorig = date("m", $tssave);
|
|
while(date("m", $tssave) == $moisorig) $tssave +=1000;
|
|
}
|
|
$apres = $tssave;
|
|
|
|
?>
|
|
|
|
|
|
<img src="../client/plugins/statsplus/graphs/graph_3mois.php?ts=<?php echo $ts; ?>" alt="-" />
|
|
<a href="module.php?nom=statsplus&graph=3mois&ts=<?php echo $avant; ?>">Avant</a>
|
|
<a href="module.php?nom=statsplus&graph=3mois&ts=<?php echo $apres; ?>" style="padding-left: 860px;">Apres</a>
|
|
|
|
<br /><br />
|
|
|
|
<?php
|
|
for($i=0;$i<13;$i++){
|
|
|
|
$moisorig = date("m", $ts);
|
|
|
|
$caport[] = calc(date("m", $ts), date("Y", $ts), 100, 1);
|
|
$casansport[] = calc(date("m", $ts), date("Y", $ts), 100, 0);
|
|
$mois[] = trouve_mois(date("m", $ts)) . " " . date("Y", $ts);
|
|
$nb[] = calc(date("m", $ts), date("Y", $ts), 100, 1, 1);
|
|
while(date("m", $ts) == $moisorig) $ts +=1000;
|
|
|
|
}
|
|
?>
|
|
<table width="100%" border="0" cellpadding="5" cellspacing="0">
|
|
<tr>
|
|
<td width="100%" height="30" class="titre_cellule_tres_sombre">Statistiques</td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
|
<tr class="cellule_sombre">
|
|
<td width="8%" height="30"> </td>
|
|
<td width="8%" height="30"><?php echo $mois[0]; ?></td>
|
|
<td width="8%" height="30"><?php echo $mois[1]; ?></td>
|
|
<td width="8%" height="30"><?php echo $mois[2]; ?></td>
|
|
<td width="8%" height="30"><?php echo $mois[3]; ?></td>
|
|
<td width="8%" height="30"><?php echo $mois[4]; ?></td>
|
|
<td width="8%" height="30"><?php echo $mois[5]; ?></td>
|
|
<td width="8%" height="30"><?php echo $mois[6]; ?></td>
|
|
<td width="8%" height="30"><?php echo $mois[7]; ?></td>
|
|
<td width="8%" height="30"><?php echo $mois[8]; ?></td>
|
|
<td width="8%" height="30"><?php echo $mois[9]; ?></td>
|
|
<td width="8%" height="30"><?php echo $mois[10]; ?></td>
|
|
<td width="8%" height="30"><?php echo $mois[11]; ?></td>
|
|
<td width="8%" height="30"><?php echo $mois[12]; ?></td>
|
|
</tr>
|
|
|
|
<tr class="cellule_sombre">
|
|
<td width="8%" height="30">CA TTC</td>
|
|
<td width="8%" height="30"><?php echo round($caport[0]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[1]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[2]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[3]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[4]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[5]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[6]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[7]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[8]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[9]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[10]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[11]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[12]); ?></td>
|
|
</tr>
|
|
<tr class="cellule_sombre">
|
|
<td width="8%" height="30">CA HT</td>
|
|
<td width="8%" height="30"><?php echo round($caport[0]/1.20, 0); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[1]/1.20, 0); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[2]/1.20, 0); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[3]/1.20, 0); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[4]/1.20, 0); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[5]/1.20, 0); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[6]/1.20, 0); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[7]/1.20, 0); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[8]/1.20, 0); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[9]/1.20, 0); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[10]/1.20, 0); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[11]/1.20, 0); ?></td>
|
|
<td width="8%" height="30"><?php echo round($caport[12]/1.20, 0); ?></td>
|
|
</tr>
|
|
<tr class="cellule_sombre">
|
|
<td width="8%" height="30">CA hors frais de port TTC</td>
|
|
<td width="8%" height="30"><?php echo round($casansport[0]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($casansport[1]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($casansport[2]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($casansport[3]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($casansport[4]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($casansport[5]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($casansport[6]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($casansport[7]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($casansport[8]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($casansport[9]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($casansport[10]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($casansport[11]); ?></td>
|
|
<td width="8%" height="30"><?php echo round($casansport[12]); ?></td>
|
|
</tr>
|
|
<tr class="cellule_sombre">
|
|
<td width="8%" height="30">Panier moyen TTC</td>
|
|
<td width="8%" height="30"><?php if($nb[0]) echo round($caport[0] / $nb[0], 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[1]) echo round($caport[1] / $nb[1], 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[2]) echo round($caport[2] / $nb[2], 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[3]) echo round($caport[3] / $nb[3], 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[4]) echo round($caport[4] / $nb[4], 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[5]) echo round($caport[5] / $nb[5], 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[6]) echo round($caport[6] / $nb[6], 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[7]) echo round($caport[7] / $nb[7], 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[8]) echo round($caport[8] / $nb[8], 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[9]) echo round($caport[9] / $nb[9], 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[10]) echo round($caport[10] / $nb[10], 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[11]) echo round($caport[11] / $nb[11], 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[12]) echo round($caport[12] / $nb[12], 0); else echo "-"; ?></td>
|
|
</tr>
|
|
<tr class="cellule_sombre">
|
|
<td width="8%" height="30">Panier moyen HT</td>
|
|
<td width="8%" height="30"><?php if($nb[0]) echo round($caport[0] / $nb[0] / 1.20, 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[1]) echo round($caport[1] / $nb[1] / 1.20, 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[2]) echo round($caport[2] / $nb[2] / 1.20, 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[3]) echo round($caport[3] / $nb[3] / 1.20, 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[4]) echo round($caport[4] / $nb[4] / 1.20, 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[5]) echo round($caport[5] / $nb[5] / 1.20, 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[6]) echo round($caport[6] / $nb[6] / 1.20, 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[7]) echo round($caport[7] / $nb[7] / 1.20, 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[8]) echo round($caport[8] / $nb[8] / 1.20, 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[9]) echo round($caport[9] / $nb[9] / 1.20, 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[10]) echo round($caport[10] / $nb[10] / 1.20, 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[11]) echo round($caport[11] / $nb[11] / 1.20, 0); else echo "-"; ?></td>
|
|
<td width="8%" height="30"><?php if($nb[12]) echo round($caport[12] / $nb[12] / 1.20, 0); else echo "-"; ?></td>
|
|
</tr>
|
|
</table>
|