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
   |  
 
 
 
$template = $this->_registry->getObject('tpl');
				$template->set_file('index','horaires_vols.html');
 
				$template->set_block('index', 'details', 'details_block');	
				$template->set_block('index', 'message', 'message_block');
				$template->set_block('index', 'vols', 'the_block')
 
  $debut_date= strtotime($values->debut_date_validite);				 				 
					              $fin_date=   strtotime($values->fin_date_validite);          
					              $date_actu=time();
 
//  on teste si la date actuelle est compris  entre dans  date debut et  date fin
 
				 		if($debut_date<=$date_actu  AND  $date_actu<= $fin_date)
				 		{ 
 
  // ici on test  s il le champ retard n est  pas null si oui  
  //c est que il ya  un retard de vol  vol donc horaire d'arrivé va etre egal a retard sino on affiche heure d'arrivé
				 					if($values->retards==null)
				 				   {
 
							 				$template->set_var('nom_compagnie', $values->nom_compagnie );
							 				$template->set_var('jours', $values->jours );
							 				$template->set_var('depart', $values->depart );
							 				$template->set_var('destination', $values->destination );
							 				$template->set_var('depart', $values->depart );
							 				$template->set_var('destination', $values->destination );
							 				$template->set_var('heure_depart', $values->heure_depart);
							 				$template->set_var('heure_arrivee', $values->heure_arrivee );
							 				$template->set_var('debut_date_validite', $values->debut_date_validite );
							 				$template->set_var('fin_date_validite', $values->fin_date_validite );
							 				$template->set_var('avion', $values->avion );
							 				$template->set_var('num_vol', $values->num_vol );
							 			  $template->parse('details_block', 'details', TRUE  );
 
				 					}  
				 			  		else 
				 			  		{
				 			  		$template->set_var('nom_compagnie', $values->nom_compagnie );
							 				$template->set_var('jours', $values->jours );
							 				$template->set_var('depart', $values->depart );
							 				$template->set_var('destination', $values->destination );
							 				$template->set_var('depart', $values->depart );
							 				$template->set_var('destination', $values->destination );
							 				$template->set_var('heure_depart', $values->heure_depart);
							 				$template->set_var('heure_arrivee', $values->retards );
							 				$template->set_var('debut_date_validite', $values->debut_date_validite );
							 				$template->set_var('fin_date_validite', $values->fin_date_validite );
							 				$template->set_var('avion', $values->avion );
							 				$template->set_var('num_vol', $values->num_vol );
							 			  $template->parse('details_block', 'details', TRUE  );	
				 			  		}
 
				 			  }
 
// si la  date actuelle n est  pas compris entre  les deux dat on affiche on message qu il  n'y a  pas de  vol 
				 		else  
				 			{
				 					$template->set_var('message',"info non disponible");
				 					 $template->parse('message_block', 'message', false);
				 			  }
				 	}
 
 
 
 
				 			$template->set_var('nom_compagnie', utf8_encode($value->nom_compagnie));				 	
				 			 $template->parse('the_block', 'vols', TRUE ); 
 
 
					 		}
 
					 		$name_exist = $tmp_name;
 
					 } else {
 
							echo '<pre>';
							print_r ($value);
							echo '</pre>';
 
					 }
				}	
				$template->pparse('result_index', 'index'); | 
Partager