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 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
| <?php
ini_set("display_errors",0);error_reporting(0);
//On charge les variables
include ('includes/vars.php');
?>
<!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" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?php echo TITRE_SITE; ?></title>
<link href="style.css" rel="stylesheet" type="text/css" id="css" media="screen, projection" />
<div align="center">
<div id="en_tete">
</div>
</div>
</head>
<div id="global">
<?php
include ('includes/menu.php');
?>
<div id="corps">
<center>
<hr>
<?php
//On se connecte a la Base de donnee
include('mysqlcnn.php');
include ("admin/config/config.php");
//On verifie si le formulaire a ete envoye
if ((isset($_POST['jourc']) && !empty($_POST['jourc'])) && (isset($_POST['heurec']) && !empty($_POST['heurec'])) && (isset($_POST['nom']) && !empty($_POST['nom'])) && (isset($_POST['prenom']) && !empty($_POST['prenom']))
&& (isset($_POST['club']) && !empty($_POST['club'])) && (isset($_POST['nlicence']) && !empty($_POST['nlicence']))
&& (isset($_POST['cat']) && !empty($_POST['cat'])) && (isset($_POST['dis']) && !empty($_POST['dis'])))
{
//On enleve l'echappement si get_magic_quotes_gpc est active
if(get_magic_quotes_gpc())
{
$_POST['jourc'] = stripslashes($_POST['jourc']);
$_POST['heurec'] = stripslashes($_POST['heurec']);
$_POST['nom'] = stripslashes($_POST['nom']);
$_POST['prenom'] = stripslashes($_POST['prenom']);
$_POST['club'] = stripslashes($_POST['club']);
$_POST['nlicence'] = stripslashes($_POST['nlicence']);
$_POST['cat'] = stripslashes($_POST['cat']);
$_POST['dis'] = stripslashes($_POST['dis']);
}
//On echappe les variables pour pouvoir les mettre dans une requete SQL
$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']);
//test de la discipline demandee
if (($dis=='c10m') || ($dis=='p10m'))
{
$tble = 'pre10m';
$nbp = 35;
echo ' "'.$tble.'" ' ;
echo ' "'.$nbp.'" postes' ;
}
else if ($dis=='vit10m')
{
$tble = 'vit10m';
$nbp = 5;
echo ' "'.$tble.'" ' ;
echo ' "'.$nbp.'" postes' ;
}
else if ($dis=='st10m')
{
$tble = 'stsam9h';
$nbp = 5;
echo ' "'.$tble.'" ' ;
echo ' "'.$nbp.'" postes' ;
}
$test = mysql_query('SELECT COUNT(*) FROM "'.$tble.'" where nlicence="'.$nlicence.'"');
$verif = mysql_fetch_array($test);
if($verif['COUNT(*)'] >= 1)
{
echo 'licencie deja inscrit !';
?>
<script language="javascript">
<!--
window.setTimeout
('document.location.href="form_pre10m.php"',20000);
//-->
</script>
<?php
exit();
}
//verification du nombre d'inscrits max 5
$test1 = mysql_query('SELECT COUNT(heurec) FROM "'.$tble.'" where jourc="'.$jourc.'" && heurec="'.$heurec.'"');
$verif1 = mysql_fetch_array($test1);
if($verif1['COUNT(heurec)'] < "'.$nbp.'")
{
if(mysql_query('insert into "'.$tble.'"(jourc, heurec, nom, prenom, club, nlicence, cat, dis)
values ( "'.$jourc.'", "'.$heurec.'", "'.$nom.'", "'.$prenom.'", "'.$club.'", "'.$nlicence.'", "'.$cat.'", "'.$dis.'")'))
{
//Si ca a fonctionne, on naffiche pas le formulaire
$form = false;
echo '<br /><a1><b1>inscription ok</b1></a1>';
}
}
//Sinon serie complete
else
{
$form = true;
echo '<b1>Il y a : ... "'.$verif1['COUNT(heurec)'].'" ... inscrits</b1><br />';
echo '<a1><b1>serie complete...... Choisissez en une autre</b1></a1>';
}
}
//Sinon remplissez tous les champs
else
{
$form = true;
echo '"'.$jourc.'", "'.$heurec.'", "'.$nom.'", "'.$prenom.'", "'.$club.'", "'.$nlicence.'", "'.$cat.'", "'.$dis.'", "'.$tble.'"';
echo '<a1><b1>remplissez tous les champs !.</b1></a1>';
}
?>
<form action="form_pre10m.php" method="post">
<h2>INSCRIPTION DEPARTEMENTAUX 10M </h2>
<hr />
Veuillez remplir ce formulaire pour vous inscrire:<br /><br />
Jour :
<select name="jourc" value="<?php if(isset($_POST['jourc'])){echo $_POST['jourc'];} ?>" />
<option value="<?php if(isset($_POST['jourc'])){echo $_POST['jourc'];} ?>"> Select </option>
<option value="<?php if(isset($_POST['jourc'])){echo $_POST['jourc'];} ?>"> samedi
<option value="<?php if(isset($_POST['jourc'])){echo $_POST['jourc'];} ?>"> dimanche
</select><br /><br />
Heure :
<select name="heurec" value="<?php if(isset($_POST['heurec'])){echo $_POST['heurec'];} ?>" />
<option value="<?php if(isset($_POST['heurec'])){echo $_POST['heurec'];} ?>"> Select </option>
<option value="<?php if(isset($_POST['heurec'])){echo $_POST['heurec'];} ?>" > 9h
<option value="<?php if(isset($_POST['heurec'])){echo $_POST['heurec'];} ?>" > 9h30
<option value="<?php if(isset($_POST['heurec'])){echo $_POST['heurec'];} ?>" > 10h
<option value="<?php if(isset($_POST['heurec'])){echo $_POST['heurec'];} ?>" > 10h30
</select><br /> <br />
Nom :<input type="text" name="nom" value="<?php if(isset($_POST['nom'])){echo $_POST['nom'];} ?>" /><br /><br />
Prenom :<input type="text" name="prenom" value="<?php if(isset($_POST['prenom'])){echo $_POST['prenom'];} ?>" /><br /><br />
Club :<input type="text" name="club" value="<?php if(isset($_POST['club'])){echo $_POST['club'];} ?>" /><br /><br />
Nlicence :<input type="text" name="nlicence" value="<?php if(isset($_POST['nlicence'])){echo $_POST['nlicence'];} ?>" /><br /><br />
Cat:
<select name="cat" value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" />
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>">Select</option>
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" > PF
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" > PG
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" > BF
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" > BG
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" > MF
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" > MG
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" > CF
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" > CG
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" > JF
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" > JG
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" > D1
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" > S1
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" > D2
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" > S2
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" > D3
<option value="<?php if(isset($_POST['cat'])){echo $_POST['cat'];} ?>" > S3
</select><br /> <br />
Dis :
<select name="heurec" value="<?php if(isset($_POST['dis'])){echo $_POST['dis'];} ?>" />
<option value="<?php if(isset($_POST['dis'])){echo $_POST['dis'];} ?>"> Select </option>
<option value="<?php if(isset($_POST['dis'])){echo $_POST['dis'];} ?>" > c10m
<option value="<?php if(isset($_POST['dis'])){echo $_POST['dis'];} ?>" > p10m
<option value="<?php if(isset($_POST['dis'])){echo $_POST['dis'];} ?>" > vit10m
<option value="<?php if(isset($_POST['dis'])){echo $_POST['dis'];} ?>" > st10m
</select><br /> <br />
<input type="submit" value="Envoyer"> <input type="button" value="Sortie" onclick="location.href='/';"> <input type="button" value="Raz Form" onClick="this.form.reset()" />
</form>
<br />
<a href="<?php echo URL_SCRIPT; ?>/export_stsam.php">Export vers EXCEL de la table</a> <br /><br />
<a href="<?php echo URL_SCRIPT; ?>/accueil.php">retour a l'accueil</a>
<br />
<a href="<?php echo URL_SCRIPT; ?>/contact.php">contacter le webmaster</a> <br />
</div>
</center>
</div>
</body>
</html> |
Partager