epnadmin-fr
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Epnadmin-fr] CVS: epnadmin camembert.inc.php,NONE,1.1 image.inc.php,NO


From: Loïc Dayot
Subject: [Epnadmin-fr] CVS: epnadmin camembert.inc.php,NONE,1.1 image.inc.php,NONE,1.1 constantes.inc.php,1.12,1.13 dateheure.inc.php,1.5,1.6 entete.inc.php,1.13,1.14 header.inc.php,1.10,1.11 inscription_session.php,1.12,1.13 logiciels.php,1.2,1.3 materiels.php,1.4,1.5 stats.php,1.7,1.8
Date: Thu, 02 Jan 2003 14:01:52 -0500

Update of /cvsroot/epnadmin/epnadmin
In directory subversions:/tmp/cvs-serv25892/epnadmin

Modified Files:
        constantes.inc.php dateheure.inc.php entete.inc.php 
        header.inc.php inscription_session.php logiciels.php 
        materiels.php stats.php 
Added Files:
        camembert.inc.php image.inc.php 
Log Message:
Améliorations dans les statistiques, notamment des graphiques (de base).
Corrections dans la gestion du parc de logiciels et de matériels.
Petites modifications de confort dans l'authentification.
Correction d'un problème dans les formulaires de choix d'heures.



--- NEW FILE ---
<?php
/*
 *
 *
 * Avertissement : Cette librairie de fonctions PHP est distribuee avec l'espoir
 * qu'elle sera utile, mais elle l'est SANS AUCUNE GARANTIE; sans meme la 
garantie de
 * COMMERCIALISATION ou d'UTILITE POUR UN BUT QUELCONQUE.
 * Elle est librement redistribuable tant que la presente licence, ainsi que 
les credits des
 * auteurs respectifs de chaque fonctions sont laisses ensembles.
 * En aucun cas, Nexen.net ne pourra etre tenu responsable de quelques 
consequences que ce soit
 * de l'utilisation ou la mesutilisation de ces fonctions PHP.

*/

/****
 * Titre : Camembert statistique
 * Auteur : Cedric Fronteau
 * Email : address@hidden
 * Url :
 * Description : Représente les valeurs d'un tableau sous forme de camembert.

****/
function draw_camembert($stats,$x,$y,$margin,$filename){
/* Parametres : 
   *     $stats : tableau de valeurs
   *     $x : largeur de l'image à créer
   *     $y : hauteur de l'image à créer
   *     $margin : marge entre le bord, le cercle et la legende
   *     $filename : nom à donner à de l'image
   */
   if (!is_array($stats) || ($x <= 0) || ($y <= 0))
      return FALSE;
   $vals = array_values($stats);
   $keys = array_keys($stats);
   
   $pic = imagecreate($x,$y);
   $min = min($vals);
   $max = max($vals);
   $taille = sizeof($vals);
   
   $white = imagecolorallocate($pic,255,255,255);
   $black = imagecolorallocate($pic,0,0,0);
   
   /* remplit le fond de l'image */
   imagefill($pic,0,0,$white);
   
   $total = somme($vals);
   $diametre = min($y,2/3*$x) - 2*$margin;
   $cx = floor($diametre/2) + $margin;
   $cy = floor($diametre/2) + $margin;
   srand((double)microtime()*1000000);
  
   /* cadre de la legende */
   $legendeW = $x - $diametre - 2*$margin;
   $legendeH = min(20 + (20 + 15)*$taille,$y-$margin);
   $nbmaxcar = floor(($legendeW-35)/8) - 1;
   imagerectangle($pic,
                  $x - $legendeW,$y - $legendeH,
                  $x - $margin,$y - $margin,
                  $black);
   /* dessin du graphe et de la legende */    
   $legende_y = $y - $margin - 20;
   $debut = 270;
   for($i=0;$i<$taille;$i++)
      {
      $r = rand(1,254);
      $g = rand(1,254);
      $b = rand(1,254);
      $col = imagecolorallocate($pic,$r,$g,$b);
      
      $fin = round($debut + $vals[$i]/$total*360);
      imagearc($pic,$cx,$cy,$diametre,$diametre,$debut,$fin,$col);

      $tx1 = round(cos(deg2rad($debut))*$diametre/2+$cx);
      $ty1 = round(sin(deg2rad($debut))*$diametre/2+$cy);
      $tx2 = round(cos(deg2rad($fin))*$diametre/2+$cx);
      $ty2 = round(sin(deg2rad($fin))*$diametre/2+$cy);
      
      imageline($pic,$cx,$cy,$tx1,$ty1,$col);
      imageline($pic,$cx,$cy,$tx2,$ty2,$col);

      $mid = floor(($fin - $debut)/2 + $debut);
      $px = round(cos(deg2rad($mid))*($diametre/2-$margin)+$cx);
      $py = round(sin(deg2rad($mid))*($diametre/2-$margin)+$cy);

      imagefilltoborder($pic,$px,$py,$col,$col);
      imagestring($pic,2,$px,$py,$vals[$i],$black);

      $debut = $fin;
      
      if ($legende_y >= ($y - $legendeH))
         {
         $xb = floor($x - $legendeW +10);
         $yb = floor($legende_y);
         $xe = floor($x - $legendeW +25);
         $ye = floor($legende_y + 15);
         imagefilledrectangle($pic,
                     $xb,$yb,
                     $xe,$ye,
                     $col);
      
         if (is_string($keys[$i]))
            {
            if (strlen($keys[$i]) > $nbmaxcar)
               $str = substr($keys[$i],0,$nbmaxcar - 1);
            else
               $str = $keys[$i];
            }
         else
            {
            if ($nbmaxcar > 8)
               $str = "Clé : ".$keys[$i];
            else
               $str = $keys[$i];
            }
         imagestring($pic,2,$x - $legendeW +35,$legende_y,$str,$black);
         }
      $legende_y -= (20+15);
      }
   imagearc($pic,$cx,$cy,$diametre,$diametre,0,360,$black);
   imagearc($pic,$cx,$cy,$diametre+7,$diametre+7,0,360,$black);
   imagefilltoborder($pic,$cx+($diametre+3)/2,$cy,$black,$black);
      
   @imagepng($pic,$filename);
   if (!file_exists($filename))
      return FALSE;
   return TRUE;
}

