Commit 4b9f44c2 authored by Denis S. Valdenaire's avatar Denis S. Valdenaire

suppression du repertoire stats

parent 7a71c7d3
......@@ -105,8 +105,13 @@ class Account extends Record {
}
public static function create_for_member($id) {
// SQL INSERT accounts
$sql = " ";
// SQL INSERT accounts SELECT members
$sql = " INSERT INTO accounts
(name, description, account_type_id)
SELECT CONCAT(lastname, ' ', firstname),
CONCAT(firstname, ' ', lastname, ' - ', po_town), 41
FROM members
WHERE id = ".$id;
return $GLOBALS["data"]->insert($sql);
}
}
<?php
/*
This file is part of phpLudoreve.
phpLudoreve 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.
phpLudoreve 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 phpLudoreve. If not, see <http://www.gnu.org/licenses/>.
*/
include "../fonctions/enttappli.php";
?>
<div class="corps"><h2>STATISTIQUES</h2>
<?php
/*
This file is part of phpLudoreve.
phpLudoreve 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.
phpLudoreve 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 phpLudoreve. If not, see <http://www.gnu.org/licenses/>.
*/
require_once "../fonctions/artichow/LinePlot.class.php";
require_once "../fonctions/artichow/BarPlot.class.php";
require "../fonctions/sql.inc";
// Return a random color
function color($a = NULL) {
return new Color(mt_rand(20, 180), mt_rand(20, 180), mt_rand(20, 180), $a);
}
function formatLabel($value) {
return sprintf("%.2f", $value);
}
$graph = new Graph(550, 200);
// $graph->setAntiAliasing(TRUE);
$graph->title->set("Fréquentation Par Mois");
$group = new PlotGroup;
$group->setXAxisZero(FALSE);
$group->setBackgroundColor(new Color(197, 180, 210, 80));
$group->setPadding(40, 160, 40, NULL);
// $group->setSpace(5, 50, 5, 0);
$group->axis->left->title->set("Presents");
$group->axis->right->title->set("Jours");
global $server_link;
$sql="SELECT date AS intervale,
SUM(enfant_m6 + enfant_p6) AS enfants,
SUM(mere + pere + ass_mat + autre) AS adultes,
COUNT(*) AS jours
FROM stats_jour WHERE YEAR(date)='".mysql_real_escape_string($_GET['year'],$server_link)."'
GROUP BY MONTH(date)";
$requete=mysql_query($sql,$server_link);
$y1 = $y2 = $x= array();
//date_default_timezone_set("Europe/Paris");
while ($resultat = mysql_fetch_array($requete))
{
$x[] = strftime("%B",strtotime($resultat['intervale']));
$y1[] = $resultat['enfants'];
$y2[] = $resultat['adultes'];
$y3[] = $resultat['jours'];
}
function setYear($value) {
global $x;
return $x[$value];
}
$group->axis->bottom->label->setCallbackFunction('setYear');
//enfants
$plot1 = new BarPlot($y1);
$blue = new Color(150, 0, 250, 0);
$plot1->setBarColor($blue);
$plot1->setYAxis(Plot::LEFT);
$group->add($plot1);
$group->legend->add($plot1, "Enfants", Legend::BACKGROUND);
//adultes
$plot2 = new BarPlot($y2);
$noir = new Color(120, 120, 10, 0);
$plot2->setBarColor($noir);
$plot2->setYAxis(Plot::LEFT);
$group->add($plot2);
$group->legend->add($plot2, "Adultes", Legend::BACKGROUND);
//jours
$plot3 = new LinePlot($y3,LinePlot::MIDDLE);
$red = new Color(240, 50, 50, 25);
$blue = new Color(150, 50, 50, 250);
$group->axis->right->setColor($red);
$plot3->setColor($red);
$plot3->setFillColor($blue);
$plot3->setYAxis(Plot::RIGHT);
//$plot->legend->setPosition(0.4, 0.2);
//$plot->legend->setPadding(3, 3, 3, 3, 3);
$group->add($plot3);
$group->legend->add($plot3, "Jours ouverts", Legend::LINE);
//dessin
$group->legend->setPosition(0.99,0.3);
$graph->add($group);
$graph->draw();
?>
<?php
/*
This file is part of phpLudoreve.
phpLudoreve 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.
phpLudoreve 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 phpLudoreve. If not, see <http://www.gnu.org/licenses/>.
*/
include "../fonctions/sql.inc";
//création de l'enregistrement du jour s'il n'existe pas
$sql="SELECT date,enfant_m6,enfant_p6,mere,pere,ass_mat,autre
FROM stats_jour
WHERE date='".date('Y-m-d')."'";
$res=mysql_query($sql,$server_link);
if ( !sql_count($res) )
{
$sql_ins="INSERT INTO stats_jour(date) VALUES ('".date('Y-m-d')."')";
$res_ins=sql_command($sql_ins,$server_link);
}
//récupération des valeurs en cours
$sql="SELECT date,enfant_m6,enfant_p6,mere,pere,ass_mat,autre
FROM stats_jour
WHERE date='".date('Y-m-d')."'";
$res=mysql_query($sql,$server_link);
$stat=mysql_fetch_array($res);
//incrementation des statistiques si appel correct de la page
if ($_GET['qui'])
{
$stat[$_GET['qui']]=$stat[$_GET['qui']]+1;
$set=" ".$_GET['qui']."=".$stat[$_GET['qui']];
$sql="UPDATE stats_jour SET $set where date='".date('Y-m-d')."'";
$res=sql_command($sql,$server_link);
}
header("Location: ../accueil/index.php");
?>
\ No newline at end of file
<?php
/*
This file is part of phpLudoreve.
phpLudoreve 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.
phpLudoreve 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 phpLudoreve. If not, see <http://www.gnu.org/licenses/>.
*/
include "entt.php";
function ligne_encours()
{
global $server_link;
$sql="SELECT count(*) FROM jeu";
$requete=mysql_query($sql,$server_link);
$resultat = mysql_fetch_array($requete);
echo "Jeux : ".$resultat[0]." - ";
$sql="SELECT count(*) FROM adherent";
$requete=mysql_query($sql,$server_link);
$resultat = mysql_fetch_array($requete);
echo "Adhérents : ".$resultat[0]." - ";
$sql="SELECT count(*) FROM prets WHERE rendu=0";
$requete=mysql_query($sql,$server_link);
$resultat = mysql_fetch_array($requete);
echo "Prêts en cours : ".$resultat[0];
}
echo "<h1>STATISTIQUES DISPONIBLES</h1>";
echo "<table>";
echo "<tr>
<th><a href=presence.php>Présence les derniers jours</a>
</th></tr><tr>
<th><a href=statsprets.php>Statistiques des Prêts sur une année</a>
</th></tr><tr>
<th><a href=statspres.php>Statistiques de Présence sur une année</a>
</th></tr><tr>
<th><a href=statspres2.php>Statistiques de Présence par âge sur une année</a>
</th>
</tr><tr>
<th><a href=statsweek.php>Présence Moyenne par jour de la semaine</a>
</th>
</tr>
<tr><td>";
ligne_encours();
echo "</td></tr></table>";
include "../fonctions/finpage.php";
<?php
/*
This file is part of phpLudoreve.
phpLudoreve 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.
phpLudoreve 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 phpLudoreve. If not, see <http://www.gnu.org/licenses/>.
*/
include "entt.php";
$sql="SELECT date,enfant_m6,enfant_p6,mere,pere,ass_mat,autre
FROM stats_jour ORDER BY date DESC LIMIT 0,30";
$requete=mysql_query($sql,$server_link);
echo "<h1>PRESENCE QUOTIDIENNE</h1>";
echo "<table>";
echo "<tr><th>DATE</th><th>Enfant -6</th><th>Enfant +6</th><th>Mère</th>
<th>Père</th><th>Assistant Maternel</th><th>Autre</th></tr>";
while ($resultat = mysql_fetch_array($requete))
{
echo "<tr>
<td>".$resultat['date']."</td>
<td>".$resultat['enfant_m6']."</td>
<td>".$resultat['enfant_p6']."</td>
<td>".$resultat['mere']."</td>
<td>".$resultat['pere']."</td>
<td>".$resultat['ass_mat']."</td>
<td>".$resultat['autre']."</td>
</tr>";
}
echo "</table>";
include "../fonctions/finpage.php";
<?php
/*
This file is part of phpLudoreve.
phpLudoreve 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.
phpLudoreve 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 phpLudoreve. If not, see <http://www.gnu.org/licenses/>.
*/
include "entt.php";
echo "<h1>FRÉQUENTATION ANNUELLE DE LA LUDOTHÈQUE</h1>";
echo "<form name=annee action=".$_SERVER['PHP_SELF']." method=post>
Année <select name=year>";
for ($annee=2020;$annee>2004;$annee--)
{
echo "<option ";
if (isset($_POST['year']) && $_POST['year']==$annee) echo "selected";
elseif ($annee==date('Y')) echo "selected";
echo " value=$annee>$annee</option>";
}
echo "</select><input type=submit value=Calculer></form>";
if (isset($_POST['year']))
{
echo "<h2>Par trimestre</h2>";
// on veut les jours d'ouverture, les enfants et les adultes par mois
stats_presence('QUARTER',$_POST['year'],'Trimestre');
echo "<h2>Par mois</h2>";
echo '<img src=image_mois.php?year='.$_POST['year'].'>';
// on veut les jours d'ouverture, les enfants et les adultes par mois
stats_presence('MONTH',$_POST['year'],'Mois');
echo "<h2>Par an</h2>";
// on veut les jours d'ouverture, les enfants et les adultes par mois
stats_presence('YEAR',$_POST['year'],'Année');
}
include "../fonctions/finpage.php";
\ No newline at end of file
<?php
/*
This file is part of phpLudoreve.
phpLudoreve 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.
phpLudoreve 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 phpLudoreve. If not, see <http://www.gnu.org/licenses/>.
*/
include "entt.php";
echo "<h1>FRÉQUENTATION ANNUELLE DE LA LUDOTHÈQUE</h1>";
echo "<form name=annee action=".$_SERVER['PHP_SELF']." method=post>
Année <select name=year>";
for ($annee=2020;$annee>2004;$annee--)
{
echo "<option ";
if (isset($_POST['year']) && $_POST['year']==$annee) echo "selected";
elseif ($annee==date('Y')) echo "selected";
echo " value=$annee>$annee</option>";
}
echo "</select><input type=submit value=Calculer></form>";
if (isset($_POST['year']))
{
echo "<h2>Par trimestre</h2>";
// on veut les jours d'ouverture, les enfants et les adultes par mois
stats_presence2('QUARTER',$_POST['year'],'Trimestre');
echo "<h2>Par mois</h2>";
echo '<img src=image_mois.php?year='.$_POST['year'].'>';
// on veut les jours d'ouverture, les enfants et les adultes par mois
stats_presence2('MONTH',$_POST['year'],'Mois');
echo "<h2>Par an</h2>";
// on veut les jours d'ouverture, les enfants et les adultes par mois
stats_presence2('YEAR',$_POST['year'],'Année');
}
include "../fonctions/finpage.php";
\ No newline at end of file
<?php
/*
This file is part of phpLudoreve.
phpLudoreve 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.
phpLudoreve 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 phpLudoreve. If not, see <http://www.gnu.org/licenses/>.
*/
include "entt.php";
echo "<h1>PRÊTS ANNUELS DE LA LUDOTHÈQUE</h1>";
echo "<form name=annee action=".$_SERVER['PHP_SELF']." method=post>
Année <select name=year>";
for ($annee=2020;$annee>2004;$annee--)
{
echo "<option ";
if (isset($_POST['year']) && $_POST['year']==$annee) echo "selected";
elseif ($annee==date('Y')) echo "selected";
echo " value=$annee>$annee</option>";
}
echo "</select><input type=submit value=Calculer></form>";
if (isset($_POST['year']))
{
echo "<h2>Par trimestre</h2>";
// on veut les jours d'ouverture, les enfants et les adultes par mois
stats_prets('QUARTER',$_POST['year'],'Trimestre');
echo "<h2>Par mois</h2>";
// on veut les jours d'ouverture, les enfants et les adultes par mois
stats_prets('MONTH',$_POST['year'],'Mois');
echo "<h2>Par an</h2>";
// on veut les jours d'ouverture, les enfants et les adultes par mois
stats_prets('YEAR',$_POST['year'],'Année');
}
include "../fonctions/finpage.php";
\ No newline at end of file
<?php
/*
This file is part of phpLudoreve.
phpLudoreve 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.
phpLudoreve 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 phpLudoreve. If not, see <http://www.gnu.org/licenses/>.
*/
include "entt.php";
echo "<h1>FRÉQUENTATION DE LA LUDOTHÈQUE</h1>";
echo "<h2>Moyenne par jour de la semaine</h2>";
echo "<form name=annee action=".$_SERVER['PHP_SELF']." method=post>
Année <select name=year>";
for ($annee=2020;$annee>2004;$annee--)
{
echo "<option ";
if (isset($_POST['year']) && $_POST['year']==$annee) echo "selected";
elseif ($annee==date('Y')) echo "selected";
echo " value=$annee>$annee</option>";
}
echo "</select><input type=submit value=Calculer></form>";
if (isset($_POST['year']))
$sql="SELECT date AS jour,
AVG(enfant_m6) + AVG(enfant_p6) AS enfants,
AVG(mere) + AVG(pere) + AVG(ass_mat) + AVG(autre) AS adultes,
count(*) as jours
FROM stats_jour
WHERE YEAR(date)={$_POST['year']}
GROUP BY DAYOFWEEK(date)";
$requete=mysql_query($sql,$server_link);
echo "<table>";
echo "<tr><th>Jour de la semaine</th><th>Enfants</th>
<th>Adultes</th><th>Jours d'ouverture</th></tr>";
$ligne=FALSE; // pour alterner les lignes
$total_enfants=$total_adultes=$total_jours=0;
while ($resultat = mysql_fetch_array($requete))
{
$ligne=alterne_tr($ligne);
echo "<td>".strftime("%A",strtotime($resultat['jour']))."</td>
<td>".intval($resultat['enfants'])."</td>
<td>".intval($resultat['adultes'])."</td>
<td>".intval($resultat['jours'])."</td>
</tr>";
}
echo "</table>";
include "../fonctions/finpage.php";
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment