| 12
 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
 
 | <article>
 
<h2> Planning - <?php echo $this->pLib;?></h2> 
 
	<!-- Navigation entre les portails -->
	<nav class="navPortail">
		<ul>
			<?php 
				foreach ($this->portails as $p){
			?>
				<li>
					<a href="/planning/index/portail/<?php echo $p->cdPortail;?>/semaine/<?php echo $this->s; ?>"><?php echo $p->libPortail; ?></a>
				</li>
			<?php
				}
			?>
		</ul>
	</nav>
 
	<!-- Navigation entre les semaines -->
	<nav class="navDate">
		<?php
			// On n'affiche pas le bouton de retour Ã* la semaine précédente si on est en semaine 1 ou semaineCourante-5
			if($this->s!=1 && $this->sCourante-5<$this->s) {
		?>
		<a class="previous" href="<?php echo $this->url(
						array('module'=>'default', 
						'controller'=>'planning', 
						'action'=>'index',
						'portail'=>$this->p,
						'semaine'=>$this->s-1));?>">Précédente</a>
 
 
		<?php
			}
		?>
 
		<?php echo $this->lundi; ?> au <?php echo $this->samedi; ?>
 
 
		<?php
			// On n'affiche pas le bouton semaine suivante si on est en ou semaineCourante+5
			if($this->sCourante+5>$this->s) {
		?>			
 
		<a class="next" href="<?php echo $this->url(
						array('module'=>'default', 
						'controller'=>'planning', 
						'action'=>'index',
						'portail'=>$this->p,
						'semaine'=>$this->s+1
						));?>">Suivante</a>
		<?php 
			}
		?>
	</nav>
 
	<!-- Affichage du planning -->
	<table id="planning"> 
		<tr>
			<th>   </th>
			<th> Lundi </th>
			<th> Mardi </th>
			<th> Mercredi </th>
			<th> Jeudi </th>
			<th> Vendredi </th>
			<th> Samedi </th>
		</tr>
 
 	<?php 
 	// On parcourt tous les horaires
 	for($i=0; $i<count($this->horaires); $i++){
 		echo "\n".'<tr>'."\n" ;
 		// les indices pairs correspondent Ã* 8h, 9h, etc. (on ne veut pas afficher les 8h30 etc.)
 		if ($i%2==0){
 			echo '<td rowspan="2" class="horaire">' .$this->horaires[$i]. '</td>'."\n";
 		}
 
 		//on parcourt les jours de la semaine
 		for($j=1; $j<=count($this->jours); $j++){
 			//s'il n'y a pas de conflits pour l'affichage de l'horaire
 			if(!$this->horaireObj->searchConflictOK(0, $i, null, $j, $this->s, $this->p)){
 				try{
 					// On essaye de récupérer l'horaire (marche pas forcément)
 					$hor=$this->horaireObj->searchHoraireOK($i, $j, $this->s, $this->p);
 
 					// si l'horaire est trouvé, on procède au reste de l'affichage
 					// on récupère la classe de l'horaire en fonction de si c'est un horaire ou non
 					if($hor['isDevoir']) $class="devoir";
 					else $class="soutien";
 
 					// La différence permet de savoir sur combien de ligne s'étend l'horaire
 					$diff=$hor['finHoraire']-$hor['debutHoraire'];
 
 					// On affiche la cellule
 					echo '<td rowspan="'.$diff.'" class="'.$class.'" >';
					echo '<h4>'.$hor['libHoraire'].'</h4>';
					echo $hor['infoHoraire'];
 					echo '</td>'."\n";
	 			}
	 			catch(Exception $e){
	 				// si la recherche a échoué, c'est qu'il n'y a pas d'horaire ici
	 				echo '<td class="vide">   </td>'."\n";
	 			}
 		}	
 
 
 		}
 
   		echo '</tr>'."\n";
 	}
 
 	?>
 	</table>
 
 </article> | 
Partager