/****
 * Titre : Somme 
 * Auteur : Damien Seguy 
 * Email : address@hidden
 * Url : www.nexen.net/
 * Description : Somme tous les arguments.
****/
function somme(){
$args = func_get_args();
        $elements = array_pop($args);
        foreach ($args as $a) {
                $elements = array_merge($elements, $a);
        }
        $b = 0;
        @eval('$b = intval("'.implode('") + intval("', $elements).'");');
        return $b;
}


?>

--- NEW FILE ---
<?
/*
    Copyright (C) 2003 Loïc Dayot - Mairie de Pierrefitte (93)

    EPNadmin - Version 0.6

    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

    http://epnadmin.pierrefitte93.fr/
*/
header ("Content-type: image/png");
$image = ImageCreateFromPNG($filename);
ImagePNG($image);
ImageDestroy ($image);
?>
Index: constantes.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/constantes.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** constantes.inc.php  1 Jan 2003 13:23:07 -0000       1.12
--- constantes.inc.php  2 Jan 2003 19:01:49 -0000       1.13
***************
*** 3,7 ****
      Copyright (C) 2001, 2002 Bertand Pallie, Loïc Dayot
  
!     EPNadmin - Version 0.6 - 01/01/2003
  
      This program is free software; you can redistribute it and/or modify
--- 3,7 ----
      Copyright (C) 2001, 2002 Bertand Pallie, Loïc Dayot
  
!     EPNadmin - Version 0.5.3
  
      This program is free software; you can redistribute it and/or modify
***************
*** 26,35 ****
  // Paramétrage de MySQL
  $mysql_serveur="localhost";
! $mysql_identifiant="epnadmin";
! $mysql_motdepasse="";
! $mysql_base="epnadmin2";
  
  // Divers chemins
! $url_epnadmin="http://epnadmin.pierrefitte93.fr/epnadmin";;
  $fichier_temporaire="/var/www/php_temp"; // N'est normalement plus utilisé 
dans usagers.php
  $dirvpopmail="/usr/sbin"; // dossier des programmes de vpopmail (vadduser...)
--- 26,35 ----
  // Paramétrage de MySQL
  $mysql_serveur="localhost";
! $mysql_identifiant="arobase";
! $mysql_motdepasse="epamarobase";
! $mysql_base="arobase2";
  
  // Divers chemins
! $url_epnadmin="http://arobase.pierrefitte93.fr/epnadmin";;
  $fichier_temporaire="/var/www/php_temp"; // N'est normalement plus utilisé 
dans usagers.php
  $dirvpopmail="/usr/sbin"; // dossier des programmes de vpopmail (vadduser...)
***************
*** 37,41 ****
  $dircomptesvpopmail="/home/vpopmail"; // dossier des données de vpopmail 
