comptacotiz.php 2.11 KB
Newer Older
Ayolo's avatar
Ayolo committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<?php

/* Copyright 2007
 * - Simon Lopez < simon DOT lopez AT ayolo DOT org >
 *
 * Ce fichier fait partie du site de l'Association des Étudiants de
 * l'UTBM, http://ae.utbm.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.
 */
24

Ayolo's avatar
Ayolo committed
25
$topdir = "../";
Ayolo's avatar
Ayolo committed
26 27 28 29 30 31 32 33 34 35 36
require_once($topdir. "include/site.inc.php");
require_once($topdir. "include/cts/sqltable.inc.php");
$site = new site ();

$site->start_page("none","Statistiques");
$cts = new contents("Statistiques");

if (!$site->user->is_in_group ("gestion_ae"))
{
  $site->error_forbidden("none","group",9);
}
Ayolo's avatar
Ayolo committed
37 38 39
$_cts=new contents("Modes paiement cotisation");

$_cts->add_paragraph(
Ayolo's avatar
Ayolo committed
40
'<ol>'.
Ayolo's avatar
Ayolo committed
41 42 43 44 45
'<li>cheque</li>'.
'<li>carte bleue</li>'.
'<li>liquide</li>'.
'<li>administration</li>'.
'<li>eboutic</li>'.
Ayolo's avatar
Ayolo committed
46
'</ol>');
Ayolo's avatar
Ayolo committed
47
$cts->add($_cts,true);
Ayolo's avatar
Ayolo committed
48 49

$req = new requete($site->db,
Ayolo's avatar
Ayolo committed
50
   'SELECT `mode_paiement_cotis` as pouet '.
Ayolo's avatar
Ayolo committed
51
   ', CONCAT(CAST(`prix_paye_cotis`/100 as UNSIGNED),\' €\') as prix '.
Ayolo's avatar
Ayolo committed
52 53
   ', count(*) as nb '.
   ', CONCAT(CAST(count(*)*`prix_paye_cotis`/100 as UNSIGNED), \' €\') as total '.
Ayolo's avatar
Ayolo committed
54
   'FROM `ae_cotisations` '.
Ayolo's avatar
Ayolo committed
55
   'WHERE `date_cotis` >= \'2008-09-04 00:00:00\' '.
Ayolo's avatar
Ayolo committed
56
//   'AND `mode_paiement_cotis` NOT LIKE 3 '.
Ayolo's avatar
Ayolo committed
57 58 59 60 61 62 63 64 65 66 67 68 69
   'GROUP BY `mode_paiement_cotis` , `prix_paye_cotis`');
$tbl = new sqltable(
    "cotisations",
    "Cotisations",
    $req,
    "",
    "",
    array("pouet"=>"Type","nb"=>"Nombre","prix"=>"P.U.", "total"=>"Total"),
    array(), array(),
    array()
  );
$cts->add($tbl,true);
$site->add_contents($cts);
70
$site->end_page();
Ayolo's avatar
Ayolo committed
71 72

?>