Initial commit

This commit is contained in:
2020-01-27 08:56:08 +01:00
commit b7525048d6
27129 changed files with 3409855 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
Ce plugin est un module de statistiques avancées.
Stats sur les 3 derniers mois, les ventes par heures, par jours, depuis l'ouverture.
Veuillez simplement glisser le répertoire statsplus dans le dossier client/plugins de votre Thelia.
Une nouvelle entrée sera disponible dans les modules d'administration.
Auteur : Yoan De Macedo
yoandm@gmail.com

View File

@@ -0,0 +1,40 @@
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) Octolys Development */
/* email : thelia@octolys.fr */
/* web : http://www.octolys.fr */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License, or */
/* (at your option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* */
/*************************************************************************************/
?>
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../classes/PluginsClassiques.class.php");
include_once(realpath(dirname(__FILE__)) . "/../../../classes/Commande.class.php");
include_once(realpath(dirname(__FILE__)) . "/../../../classes/Venteprod.class.php");
include_once(realpath(dirname(__FILE__)) . "/../../../classes/Client.class.php");
include_once(realpath(dirname(__FILE__)) . "/../../../classes/Pays.class.php");
include_once(realpath(dirname(__FILE__)) . "/../../../classes/Paysdesc.class.php");
class Statsplus extends PluginsClassiques{
function Statsplus(){
$this->PluginsClassiques();
}
}
?>

View File

@@ -0,0 +1,177 @@
<?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">&nbsp;</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>

View File

@@ -0,0 +1,84 @@
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../../fonctions/authplugins.php");
autorisation("statsplus");
?>
<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>
<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>
<img src="gfx/suivant.gif" width="12" height="9" border="0" /><a href="#" class="lien04">Stats de ventes clients</a>
</p>
<!--
<img src="../client/plugins/statsplus/graphs/graph_produits.php" alt="-" />
-->
<?php
$client = new Client();
$refer = array();
$query_test = "select id,nom,prenom from $client->table";
$resul_test = mysql_query($query_test, $client->link);
while($row_test = mysql_fetch_array($resul_test)){
$commande = new Commande();
$query_testa = "select * from $commande->table WHERE client='".$row_test[0]."' AND (statut='2' OR statut='3' OR statut='4')";
$resul_testa = mysql_query($query_testa, $commande->link);
while($row_testa = mysql_fetch_array($resul_testa)){
$venteprod = new Venteprod();
$cpta += 1;
$query_testb = "select * from $venteprod->table where commande='".$row_testa[0]."'";
$resul_testb = mysql_query($query_testb, $venteprod->link);
while($row_testb = mysql_fetch_array($resul_testb)){
$cptb += $row_testb[6];
}
}
if($cpta >=1){
$refer[] = $row_test[1].",".$row_test[2].",".$cpta.",".$cptb;
}
$cpta='';
$cptb='';
}
$annee = substr($row_test->date, 0, 4);
/*
$query_test = "select * from $commande->table where statut>=2 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);
*/
?>
<table cellpadding="0" cellspacing="0" border="0" width="100%" id="stats" class="display">
<thead>
<tr class="cellule_sombre">
<th height="30">Nom</th>
<th height="30">Pr&eacute;nom</th>
<th height="30">Nb</th>
<th height="30">C.A &euro;</th>
</tr>
</thead>
<tbody>
<?php
foreach($refer as $ref){
$cut = preg_split('#,#', $ref);
?>
<tr class="cellule_claire">
<td height="30"><?php echo $cut[0]; ?></td>
<td height="30"><?php echo $cut[1]; ?></td>
<td height="30"><?php echo $cut[2]; ?></td>
<td height="30"><?php echo ceil($cut[3]); ?></td>
</tr>
<?php
}
?>
<tbody>
</table>

View File