(pour retirer des alias de dommaines
                                        // dans courriel.php
! $dir_fontes_ttf="/home/wwwusers/epnadmin.pierrefitte93.fr/www/epnadmin-0.5/"; 
 // utilisé dans print.php
  $dir_tmp_images="/tmp/"; // utilisé dans print.php et 6cartes.php
  $fichier_hotes_virtuels="/etc/apache-ssl/Include_VirtualHost/apache.conf"; // 
extention de la configuration
--- 37,41 ----
  $dircomptesvpopmail="/home/vpopmail"; // dossier des données de vpopmail 
(pour retirer des alias de dommaines
                                        // dans courriel.php
! $dir_fontes_ttf="/home/wwwusers/arobase.pierrefitte93.fr/www/epnadmin/";  // 
utilisé dans print.php
  $dir_tmp_images="/tmp/"; // utilisé dans print.php et 6cartes.php
  $fichier_hotes_virtuels="/etc/apache-ssl/Include_VirtualHost/apache.conf"; // 
extention de la configuration
***************
*** 48,57 ****
  
  // Tous les tarifs possibles pour les usagers
! $tarifs[0]="tarif A";    $tarifcouleur[0][0]=254; $tarifcouleur[0][1]=227; 
$tarifcouleur[0][2]=197;
! $tarifs[1]="tarif B";    $tarifcouleur[1][0]=250; $tarifcouleur[1][1]=169; 
$tarifcouleur[1][2]=211;
! $tarifs[2]="tarif C";    $tarifcouleur[2][0]=255; $tarifcouleur[2][1]=255; 
$tarifcouleur[2][2]=0;
  
  // Paramétrage des réservations des salles et des postes
! $unitehoraire=30; // nombre de minutes qui est l'unité de temps de 
réservation des postes individuels
  define ("MINHORAIRE", "08:00");
  define ("MAXHORAIRE", "22:00");
--- 48,57 ----
  
  // Tous les tarifs possibles pour les usagers
! $tarifs[0]="non-pierrefittois";    $tarifcouleur[0][0]=254; 
$tarifcouleur[0][1]=227; $tarifcouleur[0][2]=197;
! $tarifs[1]="pierrefittois";        $tarifcouleur[1][0]=250; 
$tarifcouleur[1][1]=169; $tarifcouleur[1][2]=211;
! $tarifs[2]="pierrefittois-réduit"; $tarifcouleur[2][0]=255; 
$tarifcouleur[2][1]=255; $tarifcouleur[2][2]=0;
  
  // Paramétrage des réservations des salles et des postes
! $unitehoraire=60; // nombre de minutes qui est l'unité de temps de 
réservation des postes individuels
  define ("MINHORAIRE", "08:00");
  define ("MAXHORAIRE", "22:00");
***************
*** 99,103 ****
  // Configurations
  // Est-ce que les commandes serveur (par sudo) sont actives ou non.
! $EXECUTION_COMMANDES_BASH = FALSE; // sert dans usagers.php, courriel.php, 
siteweb.php
                                    // pour la création des comptes sur le 
serveur
  ?>
--- 99,103 ----
  // Configurations
  // Est-ce que les commandes serveur (par sudo) sont actives ou non.
! $EXECUTION_COMMANDES_BASH = TRUE; // sert dans usagers.php, courriel.php, 
siteweb.php
                                    // pour la création des comptes sur le 
serveur
  ?>

Index: dateheure.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/dateheure.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** dateheure.inc.php   1 Jan 2003 13:23:07 -0000       1.5
--- dateheure.inc.php   2 Jan 2003 19:01:49 -0000       1.6
***************
*** 157,161 ****
  global $unitehoraire; // nombre de minutes qui est l'unité de temps de 
réservation des postes individuels
    echo "<td><select name=\"$nomchamp\">";
!   for ($heu=$hmin ; $heu<=$hmax; $heu=date("H:i", 
strtotime("+".$unitehoraire." minutes", strtotime($heu))))
    {
      echo "<option value=\"$heu\"";
--- 157,161 ----
  global $unitehoraire; // nombre de minutes qui est l'unité de temps de 
réservation des postes individuels
    echo "<td><select name=\"$nomchamp\">";
!   for ($heu=$hmin ; $heu<=$hmax && $heu!="00:00"; $heu=date("H:i", 
strtotime("+".$unitehoraire." minutes", strtotime($heu))))
    {
      echo "<option value=\"$heu\"";
***************
*** 163,167 ****
      echo ">".date("H:i",strtotime($heu))."</option>\n";
    }
!   echo "</select>
          </td>\n";
  }
--- 163,167 ----
      echo ">".date("H:i",strtotime($heu))."</option>\n";
    }
!   echo "</select>  
          </td>\n";
  }

Index: entete.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/entete.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** entete.inc.php      5 Nov 2002 19:12:12 -0000       1.13
--- entete.inc.php      2 Jan 2003 19:01:49 -0000       1.14
***************
*** 3,7 ****
      Copyright (C) 2001, 2002 Loïc Dayot - Mairie de Pierrefitte (93)
  
!     EPNadmin - Version 0.5.5 - 05/11/2002
  
      This program is free software; you can redistribute it and/or modify
--- 3,7 ----
      Copyright (C) 2001, 2002 Loïc Dayot - Mairie de Pierrefitte (93)
  
!     EPNadmin - Version 0.6 - 01/01/2003
  
      This program is free software; you can redistribute it and/or modify
***************
*** 159,163 ****
        <a href=\"siteweb.php?operation=11\">site web</a><br>
        <a href=\"courriel.php?operation=11\">courriel</a><br>
!       <a href=\"index.php?logoff=1\">me d&eacute;logguer</a>
      </td>
    </tr>
--- 159,163 ----
        <a href=\"siteweb.php?operation=11\">site web</a><br>
        <a href=\"courriel.php?operation=11\">courriel</a><br>
!       <a href=\"index.php?logoff=1&ti=1\">me d&eacute;logguer</a>
      </td>
    </tr>

Index: header.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/header.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** header.inc.php      8 Nov 2002 18:59:07 -0000       1.10
--- header.inc.php      2 Jan 2003 19:01:49 -0000       1.11
***************
*** 3,7 ****
      Copyright (C) 2001, 2002 Bertand Pallie, Loïc Dayot - Mairie de 
Pierrefitte (93)
  
!     EPNadmin - Version 0.5.4 - 09/11/2002
  
      This program is free software; you can redistribute it and/or modify
--- 3,7 ----
      Copyright (C) 2001, 2002 Bertand Pallie, Loïc Dayot - Mairie de 
Pierrefitte (93)
  
!     EPNadmin - Version 0.6 - 01/01/2003
  
      This program is free software; you can redistribute it and/or modify
***************
*** 36,40 ****
  
    <table align=\"center\" cellspacing=\"5\" bgcolor=\"#FF9999\">
!   <tr>\n";
  if (! $structure)
    echo "<td>
--- 36,40 ----
  
    <table align=\"center\" cellspacing=\"5\" bgcolor=\"#FF9999\">
!   <tr>\n"; //"
  if (! $structure)
    echo "<td>
***************
*** 42,47 ****
        <table align=\"center\" bgcolor=\"#".COULEUR_USAGER."\">
          <tr><th align=center>Identification usager</th></tr>
!         <tr><td>Mon identifiant :</td><td><input type=\"text\" 
name=\"login\"></td></tr>
!         <tr><td>Mon mot de passe :</td><td><input type=\"password\" 
name=\"mot_de_passe\"></td></tr>
          <tr><td align=center colspan=2><input type='submit' name='Valider' 
value=\"M'identifier en tant qu'usager\"></td></tr>
        </table>
