File "job.php"

Full Path: /home/analogde/www/MassageProd/job.php
File size: 3.53 KB
MIME-type: text/x-php
Charset: utf-8

<?php


		session_start ();
		include('database.php');	
		include('fonctions.php');	
		include('generation_timing.php');

		error_reporting(0);
		
		DB_connexion(); 

		$annee = 2022;
		$mois = "juin";
		$formule = "courte";
	
		getClient($annee, $mois, $formule);
	
	
function getClient($annee, $mois , $formule)
{
					
					$table = "reservation2022_v3"; //$_SESSION['table_reservation'];
					
					echo " ---> " .$annee ." " .$mois ." " .$formule;
					
					echo "<br>";

					$sql = "SELECT * FROM " .$table ." WHERE annee ='$annee' and mode = 'actif' and formule = '$formule' and mois = '$mois'  ";
					echo $sql;
					echo "<br>";	
	 
					mysqli_query($connexion, "SET NAMES 'utf8'");	
					$query = mysqli_query($connexion, $sql );
		
					if(!$query)	
					{	
						die('Impossible d\'exécuter la requête :' . mysql_error());	
					}
			
					$nbre_dates = mysqli_num_rows($query);
					echo "Dates disponibles dans le mois " .$nbre_dates;
					echo "<br>";	
							
					$clientMois[] = array();
					$flag_empty = true;
							
					while ($datas = mysqli_fetch_assoc ($query))
					{
								$client_seance1 = $datas['seance1'];
								$client_seance2 = $datas['seance2'];
								$client_seance3 = $datas['seance3'];
								$client_seance4 = $datas['seance4'];
								$client_seance5 = $datas['seance5'];
								$client_seance6 = $datas['seance6'];
								$client_seance7 = $datas['seance7'];
								$client_seance8 = $datas['seance8'];
				
								// pour supprimer les multiples enregistrements
								if(strlen($client_seance1) != 0 && $client_seance1 != "unselect")
								{ 
									if( !in_array($client_seance1, $clientMois))
									{
										$clientMois[] = $client_seance1;
										$flag_empty = false;
									}	
								}
								
								if(strlen($client_seance2) != 0 && $client_seance2 != "unselect")
								{ 
									if( !in_array($client_seance2, $clientMois))
									{
										$clientMois[] = $client_seance2;
										$flag_empty = false;
									}	
								}
				
								if(strlen($client_seance3) != 0 && $client_seance3 != "unselect")
								{ 
									if( !in_array($client_seance3, $clientMois))
									{
										$clientMois[] = $client_seance3;
										$flag_empty = false;
									}	
								}
								
								if(strlen($client_seance4) != 0 && $client_seance4 != "unselect")
								{ 
									if( !in_array($client_seance4, $clientMois))
									{
										$clientMois[] = $client_seance4;
										$flag_empty = false;
									}	
								}
								
								if(strlen($client_seance5) != 0 && $client_seance5 != "unselect")
								{ 
									if( !in_array($client_seance5, $clientMois))
									{
										$clientMois[] = $client_seance5;
										$flag_empty = false;
									}	
								}
								
								if(strlen($client_seance6) != 0 && $client_seance6 != "unselect")
								{ 
									if( !in_array($client_seance6, $clientMois))
									{
										$clientMois[] = $client_seance6;
									}	
								}
								
								if(strlen($client_seance7) != 0 && $client_seance7 != "unselect")
								{ 
									if( !in_array($client_seance7, $clientMois))
									{
										$clientMois[] = $client_seance6;
									}	
								}
								
								if(strlen($client_seance8) != 0 && $client_seance8 != "unselect")
								{ 
									if( !in_array($client_seance8, $clientMois))
									{
										$clientMois[] = $client_seance8;
									}	
								}
						}
						
						
}
?>