@@ -0,0 +1,125 @@
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../../fonctions/authplugins.php");
autorisation("statsplus");
?>
<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>
<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>
<img src="gfx/suivant.gif" width="12" height="9" border="0" /><a href="#" class="lien04">Stats commandes</a>
</p>
<!--
<img src="../client/plugins/statsplus/graphs/graph_produits.php" alt="-" />
-->
<?php
$commande = new Commande();
//$refer = array();
$query_testa = "select * from $commande->table";
$resul_testa = mysql_query($query_testa, $commande->link);
while($row_testa = mysql_fetch_array($resul_testa)){
if($row_testa[18] == 1){
$cpta +=1;
$venteprod = new Venteprod();
$query_testb = "select * from $venteprod->table where commande='".$row_testa[0]."'";
$resul_testb = mysql_query($query_testb, $venteprod->link);
while($row_testb = mysql_fetch_array($resul_testb)){
$cptab += $row_testb[6];
}
}elseif($row_testa[18] == 2){
$cptb +=1;
$venteprod = new Venteprod();
$query_testb = "select * from $venteprod->table where commande='".$row_testa[0]."'";
$resul_testb = mysql_query($query_testb, $venteprod->link);
while($row_testb = mysql_fetch_array($resul_testb)){
$cptbb += $row_testb[6];
}
}elseif($row_testa[18] == 3){
$cptc +=1;
$venteprod = new Venteprod();
$query_testb = "select * from $venteprod->table where commande='".$row_testa[0]."'";
$resul_testb = mysql_query($query_testb, $venteprod->link);
while($row_testb = mysql_fetch_array($resul_testb)){
$cptcb += $row_testb[6];
}
}elseif($row_testa[18] == 4){
$cptd +=1;
$venteprod = new Venteprod();
$query_testb = "select * from $venteprod->table where commande='".$row_testa[0]."'";
$resul_testb = mysql_query($query_testb, $venteprod->link);
while($row_testb = mysql_fetch_array($resul_testb)){
$cptdb += $row_testb[6];
}
}elseif($row_testa[18] == 5){
$cpte +=1;
$venteprod = new Venteprod();
$query_testb = "select * from $venteprod->table where commande='".$row_testa[0]."'";
$resul_testb = mysql_query($query_testb, $venteprod->link);
while($row_testb = mysql_fetch_array($resul_testb)){
$cpteb += $row_testb[6];
}
}elseif($row_testa[18] == 6){
$cptf +=1;
$venteprod = new Venteprod();
$query_testb = "select * from $venteprod->table where commande='".$row_testa[0]."'";
$resul_testb = mysql_query($query_testb, $venteprod->link);
while($row_testb = mysql_fetch_array($resul_testb)){
$cptfb += $row_testb[6];
}
}
}
$annee = substr($row_test->date, 0, 4);
/*
$query_test = "select * from $commande->table where statut>=2 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);
*/
?>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="display">
<thead>
<tr class="cellule_sombre">
<th height="30">Nb</th>
<th height="30">Non r&eacute;gl&eacute;es</th>
<th height="30">Nb</th>
<th height="30">R&eacute;gl&eacute;es</th>
<th height="30">Nb</th>
<th height="30">En Traitement</th>
<th height="30">Nb</th>
<th height="30">Exp&eacute;di&eacute;es</th>
<th height="30">Nb</th>
<th height="30">Rembours&eacute;es</th>
<th height="30">Nb</th>
<th height="30">Attente ch&egrave;que</th>
</tr>
</thead>
<tbody>
<tr class="cellule_claire">
<td height="30"><?php echo $cpta; ?></td>
<td height="30"><?php echo ceil($cptab); ?> &euro;</td>
<td height="30"><?php echo $cptb; ?></td>
<td height="30"><?php echo ceil($cptbb); ?> &euro;</td>
<td height="30"><?php echo $cptc; ?></td>
<td height="30"><?php echo ceil($cptcb); ?> &euro;</td>
<td height="30"><?php echo $cptd; ?></td>
<td height="30"><?php echo ceil($cptdb); ?> &euro;</td>
<td height="30"><?php echo $cpte; ?></td>
<td height="30"><?php echo ceil($cpteb); ?> &euro;</td>
<td height="30"><?php echo $cptf; ?></td>
<td height="30"><?php echo ceil($cptfb); ?> &euro;</td>
</tr>
</tbody>
</table>