--- 42,48 ----
        <table align=\"center\" bgcolor=\"#".COULEUR_USAGER."\">
          <tr><th align=center>Identification usager</th></tr>
!         <input type=\"hidden\" name=\"usager\" value=\"oui\">
!         <tr><td>Mon identifiant :</td><td><input type=\"text\" 
name=\"identifiant_usager\"></td></tr>
!         <tr><td>Mon mot de passe :</td><td><input type=\"password\" 
name=\"mot_de_passe_usager\"></td></tr>
          <tr><td align=center colspan=2><input type='submit' name='Valider' 
value=\"M'identifier en tant qu'usager\"></td></tr>
        </table>
***************
*** 54,59 ****
          <tr><th align=center>Identification structure</th></tr>
          <input type=\"hidden\" name=\"structure\" value=\"oui\">
!         <tr><td>Mon identifiant :</td><td><input type=\"text\" 
name=\"login\"></td></tr>
!         <tr><td>Mon mot de passe :</td><td><input type=\"password\" 
name=\"mot_de_passe\"></td></tr>
          <tr><td align=center colspan=2><input type='submit' name='Valider' 
value=\"M'identifier en tant que structure\"></td></tr>
        </table>
--- 55,60 ----
          <tr><th align=center>Identification structure</th></tr>
          <input type=\"hidden\" name=\"structure\" value=\"oui\">
!         <tr><td>Mon identifiant :</td><td><input type=\"text\" 
name=\"identifiant_structure\"></td></tr>
!         <tr><td>Mon mot de passe :</td><td><input type=\"password\" 
name=\"mot_de_passe_structure\"></td></tr>
          <tr><td align=center colspan=2><input type='submit' name='Valider' 
value=\"M'identifier en tant que structure\"></td></tr>
        </table>
***************
*** 65,73 ****
    <br> essayer les services r&eacute;serv&eacute;s aux usagers,
    <br>vous pouvez vous identifier avec &quot;<b>test</b>&quot; et comme mot 
de passe &quot;test&quot;.</font></i>
!   </td></tr></table>\n";
  if (! $structure)
!   echo "<a href=\"$PHP_SELF?operation=1\">S'identifier en tant que 
structure.</a>\n";
  else
!   echo "<a href=\"$PHP_SELF?operation=0\">S'identifier en tant qu'usager 
individuel.</a>\n";
  
    if ($mes>"")
--- 66,74 ----
    <br> essayer les services r&eacute;serv&eacute;s aux usagers,
    <br>vous pouvez vous identifier avec &quot;<b>test</b>&quot; et comme mot 
de passe &quot;test&quot;.</font></i>
!   </td></tr></table>\n"; //"
  if (! $structure)
!   echo "<a href=\"$PHP_SELF?ti=1\">S'identifier en tant que structure.</a>\n";
  else
!   echo "<a href=\"$PHP_SELF?ti=0\">S'identifier en tant qu'usager 
individuel.</a>\n";
  
    if ($mes>"")
***************
*** 95,130 ****
  if($is_ident!="ok")
  { // pas encore identifié
!   if($mot_de_passe!="" && $login!="")
!   { // On vient d'un formulaire d'identification
!     if ($structure)
!       $resultat = recherche("structures", "login", $login);
!     else
!       $resultat = recherche("usagers", "login", $login);
! 
!     if($resultat)
!      {
!        $enr = mysql_fetch_object($resultat);
!        if ($structure)
!        {
!          $id_structure=$enr->id;
!          if ($enr->admin!="non")
!            $isadmin=$enr->admin;
!        }
!        else
!          $id_usager = $enr->id;
!        $pass = $enr->motdepasse;
!      }
!      else
!        $mes="Identifiant incorrect.";
!   }
!   if ($pass!=$mot_de_passe && $pass!=md5($mot_de_passe))
!   {
!     $mes="Mot de passe incorrect.";
!   }
  
!   if(($mot_de_passe=="" || $login=="")
!      || ($pass!=$mot_de_passe && $pass!=md5($mot_de_passe)))
    { // mauvaise identification ou pas encore faite.
!     form_login($mes, ($operation==1));
      exit;
    }
--- 96,152 ----
  if($is_ident!="ok")
  { // pas encore identifié
!       // Identification en tant que
!       $mes="";
!       if ($structure)
!       {
!               $ti=1;
!               if ($identifiant_structure!="")
!               {
!                       if($resultat = recherche("structures", "login", 
$identifiant_structure))
!                       {
!                               if ($enr=mysql_fetch_object($resultat))
!                               {
!                                       $id_structure=$enr->id;
!                                       if ($enr->admin!="non")
!                                               $isadmin=$enr->admin;
!                                       $pass = $enr->motdepasse;
!                                       if ($pass!=$mot_de_passe_structure && 
$pass!=md5($mot_de_passe_structure))
!                                               $mes="Mot de passe incorrect.";
!                               }
!                               else
!                                       $mes="Identifiant structure incorrect.";
!                       }
!                       else
!                               $mes="Identifiant structure incorrect.";
!               }
!               else
!                       $mes="Absence d'identifiant structure";
!       } // if $structure
!       elseif ($usager) // c'est une identification en tant qu'usager
!       {
!               if ($identifiant_usager!="")
!               {
!                       if ($resultat = recherche("usagers", "login", 
$identifiant_usager))
!                       {
!                               if ($enr=mysql_fetch_object($resultat))
!                               {
!                                       $id_usager=$enr->id;
!                                       $pass = $enr->motdepasse;
!                                       if ($pass!=$mot_de_passe_usager && 
$pass!=md5($mot_de_passe_usager))
!                                               $mes="Mot de passe incorrect.";
!                               }
!                               else
!                                 $mes="Identifiant usager incorrect.";
!                       }
!                       else
!                               $mes="Identifiant usager incorrect.";
!               }
!               else
!                       $mes="Absence d'identifiant usager";
!       } // if $structure
  
!   if($mes!="" || (!$structure && !$usager))
    { // mauvaise identification ou pas encore faite.
!     form_login($mes, ($ti==1));
      exit;
    }
***************
*** 141,144 ****
      session_register("isadmin");      // administrateur == "oui"   ou "super"
    }
! }
! ?>
--- 163,166 ----
      session_register("isadmin");      // administrateur == "oui"   ou "super"
    }
