Fane_CHP Just Free It Profil : Membre |
Code :
- <?php
- include ("page.inc" );
- include ("fonctions.inc" );
- entete();
- echo '<div align="center" class="titre">Liste des membres</div><hr>';
- dbconnect();
- if ($HTTP_POST_VARS[valid] == Valider)
- {
- if ($HTTP_POST_VARS[nom] != NULL && $HTTP_POST_VARS[prenom] != NULL)
- {
- $nom = $HTTP_POST_VARS[nom];
- $nom = strtoupper($nom);
- $prenom = $HTTP_POST_VARS[prenom];
- $prenom = strtolower($prenom);
- $prenom = ucwords($prenom);
- $numlicence = $HTTP_POST_VARS[numlicence];
- $datenaiss = $HTTP_POST_VARS[date3] . '-' . $HTTP_POST_VARS[date2] . '-' . $HTTP_POST_VARS[date1];
- $nationalite = $HTTP_POST_VARS[nationalite];
- $adresse = $HTTP_POST_VARS[adresse];
- $cp = $HTTP_POST_VARS[cp];
- $mail = $HTTP_POST_VARS[mail];
- $teld = $HTTP_POST_VARS[teld];
- if ($teld == "01-" )
- $teld = "";
- $telm = $HTTP_POST_VARS[telm];
- if ($telm == "06-" )
- $telm = "";
- $telp = $HTTP_POST_VARS[telp];
- if ($telp == "01-" )
- $telp = "";
- $sexe = $HTTP_POST_VARS[sexe];
- $section = $HTTP_POST_VARS[section];
- $req3 = "SELECT adherents.nom, adherents.prenom FROM adherents WHERE adherents.numad != 0";
- $res3 = mysql_query($req3);
- $exist = non;
- while ($enr3 = mysql_fetch_array($res3))
- {
- if ($nom == $enr3[nom] && $prenom == $enr3[prenom])
- {
- $exist = oui;
- }
- }
- if ($exist == oui)
- {
- echo '<p><font color="red">Cette entrée existe déjà dans la base.</font></p>';
- }
- else
- {
- dbconnect();
- $req4 = "INSERT INTO adherents
- VALUES ('', '$nom', '$prenom', '$numlicence', '$datenaiss', '$nationalite',
- '$adresse', '$cp', '$mail', '$teld', '$telm', '$telp', '$sexe', '$section')";
- $req5 = "SELECT * FROM villes WHERE cp=$cp";
- $res5 = mysql_query(req5);
- /*$exist2 = False;
- while ($enr5 = mysql_fetch_array($res5))
- {
- if ($cp == $res5[cp])
- {
- $exist2 = True;
- }
- }
- if (exist2 == False)
- {
- $req6 = "INSERT INTO villes VALUES ('$cp', '$ville')";
- if (mysql_query($req6) == True)
- {
- echo '<p><font color="red">Nouvelle ville ajoutée</font></p>';
- }
- }*/
- if (mysql_query($req4) == True)
- {
- echo '<p><font color="red">Nouveau membre créé.</font></p>';
- $HTTP_POST_VARS[valid] = 0;
- }
- else
- {
- echo '<p><font color="red">Erreur' . mysql_error () . '</font></p>';
- }
- }
- }
- else
- echo '<p><font color="red">Les champs "NOM" et "Prénom" n\'ont pas été rempli</font></p>';
- }
- /*ordre par defaut: debut d'evenement trié croissant*/
- $order = "adherents.nom";
- $sens = "ASC";
- $order2 = ", adherents.prenom ASC";
- /*si une variable est postée, on modifie les variables d'ordre*/
- if ($HTTP_GET_VARS[order] != NULL)
- {
- $order = $HTTP_GET_VARS[order];
- $sens = $HTTP_GET_VARS[sens];
- $order2 = $HTTP_GET_VARS[order2];
- }
- $req = "SELECT adherents.numad, adherents.nom, adherents.prenom, adherents.numlicence,
- adherents.sexe, DATE_FORMAT(adherents.datenaiss,'%d/%m/%Y') AS datenaiss
- FROM adherents
- WHERE adherents.numad != 1
- ORDER BY $order $sens$order2";
- $res = mysql_query($req);
- ?>
- <div align="center">
- <table width="80%" border="0">
- <tr>
- <td class="texte" valign="top">
- <div align="center"><b>
- <?
- if ($order != "adherents.nom" )
- {
- echo '<a href="adherents.php?order=adherents.nom&sens=ASC&order2=, adherents.prenom ASC">NOM<br><img src="tri_no.gif" width="11" height="12" border="0"></a>';
- }
- else
- {
- if ($sens == ASC)
- {
- echo '<a href="adherents.php?order=adherents.nom&sens=DESC&order2=, adherents.prenom DESC">NOM<br><img src="tri_down.gif" width="11" height="12" border="0"></a>';
- }
- else
- {
- echo '<a href="adherents.php?order=adherents.nom&sens=ASC&order2=, adherents.prenom ASC">NOM<br><img src="tri_up.gif" width="11" height="12" border="0"></a>';
- }
- }
- ?>
- <b></div><br>
- </td>
- <td class="texte" valign="top">
- <div align="center"><b>
- <?
- if ($order != "adherents.prenom" )
- {
- echo '<a href="adherents.php?order=adherents.prenom&sens=ASC&order2=, adherents.nom ASC">Prénom<br><img src="tri_no.gif" width="11" height="12" border="0"></a>';
- }
- else
- {
- if ($sens == ASC)
- {
- echo '<a href="adherents.php?order=adherents.prenom&sens=DESC&order2=, adherents.nom ASC">Prénom<br><img src="tri_down.gif" width="11" height="12" border="0"></a>';
- }
- else
- {
- echo '<a href="adherents.php?order=adherents.prenom&sens=ASC&order2=, adherents.nom ASC">Prénom<br><img src="tri_up.gif" width="11" height="12" border="0"></a>';
- }
- }
- ?>
- <b></div><br>
- </td>
- <td class="texte" valign="top">
- <div align="center"><b>
- <?
- if ($order != "adherents.numlicence" )
- {
- echo '<a href="adherents.php?order=adherents.numlicence&sens=ASC">Licence<br><img src="tri_no.gif" width="11" height="12" border="0"></a>';
- }
- else
- {
- if ($sens == ASC)
- {
- echo '<a href="adherents.php?order=adherents.numlicence&sens=DESC">Licence<br><img src="tri_down.gif" width="11" height="12" border="0"></a>';
- }
- else
- {
- echo '<a href="adherents.php?order=adherents.numlicence&sens=ASC">Licence<br><img src="tri_up.gif" width="11" height="12" border="0"></a>';
- }
- }
- ?>
- <b></div><br>
- </td>
- <td class="texte" valign="top">
- <div align="center"><b>
- <?
- if ($order != "adherents.datenaiss" )
- {
- echo '<a href="adherents.php?order=adherents.datenaiss&sens=ASC&order2=, adherents.nom ASC">Date de naissance<br><img src="tri_no.gif" width="11" height="12" border="0"></a>';
- }
- else
- {
- if ($sens == ASC)
- {
- echo '<a href="adherents.php?order=adherents.datenaiss&sens=DESC&order2=, adherents.nom ASC">Date de naissance<br><img src="tri_down.gif" width="11" height="12" border="0"></a>';
- }
- else
- {
- echo '<a href="adherents.php?order=adherents.datenaiss&sens=ASC&order2=, adherents.nom ASC">Date de naissance<br><img src="tri_up.gif" width="11" height="12" border="0"></a>';
- }
- }
- ?>
- <b></div><br>
- </td>
- <td class="texte" valign="top">
- <div align="center"><b>Grade
- <?/*
- if ($order != "adherents.numgrade" )
- {
- echo '<a href="adherents.php?order=adherents.numgrade&sens=ASC">Grade<br><img src="tri_no.gif" width="11" height="12" border="0"></a>';
- }
- else
- {
- if ($sens == ASC)
- {
- echo '<a href="adherents.php?order=adherents.numgrade&sens=DESC">Grade<br><img src="tri_down.gif" width="11" height="12" border="0"></a>';
- }
- else
- {
- echo '<a href="adherents.php?order=adherents.numgrade&sens=ASC">Grade<br><img src="tri_up.gif" width="11" height="12" border="0"></a>';
- }
- }
- */?>
- <b></div><br>
- </td>
- <td class="texte" valign="top">
- <div align="center"><b>
- <?
- if ($order != "adherents.sexe" )
- {
- echo '<a href="adherents.php?order=adherents.sexe&sens=ASC&order2=, adherents.nom, adherents.prenom ASC">Sexe<br><img src="tri_no.gif" width="11" height="12" border="0"></a>';
- }
- else
- {
- if ($sens == ASC)
- {
- echo '<a href="adherents.php?order=adherents.sexe&sens=DESC&order2=, adherents.nom ASC, adherents.prenom ASC">Sexe<br><img src="tri_down.gif" width="11" height="12" border="0"></a>';
- }
- else
- {
- echo '<a href="adherents.php?order=adherents.sexe&sens=ASC&order2=, adherents.nom ASC, adherents.prenom ASC">Sexe<br><img src="tri_up.gif" width="11" height="12" border="0"></a>';
- }
- }
- ?>
- <b></div><br>
- </td>
- <td class="texte" valign="top">
- <div align="center"><b>Détails</b></div><br>
- </td>
- <td class="texte" valign="top">
- <div align="center"><b>Modifier</b></div><br>
- </td>
- </tr>
-
- <?
- while ($enr = mysql_fetch_array($res))
- {
- $numad = $enr['numad'];
- $req2 = "SELECT grades.libgrade
- FROM adherents, grades, passer
- WHERE ((adherents.numad = '$numad')
- AND (passer.numad =adherents.numad )
- AND (grades.numgrade =passer.numgrade ))
- ORDER BY passer.datepassage DESC
- LIMIT 0,1";
- $res2 = mysql_query($req2);
- $grade = mysql_fetch_array($res2);
- echo '<tr>';
- echo '<td class="texte"><div align="left">' . $enr['nom'] . '</div></td>';
- echo '<td class="texte"><div align="left">' . $enr['prenom'] . '</div></td>';
- echo '<td class="texte"><div align="right">' . $enr['numlicence'] . '</div></td>';
- echo '<td class="texte"><div align="center">' . $enr['datenaiss'] . '</div></td>';
- echo '<td class="texte"><div align="center">' . $grade['libgrade'] . '</div></td>';
- echo '<td class="texte"><div align="center">' . $enr['sexe'] . '</div></td>';
- echo '<td class="texte"><div align="center"><a href="detailad.php?numad=' . $numad. '"><img src="ico_d.gif" border="0"></a></div></td>';
- echo '<td class="texte"><div align="center"><a href="modifad.php?numad=' . $numad. '"><img src="ico_m.gif" border="0"></a></div></td>';
- echo '</tr>';
- }
- echo '</table></div>';
- echo '<hr><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="100" height="23">
- <param name=movie value="newad.swf">
- <param name=quality value=high>
- <param name="BASE" value=".">
- <param name="BGCOLOR" value="">
- <embed src="newad.swf" base="." quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="23" bgcolor="">
- </embed>
- </object>';
- baspage();
- ?>
|
|