Files
2020-01-27 08:56:08 +01:00

87 lines
2.8 KiB
PHP

<?php
include_once(realpath(dirname(__FILE__)) . "/../../../../fonctions/authplugins.php");
autorisation("statsplus");
?>
<?php
include_once(realpath(dirname(__FILE__)) . "/../calc/calc_jours.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 par jour</a>
</p>
<img src="../client/plugins/statsplus/graphs/graph_jours.php" alt="-" />
<?php
$debut = mktime (0, 0, 0, 1, 1, date("Y"));
$now = mktime();
for($i=$debut; $i<=$now; $i+=86400){
$jour = date("w", $i);
$liste[$jour][] = date("Y-m-d", $i);
}
for($i=1;$i<7;$i++){
$caport[] = ca($i, $liste, 100, 1);
$casansport[] = ca($i, $liste, 100, 0);
$nb[] = ca($i, $liste, 100, 1, 1);
$j[] = trouve_jour($i);
}
$caport[] = ca(0, $liste, 100, 1);
$casansport[] = ca(0, $liste, 100, 0);
$nb[] = ca(0, $liste, 100, 1, 1);
$j[] = trouve_jour(0);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="cellule_sombre">
<td height="30">Jour</td>
<td height="30">Chiffre d'affaires TTC</td>
<td height="30">Chiffre d'affaires HT</td>
<td height="30">Chiffre d'affaires hors frais de port TTC</td>
<td height="30">Panier moyen TTC</td>
<td height="30">Panier moyen HT</td>
</tr>
<?php
for($i=0; $i<count($nb); $i ++){
?>
<tr class="cellule_sombre">
<td height="30"><?php echo $j[$i]; ?></td>
<td height="30"><?php echo $caport[$i]; ?></td>
<td height="30"><?php echo round($caport[$i]/1.196, 2); ?></td>
<td height="30"><?php echo $casansport[$i]; ?></td>
<td height="30"><?php if($nb[$i]) echo round($caport[$i] / $nb[$i], 2); else echo "-"; ?></td>
<td height="30"><?php if($nb[$i]) echo round($caport[$i] / $nb[$i] / 1.196, 2); else echo "-"; ?></td>
</tr>
<?php
}
?>
</table>