! } // if $is_ident
! ?>
\ No newline at end of file

Index: inscription_session.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/inscription_session.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** inscription_session.php     31 Dec 2002 21:12:44 -0000      1.12
--- inscription_session.php     2 Jan 2003 19:01:49 -0000       1.13
***************
*** 3,7 ****
      Copyright (C) 2001, 2002 Bertand Pallie, Loïc Dayot - Mairie de 
Pierrefitte-sur-Seine
  
!     EPNadmin - Version 0.5.4
  
      This program is free software; you can redistribute it and/or modify
--- 3,7 ----
      Copyright (C) 2001, 2002 Bertand Pallie, Loïc Dayot - Mairie de 
Pierrefitte-sur-Seine
  
!     EPNadmin - Version 0.6
  
      This program is free software; you can redistribute it and/or modify
***************
*** 30,34 ****
  <?
  $titr = "Gestion des inscriptions aux initiations";
! $datemaj="31 décembre 2002";
  require("entete.inc.php");
  
--- 30,34 ----
  <?
  $titr = "Gestion des inscriptions aux initiations";
! $datemaj="1er décembre 2003";
  require("entete.inc.php");
  
***************
*** 40,44 ****
           <input type=\"hidden\" name=\"id_session\" value=\"$id_session\">
           <table align=\"center\" border=\"1\">
!          <tr><th>Identifiant</th><th>Statut</th></tr>";
     $res = recherche("parcours", "id_session", $id_session);
     while($parcours = mysql_fetch_object($res))
--- 40,44 ----
           <input type=\"hidden\" name=\"id_session\" value=\"$id_session\">
           <table align=\"center\" border=\"1\">
!          <tr><th>Identifiant</th><th>Crédits</th><th>Statut</th></tr>";
     $res = recherche("parcours", "id_session", $id_session);
     while($parcours = mysql_fetch_object($res))
***************
*** 47,54 ****
        echo "<tr>
              <td";
!       if ($usager->credit<=0)
           echo " bgcolor=\"".couleurTarif($usager->tarif)."\"";
        echo "><A HREF=\"usagers.php?id_usager=$usager->id\">
                   $usager->prenom  $usager->nom ($usager->login)</A></td>
              <td>
              <input type=\"radio\" name=\"id$parcours->id_usager\" 
value=\"inscrit(e)\"";
--- 47,65 ----
        echo "<tr>
              <td";
!       if ($usager->credit_activites_collectives<=0)
           echo " bgcolor=\"".couleurTarif($usager->tarif)."\"";
        echo "><A HREF=\"usagers.php?id_usager=$usager->id\">
                   $usager->prenom  $usager->nom ($usager->login)</A></td>
+                               <td nowrap>I : ";
+       if ($usager->credit_acces_individuel>"0")
+         echo datetoheure($usager->credit_acces_individuel);
+       if ($usager->fin_abonnement_acces_individuel>"1")
+         echo "->".datetodatecourt($usager->fin_abonnement_acces_individuel);
+       echo "<br>C : ";
+       if ($usager->credit_activites_collectives>"0")
+         echo datetoheure($usager->credit_activites_collectives);
+       if ($usager->fin_abonnement_activites_collectives>"1")
+         echo 
"->".datetodatecourt($usager->fin_abonnement_activites_collectives);
+       echo "</td>
              <td>
              <input type=\"radio\" name=\"id$parcours->id_usager\" 
value=\"inscrit(e)\"";
***************
*** 78,85 ****
        echo "<input type=\"hidden\" name=\"nbparticipants\" value=\"0\">";
  
!    echo "<tr><td colspan=2 align=center>Commentaires / Bilan de la session
              <br><textarea name=\"commentaires\" rows=\"8\" 
cols=\"50\">$session->commentaires</textarea>
          </td></tr>\n";
!    echo "<tr><td colspan=2><center><input type=\"submit\" name=\"Envoyer\" 
value=\"Envoyer\"></center></td></tr>
           </form>
           </table>\n";
--- 89,96 ----
        echo "<input type=\"hidden\" name=\"nbparticipants\" value=\"0\">";
  
!    echo "<tr><td colspan=3 align=center>Commentaires / Bilan de la session
              <br><textarea name=\"commentaires\" rows=\"8\" 
cols=\"50\">$session->commentaires</textarea>
          </td></tr>\n";
!    echo "<tr><td colspan=3><center><input type=\"submit\" name=\"Envoyer\" 
value=\"Envoyer\"></center></td></tr>
           </form>
           </table>\n";

Index: logiciels.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/logiciels.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** logiciels.php       12 Nov 2002 20:32:57 -0000      1.2
--- logiciels.php       2 Jan 2003 19:01:49 -0000       1.3
***************
*** 3,7 ****
      Copyright (C) 2001, 2002 Loïc Dayot
  
!     EPNadmin - Version 0.5.4
  
      This program is free software; you can redistribute it and/or modify
