Your IP : 216.73.216.162


Current Path : /home/x/b/o/xbodynamge/www/reservation/admin/
Upload File :
Current File : /home/x/b/o/xbodynamge/www/reservation/admin/add_seance_complete.php

<?php
include_once('init.inc.php');
?>

<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;vertical-align: top;">

<form action="add_seance_complete.php" method="POST">

<table style="width:100%;border:0px">

<tr>
<td style="width:90px;">
Salle
</td>
<td>
<select name="salle">
<option></option>
<?php
$sql = "SELECT * from reservation".$DB_prefixtable."salle";
$req = mysqli_query($db, $sql) or die('Erreur SQL !'.mysqli_error());
while($salle = mysqli_fetch_assoc($req)):?>
  <option value="<?php echo $salle['id'];?>" <?php if ($_POST['salle']==$salle['id']) echo "selected";?>><?php echo $salle['salle']?></option>
<?php endwhile;
?>
</select>
</td>
</tr>

<tr>
<td>
Date
</td>
<td>
<select name="date">
<option></option>
<?php
for ($ind=0;$ind<=30;$ind++){
  echo '<option value="'.date('Y-m-d',strtotime(date('Y-m-d'))+$ind*86400).'"';
  if ($_POST['date']==date('Y-m-d',strtotime(date('Y-m-d'))+$ind*86400)) echo "selected";
  echo '>'.date('d-m-Y',strtotime(date('Y-m-d'))+$ind*86400).'</option>';  
}
?>
</select>
</td>
</tr>

</table>

<input type="hidden" name="type" value="new">
<input type="submit" value="Voir les seances">
</form>

<?php
if (isset($_POST['salle']) && isset($_POST['date'])){
   
  $sql = "SELECT * from reservation".$DB_prefixtable."seance_type where salle='".$_POST['salle']."' and jour = '".$jour_fr[date('D',strtotime( $_POST['date']))]."' order by heure_debut"; 
     
  
  $req = mysqli_query($db, $sql) or die('Erreur SQL !'.mysqli_error());
  while($stype = mysqli_fetch_assoc($req)):
    echo $stype['heure_debut'].' '.$stype['type_seance'];?>
    
    <?php
    $sql = "SELECT count(*) as nb_reservation from reservation".$DB_prefixtable."reservation where id_salle='".$_POST['salle']."' and date='".$_POST['date']."' and heure_deb='".$stype['heure_debut']."'";
    $req3 = mysqli_query($db, $sql) or die('Erreur SQL !'.mysqli_error()); 
    $nb_reservation = mysqli_fetch_assoc($req3);

    ?>
    
    
    <form style="display: inline; margin: 0px;padding: 0px;" action="modif_complete_seance.php" method="POST">
    <input type="hidden" name="salle" value="<?php echo $_POST['salle'];?>">
    <input type="hidden" name="date" value="<?php echo $_POST['date'];?>">
    <input type="hidden" name="heure_debut" value="<?php echo $stype['heure_debut'];?>">
    <input type="hidden" name="heure_fin" value="<?php echo $stype['heure_fin'];?>">
    <input type="hidden" name="type_seance" value="<?php echo $stype['type_seance'];?>">
    <input type="hidden" name="type" value="creer">
    <input type="submit" value="&nbsp;&nbsp;&nbsp;Afficher complet&nbsp;&nbsp;&nbsp;">
    
    
    
    </form>
        
	
    <?php echo "<br>";
  endwhile;

}
?>

</body>
</html>