[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Epnadmin-fr] CVS: epnadmin configuration.php,1.1,1.2 constantes.inc.php
From: |
Loïc Dayot |
Subject: |
[Epnadmin-fr] CVS: epnadmin configuration.php,1.1,1.2 constantes.inc.php,1.15,1.16 dateheure.inc.php,1.8,1.9 entete.inc.php,1.15,1.16 header.inc.php,1.13,1.14 stats.php,1.10,1.11 usagers.inc.php,1.6,1.7 usagers.php,1.16,1.17 |
Date: |
Wed, 22 Jan 2003 16:24:11 -0500 |
Update of /cvsroot/epnadmin/epnadmin
In directory subversions:/tmp/cvs-serv2593/epnadmin
Modified Files:
configuration.php constantes.inc.php dateheure.inc.php
entete.inc.php header.inc.php stats.php usagers.inc.php
usagers.php
Log Message:
Les grandes manoeuvres sont en marchent. (Je ne parle pas de la guerre en Irak).
La version 0.6 est en préparation, avec notamment un script de configuration
des fonctionnalités et des droits des structures et usagers.
Index: configuration.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/configuration.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** configuration.php 5 Jan 2003 20:34:01 -0000 1.1
--- configuration.php 22 Jan 2003 21:24:08 -0000 1.2
***************
*** 45,61 ****
<?
$titr = "Configuration de l'application et des autorisations";
! $datemaj="5 janvier 2003";
require("entete.inc.php");
// Remarque : même si la fonctionnalité des droits (FCT_DROITS) n'est pas
définie, on accès quand même à cette page.
! if (defined("FCT_DROITS") && ((FCT_DROITS=="INACTIF") || !defined("DROITS")
|| DROITS=="AUCUN"))
{
! echo "<p>Désolé, mais vous n'avez pas les droits suffisants pour
accéder à la configuration de l'application.
! Mettez-vous en relation avec
l'administrateur si vous pensez que c'est une erreur.</p>\n";
! include("basdepage.inc.php");
! echo "</body></html>\n";
! require("footer.inc.php");
! exit;
}
--- 45,61 ----
<?
$titr = "Configuration de l'application et des autorisations";
! $datemaj="14 janvier 2003";
require("entete.inc.php");
// Remarque : même si la fonctionnalité des droits (FCT_DROITS) n'est pas
définie, on accès quand même à cette page.
! if ((defined("FCT_DROITS") && (FCT_DROITS=="INACTIF")) || (defined("DROITS")
&& DROITS=="AUCUN"))
{
! echo "<p>Désolé, mais vous n'avez pas les droits suffisants pour accéder à
la configuration de l'application.
! Mettez-vous en relation avec l'administrateur si vous pensez que
c'est une erreur.</p>\n";
! include("basdepage.inc.php");
! echo "</body></html>\n";
! require("footer.inc.php");
! exit;
}
***************
*** 63,176 ****
function affiche_autorisations($id)
{
! if ($id>0) // Il s'agit d'une structure
! {
! // On regarde s'il y a une configuration pour cette structure
! $req0="SELECT * FROM droits WHERE id_structure=$id";
! $res0=executeRequete($req0);
! if (! mysql_fetch_object($res0))
! $id=-3; // On reprend la configuration par défaut.
! }
! echo "<table align=center border=1>
! <tr><th align=center colspan='3'>";
! switch ($id)
! {
! case -3 : echo "Les autorisations par défaut des structures"; break;
! case -2 : echo "Les autorisations des animateurs"; break;
! case -1 : echo "Les autorisations des usagers"; break;
! case 0 : echo "Les fonctionnalités de l'application"; break;
! default : echo structure($id); break;
! } // switch
! echo "</th></tr>\n";
! $req1="SELECT * FROM fonctions";
! $res1=executeRequete($req1);
! while ($fonction=mysql_fetch_object($res1))
! {
! echo "<tr><td>$fonction->fonction</td>";
! $req2="SELECT * FROM droits WHERE id_fonction=$fonction->id AND
id_structure=$id";
! $res2=executeRequete($req2);
! $droit=mysql_fetch_object($res2);
! echo "<td>";
! if (! $droit->droit)
! $droit->droit="<i>Indéfini donc inactif ou aucun</i>";
! echo "$droit->droit</td><td>$fonction->commentaire</td>";
! echo "</tr>\n";
! }
! echo "</table>\n";
} // fonction affiche_autorisations
function saisie_autorisations($id_stru)
{
! if (($id=$id_stru) > 0) // Il s'agit d'une structure
! {
! // On regarde s'il y a une configuration pour cette structure
! $req0="SELECT * FROM droits WHERE id_structure=$id";
! $res0=executeRequete($req0);
! if (! mysql_fetch_object($res0))
! $id=-3; // On reprend la configuration par défaut.
! }
! echo "<form action=\"$PHP_SELF\" method=\"POST\"
enctype=\"multipart/form-data\">
! <input type=\"hidden\" name=\"id_stru\" value=\"$id_stru\">
! <input type=\"hidden\" name=\"operation\" value=\"1\">
<table align=center border=1>
! <tr><th align=center colspan='3'>";
! switch ($id)
! {
! case -3 : echo "Les autorisations par défaut des structures"; break;
! case -2 : echo "Les autorisations des animateurs"; break;
! case -1 : echo "Les autorisations des usagers"; break;
! case 0 : echo "Les fonctionnalités de l'application"; break;
! default : echo structure($id); break;
! } // switch
! echo "</th></tr>\n";
! $req1="SELECT * FROM fonctions";
! $res1=executeRequete($req1);
! while ($fonction=mysql_fetch_object($res1))
! {
! echo "<tr><td>$fonction->fonction</td>";
! $req2="SELECT * FROM droits WHERE id_fonction=$fonction->id AND
id_structure=$id";
! $res2=executeRequete($req2);
! $droit=mysql_fetch_object($res2);
! echo "<td><select name=\"fonction_$fonction->id\">
! <option value=\"\"";
! if (! $droit->droit)
! $droit->droit=" selected";
! echo ">";
! if ($id==0)
! { // Des fonctionalités de l'application
! echo "<option value=\"actif\"";
! if ($droit->droit=="actif")
! echo " selected";
! echo ">Actif</option><option value=\"inactif\"";
! if ($droit->droit=="inactif")
! echo " selected";
! echo ">Inactif</option>";
! }
! else // Des autorisations
! { // de structure, animateurs ou usagers
! echo "<option value=\"aucun\"";
! if ($droit->droit=="aucun")
! echo " selected";
! echo ">Aucun</option><option value=\"voir\"";
! if ($droit->droit=="voir")
! echo " selected";
! echo ">Voir</option><option value=\"ajouter\"";
! if ($droit->droit=="ajouter")
! echo " selected";
! echo ">Ajouter</option><option value=\"modifier\"";
! if ($droit->droit=="modifier")
! echo " selected";
! echo ">Modifier</option><option value=\"administrer\"";
! if ($droit->droit=="administrer")
! echo " selected";
! echo ">Administrer</option>";
! }
! echo "</select></td>\n";
!
! echo "<td>$fonction->commentaire</td>";
! echo "</tr>\n";
! }
! echo "<tr><td colspan=\"3\" align=center><input type=\"submit\"
name=\"Confirmer\" value=\"Confirmer\"></td></tr>\n";
! echo "</table>\n
! </form>";
} // fonction affiche_autorisations
--- 63,222 ----
function affiche_autorisations($id)
{
! if ($id>0) // Il s'agit d'une structure
! {
! // On regarde s'il y a une configuration pour cette structure
! $req0="SELECT * FROM droits WHERE id_structure=$id";
! $res0=executeRequete($req0);
! if (! mysql_fetch_object($res0))
! $id=-3; // On reprend la configuration par défaut.
! }
! echo "<table align=center border=1>
! <tr><th align=center colspan='3'>";
! switch ($id)
! {
! case -4 : echo "Les autorisations des visiteurs non identifiés"; break;
! case -3 : echo "Les autorisations par défaut des structures"; break;
! case -2 : echo "Les autorisations des animateurs"; break;
! case -1 : echo "Les autorisations des usagers"; break;
! case 0 : echo "Les fonctionnalités de l'application"; break;
! default : echo structure($id); break;
! } // switch
! echo "</th></tr>\n";
! $req1="SELECT * FROM fonctions";
! $res1=executeRequete($req1);
! while ($fonction=mysql_fetch_object($res1))
! {
! // Retrouver les droits
! $req2="SELECT * FROM droits WHERE id_fonction=$fonction->id AND
id_structure=$id";
! $res2=executeRequete($req2);
! if (!$droit=mysql_fetch_object($res2))
! { //N'existe pas
! if ($id>0)
! {
! // Si c'est une structure, on prend la valeur par défaut.
! $req2="SELECT * FROM droits WHERE id_fonction=$fonction->id AND
id_structure=-3";
! $res2=executeRequete($req2);
! }
! if (!$droit=mysql_fetch_object($res2))
! { // Si on n'a toujours rien, on prend les fonctionnalités
! $req2="SELECT * FROM droits WHERE id_fonction=$fonction->id AND
id_structure=0";
! $res2=executeRequete($req2);
! }
! }
! if ($droit->droit)
! {
! // Retrouver si la fonctionnalité est active
! $req11="SELECT * FROM droits WHERE id_fonction=$fonction->id AND
id_structure=0";
! $res12=executeRequete($req11);
! $fct=mysql_fetch_object($res12);
! if (strtoupper($fct->droit)!="ACTIF")
! echo "<tr bgcolor=\"#ADADAD\"><th>$fonction->fonction (INACTIF)</th>";
! else
! echo "<tr
bgcolor=\"$fonction->couleur\"><th>$fonction->fonction</th>";
!
! echo "<td>";
! switch ($droit->droit)
! {
! case 'actif' : echo "Actif"; break;
! case 'inactif' : echo "Inactif"; break;
! case '00' : echo "aucun"; break;
! case '10' : echo "voir ses informations"; break;
! case '20' : echo "modifier ses informations"; break;
! case '30' : echo "voir les informations des autres"; break;
! case '40' : echo "administrer tous et tout"; break;
! default : echo "<i>Indéfini donc aucun</i>"; break;
! }
! echo "</td><td>".nl2br($fonction->commentaire)."</td>";
! echo "</tr>\n";
! }
! }
! echo "</table>\n";
} // fonction affiche_autorisations
function saisie_autorisations($id_stru)
{
! if (($id=$id_stru) > 0) // Il s'agit d'une structure
! {
! // On regarde s'il y a une configuration pour cette structure
! $req0="SELECT * FROM droits WHERE id_structure=$id";
! $res0=executeRequete($req0);
! if (! mysql_fetch_object($res0))
! $id=-3; // On reprend la configuration par défaut.
! }
! echo "<form action=\"$PHP_SELF\" method=\"POST\"
enctype=\"multipart/form-data\">
! <input type=\"hidden\" name=\"id_stru\" value=\"$id_stru\">
! <input type=\"hidden\" name=\"operation\" value=\"1\">
<table align=center border=1>
! <tr><th align=center colspan='3'>";
! switch ($id)
! {
! case -4 : echo "Les autorisations des visiteurs non identifiés"; break;
! case -3 : echo "Les autorisations par défaut des structures"; break;
! case -2 : echo "Les autorisations des animateurs"; break;
! case -1 : echo "Les autorisations des usagers"; break;
! case 0 : echo "Les fonctionnalités de l'application"; break;
! default : echo structure($id); break;
! } // switch
! echo "</th></tr>\n";
! $req1="SELECT * FROM fonctions";
! $res1=executeRequete($req1);
! while ($fonction=mysql_fetch_object($res1))
! {
! // Retrouver si la fonctionnalité est active
! $req11="SELECT * FROM droits WHERE id_fonction=$fonction->id AND
id_structure=0";
! $res12=executeRequete($req11);
! $fct=mysql_fetch_object($res12);
! if (strtoupper($fct->droit)!="ACTIF")
! echo "<tr bgcolor=\"#ADADAD\"><th>$fonction->fonction (INACTIF)</th>";
! else
! echo "<tr bgcolor=\"$fonction->couleur\"><th>$fonction->fonction</th>";
!
! // Retrouver le droit pour cette fonctionnalité
! $req2="SELECT * FROM droits WHERE id_fonction=$fonction->id AND
id_structure=$id";
! $res2=executeRequete($req2);
! $droit=mysql_fetch_object($res2);
!
! echo "<td><select name=\"fonction_$fonction->id\">
! <option value=\"\"";
! if (! $droit->droit)
! $droit->droit=" selected";
! echo ">";
! if ($id==0)
! { // Des fonctionalités de l'application
! echo "<option value=\"actif\"";
! if ($droit->droit=="actif")
! echo " selected";
! echo ">Actif</option><option value=\"inactif\"";
! if ($droit->droit=="inactif")
! echo " selected";
! echo ">Inactif</option>";
! }
! else // Des autorisations
! { // de structure, animateurs ou usagers
! echo "<option value=\"00\"";
! if ($droit->droit=="00")
! echo " selected";
! echo ">Aucun</option><option value=\"10\"";
! if ($droit->droit=="10")
! echo " selected";
! echo ">Voir (ses propres) informations)</option><option value=\"20\"";
! if ($droit->droit=="20")
! echo " selected";
! echo ">Modifier (ses propres informations)</option><option
value=\"30\"";
! if ($droit->droit=="30")
! echo " selected";
! echo ">Voir les informations des autres</option><option value=\"40\"";
! if ($droit->droit=="40")
! echo " selected";
! echo ">Administrer (tout pour tous)</option>";
! }
! echo "</select></td>\n";
!
! echo "<td>".nl2br($fonction->commentaire)."</td>";
! echo "</tr>\n";
! }
! echo "<tr><td colspan=\"3\" align=center><input type=\"submit\"
name=\"Confirmer\" value=\"Confirmer\"></td></tr>\n";
! echo "</table>\n
! </form>";
} // fonction affiche_autorisations
***************
*** 178,290 ****
{
case 1 : // Enregistrement après une saisie (retour du formulaire)
! // Quelques vérifications
! $mes="";
! // A-t-on le droit de modifier quelquechose ?
! if (defined(FCT_DROITS) && (DROITS!="MODIFIER" &&
DROITS!="ADMINISTRER"))
! $mes.="Désolé, mais vous n'avez pas les autorisations de changer des
droits ou fonctionnalités !<br>";
! // Est-on administrateur ?
! if (defined(FCT_DROITS) && ($id_stru!=$id_structure &&
DROITS!="ADMINISTRER"))
! $mes.="Désolé, mais vous n'avez pas les autorisations de changer des
droits des autres ou fonctionnalités !<br>";
! // A-t-on bien le numéro de la structure à qui changer les droits ?
! if (! isset($id_stru))
! $mes.="Problème, je ne comprends pas à quelle entité il faut changer
les droits (id_stru inconnu) !<br>";
! if ($mes!="")
! {
! echo "<p>$mes</p>\n";
! break;
! }
! // Ok, alors on fait !
!
! // On détruit toutes les autorisations de l'entité (Est-ce bien ce
qu'il faut faire ???)
! $req0="DELETE FROM droits WHERE id_structure=$id_stru";
! $res0=executeRequete($req0);
!
! //On prend chaque fonctionalité
! $req1="SELECT * FROM fonctions";
! $res1=executeRequete($req1);
! while ($fonction1=mysql_fetch_object($res1))
! {
! // et on regarde s'il y a une affectation
! $champ="fonction_$fonction1->id";
! if ($$champ && $$champ!="")
! { // Oui, un champ a été rempli
! $req2="INSERT INTO droits (id_structure, id_fonction,
droit)
! VALUES (\"$id_stru\", \"$fonction1->id\",
\"".$$champ."\")";
! $res2=executeRequete($req2);
! }
! }
! mysql_free_result($res1);
! echo "<p>Les modifications ont été prises en compte.</p>
! <p>Pour certaines, elles ne prendront effets
qu'à la prochaine identification.</p>\n";
! // Et c'est fini !
break;
case 11 : // Voir les droits des usagers
! affiche_autorisations(-1);
! break;
case 12 : // Modifier les droits des usagers
! saisie_autorisations(-1);
! break;
case 31 : // Voir les droits des structures
! affiche_autorisations($id);
! break;
case 32 : // Modifier les drotis des structures
! saisie_autorisations($id);
! break;
case 41 : // Voir les fonctionnalités de l'application
! affiche_autorisations(0);
! break;
case 42 : // Modifier les fonctionnalités de l'application
! saisie_autorisations(0);
! break;
} // switch
//default : // Affichage des éventuelles possibilités
! //'aucun', 'voir', 'ajouter', 'modifier', 'administrer'
echo "<table align='center' border='1' bgcolor='#B6FFB2'>\n";
! if (FCT_USAGERS=="ACTIF" && defined("USAGERS") && USAGERS!="AUCUN")
! {
! echo "<tr><th>Droits des usagers</th>";
! echo "<td><a href='$PHP_SELF?operation=11'>Voir</a></td>";
! if (DROITS=="MODIFIER" || DROITS=="ADMINISTRER")
! echo "<td><a
href='$PHP_SELF?operation=12'>Modifier</a></td>";
! echo "</tr>\n";
! }
! if (FCT_ANIMATEURS=="ACTIF" && defined("ANIMATEURS") &&
ANIMATEURS!="AUCUN")
! {
! echo "<tr><th>Droits des animateurs</th>";
! echo "<td><a href='$PHP_SELF?operation=21'>Voir</a></td>";
! if (DROITS=="MODIFIER" || DROITS=="ADMINISTRER")
! echo "<td><a
href='$PHP_SELF?operation=22'>Modifier</a></td>";
! echo "</tr>\n";
! }
! if (FCT_STRUCTURES=="ACTIF" && defined("STRUCTURES") &&
STRUCTURES!="AUCUN")
! {
! echo "<tr><th>Droits par défaut des structures</th>";
! echo "<td><a href='$PHP_SELF?operation=31&id=-3'>Voir</a></td>";
! if (DROITS=="MODIFIER" || DROITS=="ADMINISTRER")
! echo "<td><a
href='$PHP_SELF?operation=32&id=-3'>Modifier</a></td>";
! echo "</tr>\n";
! }
! if (FCT_STRUCTURES=="ACTIF" && defined("STRUCTURES") &&
STRUCTURES!="AUCUN")
! {
! echo "<tr><th>Droits des structures</th>";
! echo "<td><a href='$PHP_SELF?operation=31'>Voir</a></td>";
! if (DROITS=="MODIFIER" || DROITS=="ADMINISTRER")
! echo "<td><a
href='$PHP_SELF?operation=32'>Modifier</a></td>";
! echo "</tr>\n";
! }
! if (DROITS=="ADMINISTRER" || !defined("FCT_DROITS")) // On ne s'amuse
pas à faire une fonctionnalité FONCTIONNALITE, on ne
! {
// s'en sortirait plus !
! echo "<tr><th>Fonctionnalités de l'application</th>";
! echo "<td><a href='$PHP_SELF?operation=41'>Voir</a></td>";
! echo "<td><a href='$PHP_SELF?operation=42'>Modifier</a></td>";
! echo "</tr>\n";
! }
! echo "</table>\n";
//} // switch
--- 224,351 ----
{
case 1 : // Enregistrement après une saisie (retour du formulaire)
! // Quelques vérifications
! $mes="";
! // A-t-on le droit de modifier quelquechose ?
! if (defined("DROITS") && (DROITS!="MODIFIER" && DROITS<"20"))
! $mes.="Désolé, mais vous n'avez pas les autorisations de changer des
droits ou fonctionnalités !<br>";
! // Est-on administrateur ?
! if (defined("DROITS") && ($id_stru!=$id_structure && DROITS<"40"))
! $mes.="Désolé, mais vous n'avez pas les autorisations de changer des
droits des autres ou fonctionnalités !<br>";
! // A-t-on bien le numéro de la structure à qui changer les droits ?
! if (! isset($id_stru))
! $mes.="Problème, je ne comprends pas à quelle entité il faut changer les
droits (id_stru inconnu) !<br>";
! if ($mes!="")
! {
! echo "<p>$mes</p>\n";
! break;
! }
! // Ok, alors on fait !
!
! // On détruit toutes les autorisations de l'entité (Est-ce bien ce qu'il
faut faire ???)
! $req0="DELETE FROM droits WHERE id_structure=$id_stru";
! $res0=executeRequete($req0);
!
! //On prend chaque fonctionalité
! $req1="SELECT * FROM fonctions";
! $res1=executeRequete($req1);
! while ($fonction1=mysql_fetch_object($res1))
! {
! // et on regarde s'il y a une affectation
! $champ="fonction_".$fonction1->id;
! if ($$champ && $$champ>="00")
! { // Oui, un champ a été rempli
! //debug($$champ);
! $req2="INSERT INTO droits (id_structure, id_fonction, droit)
! VALUES (\"$id_stru\", \"$fonction1->id\", \"".$$champ."\")";
! $res2=executeRequete($req2);
! }
! }
! mysql_free_result($res1);
! echo "<p>Les modifications ont été prises en compte.</p>
! <p>Pour certaines, elles ne prendront effets qu'à la prochaine
identification.</p>\n";
! // Et c'est fini !
break;
case 11 : // Voir les droits des usagers
! affiche_autorisations(-1);
! break;
case 12 : // Modifier les droits des usagers
! saisie_autorisations(-1);
! break;
case 31 : // Voir les droits des structures
! affiche_autorisations($id);
! break;
case 32 : // Modifier les drotis des structures
! saisie_autorisations($id);
! break;
case 41 : // Voir les fonctionnalités de l'application
! affiche_autorisations(0);
! break;
case 42 : // Modifier les fonctionnalités de l'application
! saisie_autorisations(0);
! break;
!
! case 51 : // Voir les fonctionnalités de l'application
! affiche_autorisations(-4);
! break;
!
! case 52 : // Modifier les fonctionnalités de l'application
! saisie_autorisations(-4);
! break;
} // switch
//default : // Affichage des éventuelles possibilités
! //'aucun', 'voir', 'ajouter', 'modifier', 'administrer'
echo "<table align='center' border='1' bgcolor='#B6FFB2'>\n";
! if (defined("USAGERS") && USAGERS!="00")
! {
! echo "<tr><th>Droits des usagers</th>";
! echo "<td><a href='$PHP_SELF?operation=11'>Voir</a></td>";
! if (DROITS>="30")
! echo "<td><a href='$PHP_SELF?operation=12'>Modifier</a></td>";
! echo "</tr>\n";
! }
! if (defined("ANIMATEURS") && ANIMATEURS!="00")
! {
! echo "<tr><th>Droits des animateurs</th>";
! echo "<td><a href='$PHP_SELF?operation=21'>Voir</a></td>";
! if (DROITS>="30")
! echo "<td><a href='$PHP_SELF?operation=22'>Modifier</a></td>";
! echo "</tr>\n";
! }
! if (defined("STRUCTURES") && STRUCTURES!="00")
! {
! echo "<tr><th>Droits par défaut des structures</th>";
! echo "<td><a href='$PHP_SELF?operation=31&id=-3'>Voir</a></td>";
! if (DROITS>="30")
! echo "<td><a href='$PHP_SELF?operation=32&id=-3'>Modifier</a></td>";
! echo "</tr>\n";
! }
! if (defined("STRUCTURES") && STRUCTURES!="00")
! {
! echo "<tr><th>Droits des structures</th>";
! echo "<td><a href='$PHP_SELF?operation=31'>Voir</a></td>";
! if (DROITS>="30")
! echo "<td><a href='$PHP_SELF?operation=32'>Modifier</a></td>";
! echo "</tr>\n";
! }
!
! if ((defined("DROITS") && DROITS>="40") || !defined("FCT_DROITS"))
! { // s'en sortirait plus !
! echo "<tr><th>Droits des visiteurs non identifiés</th>";
! echo "<td><a href='$PHP_SELF?operation=51'>Voir</a></td>";
! echo "<td><a href='$PHP_SELF?operation=52'>Modifier</a></td>";
! echo "</tr>\n";
!
! echo "<tr><th>Fonctionnalités de l'application</th>";
! echo "<td><a href='$PHP_SELF?operation=41'>Voir</a></td>";
! echo "<td><a href='$PHP_SELF?operation=42'>Modifier</a></td>";
! echo "</tr>\n";
! }
! echo "</table>\n";
//} // switch
***************
*** 293,295 ****
echo "</body></html>\n";
require("footer.inc.php");
! ?>
\ No newline at end of file
--- 354,356 ----
echo "</body></html>\n";
require("footer.inc.php");
! ?>
Index: constantes.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/constantes.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** constantes.inc.php 5 Jan 2003 20:34:01 -0000 1.15
--- constantes.inc.php 22 Jan 2003 21:24:08 -0000 1.16
***************
*** 64,68 ****
// et des domaines de
courriels
// utilisé dans courriel.(inc.)php et siteweb.(inc.)php
! $ip_serveur="127.0.0.1"; // sert dans courriel.inc.php
// constantes
--- 64,68 ----
// et des domaines de
courriels
// utilisé dans courriel.(inc.)php et siteweb.(inc.)php
! $ip_serveur="192.168.0.253"; // sert dans courriel.inc.php
// constantes
***************
*** 103,107 ****
$supprimer = "<img src=\"images/supprimer.png\" border=0
alt=\"Supprimer\">";
$info = "<img src=\"images/info.png\" border=0 alt=\"Plus de
détails\">";
! $programmer = "<img src=\"images/programmer.png\" border=0
alt=\"Programmer, s'inscrire\">";
$deprogrammer = "<img src=\"images/deprogrammer.png\" border=0
alt=\"Déprogrammer, désinscrire\">";
$modifier = "<img src=\"images/modifier.png\" border=0
alt=\"Modifier\">";
--- 103,107 ----
$supprimer = "<img src=\"images/supprimer.png\" border=0
alt=\"Supprimer\">";
$info = "<img src=\"images/info.png\" border=0 alt=\"Plus de
détails\">";
! $programmer = "<img src=\"images/programmer.png\" border=0
alt=\"Programmer, s'inscrire\">"; //'
$deprogrammer = "<img src=\"images/deprogrammer.png\" border=0
alt=\"Déprogrammer, désinscrire\">";
$modifier = "<img src=\"images/modifier.png\" border=0
alt=\"Modifier\">";
Index: dateheure.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/dateheure.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** dateheure.inc.php 5 Jan 2003 20:34:01 -0000 1.8
--- dateheure.inc.php 22 Jan 2003 21:24:08 -0000 1.9
***************
*** 261,263 ****
}
! ?>
\ No newline at end of file
--- 261,263 ----
}
! ?>
Index: entete.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/entete.inc.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** entete.inc.php 5 Jan 2003 20:34:01 -0000 1.15
--- entete.inc.php 22 Jan 2003 21:24:08 -0000 1.16
***************
*** 3,7 ****
Copyright (C) 2001, 2002 Loïc Dayot - Mairie de Pierrefitte (93)
! EPNadmin - Version 0.6 - 04/01/2003
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 - 14/01/2003
This program is free software; you can redistribute it and/or modify
***************
*** 23,27 ****
/* LD 4/1/2002 - essai de prise en compte des différentes fonctionnalités
! et des
autorisations des entités (usagers, structures).
*/
--- 23,27 ----
/* LD 4/1/2002 - essai de prise en compte des différentes fonctionnalités
! et des autorisations des entités (usagers, structures).
*/
***************
*** 45,59 ****
$ctitre="yellow";
! // Affichage du menu de gauche quand on est simple usager
! if (!$id_structure)
{
$res=recherche("usagers", "id", $id_usager);
$usager = mysql_fetch_object($res);
! echo "
<table cellpadding=\"2\" cellspacing=\"0\" align=\"left\">
<tr>
<td colspan=3 align=center><a href=\"index.php\"><img src=\"$logo\"
width=113 height=113 border=0></a></td>
<td width=\"5\"></td>
! </tr>
<tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
--- 45,80 ----
$ctitre="yellow";
! switch ($is_ident)
{
+ case "usager" :
+ // Retrouver l'usager en cours
$res=recherche("usagers", "id", $id_usager);
$usager = mysql_fetch_object($res);
! break;
! case "structure" :
! $res=recherche("structures", "id", $id_structure);
! $structure = mysql_fetch_object($res);
! break;
! case "animateur" :
! $res=recherche("animateurs", "id", $id_animateur);
! $animateur = mysql_fetch_object($res);
! break;
! case "visiteur" :
! $visiteur=TRUE;
! }
!
! // Début de l'affichage de la barre de menu (y compris le logo de
l'application).
!
! echo "
<table cellpadding=\"2\" cellspacing=\"0\" align=\"left\">
<tr>
<td colspan=3 align=center><a href=\"index.php\"><img src=\"$logo\"
width=113 height=113 border=0></a></td>
<td width=\"5\"></td>
! </tr>\n";
!
!
! // COMPTE PERSONNELS des usagers et structures (et bientôt animateurs)
!
! echo "
<tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
***************
*** 61,65 ****
<tr>
<td align=\"center\" valign=\"top\" colspan=\"2\" bgcolor=\"$cfond\">
! <b><font color=\"$ctitre\">Perso</font></b>
</td>
<td bgcolor=\"$cfond\" rowspan=\"3\"><br></td>
--- 82,95 ----
<tr>
<td align=\"center\" valign=\"top\" colspan=\"2\" bgcolor=\"$cfond\">
! <b><font color=\"$ctitre\">";
! switch ($is_ident)
! {
! case "usager" : $logon=2; echo "Perso $usager->login"; break;
! case "structure" : $logon=1; echo "Ma structure $structure->login"; break;
! case "animateur" : $logon=3; echo "Perso"; break;
! case "visiteur" : $logon=4; echo "Visiteur"; break;
! }
!
! echo "</font></b>
</td>
<td bgcolor=\"$cfond\" rowspan=\"3\"><br></td>
***************
*** 68,105 ****
<td valign=\"top\" bgcolor=\"$cfond\"><br>
</td>
! <td valign=\"top\">
! <a href=\"usagers.php\">mes infos</a><br>
! <a href=\"usagers.php?operation=7\">mes crédits</a><br>
! <a href=\"usagers.php?operation=6\">mot de passe</a><br>
! <a href=\"siteweb.php\">ma page perso</a><br>
! <a href=\"courriel.php\">mon courriel</a><br>
! <a href=\"index.php?logoff=1\">me délogguer</a>
! </td>
! </tr>
! <tr>
! <td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"
bgcolor=\"$cfond\"></td>
! </tr>
! <tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
</tr>
<tr>
<td align=\"center\" valign=\"top\" rowspan=\"1\" colspan=\"2\"
bgcolor=\"$cfond\">
! <b><font color=\"$ctitre\">Accès individuel</font></b><br>
</td>
<td bgcolor=\"$cfond\" rowspan=\"3\"><br></td>
</tr>
<tr>
! <td valign=\"top\" bgcolor=\"$cfond\"><br>
! </td>
! <td valign=\"top\">
! <a href=\"reservations.php?operation=5\">reservations
prévues</a><br>
! <a href=\"table_horaire.php\">réserver un poste</a><br>
! <a href=\"reservations.php?operation=4\">utilisations
passées</a><br>
! </td>
</tr>
<tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"
bgcolor=\"$cfond\"></td>
! </tr>
! <tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
</tr>
--- 98,191 ----
<td valign=\"top\" bgcolor=\"$cfond\"><br>
</td>
! <td valign=\"top\">\n";
!
! if ($is_ident=="usager")
! {
! if(defined("USAGERS") && USAGERS>"00")
! echo "<a href=\"usagers.php\">mes infos</a><br>\n";
!
! if ("CREDITS">"00")
! echo "<a href=\"usagers.php?operation=7\">mes crédits</a><br>\n";
!
! if (defined("USAGERS") && USAGERS>"00")
! echo "<a href=\"usagers.php?operation=6\">mot de passe</a><br>\n";
!
! if (defined("SITES") && SITES>"00")
! echo "<a href=\"siteweb.php\">ma page perso</a><br>\n";
!
! if (defined("COURRIELS") && COURRIELS>"00")
! echo "<a href=\"courriel.php\">mon courriel</a><br>\n";
! }
! elseif ($is_ident=="structure")
! {
! if (defined("STRUCTURES") && STRUCTURES>"00")
! echo "<a href=\"structures.php\">informations</a><br>
! <a href=\"structures.php?operation=6\">mot de passe</a><br>\n";
! if (defined("SITES") && SITES>"00")
! echo "<a href=\"siteweb.php?operation=11\">site web</a><br>\n";
! if (defined("COURRIELS") && COURRIELS>"00")
! echo "<a href=\"courriel.php?operation=11\">courriel</a><br>\n";
! }
! echo "<a href=\"index.php?logoff=$logon\">me délogguer</a>\n";
!
! echo "</td>
! </tr>
! <tr>
! <td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"
bgcolor=\"$cfond\"></td>
! </tr>\n";
!
! // UTILISATION DES POSTES EN ACCES INDIVIDUELS
!
! if ((defined("UTILISATION") && UTILISATION>"00")
! || (defined("USAGERS") && USAGERS>"00")
! || (defined("USAGES") && USAGES>"00") )
! {
! echo "<tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
</tr>
<tr>
<td align=\"center\" valign=\"top\" rowspan=\"1\" colspan=\"2\"
bgcolor=\"$cfond\">
! <b><font color=\"$ctitre\">";
! if ($is_ident=="usager")
! echo "Accès individuel";
! else
! echo "Individuels";
! echo "</font></b><br>
</td>
<td bgcolor=\"$cfond\" rowspan=\"3\"><br></td>
</tr>
<tr>
! <td valign=\"top\" bgcolor=\"$cfond\"><br></td>
! <td valign=\"top\">\n";
! if ($is_ident=="usager")
! echo "<a href=\"reservations.php?operation=5\">reservations
prévues</a><br>\n";
!
! if (defined("UTILISATION") && UTILISATION>="20")
! echo "<a href=\"table_horaire.php\">réserver un poste</a><br>\n";
!
! if (USAGERS==="40")
! echo "<a href=\"usagers.php?operation=3\">nouvel</a> -";
! if (USAGERS>="30")
! echo "<a href=\"usagers.php?operation=5\">usagers</a><br>\n";
! if (USAGERS==="40")
! echo "<a href=\"print.php\">cartes</a><br>\n";
! if (defined("USAGES") && USAGES>="10")
! echo "<a href=\"usages.php\">usages</a><br>\n";
! if (defined(HORAIRES) && HORAIRES>="10")
! echo "<a href=\"horaires.php\">horaires</a><br>\n";
!
! if ($is_ident=="usager")
! echo "<a href=\"reservations.php?operation=4\">utilisations
passées</a><br>\n";
!
! echo "</td>
</tr>
<tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"
bgcolor=\"$cfond\"></td>
! </tr>\n";
! } // if
!
! if ($is_ident=="usager" && PARCOURS>"00")
! {
! echo "<tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
</tr>
***************
*** 114,126 ****
</td>
<td valign=\"top\">
! <a href=\"parcours.php\">mon parcours</a><br>
! <a href=\"parcours.php?operation=4\">ajouter initiation</a><br>
! <a href=\"parcours.php?operation=5\">mettre à jour</a><br>
! </td>
</tr>
<tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"
bgcolor=\"$cfond\"></td>
! </tr>
! <tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
</tr>
--- 200,221 ----
</td>
<td valign=\"top\">
! <a href=\"parcours.php\">mon parcours</a><br>\n";
! if (SESSIONS>="10")
! echo "<a href=\"parcours.php\">m'inscrire à une initiation</a><br>\n";
! if (PARCOURS>="20")
! echo "<a href=\"parcours.php?operation=4\">ajouter initiation</a><br>
! <a href=\"parcours.php?operation=5\">mettre à jour</a><br>\n";
! echo "</td>
</tr>
<tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"
bgcolor=\"$cfond\"></td>
! </tr>\n";
! }
!
! // Positionnement ou compétences ou autoévaluation
!
! if ($is_ident=="usager" && defined("POSITIONNEMENT") && POSITIONNEMENT>"00")
! {
! echo "<tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
</tr>
***************
*** 134,141 ****
<td valign=\"top\" bgcolor=\"$cfond\"><br></td>
<td valign=\"top\">
! <a href=\"positionnement.php\">mes compétences</a><br>
! <a href=\"positionnement.php?operation=3\">me repositionner</a><br>
! <a href=\"positionnement.php?operation=5\">après une
initiation</a><br>
! </td>
</tr>
<tr>
--- 229,237 ----
<td valign=\"top\" bgcolor=\"$cfond\"><br></td>
<td valign=\"top\">
! <a href=\"positionnement.php\">mes compétences</a><br>\n";
! if (POSITIONNEMENT>="20")
! echo "<a href=\"positionnement.php?operation=3\">me
repositionner</a><br>
! <a href=\"positionnement.php?operation=5\">après une
initiation</a><br>\n";
! echo "</td>
</tr>
<tr>
***************
*** 144,246 ****
<tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
! </tr>
! </table>";
! } // fin du menu si on est simple usager...
! else // on est une structure
! {
! $res=recherche("structures", "id", $id_structure);
! $structure = mysql_fetch_object($res);
!
! echo "
! <table cellpadding=\"2\" cellspacing=\"0\" align=\"left\">
! <tr>
! <td colspan=3 align=center><a href=\"index.php\"><img src=\"$logo\"
width=113 height=113 border=0></a></td>
! <td width=\"5\"></td>
! </tr>
! <tr>
! <td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
! </tr>
! <tr>
! <td align=\"center\" valign=\"top\" colspan=\"2\" bgcolor=\"$cfond\">
! <b><font color=\"$ctitre\">Ma structure</font></b>
! </td>
! <td bgcolor=\"$cfond\" rowspan=\"3\"><br></td>
! </tr>
! <tr>
! <td valign=\"top\" bgcolor=\"$cfond\"><br>
! </td>
! <td valign=\"top\">
! <a href=\"structures.php\">informations</a><br>
! <a href=\"structures.php?operation=6\">mot de passe</a><br>
! <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élogguer</a>
! </td>
! </tr>
! <tr>
! <td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"
bgcolor=\"$cfond\"></td>
! </tr>
! <tr>
! <td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
! </tr>
! <tr>
! <td align=\"center\" valign=\"top\" rowspan=\"1\" colspan=\"2\"
bgcolor=\"$cfond\">
! <b><font color=\"$ctitre\">Activités collectives</font></b><br>
! </td>
! <td bgcolor=\"$cfond\" rowspan=\"3\"><br></td>
! </tr>
! <tr>
! <td valign=\"top\" bgcolor=\"$cfond\"><br>
! </td>
! <td valign=\"top\">
! <a href=\"session.php?operation=4\">sessions à venir</a><br>
! <a href=\"table_horaire_session.php?operation=1\">réserver une
salle</a><br>
! <a href=\"session.php?operation=5\">sessions passées</a>\n";
! if ($isadmin)
! {
! echo "<br>
! <a href=\"initiations.php?operation=5\">initiations</a><br>
! <a href=\"themes.php\">thèmes</a><br>\n";
! }
! echo "<a href=\"horaires.php\">horaires</a>
! </td>
! </tr>
! <tr>
! <td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"
bgcolor=\"$cfond\"></td>
! </tr>
! <tr>
! <td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
! </tr>
! <tr>
! <td align=\"center\" valign=\"top\" rowspan=\"1\" colspan=\"2\"
bgcolor=\"$cfond\">
! <font color=\"$ctitre\"><b>Individuels</b></font><br>
! </td>
! <td bgcolor=\"$cfond\" rowspan=\"3\"><br></td>
! </tr>
! <tr>
! <td valign=\"top\" bgcolor=\"$cfond\"><br>
! </td>
! <td valign=\"top\">
! <a href=\"table_horaire.php\">réservations postes</a>\n";
! if ($isadmin)
{
! echo "<br>
! <a href=\"usagers.php?operation=3\">nouvel</a> -
! <a href=\"usagers.php?operation=5\">usagers</a><br>
! <a href=\"print.php\">cartes</a><br>
! <a href=\"usages.php\">usages</a>\n";
! }
! echo "<br><a href=\"horaires.php\">horaires</a>
! </td>
</tr>
<tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"
bgcolor=\"$cfond\"></td>
! </tr>
! <tr>
! <td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
! </tr>
<tr>
<td align=\"center\" valign=\"top\" rowspan=\"1\" colspan=\"2\"
bgcolor=\"$cfond\">
<font color=\"$ctitre\"><b>Emprunt de matériels</b></font><br>
--- 240,288 ----
<tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
! </tr>\n";
! }
! // Activités collectives
! if ((defined("SESSIONS") && SESSIONS>"00") ||
! (defined("PEDAGOGIE") && PEDAGOGIE>"00"))
{
! echo "<tr>
! <td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
! </tr>
! <tr>
! <td align=\"center\" valign=\"top\" rowspan=\"1\" colspan=\"2\"
bgcolor=\"$cfond\">
! <b><font color=\"$ctitre\">Activités collectives</font></b><br>
! </td>
! <td bgcolor=\"$cfond\" rowspan=\"3\"><br></td>
! </tr>
! <tr>
! <td valign=\"top\" bgcolor=\"$cfond\"><br>
! </td>
! <td valign=\"top\">\n";
! if (defined("SESSIONS") && SESSIONS>"00")
! echo "<a href=\"session.php?operation=4\">sessions à venir</a><br>
! <a href=\"table_horaire_session.php?operation=1\">réserver une
salle</a><br>
! <a href=\"session.php?operation=5\">sessions passées</a><br>\n";
! if (defined("PEDAGOGIE") && PEDAGOGIE>"00")
! echo "<a href=\"initiations.php?operation=5\">initiations</a><br>
! <a href=\"themes.php\">thèmes</a><br>\n";
! if (defined("HORAIRES") && HORAIRES>"10")
! echo "<a href=\"horaires.php\">horaires</a>\n";
! echo "</td>
</tr>
<tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"
bgcolor=\"$cfond\"></td>
! </tr>\n";
! }
!
!
! // TODO : Prêt et emprunt de matériel ou logiciels
! /*
! echo "
<tr>
+ <td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
+ </tr>
+ <tr>
<td align=\"center\" valign=\"top\" rowspan=\"1\" colspan=\"2\"
bgcolor=\"$cfond\">
<font color=\"$ctitre\"><b>Emprunt de matériels</b></font><br>
***************
*** 253,256 ****
--- 295,300 ----
<a href=\"prets.php?operation=2\">emprunter</a><br>
<a href=\"prets.php?operation=1\">prêter</a>\n";
+
+
if ($isadmin)
{
***************
*** 259,262 ****
--- 303,307 ----
<a href=\"materiels.php?operation=5\">parc</a>\n";
}
+
echo "
</td>
***************
*** 268,273 ****
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
</tr>\n";
! if ($isadmin=="super")
{
echo "
--- 313,324 ----
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
</tr>\n";
+ */
! // if ($isadmin=="super") // Suppri avec 0.6
! if ((defined("STRUCTURES") && STRUCTURES>="40") ||
! (defined("LOCALISATIONS") && LOCALISATIONS>="40") ||
! (defined("SITES") && SITES>="40") ||
! (defined("COURRIELS") && COURRIELS>="40") ||
! (defined("DROITS") && DROITS>="40"))
{
echo "
***************
*** 281,299 ****
<td valign=\"top\" bgcolor=\"$cfond\"><br>
</td>
! <td valign=\"top\">
! <a href=\"structures.php?operation=5\">liste des structures</a><br>
! <a href=\"localisations.php\">liste des salles</a><br>
! <a href=\"siteweb.php?operation=10\">domaines sites web<br>
! <a href=\"courriel.php?operation=10\">domaines courriels
! </td>
</tr>
<tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"
bgcolor=\"$cfond\"></td>
- </tr>
- <tr>
- <td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"></td>
</tr>";
}
// Ajouté par LD 5/11/2002 - accès aux statistiques
echo "
--- 332,356 ----
<td valign=\"top\" bgcolor=\"$cfond\"><br>
</td>
! <td valign=\"top\">\n";
! if (STRUCTURES>="40")
! echo "<a href=\"structures.php?operation=5\">liste des
structures</a><br>\n";
! if (LOCALISATIONS>="40")
! echo "<a href=\"localisations.php\">liste des salles</a><br>\n";
! if (SITES>="40")
! echo "<a href=\"siteweb.php?operation=10\">domaines sites
web</a><br>\n";
! if (COURRIELS>="40")
! echo "<a href=\"courriel.php?operation=10\">domaines
courriels</a><br>\n";
! if (DROITS>="40")
! echo "<a href=\"configuration.php\">fonctionnalités et
droits</a><br>\n";
! echo "</td>
</tr>
<tr>
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"
bgcolor=\"$cfond\"></td>
</tr>";
}
+
+ if (defined("STATISTIQUES") && STATISTIQUES>"00")
+ {
// Ajouté par LD 5/11/2002 - accès aux statistiques
echo "
***************
*** 317,323 ****
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"
bgcolor=\"$cfond\"></td>
</tr>";
-
- echo "</table>";
}
// Ceci termine l'entête
--- 374,380 ----
<td valign=\"top\" rowspan=\"1\" colspan=\"2\" height=\"5\"
bgcolor=\"$cfond\"></td>
</tr>";
}
+
+ echo "</table>";
// Ceci termine l'entête
Index: header.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/header.inc.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** header.inc.php 5 Jan 2003 20:34:01 -0000 1.13
--- header.inc.php 22 Jan 2003 21:24:08 -0000 1.14
***************
*** 37,41 ****
mysql_connecte();
! function form_login($mes, $structure=FALSE)
{
global $PHP_SELF, $logo;
--- 37,41 ----
mysql_connecte();
! function form_login($mes, $logon)
{
global $PHP_SELF, $logo;
***************
*** 48,61 ****
<table align=\"center\" cellspacing=\"5\" bgcolor=\"#FF9999\">
<tr>\n"; //"
! if (! $structure)
{
echo "<td>
<form name=\"ident_usager\" method=\"post\" action=\"$PHP_SELF\">
<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>
</form>
--- 48,85 ----
<table align=\"center\" cellspacing=\"5\" bgcolor=\"#FF9999\">
<tr>\n"; //"
!
! switch ($logon)
{
+ case 1 : // Structure
+ echo "<td>
+ <form name=\"ident_structure\" method=\"post\" action=\"$PHP_SELF\">
+ <table align=\"center\" bgcolor=\"".COULEUR_STRUCTURE."\">
+ <tr><th align=center colspan=2>Identification structure</th></tr>
+ <input type=\"hidden\" name=\"logon\" value=\"$logon\">
+ <tr><td>Mon identifiant :</td><td><input type=\"text\"
name=\"identifiant1\"></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>
+ </form>
+ </td>\n"; // '
+ echo "</tr>
+ <tr><td align=center>
+ <i><font size=\"-1\">Si vous n'êtes pas une structure, mais que
vous voulez quand même
+ <br> essayer les services réservés aux structures,
+ <br>vous pouvez vous identifier avec "<b>admin</b>" et comme
mot de passe "admin".</font></i>
+ </td></tr></table>\n"; //"
+ break;
+
+ case 2 : // Usager
echo "<td>
<form name=\"ident_usager\" method=\"post\" action=\"$PHP_SELF\">
<table align=\"center\" bgcolor=\"#".COULEUR_USAGER."\">
! <tr><th align=center colspan=2>Identification usager</th></tr>
! <input type=\"hidden\" name=\"logon\" value=\"$logon\">
! <tr><td>Mon identifiant :</td><td><input type=\"text\"
name=\"identifiant2\"></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>
</form>
***************
*** 65,95 ****
<i><font size=\"-1\">Si vous n'êtes pas un usager, mais que vous
voulez quand même
<br> essayer les services réservés aux usagers,
! <br>vous pouvez vous identifier avec "<b>test</b>" et comme mot
de passe "test".</font></i>
</td></tr></table>\n"; //"
! }
! else
! {
echo "<td>
! <form name=\"ident_structure\" method=\"post\" action=\"$PHP_SELF\">
! <table align=\"center\" bgcolor=\"".COULEUR_STRUCTURE."\">
! <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>
</form>
! </td>\n"; // '
echo "</tr>
<tr><td align=center>
<i><font size=\"-1\">Si vous n'êtes pas une structure, mais que
vous voulez quand même
<br> essayer les services réservés aux structures,
! <br>vous pouvez vous identifier avec "<b>admin</b>" et comme
mot de passe "admin".</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>"")
--- 89,142 ----
<i><font size=\"-1\">Si vous n'êtes pas un usager, mais que vous
voulez quand même
<br> essayer les services réservés aux usagers,
! <br>vous pouvez vous identifier avec "<b>test</b>"
! et comme mot de passe "test".</font></i>
</td></tr></table>\n"; //"
! break;
!
! case 3 : // Animateur
echo "<td>
! <form name=\"ident_animateur\" method=\"post\" action=\"$PHP_SELF\">
! <table align=\"center\" bgcolor=\"".COULEUR_ANIMATEUR."\">
! <tr><th align=center colspan=2>Identification en tant
qu'animateur</th></tr>
! <input type=\"hidden\" name=\"logon\" value=\"$logon\">
! <tr><td>Mon identifiant :</td><td><input type=\"text\"
name=\"identifiant3\"></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'animateur\"></td></tr>
</table>
</form>
! </td>\n";
echo "</tr>
<tr><td align=center>
<i><font size=\"-1\">Si vous n'êtes pas une structure, mais que
vous voulez quand même
<br> essayer les services réservés aux structures,
! <br>vous pouvez vous identifier avec "<b>anim</b>" et comme mot
de passe "anim".</font></i>
</td></tr></table>\n"; //"
! break;
!
! default : // Visiteur
! echo "<td>
! <form name=\"ident_visiteur\" method=\"post\" action=\"$PHP_SELF\">
! <table align=\"center\" bgcolor=\"#".COULEUR_VISITEUR."\">
! <tr><th align=center colspan=2>Identification visiteur</th></tr>
! <input type=\"hidden\" name=\"logon\" value=\"4\">
! <input type=\"hidden\" name=\"identifiant4\" value=\"visiteur\">
! <tr><td align=center colspan=2><input type='submit' name='Valider'
! value=\"M'identifier en tant que simple visiteur\"></td></tr>
! </table>
! </form>
! </td>\n";
! echo "</tr></table>\n"; //'
! break;
! } // switch
!
! if ($logon!=1)
! echo "<a href=\"$PHP_SELF?logon=1\">S'identifier en tant que
structure.</a><br>\n";
! if ($logon!=2)
! echo "<a href=\"$PHP_SELF?logon=2\">S'identifier en tant qu'usager
individuel.</a><br>\n";
! if ($logon!=3)
! echo "<a href=\"$PHP_SELF?logon=3\">S'identifier en tant
qu'animateur.</a><br>\n";
! if ($logon!=4)
! echo "<a href=\"$PHP_SELF?logon=4\">Visiteur sans
identification.</a><br>\n";
if ($mes>"")
***************
*** 98,104 ****
<p><a href=\"courriel.php?operation=1\">Un problème avec votre
identification ?</a></p>\n";
echo "</body></html>";
! }
! if($logoff!=1)
{
session_start();
--- 145,152 ----
<p><a href=\"courriel.php?operation=1\">Un problème avec votre
identification ?</a></p>\n";
echo "</body></html>";
! } // function
!
! if (!$logoff || $logoff==0)
{
session_start();
***************
*** 106,269 ****
else // L'usager vient de se délogguer
{
session_start();
session_destroy();
! $is_ident=""; // == "ok" si identifié
$isadmin=""; // == "oui" si la structure identifiée a les
droits d'administration comptes usagers
// == "super" si la structure identifiée a tous
les droits
$id_structure=""; // id de la structure qui regarde, rien si usager
$id_usager=""; // id de l'usager qui regarde, rien si structure
}
! 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;
}
! else
! { // Test si ok
! $is_ident = "ok";
! session_register("is_ident"); // identification ok
!
! if ($id_structure>"")
! {
! session_register("id_structure"); // celle qui
regarde
! // Ancienne méthode, il faudrait s'en affranchir, au
profit des droits
! if ($isadmin>"")
! session_register("isadmin"); //
administrateur == "oui" ou "super"
! }
!
! if ($id_usager>"")
! {
! session_register("id_usager"); // celui qui regarde
! }
! }
} // if $is_ident
! /* Ici on va définir comme constantes toutes les
fonctionalités et tous les droits
! de la structure ou de l'usager. Tous
ces éléments sont tirés des tables
! fonctions et droits.
!
! Cinq cas :
!
! id_structure==0
! - C'est celui de la totalité de
l'application qui est définie, qui permet
! de rendre actif ou non
des fonctionnalités.
!
! id_structure==-1
! - C'est celui des droits des
usagers, ils sont tous identiques.
!
! id_structure==-2
! - C'est celui des droits des
animateurs, ils sont tous identiques. (Quand ça existera !)
!
! id_structure>0
! - Il s'agit des droits des
structures.
!
! id_structure==-3
! - C'est celui des droits des
strctures qui n'en ont pas encore (bref, les droits par défaut des structures).
!
! Dans la mesure où cet enregistrement ne
se fait que lors de l'identification,
! aux changements de droits dans la base,
il faudra penser à se ré-identifier.
! */
!
! // Retrouver les fonctionnalités actives de l'application
! $req="SELECT fonction, droit
! FROM droits
! LEFT JOIN fonctions ON
id_fonction=fonctions.id
! WHERE id_structure='0'";
! $res = executeRequete($req);
! if ($res)
! while ($droit = mysql_fetch_object($res))
! {
! define(strtoupper("FCT_".$droit->fonction),
strtoupper($droit->droit));
!
//debug(strtoupper("FCT_".$droit->fonction)."=".constant(strtoupper("FCT_".$droit->fonction)));
! }
! /* Dans le cas de la définition des
fonctionnalités, les constantes sont précédées de FCT_
! Par exemple, si la fonction de gestion
des usagers est activé, FCT_USAGERS vaudra ACTIF. */
!
! if ($id_usager)
! $nstructure=-1;
! elseif ($id_structure)
! {
! $nstructure=$id_structure;
! // On regarde si la structure a des droits de
configurés
! $req="SELECT * FROM droits WHERE
id_structure='$nstructure'";
! $res=executeRequete($req);
! if (! mysql_fetch_object($res))
! $nstructure=-3; // si non, on prend la
configuration apr défaut des structures.
! }
! else
! exit;
!
! // Enregistrer tous les droits
! $req="SELECT fonction, droit
! FROM droits
! LEFT JOIN fonctions ON
id_fonction=fonctions.id
! WHERE
id_structure='$nstructure'";
! $res = executeRequete($req);
! if ($res)
! while ($droit = mysql_fetch_object($res))
! {
! $variable=$droit->fonction;
! if (defined(strtoupper("FCT_".$variable)) &&
constant(strtoupper("FCT_".$variable))=="ACTIF")
! {
!
define(strtoupper($variable),strtoupper($droit->droit));
!
//debug(strtoupper($droit->fonction)."=".constant(strtoupper($droit->fonction)));
! }
! }
! /* Dans le cas des droits de la structure, si la
structure a le droits de voir (et uniquement de voir)
! les informations sur les usagers, on aura :
USAGERS=="VOIR". */
! ?>
--- 154,323 ----
else // L'usager vient de se délogguer
{
+ $logon=$logoff;
session_start();
session_destroy();
! $is_ident=""; // !="" si identifié
$isadmin=""; // == "oui" si la structure identifiée a les
droits d'administration comptes usagers
// == "super" si la structure identifiée a tous
les droits
$id_structure=""; // id de la structure qui regarde, rien si usager
$id_usager=""; // id de l'usager qui regarde, rien si structure
+ $id_animateur="";
}
! if(!$is_ident || $is_ident=="")
{ // pas encore identifié
! // Identification en tant que
! $mes="";
! $identifiant= "identifiant".$logon;
! $identifiant=$$identifiant;
! if ($logon!=4 && $identifiant)
! if ($identifiant!="")
! {
! switch ($logon)
! {
! case 1 : $resultat = recherche("structures", "login", $identifiant);
break;
! case 2 : $resultat = recherche("usagers", "login", $identifiant); break;
! case 3 : $resultat = recherche("animateurs", "login", $identifiant);
break;
! } // switch
! if ($resultat && $enr=mysql_fetch_object($resultat))
! {
! $id=$enr->id;
! $pass = $enr->motdepasse;
! if ($pass!=$mot_de_passe && $pass!=md5($mot_de_passe))
! $mes="Mot de passe incorrect.";
! }
! else
! $mes="Identifiant inconnu.";
! }
! else
! $mes="Identifiant absent.";
!
! if($mes!="" || !$logon || !$identifiant)
{ // mauvaise identification ou pas encore faite.
! form_login($mes, $logon);
exit;
}
!
! switch ($logon)
! {
! case 1 :
! $is_ident = "structure";
! $id_structure=$id;
! session_register("id_structure"); // celle qui regarde
! break;
! case 2 :
! $is_ident = "usager";
! $id_usager=$id;
! session_register("id_usager"); // celle qui regarde
! break;
! case 3 :
! $is_ident = "animateur";
! $id_animateur=$id;
! session_register("id_animateur"); // celle qui regarde
! break;
! case 4 :
! $is_ident = "visiteur";
! $id_visiteur=TRUE;
! session_register("id_visiteur"); // celle qui regarde
! break;
! } // switch
! session_register("is_ident"); // identification ok
!
} // if $is_ident
! /* Ici on va définir comme constantes toutes les fonctionalités et tous les
droits
! de la structure ou de l'usager. Tous ces éléments sont tirés des tables
! fonctions et droits.
!
! Cinq cas :
!
! id_structure==0
! - C'est celui de la totalité de l'application qui est définie, qui
permet
! de rendre actif ou non des fonctionnalités.
!
! id_structure==-1
! - C'est celui des droits des usagers, ils sont tous identiques.
!
! id_structure==-2
! - C'est celui des droits des animateurs, ils sont tous identiques.
(Quand ça existera !)
!
! id_structure>0
! - Il s'agit des droits de chacune des structures.
!
! id_structure==-3
! - C'est celui des droits par défaut des structures.
!
! id_structure==-4
! - C'est celui des droits des visiteurs non identifiés.
!
! Dans la mesure où cet enregistrement ne se fait que lors de
l'identification,
! aux changements de droits dans la base, il faudra penser à se
ré-identifier.
! */
!
!
! //debug($is_ident);
! switch ($is_ident)
! {
! case "usager" : $nstructure=-1; break;
! case "structure" : $nstructure=$id_structure; break;
! case "animateur" : $nstructure=-2; break;
! case "visiteur" : $nstructure=-4; break;
! default : debug("Problème grave de droits dans header.inc.php");
exit;
! } // switch
!
! //debug($nstructure);
!
! // On regarde si ça existe, sinon, on prend les fonctionnalités de
l'application
!
! // Retrouver les fonctionnalités actives de l'application
! $req1="SELECT id_fonction, fonction, droit
! FROM droits
! LEFT JOIN fonctions ON id_fonction=fonctions.id
! WHERE id_structure='0'";
! $config=FALSE;
! if ($res1 = executeRequete($req1))
! while ($fonctionnalite = mysql_fetch_object($res1))
! {
! $config=TRUE;
! if (strtoupper($fonctionnalite->droit)!="INACTIF")
! {
! define(strtoupper("FCT_".$fonctionnalite->fonction),
strtoupper($fonctionnalite->droit));
! /* Dans le cas de la définition des fonctionnalités, les constantes
sont précédées de FCT_
! Par exemple, si la fonction de gestion des usagers est activé,
FCT_USAGERS vaudra ACTIF. */
! //debug(strtoupper("FCT_".$fonctionnalite->fonction)." =>
".strtoupper($fonctionnalite->droit));
!
! // Pour chaque fonctionnalité, on regarde les droit.
! $variable=$fonctionnalite->fonction;
! $req2="SELECT droit FROM droits
! WHERE id_structure='$nstructure' AND
id_fonction='$fonctionnalite->id_fonction'";
! $res2= executeRequete($req2);
! if ($droit = mysql_fetch_object($res2))
! {
! define(strtoupper($variable), strtoupper($droit->droit));
! /* Dans le cas des droits de la structure,
! si la structure a le droits de voir (et uniquement de voir)
! les informations sur les usagers, on aura : USAGERS=="10". */
! //debug(strtoupper($variable)." -> ".strtoupper($droit->droit));
! }
! elseif ($nstructure>0) // Si c'est une structure et qu'on n'a rien, on
prend la config par défaut
! {
! $req3="SELECT droit FROM droits
! WHERE id_structure='-3' AND
id_fonction='$fonctionnalite->id_fonction'";
! $res3= executeRequete($req3);
! if ($droit = mysql_fetch_object($res3))
! {
! define(strtoupper($variable), strtoupper($droit->droit));
! }
! } // elseif
! } // if !=inactif
! } // while
!
! if (!$config)
! {
! debug("Il n'y a aucune configuration de faite, Un jour il faudrait prévoir
un guide à l'installation");
! exit;
! }
! ?>
\ No newline at end of file
Index: stats.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/stats.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** stats.php 5 Jan 2003 20:34:01 -0000 1.10
--- stats.php 22 Jan 2003 21:24:08 -0000 1.11
***************
*** 38,50 ****
require_once("parcours.inc.php"); // concernant les parcours des
usagers et leur positionnement
- mysql_connecte();
-
include("camembert.inc.php");
//include("histogramme.inc.php");
- // Si on veut une authentification, commenter les deux lignes précédentes et
rendre
- // active la ligne suivante.
- //require("header.inc.php");
-
?>
<html>
--- 38,44 ----
***************
*** 55,76 ****
<?
$titr = "Statistiques";
! $datemaj="5 décembre 2003";
! // On retire l'affichage du menu et du titre.
! //require("entete.inc.php");
! echo "<body bgcolor=\"#FFFFFF\">";
! $cfond="black";
! $ctitre="yellow";
! echo "<table cellpadding=\"2\" cellspacing=\"0\" align=\"left\">
! <tr>
! <td colspan=3 align=center><a href=\"index.php\"><img src=\"$logo\"
border=0></a></td>
! <td width=\"5\"></td>
! </tr></table>
! <table align=center>
! <tr>
! <td bgcolor=\"$cfond\" align=center>
! <font color=\"$ctitre\" size=\"+2\"><b>$titr</b></font></td>
! </tr>
! </table>\n<hr>";
// rends un traits d'une taille proportionnelle à la valeur (0 à 100) de
l'argument
--- 49,55 ----
<?
$titr = "Statistiques";
! $datemaj="21 janvier 2003";
! require("entete.inc.php");
// rends un traits d'une taille proportionnelle à la valeur (0 à 100) de
l'argument
***************
*** 271,275 ****
echo "<th>$ut</th>\n";
$utp = round($ut / $nbtotal * 100,1);
! $stats1[$us]=$utp;
echo "<td>$utp%".traitp($utp)."</td>\n";
echo "</tr>\n";
--- 250,254 ----
echo "<th>$ut</th>\n";
$utp = round($ut / $nbtotal * 100,1);
! if ($utp>1) $stats1[$us]=$utp;
echo "<td>$utp%".traitp($utp)."</td>\n";
echo "</tr>\n";
***************
*** 541,544 ****
--- 520,524 ----
echo "<tr><td>Nombre</td>";
$where = "WHERE DATE_ADD(usagers.date, INTERVAL 0 DAY)<=\"$datefin\"";
+
$req = "SELECT COUNT(*) AS nb, tarif
FROM usagers
***************
*** 562,565 ****
--- 542,546 ----
FROM usagers $where
GROUP BY age ORDER BY age"; //
+ //debug($req);
$res = executeRequete($req);
$i=-1;
***************
*** 582,586 ****
echo "<td>$stat->nb</td>";
! // Ligne nombre de sessions
echo "</tr>\n<tr><td>Nb d'heures d'initiation</td>";
$where = "LEFT JOIN parcours ON usagers.id=parcours.id_usager
--- 563,567 ----
echo "<td>$stat->nb</td>";
! // Ligne nombre d'h sessions
echo "</tr>\n<tr><td>Nb d'heures d'initiation</td>";
$where = "LEFT JOIN parcours ON usagers.id=parcours.id_usager
***************
*** 589,593 ****
. " AND (DATE_ADD(sessions.date, INTERVAL 0
DAY)>=\"$datedeb\"
AND DATE_ADD(sessions.date, INTERVAL 0
DAY)<=\"$datefin\") ";
! $req = "SELECT COUNT(*) AS nb, tarif
FROM usagers
LEFT JOIN credits ON credits.id_usager=usagers.id
--- 570,574 ----
. " AND (DATE_ADD(sessions.date, INTERVAL 0
DAY)>=\"$datedeb\"
AND DATE_ADD(sessions.date, INTERVAL 0
DAY)<=\"$datefin\") ";
! $req = "SELECT
SUM(TIME_TO_SEC(sessions.fin)-TIME_TO_SEC(sessions.debut))/60 AS nb, tarif
FROM usagers
LEFT JOIN credits ON credits.id_usager=usagers.id
***************
*** 603,611 ****
$i++;
}
! echo "<td>$stat->nb</td>";
$i=$stat->tarif;
$i++;
}
! $req = "SELECT COUNT(*) AS nb,
INTERVAL(YEAR(CURDATE())-YEAR(naissance), 20, 40, 60) as
age
FROM usagers
--- 584,593 ----
$i++;
}
! echo "<td>".datetoheure(minute2heure($stat->nb))."</td>";
$i=$stat->tarif;
$i++;
}
!
! $req = "SELECT SUM(TIME_TO_SEC(fin)-TIME_TO_SEC(debut))/60 AS nb,
INTERVAL(YEAR(CURDATE())-YEAR(naissance), 20, 40, 60) as
age
FROM usagers
***************
*** 614,617 ****
--- 596,600 ----
GROUP BY age ORDER BY age"; //
$res = executeRequete($req);
+
$i=-1;
while ($stat = mysql_fetch_object($res))
***************
*** 622,634 ****
$i++;
}
! echo "<td>$stat->nb</td>";
$i=$stat->age;
$i++;
}
! $req = "SELECT COUNT(*) AS nb FROM usagers $where";
$res = executeRequete($req);
while ($stat = mysql_fetch_object($res))
! echo "<td>$stat->nb</td>";
// Ligne nombre d'heures d'accès individuel total
--- 605,618 ----
$i++;
}
! echo "<td>".datetoheure(minute2heure($stat->nb))."</td>";
$i=$stat->age;
$i++;
}
! $req = "SELECT SUM(TIME_TO_SEC(fin)-TIME_TO_SEC(debut))/60 AS nb FROM
usagers $where";
$res = executeRequete($req);
+
while ($stat = mysql_fetch_object($res))
! echo "<td>".datetoheure(minute2heure($stat->nb))."</td>";
// Ligne nombre d'heures d'accès individuel total
***************
*** 639,643 ****
AND DATE_ADD(utilisation_postes.date, INTERVAL 0
DAY)<=\"$datefin\") ";
! $req = "SELECT COUNT(*) AS nb, tarif
FROM usagers
LEFT JOIN credits ON credits.id_usager=usagers.id
--- 623,627 ----
AND DATE_ADD(utilisation_postes.date, INTERVAL 0
DAY)<=\"$datefin\") ";
! $req = "SELECT SUM(TIME_TO_SEC(fin)-TIME_TO_SEC(debut))/60 AS nb, tarif
FROM usagers
LEFT JOIN credits ON credits.id_usager=usagers.id
***************
*** 652,660 ****
$i++;
}
! echo "<td>$stat->nb</td>";
$i=$stat->tarif;
$i++;
}
! $req = "SELECT COUNT(*) AS nb,
INTERVAL(YEAR(CURDATE())-YEAR(naissance), 20, 40, 60) as
age
FROM usagers $where GROUP BY age ORDER BY age"; //
--- 636,644 ----
$i++;
}
! echo "<td>".datetoheure(minute2heure($stat->nb))."</td>";
$i=$stat->tarif;
$i++;
}
! $req = "SELECT SUM(TIME_TO_SEC(fin)-TIME_TO_SEC(debut))/60 AS nb,
INTERVAL(YEAR(CURDATE())-YEAR(naissance), 20, 40, 60) as
age
FROM usagers $where GROUP BY age ORDER BY age"; //
***************
*** 668,672 ****
$i++;
}
! echo "<td>$stat->nb</td>";
$i=$stat->age;
$i++;
--- 652,656 ----
$i++;
}
! echo "<td>".datetoheure(minute2heure($stat->nb))."</td>";
$i=$stat->age;
$i++;
***************
*** 676,680 ****
$res = executeRequete($req);
while ($stat = mysql_fetch_object($res))
! echo "<td>$stat->nb</td>";
echo "</tr></table>\n";
--- 660,664 ----
$res = executeRequete($req);
while ($stat = mysql_fetch_object($res))
! echo "<td>".datetoheure(minute2heure($stat->nb))."</td>";
echo "</tr></table>\n";
***************
*** 789,798 ****
echo "<td>";
$where = "WHERE date>=\"$dated\" AND date<\"$datef\" ";
! $req = "SELECT COUNT(utilisation_postes.id_usager) AS nb FROM
utilisation_postes
$where AND etat IN ('réservation', 'impromptue')";
$res = executeRequete($req);
$i="";
if ($stat = mysql_fetch_object($res))
! echo "$stat->nb";
echo "</td>";
}
--- 773,783 ----
echo "<td>";
$where = "WHERE date>=\"$dated\" AND date<\"$datef\" ";
! $req = "SELECT SUM(TIME_TO_SEC(fin)-TIME_TO_SEC(debut))/60 AS nb
! FROM utilisation_postes
$where AND etat IN ('réservation', 'impromptue')";
$res = executeRequete($req);
$i="";
if ($stat = mysql_fetch_object($res))
! echo datetoheure(minute2heure($stat->nb));
echo "</td>";
}
Index: usagers.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/usagers.inc.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** usagers.inc.php 5 Jan 2003 20:34:01 -0000 1.6
--- usagers.inc.php 22 Jan 2003 21:24:08 -0000 1.7
***************
*** 306,308 ****
return $nouveaucredit;
}
! ?>
\ No newline at end of file
--- 306,308 ----
return $nouveaucredit;
}
! ?>
Index: usagers.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/usagers.php,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** usagers.php 5 Jan 2003 20:34:01 -0000 1.16
--- usagers.php 22 Jan 2003 21:24:08 -0000 1.17
***************
*** 488,493 ****
break;
}
- echo "<p>Effacement des informations de l'usager.</p><p>";
if ($perso=="on")
{ // Effacement de l'enregistrement des informations personnelles
--- 488,497 ----
break;
}
+ // On retrouve l'enregistrement de l'usager
+ $res = recherche("usagers", "id", $id_usager);
+ $usager = mysql_fetch_object($res);
+
+ echo "<p>Effacement des informations de l'usager.</p><p>";
if ($perso=="on")
{ // Effacement de l'enregistrement des informations personnelles
***************
*** 522,529 ****
echo "</p>\n";
- // On retrouve l'enregistrement de l'usager
- $res = recherche("usagers", "id", $id_usager);
- $usager = mysql_fetch_object($res);
-
// Effacement du compte sur la machine local
if ($nis=="on")
--- 526,529 ----
***************
*** 804,808 ****
<a href=\"$PHP_SELF?operation=6&id_usager=$id_usager\">Changer le
mot de passe de l'usager</a><br>
<a href=\"$PHP_SELF?operation=1&id_usager=$id_usager\">$modifier
Modifier cet utilisateur</a><br>
! <a href=\"courriel.php?operation=71&id_usager=$id_usager\">$ajouter
Créer un compte de courriel à cet utilisateur</a><br>
<a href=\"$PHP_SELF?operation=2&id_usager=$id_usager\">$supprimer
Supprimer cet utilisateur</a></p>\n";
--- 804,808 ----
<a href=\"$PHP_SELF?operation=6&id_usager=$id_usager\">Changer le
mot de passe de l'usager</a><br>
<a href=\"$PHP_SELF?operation=1&id_usager=$id_usager\">$modifier
Modifier cet utilisateur</a><br>
! <a href=\"courriel.php?operation=71&id_usager=$id_usager\">$ajouter
Créer un compte de courriel à cet utilisateur</a><br>
<a href=\"$PHP_SELF?operation=2&id_usager=$id_usager\">$supprimer
Supprimer cet utilisateur</a></p>\n";
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Epnadmin-fr] CVS: epnadmin configuration.php,1.1,1.2 constantes.inc.php,1.15,1.16 dateheure.inc.php,1.8,1.9 entete.inc.php,1.15,1.16 header.inc.php,1.13,1.14 stats.php,1.10,1.11 usagers.inc.php,1.6,1.7 usagers.php,1.16,1.17,
Loïc Dayot <=
- Prev by Date:
[Epnadmin-fr] CVS: epnadmin/images logoepnadmin.png,1.1.1.1,NONE
- Next by Date:
[Epnadmin-fr] CVS: epnadmin AUTHORS,1.1,1.2 configuration.php,1.2,1.3 constantes.inc.php,1.17,1.18 entete.inc.php,1.16,1.17 fr.lang.inc.php,1.1,1.2 header.inc.php,1.15,1.16 horaires.php,1.9,1.10 initiations.php,1.5,1.6 questions.php,1.3,1.4 themes.php,1.4,1.5
- Previous by thread:
[Epnadmin-fr] CVS: epnadmin/images logoepnadmin.png,1.1.1.1,NONE
- Next by thread:
[Epnadmin-fr] CVS: epnadmin AUTHORS,1.1,1.2 configuration.php,1.2,1.3 constantes.inc.php,1.17,1.18 entete.inc.php,1.16,1.17 fr.lang.inc.php,1.1,1.2 header.inc.php,1.15,1.16 horaires.php,1.9,1.10 initiations.php,1.5,1.6 questions.php,1.3,1.4 themes.php,1.4,1.5
- Index(es):