--- 3,7 ----
      Copyright (C) 2001, 2002 Loïc Dayot
  
!     EPNadmin - Version 0.6
  
      This program is free software; you can redistribute it and/or modify
***************
*** 30,34 ****
  <?
  $titr = "Gestion du parc de logiciels";
! $datemaj="12 novembre 2002";
  require("entete.inc.php");
  
--- 30,34 ----
  <?
  $titr = "Gestion du parc de logiciels";
! $datemaj="1er décembre 2003";
  require("entete.inc.php");
  
***************
*** 96,100 ****
  case 2 : // formulaire d'édition
     // Saisie pour modification d'un enregistrement
!    if (!isadmin)
     {
        echo "<p>C'est un vrai labyrinthe, n'est-ce pas, ce site... Quoi qu'il 
en soit vous êtes perdus.</p>\n";
--- 96,100 ----
  case 2 : // formulaire d'édition
     // Saisie pour modification d'un enregistrement
!    if (!$isadmin)
     {
        echo "<p>C'est un vrai labyrinthe, n'est-ce pas, ce site... Quoi qu'il 
en soit vous êtes perdus.</p>\n";
***************
*** 108,112 ****
  case 1 : // formulaire d'ajout
  // Début du fomulaire de saisie d'enregistrement de logiciels
!    if (!isadmin)
     {
        echo "<p>Encore vous, mais que faites-vous là ?..</p>\n";
--- 108,112 ----
  case 1 : // formulaire d'ajout
  // Début du fomulaire de saisie d'enregistrement de logiciels
!    if (!$isadmin)
     {
        echo "<p>Encore vous, mais que faites-vous là ?..</p>\n";
***************
*** 117,121 ****
     echo "<input type=\"hidden\" name=\"operation\" value=\"11\">";
     if ($id_logiciel)
!       echo "<input type=\"hidden\" name=\"id_materiel\" 
value=\"$id_logiciel\">";
     echo "<table align=\"center\">
           <tr><td>Type*</td><td><select name=\"type\" size=\"1\">
--- 117,121 ----
     echo "<input type=\"hidden\" name=\"operation\" value=\"11\">";
     if ($id_logiciel)
!       echo "<input type=\"hidden\" name=\"id_logiciel\" 
value=\"$id_logiciel\">";
     echo "<table align=\"center\">
           <tr><td>Type*</td><td><select name=\"type\" size=\"1\">
***************
*** 165,169 ****
     {
        $l = "<option value=\"$mat->id\"";
!       $l2 = ">$mat->type ($mat->localisation) : $mat->materiel 
($mat->specificite) $mat->description\n";
        $l1 = "";
        while (($mat) & ($mat->id == $ancien_id_mat))
--- 165,169 ----
     {
        $l = "<option value=\"$mat->id\"";
!       $l2 = ">$mat->type ($mat->localisation) : $mat->materiel 
($mat->specificite) ".substr($mat->description, 0, 20)."\n";
        $l1 = "";
        while (($mat) & ($mat->id == $ancien_id_mat))
***************
*** 272,276 ****
           echo "<table align=center border=1>
                 <tr><td colspan=2 align=center><h3>$logiciel->titre</h3>";
!          if ($logiciel->licence!="")
             echo "<p>($logiciel->licence)</p>";
           echo "</td></tr>\n";
--- 272,276 ----
           echo "<table align=center border=1>
                 <tr><td colspan=2 align=center><h3>$logiciel->titre</h3>";
!          if ($logiciel->licence!="" || $isadmin)
             echo "<p>($logiciel->licence)</p>";
           echo "</td></tr>\n";
***************
*** 282,286 ****
           // affichage des materiels attachés au logiciel
           echo "<tr><td colspan=2 align=center><b>Liste des materiels attachés 
à ce logiciel</b></td></tr>\n";
!          $req3 = "SELECT * FROM materiels LEFT JOIN logi_mate ON 
materiels.id=logi_mate.id_materiel 
                            WHERE id_logiciel=$id_logiciel ORDER BY type, 
id_localisation, materiel";
           $res3 = executeRequete($req3);
--- 282,286 ----
           // affichage des materiels attachés au logiciel
           echo "<tr><td colspan=2 align=center><b>Liste des materiels attachés 
à ce logiciel</b></td></tr>\n";
!          $req3 = "SELECT * FROM materiels LEFT JOIN logi_mate ON 
materiels.id=logi_mate.id_materiel
                            WHERE id_logiciel=$id_logiciel ORDER BY type, 
id_localisation, materiel";
           $res3 = executeRequete($req3);
***************
*** 294,298 ****
              echo "</td>";
              if ($isadmin)
!               echo "<td><a 
href=\"materiels.php?operation=2&id_materiel=$materiel->id&$idu\">$info</a>\n";
              echo "</tr>\n";
           }
--- 294,298 ----
              echo "</td>";
              if ($isadmin)
!               echo "<td><a 
href=\"materiels.php?id_materiel=$materiel->id\">$info</a>\n";
              echo "</tr>\n";
           }

Index: materiels.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/materiels.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** materiels.php       29 Nov 2002 21:34:20 -0000      1.4
--- materiels.php       2 Jan 2003 19:01:49 -0000       1.5
***************
*** 3,7 ****
      Copyright (C) 2001 Loïc Dayot
  
!     EPNadmin - Version 0.5
  
      This program is free software; you can redistribute it and/or modify
--- 3,7 ----
      Copyright (C) 2001 Loïc Dayot
  
!     EPNadmin - Version 0.6
  
      This program is free software; you can redistribute it and/or modify
***************
*** 30,34 ****
  <?
  $titr = "Gestion du parc de matériel";
! $datemaj="7 ao&ucirc;t 2002";
  require("entete.inc.php");
  
--- 30,34 ----
  <?
  $titr = "Gestion du parc de matériel";
! $datemaj="1er janvier 2003";
  require("entete.inc.php");
  
***************
*** 144,153 ****
     echo ">Portable
             <option";
!    if ($type=="Périphérique sortie") echo " SELECTED";
!    echo ">Périphérique sortie
!            <option";
!    if ($type=="Périphérique entrée") echo " SELECTED";
!    echo ">Périphérique entrée
             <option";
     if ($type=="Documentation") echo " SELECTED";
     echo ">Documentation
--- 144,153 ----
     echo ">Portable
             <option";
!    if ($type=="Périphérique") echo " SELECTED";
!    echo ">Périphérique
             <option";
+   // if ($type=="Périphérique entrée") echo " SELECTED";
+   // echo ">Périphérique entrée
+   //         <option";
     if ($type=="Documentation") echo " SELECTED";
     echo ">Documentation
***************
*** 354,358 ****
                    echo "</td>";
                    if ($isadmin)
!                     echo "<td><a 
href=\"logiciels.php?operation=2&id_logiciel=$logiciel->id&$idu\">$info</a>\n";
                    echo "</tr>\n";
                 }
--- 354,358 ----
                    echo "</td>";
                    if ($isadmin)
!                     echo "<td><a 
href=\"logiciels.php?id_logiciel=$logiciel->id\">$info</a>\n";
                    echo "</tr>\n";
                 }
***************
*** 370,374 ****
                 echo "</td>";
                 if ($isadmin)
!                  echo "<td><a 
href=\"logiciels.php?operation=2&id_logiciel=$logiciel->id\">$info</a>\n";
                 echo "</tr>\n";
              }
--- 370,374 ----
                 echo "</td>";
                 if ($isadmin)
!                  echo "<td><a 
href=\"logiciels.php?id_logiciel=$logiciel->id\">$info</a>\n";
                 echo "</tr>\n";
              }