View File

@@ -0,0 +1,64 @@
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../../fonctions/authplugins.php");
autorisation("statsplus");
?>
<?php
include_once(realpath(dirname(__FILE__)) . "/../calc/calc_heures.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 heure</a>
<?php
for($i=0;$i<24;$i++){
$caport[] = ca($i, 100, 1);
$casansport[] = ca($i, 100, 0);
$nb[] = ca($i, 100, 0, 1);
}
?>
<img src="../client/plugins/statsplus/graphs/graph_heures.php" alt="-" />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="cellule_sombre">
<td height="30">Heure</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<24; $i ++){
?>
<tr class="cellule_sombre">
<td height="30"><?php if(strlen($i) == 1) echo "0"; echo $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>

View File

@@ -0,0 +1,87 @@
<?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>

View File

@@ -0,0 +1,81 @@
<?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>

View File

@@ -0,0 +1,81 @@
<?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>

View File

@@ -0,0 +1,77 @@
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../../fonctions/authplugins.php");
autorisation("statsplus");
?>
<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>
<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>
<img src="gfx/suivant.gif" width="12" height="9" border="0" /><a href="#" class="lien04">Stats de ventes produits</a>
</p>
<!--
<img src="../client/plugins/statsplus/graphs/graph_produits.php" alt="-" />
-->
<?php
$venteprod = new Venteprod();
$refer = array();
$query_test = "select * from $venteprod->table group by ref";
$resul_test = mysql_query($query_test, $venteprod->link);
while($row_test = mysql_fetch_array($resul_test)){
$query_testa = "select * from $venteprod->table where ref='".$row_test[1]."'";
$resul_testa = mysql_query($query_testa, $venteprod->link);
while($row_testa = mysql_fetch_array($resul_testa)){
$cpta += 1;
$cptb += $row_testa[6];
}
$refer[] = $row_test[1].",".$row_test[2].",".$cpta.",".$cptb;
$cpta='';
$cptb='';
}
$annee = substr($row_test->date, 0, 4);
/*
$query_test = "select * from $commande->table where statut>=2 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);
*/
?>
<table cellpadding="0" cellspacing="0" border="0" width="100%" id="stats" class="display">
<thead>
<tr class="cellule_sombre">
<th height="30">R&eacute;f&eacute;rence</th>
<th height="30">D&eacute;signation</th>
<th height="30">Qt&eacute;</th>
<th height="30">C.A &euro;</th>
</tr>
</thead>
<tbody>
<?php
foreach($refer as $ref){
$cut = preg_split('#,#', $ref);
?>
<tr class="cellule_claire">
<td height="30"><?php echo $cut[0]; ?></td>
<td height="30"><?php echo preg_replace('#- Taille.*|- Couleur.*|Taille.*|Couleur.*#is','',$cut[1]); ?></td>
<td height="30"><?php echo $cut[2]; ?></td>
<td height="30"><?php echo ceil($cut[3]); ?></td>
</tr>
<?php
}
?>
<tbody>
</table>

View File

@@ -0,0 +1,79 @@
<?php
function calc($mois, $annee, $pourc=100, $port=1, $type=0){
if(strlen($mois)<2)
$mois = "0$mois";
$commande = new Commande();
if($type == 0)
$query = "select * from $commande->table where statut>=2 and statut<>5 and date like '$annee-$mois-%'";
else
$query = "select count(*) as nb from $commande->table where statut>=2 and statut<>5 and date like '$annee-$mois-%'";
$resul = mysql_query($query);
if($type == 1){
return mysql_result($resul, 0, "nb");
}
$list="";
while($row = mysql_fetch_object($resul)){
$list .= "'" . $row->id . "'" . ",";
}
$list = substr($list, 0, strlen($list)-1);
$list == "";
if($list == "") $list="''";
$query = "SELECT sum(venteprod.quantite*venteprod.prixu) as ca FROM venteprod where commande in ($list)";
$resul = mysql_query($query);
$ca = round(mysql_result($resul, 0, "ca"), 2);
$query = "SELECT sum(port)as ca FROM commande where id in ($list)";
$resul = mysql_query($query);
$ca += mysql_result($resul, 0, "ca");
$query = "SELECT sum(remise)as ca FROM commande where id in ($list)";
$resul = mysql_query($query);
$ca -= mysql_result($resul, 0, "ca");
if(!$port){
$query = "SELECT sum(port)as port FROM commande where id in ($list)";
$resul = mysql_query($query);
$ca -= mysql_result($resul, 0, "port");
}
return round($ca*$pourc/100, 0);
}
function trouve_mois($mois){
switch($mois){
case '1' : return "Jan"; break;
case '2' : return "Fev"; break;
case '3' : return "Mars"; break;
case '4' : return "Avril"; break;
case '5' : return "Mai"; break;
case '6' : return "Juin"; break;
case '7' : return "Juil"; break;
case '8' : return "Aout"; break;
case '9' : return "Sept"; break;
case '10' : return "Oct"; break;
case '11' : return "Nov"; break;
case '12' : return "Dec"; break;
}
}
?>

View File

@@ -0,0 +1,58 @@
<?php
function ca($heure, $pourc=100, $port=1, $type=0){
if(strlen($heure)<2)
$heure = "0$heure";
$commande = new Commande();
if($type == 0)
$query = "select * from $commande->table where statut>=2 and statut<>5 and date like '%-%-% $heure:%:%'";
else
$query = "select count(*) as nb from $commande->table where statut>=2 and statut<>5 and date like '%-%-% $heure:%:%'";
$resul = mysql_query($query);
if($type == 1){
return mysql_result($resul, 0, "nb");
}
$list="";
while($row = mysql_fetch_object($resul)){
$list .= "'" . $row->id . "'" . ",";
}
$list = substr($list, 0, strlen($list)-1);
$list == "";
if($list == "") $list="''";
$query = "SELECT sum(venteprod.quantite*venteprod.prixu) as ca FROM venteprod where commande in ($list)";
$resul = mysql_query($query);
$ca = round(mysql_result($resul, 0, "ca"), 2);
$query = "SELECT sum(port)as ca FROM commande where id in ($list)";
$resul = mysql_query($query);
$ca += mysql_result($resul, 0, "ca");
$query = "SELECT sum(remise)as ca FROM commande where id in ($list)";
$resul = mysql_query($query);
$ca -= mysql_result($resul, 0, "ca");
if(!$port){
$query = "SELECT sum(port)as port FROM commande where id in ($list)";
$resul = mysql_query($query);
$ca -= mysql_result($resul, 0, "port");
}
return round($ca*$pourc/100, 2);
}
?>

View File

@@ -0,0 +1,78 @@
<?php
function ca($jour, $liste, $pourc=100, $port=1, $type=0){
if ( !isset( $search ) ) {
$search = "";
}
$search .= " and";
for($i=0; $i<count($liste);$i++)
$search .= " date like '" . $liste[$jour][$i] . "%' or";
$search = substr($search, 0, strlen($search)-2);
$commande = new Commande();
if($type == 0)
$query = "select * from $commande->table where statut>=2 and statut<>5 $search";
else
$query = "select count(*) as nb from $commande->table where statut>=2 and statut<>5 $search";
$resul = mysql_query($query);
if($type == 1){
return mysql_result($resul, 0, "nb");
}
$list="";
while($row = mysql_fetch_object($resul)){
$list .= "'" . $row->id . "'" . ",";
}
$list = substr($list, 0, strlen($list)-1);
$list == "";
if($list == "") $list="''";
$query = "SELECT sum(venteprod.quantite*venteprod.prixu) as ca FROM venteprod where commande in ($list)";
$resul = mysql_query($query);
$ca = round(mysql_result($resul, 0, "ca"), 2);
$query = "SELECT sum(port)as ca FROM commande where id in ($list)";
$resul = mysql_query($query);
$ca += mysql_result($resul, 0, "ca");
$query = "SELECT sum(remise)as ca FROM commande where id in ($list)";
$resul = mysql_query($query);
$ca -= mysql_result($resul, 0, "ca");
if(!$port){
$query = "SELECT sum(port)as port FROM commande where id in ($list)";
$resul = mysql_query($query);
$ca -= mysql_result($resul, 0, "port");
}
return round($ca*$pourc/100, 2);
}
function trouve_jour($jour){
switch($jour){
case '0' : return "Dimanche"; break;
case '1' : return "Lundi"; break;
case '2' : return "Mardi"; break;
case '3' : return "Mercredi"; break;
case '4' : return "Jeudi"; break;
case '5' : return "Vendredi"; break;
case '6' : return "Samedi"; break;
}
}
?>

View File

@@ -0,0 +1,57 @@
<?php
function ca($annee, $pourc=100, $port=1, $type=0){
$commande = new Commande();
if($type == 0)
$query = "select * from $commande->table where statut>=2 and statut<>5 and date like '$annee-%-%'";
else
$query = "select count(*) as nb from $commande->table where statut>=2 and statut<>5 and date like '$annee-%-%'";
$resul = mysql_query($query);
if($type == 1){
return mysql_result($resul, 0, "nb");
}
$list="";
while($row = mysql_fetch_object($resul)){
$list .= "'" . $row->id . "'" . ",";
}
$list = substr($list, 0, strlen($list)-1);
$list == "";
if($list == "") $list="''";
$query = "SELECT sum(venteprod.quantite*venteprod.prixu) as ca FROM venteprod where commande in ($list)";
$resul = mysql_query($query);
$ca = round(mysql_result($resul, 0, "ca"), 2);
$query = "SELECT sum(port)as ca FROM commande where id in ($list)";
$resul = mysql_query($query);
$ca += mysql_result($resul, 0, "ca");
$query = "SELECT sum(remise)as ca FROM commande where id in ($list)";
$resul = mysql_query($query);
$ca -= mysql_result($resul, 0, "ca");
if(!$port){
$query = "SELECT sum(port)as port FROM commande where id in ($list)";
$resul = mysql_query($query);
$ca -= mysql_result($resul, 0, "port");
}
return round($ca*$pourc/100, 2);
}
?>

View File

@@ -0,0 +1,57 @@
<?php
function ca($annee, $pourc=100, $port=1, $type=0){
$commande = new Commande();
if($type == 0)
$query = "select * from $commande->table where statut>=2 and statut<>5 and date like '$annee-%-%'";
else
$query = "select count(*) as nb from $commande->table where statut>=2 and statut<>5 and date like '$annee-%-%'";
$resul = mysql_query($query);
if($type == 1){
return mysql_result($resul, 0, "nb");
}
$list="";
while($row = mysql_fetch_object($resul)){
$list .= "'" . $row->id . "'" . ",";
}
$list = substr($list, 0, strlen($list)-1);
$list == "";
if($list == "") $list="''";
$query = "SELECT sum(venteprod.quantite*venteprod.prixu) as ca FROM venteprod where commande in ($list)";
$resul = mysql_query($query);
$ca = round(mysql_result($resul, 0, "ca"), 2);
$query = "SELECT sum(port)as ca FROM commande where id in ($list)";
$resul = mysql_query($query);
$ca += mysql_result($resul, 0, "ca");
$query = "SELECT sum(remise)as ca FROM commande where id in ($list)";
$resul = mysql_query($query);
$ca -= mysql_result($resul, 0, "ca");
if(!$port){
$query = "SELECT sum(port)as port FROM commande where id in ($list)";
$resul = mysql_query($query);
$ca -= mysql_result($resul, 0, "port");
}
return round($ca*$pourc/100, 2);
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

View File

@@ -0,0 +1,64 @@
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../../fonctions/authplugins.php");
autorisation("statsplus");
?>
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../../classes/Commande.class.php");
include_once(realpath(dirname(__FILE__)) . "/../../../../classes/Venteprod.class.php");
include_once(realpath(dirname(__FILE__)) . "/../calc/calc_3mois.php");
$mois = date("m");
$annee = date("Y");
$values = array();
$days = array();
$ts = $_REQUEST['ts'];
for($i=0;$i<13;$i++){
$moisorig = date("m", $ts);
$values[] = calc(date("m", $ts), date("Y", $ts), 100, 1);
$days[] = trouve_mois(date("m", $ts)) . " " . date("Y", $ts);
while(date("m", $ts) == $moisorig) $ts +=1000;
}
include_once(realpath(dirname(__FILE__)) . "/../../../../lib/artichow/LinePlot.class.php");
$graph = new archiGraph(968, 200);
$graph->border->hide();
$graph->title = new archiLabel("Progression du chiffre d'Affaires sur 12 mois.",new archiFileFont(ARTICHOW_FONT.'/Arial', 10));
$plot = new archiLinePlot($values);
// $plot->setBackgroundColor(new archiColor(240, 240, 240));
$plot->hideLine(TRUE);
$plot->setFillColor(new archiColor(180, 180, 180, 75));
//$plot->grid->setBackgroundColor(new archiColor(235, 235, 180, 60));
$plot->grid->hideVertical();
$plot->yAxis->setLabelPrecision(2);
$plot->xAxis->setLabelText($days);
$plot->mark->setType(archiMark::IMAGE);
$plot->mark->setImage(new archiFileImage("../gfx/point_graph.png"));
$plot->label->set($values);
$plot->label->setColor(new archiColor(236, 128, 0));
$plot->label->move(0, -12);
$plot->label->setFont(new archiFileFont(ARTICHOW_FONT.'/Arial', 8));
$plot->label->setPadding(3, 1, 1, 0);
$plot->setSpace(2, 2, NULL, NULL);
$graph->add($plot);
$graph->draw();
?>

View File

@@ -0,0 +1,62 @@
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../../fonctions/authplugins.php");
autorisation("statsplus");
?>
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../../classes/Commande.class.php");
include_once(realpath(dirname(__FILE__)) . "/../../../../classes/Venteprod.class.php");
include_once(realpath(dirname(__FILE__)) . "/../calc/calc_heures.php");
$mois = date("m");
$annee = date("Y");
$values = array();
$h = array();
for($i=0;$i<24;$i++){
$values[] = ca($i, 100, 1);
if(strlen($i) == 1)
$h[] = "0" . $i;
else
$h[] = $i;
}
include_once(realpath(dirname(__FILE__)) . "/../../../../lib/artichow/LinePlot.class.php");
$graph = new archiGraph(968, 200);
$graph->border->hide();
$graph->title = new archiLabel("Progression du chiffre d'Affaires par heure.",new archiFileFont(ARTICHOW_FONT.'/Arial', 10));
$plot = new archiLinePlot($values);
// $plot->setBackgroundColor(new archiColor(240, 240, 240));
$plot->hideLine(TRUE);
$plot->setFillColor(new archiColor(180, 180, 180, 75));
//$plot->grid->setBackgroundColor(new archiColor(235, 235, 180, 60));
$plot->grid->hideVertical();
$plot->yAxis->setLabelPrecision(2);
$plot->xAxis->setLabelText($h);
$plot->mark->setType(archiMark::IMAGE);
$plot->mark->setImage(new archiFileImage("../gfx/point_graph.png"));
$plot->label->set($values);
$plot->label->setColor(new archiColor(236, 128, 0));
$plot->label->move(0, -12);
$plot->label->setFont(new archiFileFont(ARTICHOW_FONT.'/Arial', 8));
$plot->label->setPadding(3, 1, 1, 0);
$plot->setSpace(2, 2, NULL, NULL);
$graph->add($plot);
$graph->draw();
?>

View File

@@ -0,0 +1,70 @@
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../../fonctions/authplugins.php");
autorisation("statsplus");
?>
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../../classes/Commande.class.php");
include_once(realpath(dirname(__FILE__)) . "/../../../../classes/Venteprod.class.php");
include_once(realpath(dirname(__FILE__)) . "/../calc/calc_jours.php");
$mois = date("m");
$annee = date("Y");
$values = array();
$j = array();
$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++){
$values[] = ca($i, $liste, 100, 1);
$j[] = trouve_jour($i);
}
$values[] = ca(0, $liste, 100, 1);
$j[] = trouve_jour(0);
include_once(realpath(dirname(__FILE__)) . "/../../../../lib/artichow/LinePlot.class.php");
$graph = new archiGraph(968, 200);
$graph->border->hide();
$graph->title = new archiLabel("Progression du chiffre d'Affaires par jour.",new archiFileFont(ARTICHOW_FONT.'/Arial', 10));
$plot = new archiLinePlot($values);
// $plot->setBackgroundColor(new archiColor(240, 240, 240));
$plot->hideLine(TRUE);
$plot->setFillColor(new archiColor(180, 180, 180, 75));
//$plot->grid->setBackgroundColor(new archiColor(235, 235, 180, 60));
$plot->grid->hideVertical();
$plot->yAxis->setLabelPrecision(2);
$plot->xAxis->setLabelText($j);
$plot->mark->setType(archiMark::IMAGE);
$plot->mark->setImage(new archiFileImage("../gfx/point_graph.png"));
$plot->label->set($values);
$plot->label->setColor(new archiColor(236, 128, 0));
$plot->label->move(0, -12);
$plot->label->setFont(new archiFileFont(ARTICHOW_FONT.'/Arial', 8));
$plot->label->setPadding(3, 1, 1, 0);
$plot->setSpace(2, 2, NULL, NULL);
$graph->add($plot);
$graph->draw();
?>

View File

@@ -0,0 +1,71 @@
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../../fonctions/authplugins.php");
autorisation("statsplus");
?>
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../../classes/Commande.class.php");
include_once(realpath(dirname(__FILE__)) . "/../../../../classes/Venteprod.class.php");
include_once(realpath(dirname(__FILE__)) . "/../calc/calc_ouverture.php");
$mois = date("m");
$annee = date("Y");
$values = array();
$days = array();
$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++){
$values[] = ca($i, 100, 1);
$days[] = $i;
}
include_once(realpath(dirname(__FILE__)) . "/../../../../lib/artichow/LinePlot.class.php");
$graph = new archiGraph(968, 200);
$graph->border->hide();
$graph->title = new archiLabel("Progression du chiffre d'Affaires par an.",new archiFileFont(ARTICHOW_FONT.'/Arial', 10));
$plot = new archiLinePlot($values);
// $plot->setBackgroundColor(new archiColor(240, 240, 240));
$plot->hideLine(TRUE);
$plot->setFillColor(new archiColor(180, 180, 180, 75));
//$plot->grid->setBackgroundColor(new archiColor(235, 235, 180, 60));
$plot->grid->hideVertical();
$plot->yAxis->setLabelPrecision(2);
$plot->xAxis->setLabelText($days);
$plot->mark->setType(archiMark::IMAGE);
$plot->mark->setImage(new archiFileImage("../gfx/point_graph.png"));
$plot->label->set($values);
$plot->label->setColor(new archiColor(236, 128, 0));
$plot->label->move(0, -12);
$plot->label->setFont(new archiFileFont(ARTICHOW_FONT.'/Arial', 8));
$plot->label->setPadding(3, 1, 1, 0);
$plot->setSpace(2, 2, NULL, NULL);
$graph->add($plot);
$graph->draw();
?>

