1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
<?php require_once('connexion.php'); ?>
<?php
session_start(); // On relaye la session
if (session_is_registered("authentification")){ // vérification sur la session authentification (la session est elle enregistrée ?)
// ici les éventuelles actions en cas de réussite de la connexion
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>OUTIL DE GESTION DES CYBERCENTRES : Gestion des adhérents</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body class="fond_page">
<table width="795" border="0" align="center" >
<tr>
<td width="131" valign="top"><div align="center" class="fond_menu">
<p> <br />
<span class="titre-rubrique">Menu</span> <br />
<br />
<a href="index2.php">Accueil</a><br />
<a href="admin.php">Gérer les utilisateurs</a><br />
<a href="gestion_adherent.php">Gérer les adhérents</a><br />
<a href="ajout_adherent.php">Ajouter un adhérent</a><br />
<a href="index.php?erreur=logout">Se déconnecter</a> </p>
<br />
</div></td>
<td width="652" valign="top" class="fond_affichage"><div class="titre" align="center"> <br />
<br />
</div>
<div class="titre" align="center"> Liste des adhérents <br />
<br />
</div>
<p>
<?php
//on se connecte à la bdd
mysql_connect("$hostname_dbprotect", "$username_dbprotect", "$password_dbprotect");
mysql_select_db("$database_dbprotect");
$envoi = $_POST['envoi'];
if ($envoi == 'Modifier') {
$venue = $_POST['venue'];
$raison_venue = implode(', ', $venue);
$themes_voulus = $_POST['themes_voulus'];
$id_adherent = mysql_real_escape_string($_GET['gestion_adherent']);
// on prépare la requête pour la mise à jour
$sql = "UPDATE adherents SET numcal='" . $_POST['numcal'] . "', pvcarte='" . $_POST['pvcarte'] . "', cyber_rattachement='" . $_POST['cyber_rattachement'] . "', titre='" . $_POST['titre'] . "', nom_adherent='" . $_POST['nom_adherent'] . "', prenom_adherent='" . $_POST['prenom_adherent'] . "', date_naissance_j='" . $_POST['date_naissance_j'] . "', date_naissance_m='" . $_POST['date_naissance_m'] . "', date_naissance_a='" . $_POST['date_naissance_a'] . "', sexe='" . $_POST['sexe'] . "', adresse='" . $_POST['adresse'] . "', adresse_comp='" . $_POST['adresse_comp'] . "', cp='" . $_POST['cp'] . "', ville='" . $_POST['ville'] . "', quartier='" . $_POST['quartier'] . "', tel='" . $_POST['tel'] . "', mail='" . $_POST['mail'] . "', statut='" . $_POST['statut'] . "', inscription_cyber_j='" . $_POST['inscription_cyber_j'] . "', inscription_cyber_m='" . $_POST['inscription_cyber_m'] . "', inscription_cyber_a='" . $_POST['inscription_cyber_a'] . "', niveau_info='" . $_POST['niveau_info'] . "', raison_venue='" . $raison_venue . "', themes_voulus='" . $_POST['themes_voulus'] . "' WHERE id=" . $id_adherent;
// on execute la requête de mise à jour
mysql_query($sql) OR die ("Impossible d'exécuter la requête : ".mysql_error());
}
if($_POST['delete'] == 'supprimer')
mysql_query("DELETE FROM adherents WHERE id IN(".implode(',', $_POST['delete']).")") or die(mysql_error());
?>
<table width="53%" border="0" align="center">
<tr>
<td width="72%" class="titre-rubrique"><div align="left">Nom</div></td>
<td width="28%" class="titre-rubrique"><div align="center">Supprimer</div></td>
</tr>
</table>
<table width="53%" border="0" align="center">
<?php
$retour = mysql_query('SELECT * FROM adherents ORDER BY nom_adherent');
while ($donnees = mysql_fetch_array($retour)) // On fait une boucle pour lister les adherents
{
?>
<tr>
<td width="72%">
<?php echo '<a href="modifier_adherent.php?modifier_adherent=' . $donnees['id'] . '">'; ?><?php echo stripslashes($donnees['nom_adherent']); ?> <?php echo stripslashes($donnees['prenom_adherent']); ?> </td>
<td width="28%">
<div align="center">
<form action="gestion_adherent.php" method="post" name="delete">
<input name="delete[]" type="checkbox" value="',$donnees['id'],'" />
</form>
</div>
</td>
</tr>
<?php
} // Fin de la boucle qui liste les adherents
?>
</table>
<table width="53%" border="0" align="center">
<tr>
<td><div align="center"><input type="submit" name="supprimer" value="Supprimer la sélection" /></div></td>
</tr>
</table>
<br />
</tr>
</table>
<?php
}
else {
header("Location:index.php?erreur=intru"); // redirection en cas d'echec
}
?>
</body>
</html> |
Partager