Index: stats.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/stats.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** stats.php   1 Jan 2003 13:23:07 -0000       1.7
--- stats.php   2 Jan 2003 19:01:49 -0000       1.8
***************
*** 25,29 ****
  // pour consulter les statistiques.
  include("fonctions.inc.php");
! mysql_connecte();
  // Si on veut une authentification, commenter les deux lignes précédentes et 
rendre
  // active la ligne suivante.
--- 25,31 ----
  // pour consulter les statistiques.
  include("fonctions.inc.php");
! mysql_connecte();                
! 
! include("camembert.inc.php");
  // Si on veut une authentification, commenter les deux lignes précédentes et 
rendre
  // active la ligne suivante.
***************
*** 245,248 ****
--- 247,251 ----
        echo "<th>$ut</th>\n";
        $utp = round($ut / $nbtotal * 100,1);
+       $stats1[$us]=$utp;
        echo "<td>$utp%".traitp($utp)."</td>\n";
        echo "</tr>\n";
***************
*** 273,289 ****
--- 276,299 ----
      echo "<td>%</td>\n";
      $tunp = round($tun / $nbtotal * 100,1);
+     $stats3[$tarifs[0]]=$tunp;
      echo "<td>$tunp% ".traitp($tunp)."</td>\n";
      $tuptnp = round($tuptn / $nbtotal * 100,1);
+     $stats3[$tarifs[1]]=$tuptnp;
      echo "<td>$tuptnp% ".traitp($tuptnp)."</td>\n";
      $tuptrp = round($tuptr / $nbtotal * 100,1);
+     $stats3[$tarifs[2]]=$tuptrp;
      echo "<td>$tuptrp% ".traitp($tuptrp)."</td>\n";
  
      $tupjeune = round($tupjeune / $nbtotal * 100,1);
+     $stats2["- de 20 ans"]=$tupjeune;
      echo "<td>$tupjeune% ".traitp($tupjeune)."</td>\n";
      $tup20ans = round($tup20ans / $nbtotal * 100,1);
+     $stats2["20 à 60 ans"]=$tup20ans;
      echo "<td>$tup20ans% ".traitp($tup20ans)."</td>\n";
      $tup60ans = round($tup60ans / $nbtotal * 100,1);
+     $stats2["+ de 60 ans"]=$tup60ans;
      echo "<td>$tup60ans% ".traitp($tup60ans)."</td>\n";
      $tupinconnu = round($tupinconnu / $nbtotal * 100,1);
+     $stats2["âge inconnu"]=$tupinconnu;
      echo "<td>$tupinconnu% ".traitp($tupinconnu)."</td>\n";
  
***************
*** 296,299 ****
--- 306,352 ----
      echo "</table>\n";
  