View File

@@ -0,0 +1,72 @@
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../../fonctions/authplugins.php");
autorisation("statsplus");
?>
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../../classes/Commande.class.php");
include_once(realpath(dirname(__FILE__)) . "/../../../../classes/Venteprod.class.php");
/*
$mois = date("m");
$annee = date("Y");
$values = array();
$days = array();
$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++){
$values[] = ca($i, 100, 1);
$days[] = $i;
}
include_once(realpath(dirname(__FILE__)) . "/../../../../lib/artichow/LinePlot.class.php");
$graph = new archiGraph(968, 200);
$graph->border->hide();
$graph->title = new archiLabel("Progression du chiffre d'Affaires par an.",new archiFileFont(ARTICHOW_FONT.'/Arial', 10));
$plot = new archiLinePlot($values);
// $plot->setBackgroundColor(new archiColor(240, 240, 240));
$plot->hideLine(TRUE);
$plot->setFillColor(new archiColor(180, 180, 180, 75));
//$plot->grid->setBackgroundColor(new archiColor(235, 235, 180, 60));
$plot->grid->hideVertical();
$plot->yAxis->setLabelPrecision(2);
$plot->xAxis->setLabelText($days);
$plot->mark->setType(archiMark::IMAGE);
$plot->mark->setImage(new archiFileImage("../gfx/point_graph.png"));
$plot->label->set($values);
$plot->label->setColor(new archiColor(236, 128, 0));
$plot->label->move(0, -12);
$plot->label->setFont(new archiFileFont(ARTICHOW_FONT.'/Arial', 8));
$plot->label->setPadding(3, 1, 1, 0);
$plot->setSpace(2, 2, NULL, NULL);
$graph->add($plot);
$graph->draw();
*/
?>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--Migration automatique depuis le fichier original, sauvegardé dans plugin.xml.save-->
<plugin>
<descriptif lang="fr">
<titre>Statistiques plus</titre>
<chapo></chapo>
<description>Ce plugin est un module de statistiques avancées.</description>
<postscriptum></postscriptum>
</descriptif>
<version>1.1</version>
<auteur>
<nom>Yoan De Macedo - yoandm@gmail.com</nom>
<societe></societe>
<email></email>
<web></web>
</auteur>
<type>classique</type>
<prerequis/>
<thelia>1.5.0</thelia>
<etat>production</etat>
<documentation>Readme.txt</documentation>
<urlmiseajour></urlmiseajour>
</plugin>

