Voici la structure desiré
date | 8h |9h |10h |11H |12h |13h |14h |15h |16h |17h | 18h
-------------------------------------------------------------------------------------
lundi | | | | | | | | | | |
mardi
mercredi
jeudi
vendredi
samedi
dimanche
en faite dans le tableau j'aimerai faire apparaitre des rendez vous (tel proff avec tel eleve )
sachant qu'il peut avoir plusieur rendez vous mais avec des proff different a la meme heure
voici la table que j'utilise :
heure_conduite (
indentifiant_proff
identitifant_eleve
identifiant_heure
date
heure)
et voici le code que j'ai entré :
//les dates du debut et fin de semaines
$lundi2 = "$anneelundi-$moislundi-$jourlundi";
$dimanche2 = "$anneedimanche-$moisdimanche-$jourdimanche";
//tableau avec nom des jours
$a[1] = 'lundi';
$a[2] = 'mardi';
$a[3] = 'mercredi';
$a[4] = 'jeudi';
$a[5] = 'vendredi';
$a[6] = 'samedi';
$a[7] = 'dimanche';
//voici la requete qui permet de toute recuperer entre le debut et la fin de semaine
$selectinv = "Select * from heure_conduite WHERE Date >='$lundi2' and date <='$dimanche2' group by date";
$resultinv = mysql_query($selectinv,$link) or die ('Erreur 1: '.mysql_error() );
$i=1;
while ($voir = mysql_fetch_assoc($resultinv)&& $i<=7)
{
//création de l'objet personne
$personne1 = new date();
$personne1->identifiant_date = $voir['identifiant_date'];
$personne1->identifiant_eleve = $voir['identifiant_eleve'];
$personne1->identifiant_proff = $voir['identifiant_proff'];
$personne1->date = $voir['date'];
$personne1->heure = $voir['heure'];
?>
<tr><td><?php echo $a[$i]; ?></td>
<td><?php $personne1->identifiant_eleve() ?>/<?php $personne1->identifiant_proff() ?></td>
<td><?php $personne1->identifiant_eleve() ?>/<?php $personne1->identifiant_proff() ?></td>
<td><?php $personne1->identifiant_eleve() ?>/<?php $personne1->identifiant_proff() ?></td>
<td><?php $personne1->identifiant_eleve() ?>/<?php $personne1->identifiant_proff() ?></td>
<td><?php $personne1->identifiant_eleve() ?>/<?php $personne1->identifiant_proff() ?></td>
<td><?php $personne1->identifiant_eleve() ?>/<?php $personne1->identifiant_proff() ?></td>
<td><?php $personne1->identifiant_eleve() ?>/<?php $personne1->identifiant_proff() ?></td>
<td><?php $personne1->identifiant_eleve() ?>/<?php $personne1->identifiant_proff() ?></td>
<?php
$i++;
}
?></tr></table>