Commit ef36a940 authored by Denis S. Valdenaire's avatar Denis S. Valdenaire

translation of the schema

parent 0b06fa64
<?php
/*
This file is part of phpLudoreve.
phpLudoreve is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
phpLudoreve is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with phpLudoreve. If not, see <http://www.gnu.org/licenses/>.
*/
include "entt.php";
$sql = "SELECT prets.id_pret,prets.rendu,prets.date_retour,prets.id_jeu,
prets.id_adherent,prets.reglera,
adherent.id_adherent,adherent.nom,adherent.prenom
FROM prets,adherent
WHERE adherent.id_adherent=prets.id_adherent ";
$sql.= " AND adherent.id_adherent='".mysql_real_escape_string($_GET['id_adherent'],$server_link)."'";
echo "<h1>PRETS DE L'ADHERENT</h1>";
$requete = mysql_query($sql,$server_link);
if ( mysql_num_rows($requete) > 0 && !isset($_GET['forcer']) ) {
echo "<h3>Cet adhérent a ".mysql_num_rows($requete)." prêts!</h3>";
echo "<p>Vous devez changer l'adhérent de chacun de ces prêts pour pouvoir supprimer cet adhérent.</p>";
echo "<p>Ou alors cliquez sur <a href='../adherents/del.php?forcer=1&amp;id_adherent={$_GET['id_adherent']}'>forcer</a> : cela supprimera tous les prêts de cet adhérent!</p>";
echo "<table>";
echo "<tr><th>Etat</th><th>JEU</th><th>ADHERENT</th><th>REGLERA</th></tr>";
$ligne=FALSE;
# affichage des résultats de la requête dans le menu déroulant
while ($resultat = mysql_fetch_array($requete))
{
if ( $resultat['rendu'] ) $editer="Rendu";
else $editer="Prêté jusqu'au ".$resultat['date_retour'];
$ligne=alterne_tr($ligne);
echo "<td>
<a href=../pret/edit.php?id_pret=".$resultat['id_pret'].">$editer
</a></td>
<td><a href=../jeux/edit.php?id_jeu=".$resultat['id_jeu'].">".nom_jeu($resultat['id_jeu'])."</a></td>
<td><a href=../adherents/edit.php?id_adherent=".$resultat['id_adherent'].">".nom_adherent($resultat['id_adherent'])."</a></td>
<td>".$resultat['reglera']."</td>
</tr>";
}
echo "</table>";
} else {
$sql = "DELETE FROM prets WHERE id_adherent='".mysql_real_escape_string($_GET['id_adherent'],$server_link)."'";
mysql_query($sql,$server_link);
$sql="DELETE FROM adherent WHERE id_adherent='".mysql_real_escape_string($_GET['id_adherent'],$server_link)."'";
mysql_query($sql,$server_link);
echo '<P>Cet adhérent a été définitivement supprimé!</P>';
}
include "../fonctions/finpage.php";
?>
<?php
/*
This file is part of phpLudoreve.
phpLudoreve is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
phpLudoreve is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with phpLudoreve. If not, see <http://www.gnu.org/licenses/>.
*/
include "entt.php";
?>
<SCRIPT LANGUAGE="JavaScript">
function validate_and_submit ()
{
if(document.forms["saisie"].nom.value == 0)
{
alert ("Vous n'avez pas saisi le nom!");
return false;
}
if(document.forms["saisie"].date_inscription.value == 0)
{
alert ("Vous n'avez pas saisi la date d'inscription!");
return false;
}
if(document.forms["saisie"].date_naissance.value == 0)
{
alert ("Vous n'avez pas saisi la date de naissance!");
return false;
}
document.forms["saisie"].submit();
return true;
}
</SCRIPT>
<?php
echo "<center>";
if (isset($_GET['id_adherent']))
{
$adherent = get_adherent($_GET['id_adherent']);
echo "<h3>ADHERENT n°".$_GET['id_adherent']."</h3>";
echo "<a href='../pret/list.php?id_adherent=".$_GET['id_adherent']."'>
PRETS EN COURS DE l'ADHERENT</a>";
}
else
#Création à vide
{
$adherent = array('nom'=>'','prenom'=>'','date_inscription'=>'','date_naissance'=>'','adresse'=>'','cp_ville'=>'','tel_maison'=>'','tel_travail'=>'','tel_mobile'=>'','tel_fax'=>'','commentaire'=>'');
echo "<h3>NOUVEL ADHERENT</h3>";
}
?>
<table>
<form name="saisie" action="valide.php" enctype="multipart/form-data" method="post">
<tr>
<td align=right>Num&eacute;ro</td>
<td align=left><input type=text name=num_adherent SIZE=4 MAXLENGTH=4
value="<?php if ($adherent['num_adherent']>0) { printf('%04d', $adherent['num_adherent']);}?>"></td>
</tr>
<tr>
<td align=right>Adh&eacute;sion</td>
<?php $list_adhesion= array('Famille', 'Individuel', 'Nounou', 'Nounou+famille', 'Structure'); ?>
<td align=left><select name="adhesion">
<?php
foreach ($list_adhesion as $cur) {
if ($adherent['adhesion'] == $cur) {
echo '<option selected value="' . $cur . '">' . $cur . '</option>';
} else {
echo '<option value="' . $cur . '">' . $cur . '</option>';
}
}
?>
</select></td>
</tr>
<tr>
<td align=right>Caution</td>
<?php $list_caution= array('Cheque', 'Espece', 'Aucune'); ?>
<td align=left><select name="caution">
<?php
foreach ($list_caution as $cur) {
if ($adherent['caution'] == $cur) {
echo '<option selected value="' . $cur . '">' . $cur . '</option>';
} else {
echo '<option value="' . $cur . '">' . $cur . '</option>';
}
}
?>
</select></td>
</tr>
<tr>
<td align=right>Nom</td>
<td align=left><input type=text name=nom SIZE=50 MAXLENGTH=50
value="<?php echo $adherent['nom'];?>"></td>
</tr>
<tr>
<td align=right>Prénom</td>
<td align=left><input type=text name=prenom SIZE=50 MAXLENGTH=50
value="<?php echo $adherent['prenom'];?>"></td>
</tr>
<tr>
<td align=right>Date inscription</td>
<td align=left><input type=text name=date_inscription SIZE=10 MAXLENGTH=10
value="<?php echo $adherent['date_inscription'];?>">
<font size=-1> (AAAA-MM-JJ) Année-Mois-Jour</font></td>
</tr>
<tr>
<td align=right>Date de naissance</td>
<td align=left><input type=text name=date_naissance SIZE=10 MAXLENGTH=10
value="<?php echo $adherent['date_naissance'];?>">
<font size=-1> (AAAA-MM-JJ) Année-Mois-Jour</font></td>
</tr>
<tr>
<td align=right>Adresse</td>
<td align=left><input type=text name=adresse SIZE=70 MAXLENGTH=70
value="<?php echo $adherent['adresse'];?>"></td>
</tr>
<tr>
<td align=right>Code Postal et Ville</td>
<td align=left><input type=text name=cp_ville SIZE=60 MAXLENGTH=60
value="<?php echo $adherent['cp_ville'];?>"></td>
</tr>
<tr>
<td align=right>Tél. Domicile</td>
<td align=left><input type=text name=tel_maison SIZE=14 MAXLENGTH=14
value="<?php echo $adherent['tel_maison'];?>"></td>
</tr>
<tr>
<td align=right>Tél. Professionnel</td>
<td align=left><input type=text name=tel_travail SIZE=14 MAXLENGTH=14
value="<?php echo $adherent['tel_travail'];?>"></td>
</tr>
<tr>
<td align=right>Tél. Mobile</td>
<td align=left><input type=text name=tel_mobile SIZE=14 MAXLENGTH=14
value="<?php echo $adherent['tel_mobile'];?>"></td>
</tr>
<tr>
<td align=right>Tél. Fax</td>
<td align=left><input type=text name=tel_fax SIZE=14 MAXLENGTH=14
value="<?php echo $adherent['tel_fax'];?>"></td>
</tr>
<tr>
<td align=right>Email</td>
<td align=left><input type=text name=email SIZE=50 MAXLENGTH=50
value="<?php echo $adherent['email'];?>"></td>
</tr>
<tr>
<td align=right>Newsletter</td>
<td align=left>
<?php
if ($adherent['newsletter'] == 1) {
echo '<input type="checkbox" name="newsletter" value="1" checked="checked"/>';
} else {
echo '<input type="checkbox" name="newsletter" value="1"/>';
}?>
</td>
</tr>
<tr>
<td align=right>Autres personnes rattach&eacute;es</td>
<td align=left><textarea name=autres cols=60 rows=5><?php echo $adherent['autres'];?></textarea>
</td>
</tr>
<tr>
<td align=right>Commentaire</td>
<td align=left><textarea name=commentaire cols=60 rows=5><?php echo $adherent['commentaire'];?></textarea>
<?php if (isset($adherent['id_adherent'])) echo "
<tr>
<td colspan=2>
<input type=hidden name=id_adherent value={$adherent['id_adherent']}>
<!--a href='del.php?id_adherent={$adherent['id_adherent']}>'>SUPPRIMER</a-->
</td>
</tr>
";?>
</td>
</tr>
<tr>
<TD colspan=2 align=center>
<SCRIPT LANGUAGE="JavaScript">
document.writeln ( '<br><INPUT TYPE=button VALUE=VALIDER ONCLICK=validate_and_submit()>' );
</SCRIPT>
</TD>
</tr>
</form>
</table>
<?php
include "../fonctions/finpage.php";
?>
<?php
/*
This file is part of phpLudoreve.
phpLudoreve is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
phpLudoreve is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with phpLudoreve. If not, see <http://www.gnu.org/licenses/>.
*/
include "../fonctions/enttappli.php";
?>
<div class="corps"><h2>ADHERENTS</h2>
<?php
/*
This file is part of phpLudoreve.
phpLudoreve is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
phpLudoreve is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with phpLudoreve. If not, see <http://www.gnu.org/licenses/>.
*/
include "entt.php";
$sql = "SELECT * FROM adherent ORDER BY nom";
$requete = mysql_query($sql,$server_link);
echo "<h1>LISTE DES ADHERENTS</h1>";
echo "<table>";
echo "<tr><th>Identifiant</th><th>NOM Prénom</th><th>Date de naissance</th></tr>";
$ligne=FALSE;
# affichage des résultats de la requête dans le menu déroulant
while ($resultat = mysql_fetch_array($requete))
{
$ligne=alterne_tr($ligne);
echo "<td>".$resultat['id_adherent']."</td>";
echo "<td><a href=edit.php?id_adherent=".$resultat['id_adherent'].">".
$resultat['nom']." ".$resultat['prenom'].
"</a></td>";
echo "<td>".$resultat['date_naissance']."</td>";
echo "</tr>";
}
echo "</table";
include "../fonctions/finpage.php";
?>
<?php
/*
This file is part of phpLudoreve.
phpLudoreve is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
phpLudoreve is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with phpLudoreve. If not, see <http://www.gnu.org/licenses/>.
*/
include "../fonctions/sql.inc";
$_POST['num_adherent'] = $_POST['num_adherent']+0;
if (!isset($_POST['newsletter'])) {
$_POST['newsletter'] = 0;
}
while (list ($key, $val) = each ($_POST)) {
$_POST[$key] = mysql_real_escape_string($val);
}
if (!$_POST[id_adherent])
{
$sql = "insert into adherent(
nom,
prenom,
date_inscription,
date_naissance,
adresse,
cp_ville,
tel_maison,
tel_travail,
tel_mobile,
tel_fax,
commentaire,
num_adherent,
adhesion,
email,
newsletter,
autres,
caution
)
values (
'".$_POST[nom]."',
'".$_POST[prenom]."',
'".$_POST[date_inscription]."',
'".$_POST[date_naissance]."',
'".$_POST[adresse]."',
'".$_POST[cp_ville]."',
'".$_POST[tel_maison]."',
'".$_POST[tel_travail]."',
'".$_POST[tel_mobile]."',
'".$_POST[tel_fax]."',
'".$_POST[commentaire]."',
'".$_POST[num_adherent]."',
'".$_POST[adhesion]."',
'".$_POST[email]."',
'".$_POST[newsletter]."',
'".$_POST[autres]."',
'".$_POST[caution]."')";
}
else
{
$sql="update `adherent` set id_adherent='".$_POST[id_adherent]."',
nom='".$_POST[nom]."',
prenom='".$_POST[prenom]."',
date_inscription='".$_POST[date_inscription]."',
date_naissance='".$_POST[date_naissance]."',
adresse='".$_POST[adresse]."',
cp_ville='".$_POST[cp_ville]."',
tel_maison='".$_POST[tel_maison]."',
tel_travail='".$_POST[tel_travail]."',
tel_mobile='".$_POST[tel_mobile]."',
tel_fax='".$_POST[tel_fax]."',
commentaire='".$_POST[commentaire]."',
num_adherent='".$_POST[num_adherent]."',
adhesion='".$_POST[adhesion]."',
email='".$_POST[email]."',
newsletter='".$_POST[newsletter]."',
autres='".$_POST[autres]."',
caution='".$_POST[caution]."'
where id_adherent='".$_POST[id_adherent]."'";
}
$res=sql_command($sql,$server_link);
header("Location: ../accueil/index.php");
<?php
// $Id$
/*
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.
*/
/**
* Basic Calendar data and display
*
* @author Oscar Merida <oscar@oscarm.org>
* @created Jan 18 2004
* @updated Feb 2 2004
*/
class calendar {
public $year;
public $month;
public $monthNameFull;
public $monthNameBrief;
public $startDay;
public $endDay;
public $display_links_on_week;
/**
* Constructor
*
* @param integer, year
* @param integer, month
* @param boolean, whether the links on week should be displayed
* @return object
* @public
*/
function Calendar ( $yr, $mo, $dlow = FALSE )
{
$this->display_links_on_week = $dlow;
setlocale(LC_TIME,'fr_FR');
$this->year = $yr;
$this->month = (int) $mo;
$this->startTime = strtotime( "$yr-$mo-01 00:00" );
$this->endDay = date( 't', $this->startTime );
$this->endTime = strtotime( "$yr-$mo-".$this->endDay." 23:59" );
$this->startDay = date( 'D', $this->startTime );
$this->startOffset = date( 'w', $this->startTime ) - 1;
if ( $this->startOffset < 0 )
{
$this->startOffset = 6;
}
$this->monthNameFull = strftime( '%B', $this->startTime );
$this->monthNameBrief= strftime( '%b', $this->startTime );
$this->dayNameFmt = '%a';
$this->tblWidth="*";
}
// ==== end Calendar ================================================
function getStartTime()
{
return $this->startTime;
}
function getEndTime()
{
return $this->endTime;
}
function getYear()
{
return $this->year;
}
function getFullMonthName()
{
return $this->monthNameFull;
}
function getBriefMonthName()
{
return $this->monthNameBrief;
}
function setTableWidth( $w )
{
$this->tblWidth = $w;
}
function setYear( $year )
{
$this->year = $year;
}
function setMonth( $month )
{
$this->month = $month;
}
/**
* Any valid strftime format for display weekday names
*
* %a - abbreviated, %A - full, %u as number with 1==Monday
*/
function setDayNameFormat( $f )
{
$this->dayNameFmt = $f;
}
/**
* Returns markup for displaying the calendar.
*
* @return
* @public
*/
function display ( )
{
ob_start();
?>
<table border="1" cellspacing="0" cellpadding="0" width="<?=$this->tblWidth?>">
<?=$this->dspDayNames()?>
<?=$this->dspDayCells()?>
</table>
<?php
$c = ob_get_contents();
ob_end_clean();
return $c;
}
// ==== end display ================================================
function dc_display() {
ob_start();
?>
<table border="1" cellspacing="0" cellpadding="0" width="<?=$this->tblWidth?>">
<?=$this->dc_dspDayNames()?>
<?=$this->dc_dspDayCells()?>
</table>
<?php
$c = ob_get_contents();
ob_end_clean();
return $c;
}
/**
* Displays the row of day names.
*
* @return string
* @private
*/
function dspDayNames ( )
{
ob_start();?>
<tr>
<?php
for( $i=-3; $i<4; $i++ ) {
echo '<th width="12%">'.substr(date("l",($i*86400)),0,2)."</th>";
}
?>
<th width="12%">Week</th>
</tr>
<?php
$c = ob_get_contents();
ob_end_clean();
return $c;
}
function dc_dspDayNames ( )
{
ob_start();?>
<tr>
<?php
for( $i=-2; $i<3; $i++ ) {
echo '<th width="12%">'.substr(date("l",($i*86400)),0,2)."</th>";
}
?>
<th width="12%">Sem</th>
</tr>
<?php
$c = ob_get_contents();
ob_end_clean();
return $c;
}
// ==== end dspDayNames ================================================
/**
* Displays all day cells for the month
*
* @return string
* @private
*/
function dspDayCells ( )
{
$i = 0; // cell counter
ob_start();
?>
<tr>
<?php
// first display empty cells based on what weekday the month starts in]
for( $c=0; $c<$this->startOffset; $c++ )
{
$i++;
?>