View File

@@ -0,0 +1,43 @@
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../fonctions/authplugins.php");
autorisation("statsplus");
include_once(realpath(dirname(__FILE__)) . "/Statsplus.class.php");
?>
<div id="contenu_int">
<p class="titre_rubrique">Statistiques</p>
<?php
if($_REQUEST['graph'] == ""){
?>
<a href="module.php?nom=statsplus&graph=ouverture">Ventes par an</a><br /><br />
<a href="module.php?nom=statsplus&graph=3mois">Ventes sur les 12 derniers mois</a><br /><br />
<a href="module.php?nom=statsplus&graph=heures">Ventes par heures</a><br /><br />
<a href="module.php?nom=statsplus&graph=jours">Ventes par jour</a><br /><br />
<a href="module.php?nom=statsplus&graph=clients">Clients</a><br /><br />
<a href="module.php?nom=statsplus&graph=commandes">Produits</a><br /><br />
<a href="module.php?nom=statsplus&graph=paiements">Paiements</a>
<?php
} else {
switch($_REQUEST['graph']){
case 'ouverture' : include("../client/plugins/statsplus/admin/ouverture.php"); break;
case '3mois' : include("../client/plugins/statsplus/admin/3mois.php"); break;
case 'heures' : include("../client/plugins/statsplus/admin/heures.php"); break;
case 'jours' : include("../client/plugins/statsplus/admin/jours.php"); break;
case 'produits' : include("../client/plugins/statsplus/admin/produits.php"); break;
case 'commandes' : include("../client/plugins/statsplus/admin/commandes.php"); break;
case 'clients' : include("../client/plugins/statsplus/admin/clients.php"); break;
case 'paiements' : include("../client/plugins/statsplus/admin/paiements.php"); break;
}
}
?>
</div>