+ 
+     // Essai d'affichage d'un camembert pour ces données
+     //print_r($stats);
+ /*    $stats : tableau de valeurs
+ *     $x : largeur de l'image à créer
+ *     $y : hauteur de l'image à créer
+ *     $margin : marge entre le bord, le cercle et la legende
+ *     $filename : nom à donner à de l'image */
+     $x=600; $y=300;
+     $margin=8;
+     $filename=$dir_tmp_images.'camembert1.png';
+     arsort($stats1);
+     if (draw_camembert($stats1, $x, $y, $margin, $filename))
+     {
+       //debug("ok");
+       echo "<h3 align=center>Part de chacun des usages<br>
+              <img src='image.inc.php?filename=$filename' alt='Camembert' 
border='0'></h3>\n";
+     }
+     else
+       debug("Graphique pas ok !");
+ 
+     $filename=$dir_tmp_images.'camembert3.png';
+     arsort($stats3);
+     if (draw_camembert($stats3, $x, $y, $margin, $filename))
+     {
+       //debug("ok");
+       echo "<h3 align=center>Utilisation des postes par tarifs<br>
+              <img src='image.inc.php?filename=$filename' alt='Camembert' 
border='0'></h3>\n";
+     }
+     else
+       debug("Graphique pas ok !");
+ 
+     $filename=$dir_tmp_images.'camembert2.png';
+     arsort($stats2);
+     if (draw_camembert($stats2, $x, $y, $margin, $filename))
+     {
+       //debug("ok");
+       echo "<h3 align=center>Utilisation des postes par âges<br>
+              <img src='image.inc.php?filename=$filename' alt='Camembert' 
border='0'></h3>\n";
+     }
+     else
+       debug("Graphique pas ok !");
+ 
      break;
  
***************
*** 349,354 ****
--- 402,427 ----
        echo "<td>".datetoheure(minute2heure($stat->nbhp))."</td>\n";
        echo "</tr>\n";
+       $stats[$stat->structure]=round($stat->nbhp);
      }
      echo "</table>\n";
+ 
+     // Essai d'affichage d'un camembert pour ces données
+     //print_r($stats);
+ /*    $stats : tableau de valeurs
+ *     $x : largeur de l'image à créer
+ *     $y : hauteur de l'image à créer
+ *     $margin : marge entre le bord, le cercle et la legende
+ *     $filename : nom à donner à de l'image */
+     $x=600; $y=300;
+     $margin=8;
+     $filename=$dir_tmp_images.'camembert.png';
+     arsort($stats);
+     if (draw_camembert($stats, $x, $y, $margin, $filename))
+     {
+       //debug("ok");
+       echo "<center><img src='image.inc.php?filename=$filename' 
alt='Camembert' border='0'></center>\n";
+     }
+     else
+       debug("nok");
      break;
  
***************
*** 604,607 ****
--- 677,681 ----
         {
            echo "<th>$an<br>".nommois($mois)."</th>";
+           $abscisses[]=$an." ".nommois($mois);
         }
      }
***************
*** 702,713 ****
  
      echo "</table>\n";
      break;
  
  
//-----------------------------------------------------------------------------------------/
! //    EVOLUTION MENSUELLE                                                     
             /
  
//-----------------------------------------------------------------------------------------/
  
!   case 'horaires' :  //   HORAIRES            
!   
      // Condition interval de date demandé.
      $where = "(date>='$datedeb'
--- 776,788 ----
  
      echo "</table>\n";
+ 
      break;
  
  
//-----------------------------------------------------------------------------------------/
! //    AFFLUENCE HORAIRE                                                       
           /
  
//-----------------------------------------------------------------------------------------/
  
!   case 'horaires' :  //   HORAIRES
! 
      // Condition interval de date demandé.
      $where = "(date>='$datedeb'
***************
*** 761,772 ****
  
          // Calcul du rapport d'utilisation
!         $coul=" bgcolor='white'";
          if ($nb2>0)
          {
            $rapport=$nb1/$nb2;
!           if ($rapport<2)  // 4 est le nombre de postes réservables divisé 
par deux
!             $coul=" bgcolor='red'";
!           if ($rapport>4)
!             $coul=" bgcolor='#90EE90'";
          }
          else
--- 836,847 ----
  
          // Calcul du rapport d'utilisation
!         $coul="white";
          if ($nb2>0)
          {
            $rapport=$nb1/$nb2;
!           $rouge = round(255 - min(255, max(0, $rapport*$rapport*8)));
!           $vert = round(min(255, max(20, $rapport/5*255)));
!           $hexa="000000".dechex($rouge*65536 + $vert*256);
!           $coul="#".substr($hexa, strlen($hexa)-6, 6);
          }
          else
***************
*** 777,781 ****
            echo "<td></td>\n";
          else
!           printf("<td%s>%u/%u= <b>%01.1f</b></td>\n", $coul, $nb1, $nb2, 
$rapport);
        } // for $nojour
        // Termine la ligne d'horaire
--- 852,856 ----
            echo "<td></td>\n";
          else
!           printf("<td bgcolor='%s'>%u/%u= <b>%01.1f</b></td>\n", $coul, $nb1, 
$nb2, $rapport);
        } // for $nojour
        // Termine la ligne d'horaire
***************
*** 784,789 ****
      } // for $heure
  
!     echo "</table>\n";        
!     
      // Légende
      echo "<p>Le contenu de chque cellule est constitué ainsi : <br>
--- 859,864 ----
      } // for $heure
  
!     echo "</table>\n";
! 
      // Légende
      echo "<p>Le contenu de chque cellule est constitué ainsi : <br>
***************
*** 791,795 ****
               (1) : nombre d'utilisations de postes en accès individuels<br>
               (2) : nombre de fois que l'accès individuel a été ouvert<br>
!              (3) : résultat du ration de (1) sur (2). 
                  Ce résultat devrait être rapproché du nombre
                  de postes accessibles en accès individuels.</p>\n";
--- 866,870 ----
               (1) : nombre d'utilisations de postes en accès individuels<br>
               (2) : nombre de fois que l'accès individuel a été ouvert<br>
!              (3) : résultat du ration de (1) sur (2).
                  Ce résultat devrait être rapproché du nombre
                  de postes accessibles en accès individuels.</p>\n";




reply via email to

[Prev in Thread] Current Thread [Next in Thread]