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

81 lines
3.0 KiB
PHP

<?php
include_once(realpath(dirname(__FILE__)) . "/../../../../fonctions/authplugins.php");
autorisation("statsplus");
?>
<?php
include_once(realpath(dirname(__FILE__)) . "/../calc/calc_ouverture.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 an</a>
</p>
<img src="../client/plugins/statsplus/graphs/graph_ouverture.php" alt="-" />
<?php
$commande = new Commande();
$query_test = "select * from $commande->table where statut>=2 and statut<>5 order by date limit 0,1";
$resul_test = mysql_query($query_test, $commande->link);
$row_test = mysql_fetch_object($resul_test);
$annee = substr($row_test->date, 0, 4);
$query_test = "select * from $commande->table where statut>=2 and statut<>5 order by date desc limit 0,1";
$resul_test = mysql_query($query_test, $commande->link);
$row_test = mysql_fetch_object($resul_test);
$anneefin = substr($row_test->date, 0, 4);
for($i=$annee;$i<=$anneefin;$i++){
$caport[] = ca($i, 100, 1);
$casansport[] = ca($i, 100, 0);
$nb[] = ca($i, 100, 0, 1);
$lstannee[] = $i;
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="cellule_sombre">
<td height="30">Ann&eacute;e</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($caport);$i++){
?>
<tr class="cellule_sombre">
<td height="30"><?php echo $lstannee[$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>