| Current Path : /home/xbodynamge/crosstraining/reservation/dev/admin/ |
| Current File : /home/xbodynamge/crosstraining/reservation/dev/admin/modif_client.php |
<?php
include_once('init.inc.php');
if ($_POST['id']=="new"){
$print_nom='';
$print_prenom='';
$print_email='';
$print_gsm='';
$print_adr='';
$print_cp='';
$print_ville='';
$print_nb_seance='';
}
else{
$sql = "SELECT * from reservation_client where id=".$_POST['id'];
$req = mysql_query($sql) or die('Erreur SQL !'.mysql_error());
$client = mysql_fetch_assoc($req);
$print_nom=$client['nom'];
$print_prenom=$client['prenom'];
$print_email=$client['email'];
$print_gsm=$client['gsm'];
$print_adr=$client['adr'];
$print_cp=$client['cp'];
$print_ville=$client['ville'];
$print_nb_seance=$client['nb_seance'];
echo $print_validite_jour=date('d',strtotime($client['validite_seance']));
echo $print_validite_mois=date('m',strtotime($client['validite_seance']));
echo $print_validite_annee=date('Y',strtotime($client['validite_seance']));
}
?>
<html>
<body>
<table style="width:100%;border:1px solid black;border-collapse:collapse;">
<tr>
<?php include_once('menu.php');?>
<td style="border:1px solid black;">
<form action="action_client.php" method="POST">
<table style="width:100%;border:0px">
<tr>
<td style="width:90px;">
Nom
</td>
<td>
<input type="text" name="nom" size="100" maxlength="200" value="<?php echo $print_nom;?>">
</td>
</tr>
<tr>
<td>
Prenom
</td>
<td>
<input type="text" name="prenom" size="100" maxlength="200" value="<?php echo $print_prenom;?>">
</td>
</tr>
<tr>
<td>
Email
</td>
<td>
<input type="text" name="email" size="100" maxlength="200" value="<?php echo $print_email;?>">
</td>
</tr>
<tr>
<td>
Gsm
</td>
<td>
<input type="text" name="gsm" size="100" maxlength="200" value="<?php echo $print_gsm;?>">
</td>
</tr>
<tr>
<td>
Adresse
</td>
<td>
<input type="text" name="adr" size="100" maxlength="200" value="<?php echo $print_adr;?>">
</td>
</tr>
<tr>
<td>
CP
</td>
<td>
<input type="text" name="cp" size="10" maxlength="6" value="<?php echo $print_cp;?>">
</td>
</tr>
<tr>
<td>
Ville
</td>
<td>
<input type="text" name="ville" size="100" maxlength="200" value="<?php echo $print_ville;?>">
</td>
</tr>
<tr>
<td>
Nb Seance
</td>
<td>
<input type="text" name="nb_seance" size="10" maxlength="2" value="<?php echo $print_nb_seance;?>">
</td>
</tr>
<tr>
<td>
Validite
</td>
<td>
<select name="date_validite_jour">
<?php
for ($ind=1;$ind<31;$ind++){
echo '<option value="'.$ind.'"'; if ($ind==$print_validite_jour) echo " selected"; echo'>'.$ind.'</option>';
}
?>
</select>
/
<select name="date_validite_mois">
<?php
for ($ind=1;$ind<12;$ind++){
echo '<option value="'.$ind.'"'; if ($ind==$print_validite_mois) echo " selected"; echo'>'.$ind.'</option>';
}
?>
</select>
/
<select name="date_validite_annee">
<?php
for ($ind=2014;$ind<2020;$ind++){
echo '<option value="'.$ind.'"'; if ($ind==$print_validite_annee) echo " selected"; echo'>'.$ind.'</option>';
}
?>
</select>
</td>
</tr>
</table>
<?php
if ($_POST['id']=="new"){
echo '<input type="hidden" name="type" value="new">';
echo '<input type="submit" value="Creer client">';
echo "</form>";
}
else{
echo '<input type="hidden" name="type" value="modif">';
echo '<input type="hidden" name="id" value="'.$client['id'].'">';
echo '<input type="submit" value="Modifier client">';
echo "</form>";
echo '<form action="action_client.php" method="POST">';
echo '<input type="hidden" name="type" value="remove">';
echo '<input type="hidden" name="id" value="'.$client['id'].'">';
echo '<input type="submit" value="Supprimer client">';
echo "</form>";
}
?>
<form>
</form>
</body>
</html>