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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
|
<?php
ini_set("display_errors",-1);error_reporting(E_ALL);
@session_start;
include ('header.php');
include ('menucompet.php');
include ("../mysqlcnn.php");
$pseudo = ($_SESSION['pseudo']);
?>
<div id="corps">
<hr>
<?php
if ( !empty($_POST['jourc'])
&& !empty($_POST['heurec'])
&& !empty($_POST['nom'])
&& !empty($_POST['prenom'])
&& !empty($_POST['club'])
&& !empty($_POST['nlicence'])
&& !empty($_POST['cat'])
&& !empty($_POST['dis'])
)
{
//$id = mysql_real_escape_string($_POST['id']);
$jourc = mysql_real_escape_string($_POST['jourc']);
$heurec = mysql_real_escape_string($_POST['heurec']);
$nom = mysql_real_escape_string($_POST['nom']);
$prenom = mysql_real_escape_string($_POST['prenom']);
$club = mysql_real_escape_string($_POST['club']);
$nlicence = mysql_real_escape_string($_POST['nlicence']);
$cat = mysql_real_escape_string($_POST['cat']);
$dis = mysql_real_escape_string($_POST['dis']);
if (($_GET['m']=="c10") || ($_GET['m']=="p10") && ($_GET['o']=="09octobre"))
{
$tble = "chaladult1";
$nbp = 20;
}
else if (($_GET['m']=="c10") || ($_GET['m']=="p10") && ($_GET['o']=="20novembre"))
{
$tble = "chaladult2";
$nbp = 30;
}
else if (($_GET['m']=="c10") || ($_GET['m']=="p10") && ($_GET['o']=="11decembre"))
{
$tble = "chaladult3";
$nbp = 18;
}
else if (($_GET['m']=="c10") || ($_GET['m']=="p10") && ($_GET['o']=="22janvier"))
{
$tble = "chaladult4";
$nbp = 16;
}
else if (($_GET['m']=="c10") || ($_GET['m']=="p10") && ($_GET['o']=="04mars"))
{
$tble = "chaladult5";
$nbp = 30;
}
//On modifie les informations de l'utilisateur avec les nouvelles valeurs
if(mysql_query('update fuschaladult set jourc="'.$jourc.'", heurec="'.$heurec.'", nom="'.$nom.'", prenom="'.$prenom.'", club="'.$club.'", nlicence="'.$nlicence.'", cat="'.$cat.'", dis="'.$dis.'" where nlicence="'.$nlicence.'" && dis="'.$dis.'" && jourc="'.$jourc.'" '))
{
//Si ca a fonctionne, on naffiche pas le formulaire
//$form = false;
mysql_query('update '.$tble.' set jourc="'.$jourc.'", heurec="'.$heurec.'", nom="'.$nom.'", prenom="'.$prenom.'", club="'.$club.'", nlicence="'.$nlicence.'", cat="'.$cat.'", dis="'.$dis.'" where nlicence="'.$nlicence.'" && dis="'.$dis.'" && jourc="'.$jourc.'" ');
?>
<script type="text/javascript">
window.setTimeout
('document.location.href="admin_chaladult.php"',2000);
</script>
<h2>
Les infos du membre ont été modifiées avec succès !
<br />
<br />
Redirection...
</h2>
<?php
exit();
}
}
else
{
//Sinon on dit quil y a eu une erreur
$form = true;
$message = 'Une erreur est survenue lors des modifications.';
}
if(isset($_POST['id'],$_POST['jourc'],$_POST['heurec'],$_POST['nom'],$_POST['prenom'],$_POST['club'],$_POST['nlicence'],$_POST['cat'],$_POST['dis']))
{
//$id = htmlentities($_POST['id']);
$nlicence = mysql_real_escape_string($_POST['nlicence']);
$dis = mysql_real_escape_string($_POST['dis']);
$jourc = mysql_real_escape_string($_POST['jourc']);
}
else
{
//Sinon, on affiche les donnes a partir de la base de donnee
$dnn = mysql_fetch_array(mysql_query('select * from fuschaladult where pseudo="'.$pseudo.'"'));
//$id = htmlentities($dnn['id']);
$jourc = htmlentities($dnn['jourc']);
$heurec = htmlentities($dnn['heurec']);
$nom = htmlentities($dnn['nom']);
$prenom = htmlentities($dnn['prenom']);
$club = htmlentities($dnn['club']);
$nlicence = htmlentities($dnn['nlicence']);
$cat = htmlentities($dnn['cat']);
$dis = htmlentities($dnn['dis']);
}
//On affiche le formulaire
?>
<form action="adm_chaladult.php?o=<?php echo $dnn['jourc']; ?>&n=<?php echo $dnn['nlicence']; ?>&m=<?php echo $dnn['dis'] ;?>" method="post">
Vous pouvez modifier les informations de <?php echo "$nom"," ","$prenom";?><br /><br />
Jour de tir:<input type="text" name="jourc" value="<?php echo $jourc; ?>" /><br /><br />
Heure de tir:<input type="text" name="heurec" value="<?php echo $heurec; ?>" /><br /><br />
Nom d'utilisateur:<input type="text" name="nom" value="<?php echo $nom; ?>" /><br /><br />
Prenom:<input type="text" name="prenom" value="<?php echo $prenom; ?>" /><br /><br />
Club:<input type="text" name="club" value="<?php echo $club; ?>" /><br /><br />
Nlicence:<input type="text" name="nlicence" value="<?php echo $nlicence; ?>" /><br /><br />
Categorie :<input type="text" name="cat" value="<?php echo $cat; ?>" /><br /><br />
Discipline:<input type="text" name="dis" value="<?php echo $dis; ?>" /><br /><br />
<br /><br />
<input type="submit" value="valider les modifications" /><br />
</form>
</div>
</div>
</div>
</body>
</html> |