Sélectionner une révision Git
-
Thomas Goyne a rédigé
This is needed to destroy the correct things when there are multiple active opengl displays.
Thomas Goyne a rédigéThis is needed to destroy the correct things when there are multiple active opengl displays.
match_script.php 1,92 Kio
<?php
function match_script($student, $userRepository){
$dispoStudent = $student->getDispo();
$subjectStudent = $student->getSubject();
$prof = $userRepository->fetchTeacher();
$matchs = [];
#$bool = false;
foreach($prof as $p){
#$firstnameProf = $p->getFirstname();
#$nameProf = $p->getName();
$subjectProf = $p->getSubject();
$dispoProf = $p->getDispo();
$mailProf = $p->getMail();
foreach($subjectStudent as $ss){
foreach($subjectProf as $sp){
foreach($dispoStudent as $ds){
foreach($dispoProf as $dp){
if (($ss==$sp)&&($ds==$dp)){
$match = [
"teacher" => $p,
"subject" => $sp,
"dispo" => $dp,
"mail" => $mailProf
];
$matchs[] = $match;
#echo "Le professeur <b>$firstnameProf $nameProf</b> est disponible pour l'élève le <b>$ds</b> pour un cours de <b>$sp</b> </br>";
#$bool = true;
#echo "Le mail du <b>$firstnameProf $nameProf</b> est <b>$mailProf</b>
}
}
}
}
}
}
return $matchs;
#if (!$bool){
# echo "<p>Aucun prof trouvé</p>";
#}
}
function print_requests($requests){
$noRequest = true;
foreach($requests as $r){
$subject = $r->subject;
$student = $r->student;
$dispo = $r->dispo;
$accepted = $r->accepted;
if (!$accepted){
echo "<p>Vous avez une demande de $student pour un cours de $subject le $dispo</p>";
$noRequest = false;
}
}
if ($noRequest){
echo "<p>Vous n'avez aucune demande</p>";
}
}
?>