Location: PHPKode > projects > EmploiNet : a timetable web manager > EmploiNet/v0.8.0/FichesAdmin/suivi_hres2.php3
<?

	include("../date.php3");
    include("../Session/security.php");

	print("<HTML>\n<BODY BGCOLOR=white>\n");

// Verification de la session
	$autorisation_list[0]=0; // Administrateur
	$autorisation_list[1]=1; // Professeur
	$user_type = validateSession($id_session);
	if ($user_type == -1 || !security($id_session,$autorisation_list)) print("Accès refusé");
    else
    {
//		$idp=getUserID($id_session);
		$idp=$prof;
// Ouverture de la connexion avec la base de donnees
	    $connection = openConnection($databaseName);

	$result=mysql_query("SELECT nom, prenom, id_grade, id_departement, cnu, titulaire, id_cgu, pedr FROM professeur WHERE id_professeur=".$idp);
	$row=mysql_fetch_row($result);
	$result2=mysql_query("SELECT libelle FROM grade WHERE id_grade=".$row[2]);
	$row2=mysql_fetch_row($result2);
	$grade=$row2[0];
	$result2=mysql_query("SELECT libelle FROM departement WHERE id_departement=".$row[3]);
	$row2=mysql_fetch_row($result2);
	$departement=$row2[0];
	$result2=mysql_query("SELECT libelle FROM cgu WHERE id_cgu=".$row[6]);
	$row2=mysql_fetch_row($result2);
	$cgu=$row2[0];
	$annee=date("Y");
	$mois=date("m");
	if($mois<8) $anneeDeb=$annee-1;
	else $anneeDeb=$annee;
	$result2=mysql_query("SELECT annee FROM global");
	$row2=mysql_fetch_row($result2);	
	$per=$row2[0]."/".((int)($row2[0])+1);
	//$per=$anneeDeb."/".($anneeDeb+1);
	print("<TABLE BORDER=0 WIDTH=925>\n");
	print("<TR>\n");
		print("<TD VALIGN=TOP ALIGN=CENTER COLSPAN=2>\n");
		print("	
	<B>
	FICHE DE SUIVI DES HEURES D'ENSEIGNEMENT <BR>
	(hors stages, mémoires, projets, T.E.R, etc.) <BR></B>
		");
		print("</TD>\n");
	print("<TR>\n");
		print("<TD VALIGN=TOP ALIGN=RIGHT COLSPAN=2>\n");		
		print($per."\n");
		print("</TD>\n");
	print("<TR>\n");
		print("<TD ALIGN=LEFT COLSPAN=2>\n");
		if($row[5]=='0') print("<B><FONT SIZE=3>VACATAIRE(1)</FONT><BR>\n");
		else print("<B><FONT SIZE=3>TITULAIRE(1)</FONT><BR>\n");
		print("<BR></FONT></B>\n");
		print("</TD>\n");
	print("<TR>\n");
		print("<TD VALIGN=TOP ALIGN=LEFT>\n");
		print("<BR><B><FONT SIZE=3>NOM : </FONT></B> ".$row[0]."<BR>\n");
		print("<FONT SIZE=2>EMPLOI PRINCIPAL (Grade) : ".$grade."<BR>\n");
		print("DISCIPLINE D'ENSEIGNEMENT : ".$row[4]."<BR>\n");
		print("C.G.U. DE RATTACHEMENT : ".$cgu."<BR>\n");
		print("DEPARTEMENT DE RATTACHEMENT : ".$departement."<BR>\n");
		print("</TD>\n");
		print("<TD VALIGN=TOP ALIGN=LEFT>\n");
		print("<BR><B><FONT SIZE=3>PRENOM : </FONT></B> ".StrToUpper($row[1])."\n");
		print("</TD>\n");		
	print("</TABLE>\n");
	
	print("<BR>\n");
	/* Recherche de la première semaine de cours : */	
	$trouve=true;
	$request = "SELECT MIN(semaine) FROM planifie WHERE id_professeur=".$idp." AND semaine>=".$premiereSemaine;
	$resultSemaine=mysql_query($request,$connection);
	$rowSemaine=mysql_fetch_row($resultSemaine);
	if($rowSemaine[0]=="")
	{
		if($premiereSemaine<=52 && $premiereSemaine>35)
		{
			$resultSemaine=mysql_query("SELECT MIN(semaine) FROM planifie WHERE id_professeur=".$idp." AND semaine>=1");
			$rowSemaine=mysql_fetch_row($resultSemaine);
			if($rowSemaine[0]=="")
			{
				$trouve=false;
			}
		}else{

			$trouve=false;

		}

	}

  if($trouve==true)

  {

	$semaineUn=$rowSemaine[0];

	

	/* Recherche des cours de cette semaine : */

	$request = "SELECT pl.id_planifie, id_matiere, id_type_seance, pl.id_professeur, id_salle, semaine, jour_semaine, heure_debut, heure_fin, semaine-35 as tst, semaine-35<=0 as tst2, p.id_promotion, sigle FROM planifie pl, planifiepromotion p, promotion pr WHERE pr.id_promotion=p.id_promotion AND pl.id_planifie=p.id_planifie AND pl.id_professeur=".$idp." AND semaine=".$semaineUn." ORDER BY tst2 ASC, tst ASC, jour_semaine ASC, pl.id_planifie ASC";

	$resultSemaine=mysql_query($request,$connection);

	$nbCours=mysql_num_rows($resultSemaine);

	

/******		TABLEAU DES SEMAINES	***************/	



	print("<TABLE BORDER=2 WIDTH=925 CELLSPACING=0 CELLPADDING=0>\n");

	

	print("<TR>\n");

		print("<TD ALIGN=CENTER WIDTH=60>\n");

		print("Semaines\n");

		print("</TD>\n");

		

		for($i=36;$i<=52;$i++)

		{

			print("<TD ALIGN=CENTER WIDTH=18>\n");

			print($i."\n");

			print("</TD>\n");

		}

		for($i=1;$i<=26;$i++)

		{

			print("<TD ALIGN=CENTER WIDTH=18>\n");

			print($i."\n");

			print("</TD>\n");

		}		

		

	print("<TR>\n");

		print("<TD ALIGN=CENTER WIDTH=60>\n");

		print("(*)\n");

		print("</TD>\n");



	/* ON VA COMPARER LES COURS DE TOUTES LES SEMAINES AVEC LA PREMIERE, SI ON RETROUVE LES MEMES COURS DANS UNE */

	/* ALORS ON COCHERA LA CASE CORRESPONDANTE DANS LE TABLEAU */



		$resultSemaines=mysql_query("SELECT semaine, semaine-35 as tst, semaine-35<=0 as tst2 FROM planifie WHERE id_professeur=".$idp." ORDER BY tst2 ASC, tst ASC, jour_semaine ASC, id_planifie ASC",$connection);

		$rowSemaines=mysql_fetch_array($resultSemaines);

		

		$nbCorres=0;

		

		for($i=36;$i<=52;$i++)

		{

			print("<TD ALIGN=CENTER WIDTH=18>\n");

			

/*print($rowSemaines["semaine"]." ".$i."<BR>");*/

			

			$resultTest=mysql_query("SELECT pl.id_planifie, id_matiere, id_type_seance, id_professeur, id_salle, semaine, jour_semaine, heure_debut, heure_fin, id_promotion FROM planifie pl, planifiepromotion p WHERE pl.id_planifie=p.id_planifie AND id_professeur=".$idp." AND semaine=".$i." ORDER BY jour_semaine ASC, pl.id_planifie ASC",$connection);

			$nbCours2=mysql_num_rows($resultTest);

			

/*print($nbCours." ".$nbCours."<BR>");*/

			

			if($nbCours2>=$nbCours)

			{

				mysql_data_seek($resultSemaine, 0);

				$tst=0;



				$rowTest=mysql_fetch_array($resultTest);

				$rowSemaine=mysql_fetch_array($resultSemaine);

				for($j=0;$j<$nbCours2;$j++)

				{

				

/*print($rowTest["id_promotion"]."<BR>".$rowSemaine["id_promotion"]."*<BR>".$rowTest["id_matiere"]."<BR>".$rowSemaine["id_matiere"]."<BR>".$rowTest["id_type_seance"]."<BR>".$rowSemaine["id_type_seance"]."<BR>".$rowTest["id_salle"]."<BR>".$rowSemaine["id_salle"]."<BR>".$rowTest["jour_semaine"]."<BR>".$rowSemaine["jour_semaine"]."<BR>".$rowTest["heure_debut"]."<BR>".$rowSemaine["heure_debut"]."<BR>".$rowTest["heure_fin"]."<BR>".$rowSemaine["heure_fin"]);*/



					$hd=explode(":",$rowSemaine["heure_debut"]);

					$hf=explode(":",$rowSemaine["heure_fin"]);

					

					/* Calcul du nombre de minutes : */

					$minutes=((float)((int)($hf[1]))-((int)($hd[1])))*0.5/30;

		

					/* Calcul du nombre d'heures : */

					$heures=((int)($hf[0]))-((int)($hd[0]));

								

					$nbHeuresCours1=($heures+$minutes);

					

					$hd=explode(":",$rowTest["heure_debut"]);

					$hf=explode(":",$rowTest["heure_fin"]);

					

					/* Calcul du nombre de minutes : */

					$minutes=((float)((int)($hf[1]))-((int)($hd[1])))*0.5/30;

		

					/* Calcul du nombre d'heures : */

					$heures=((int)($hf[0]))-((int)($hd[0]));

								

					$nbHeuresCours2=($heures+$minutes);				



					if($rowTest["id_promotion"]==$rowSemaine["id_promotion"] && $rowTest["id_type_seance"]==$rowSemaine["id_type_seance"] && $rowTest["jour_semaine"]==$rowSemaine["jour_semaine"] && $nbHeuresCours1==$nbHeuresCours2)

					{

						$tst++;

						$rowSemaine=mysql_fetch_array($resultSemaine);

					}

					$rowTest=mysql_fetch_array($resultTest);

				}

				

				if($tst==$nbCours)

				{

					print("X\n");

					$nbCorres++;

				}else{

					print("&nbsp;\n");

				}

			}else{

				print("&nbsp;\n");

			}

			

			print("</TD>\n");

		}

	

		for($i=1;$i<=26;$i++)

		{

			print("<TD ALIGN=CENTER WIDTH=18>\n");

			

/*print($rowSemaines["semaine"]." ".$i."<BR>");*/

			

			$resultTest=mysql_query("SELECT pl.id_planifie, id_matiere, id_type_seance, id_professeur, id_salle, semaine, jour_semaine, heure_debut, heure_fin, id_promotion FROM planifie pl, planifiepromotion p WHERE pl.id_planifie=p.id_planifie AND id_professeur=".$idp." AND semaine=".$i." ORDER BY jour_semaine ASC, pl.id_planifie ASC",$connection);

			$nbCours2=mysql_num_rows($resultTest);

			

/*print($nbCours." ".$nbCours."<BR>");*/

			

			if($nbCours2>=$nbCours)

			{

				mysql_data_seek($resultSemaine, 0);

				$tst=0;



				$rowTest=mysql_fetch_array($resultTest);

				$rowSemaine=mysql_fetch_array($resultSemaine);

				for($j=0;$j<$nbCours2;$j++)

				{

				

/*print($rowTest["id_promotion"]."<BR>".$rowSemaine["id_promotion"]."*<BR>".$rowTest["id_matiere"]."<BR>".$rowSemaine["id_matiere"]."<BR>".$rowTest["id_type_seance"]."<BR>".$rowSemaine["id_type_seance"]."<BR>".$rowTest["id_salle"]."<BR>".$rowSemaine["id_salle"]."<BR>".$rowTest["jour_semaine"]."<BR>".$rowSemaine["jour_semaine"]."<BR>".$rowTest["heure_debut"]."<BR>".$rowSemaine["heure_debut"]."<BR>".$rowTest["heure_fin"]."<BR>".$rowSemaine["heure_fin"]);*/

				

					$hd=explode(":",$rowSemaine["heure_debut"]);

					$hf=explode(":",$rowSemaine["heure_fin"]);

					

					/* Calcul du nombre de minutes : */

					$minutes=((float)((int)($hf[1]))-((int)($hd[1])))*0.5/30;

		

					/* Calcul du nombre d'heures : */

					$heures=((int)($hf[0]))-((int)($hd[0]));

								

					$nbHeuresCours1=($heures+$minutes);

					

					$hd=explode(":",$rowTest["heure_debut"]);

					$hf=explode(":",$rowTest["heure_fin"]);

					

					/* Calcul du nombre de minutes : */

					$minutes=((float)((int)($hf[1]))-((int)($hd[1])))*0.5/30;

		

					/* Calcul du nombre d'heures : */

					$heures=((int)($hf[0]))-((int)($hd[0]));

								

					$nbHeuresCours2=($heures+$minutes);				



					if($rowTest["id_promotion"]==$rowSemaine["id_promotion"] && $rowTest["id_type_seance"]==$rowSemaine["id_type_seance"] && $rowTest["jour_semaine"]==$rowSemaine["jour_semaine"] && $nbHeuresCours1==$nbHeuresCours2)

					{

						$tst++;

						$rowSemaine=mysql_fetch_array($resultSemaine);

					}

					$rowTest=mysql_fetch_array($resultTest);

				}

				

				if($tst==$nbCours)

				{

					print("X\n");

					$nbCorres++;

				}else{

					print("&nbsp;\n");

				}

			}else{

				print("&nbsp;\n");

			}

			

			print("</TD>\n");

		}

	

	print("</TABLE>\n");

	

	print("<BR>\n");

	print("(*) Cocher les semaines correspondantes au tableau ci-dessous<BR><BR>\n");

	

/******** DEUXIEME TABLEAU (Cours de la semaine) *********/

	

	print("<TABLE BORDER=2 WIDTH=806 CELLSPACING=0 CELLPADDING=0>\n");

	

	print("<TR>\n");

	

		print("<TD ALIGN=CENTER WIDTH=300>\n");

		print("FORMATION\n");

		print("</TD>\n");

		

		print("<TD ALIGN=CENTER WIDTH=100>\n");

		print("JOUR\n");

		print("</TD>\n");		

		

		print("<TD ALIGN=CENTER WIDTH=150>\n");

		print("NBRE D'HEURES\n");

		print("</TD>\n");

		

		print("<TD ALIGN=CENTER WIDTH=125>\n");

		print("NATURE\n");

		print("</TD>\n");

		

		print("<TD ALIGN=CENTER WIDTH=150>\n");

		print("EQUIVALENT TD\n");

		print("</TD>\n");			

		

	print("</TABLE>\n");

	

	print("<TABLE BORDER=0 WIDTH=900 CELLSPACING=0 CELLPADDING=0>\n");

	print("<TR>\n<TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n");

	print("<TABLE BORDER=2 WIDTH=802 CELLSPACING=0 CELLPADDING=0>\n");

	print("<TR>\n<TD ALIGN=LEFT VALIGN=TOP WIDTH=800>\n");

	print("<TABLE BORDER=0 WIDTH=802 CELLSPACING=0 CELLPADDING=0>\n");

		

		/* ON REPART AU DEBUT DE LA PREMIERE SEMAINE POUR AFFICHER LES COURS CORRESPONDANT */

		mysql_data_seek($resultSemaine, 0);

		

		$tabJour=array(1=>"Lundi",2=>"Mardi",3=>"Mercredi",4=>"Jeudi",5=>"Vendredi",6=>"Samedi",7=>"Dimanche");

		$tabSeance=array(1=>"CM",2=>"TD",3=>"TDm",4=>"TP");

		$tabCoeff=array(1=>1.5,2=>1,3=>1,4=>2/3);

		

		$totalEqTD=0;

				

		for($i=0;$i<$nbCours;$i++)

		{

			print("<TR>\n");

			

			$rowSemaine=mysql_fetch_array($resultSemaine);

			

			while($rowSemaine["id_type_seance"]==5)

			{

				$rowSemaine=mysql_fetch_array($resultSemaine);

				$nbCours--;

			}

			

			if($i<$nbCours)

			{

			

			print("<TD ALIGN=CENTER WIDTH=270 HEIGHT=15>\n");

			print("<FONT SIZE=1>\n");

			print($rowSemaine["sigle"]);

			print("</FONT>\n");

			print("</TD>");

			

			print("<TD ALIGN=CENTER WIDTH=100 HEIGHT=15>\n");

			print("<FONT SIZE=1>\n");

			print($tabJour[$rowSemaine["jour_semaine"]]);

			print("</FONT>\n");

			print("</TD>\n");		

			

			$hd=explode(":",$rowSemaine["heure_debut"]);

			$hf=explode(":",$rowSemaine["heure_fin"]);

			

			/* Calcul du nombre de minutes : */

			$minutes=((float)((int)($hf[1]))-((int)($hd[1])))*0.5/30;



			/* Calcul du nombre d'heures : */

			$heures=((int)($hf[0]))-((int)($hd[0]));

						

			$nbHeuresCours1=($heures+$minutes);

			

			print("<TD ALIGN=CENTER WIDTH=150 HEIGHT=15>\n");

			print("<FONT SIZE=1>\n");

			print($nbHeuresCours1);

			print("</FONT>\n");

			print("</TD>\n");

			

			print("<TD ALIGN=CENTER WIDTH=125 HEIGHT=15>\n");

			print("<FONT SIZE=1>\n");

			print($tabSeance[$rowSemaine["id_type_seance"]]);

			print("</FONT>\n");

			print("</TD>\n");

			

			$eqTD=$tabCoeff[$rowSemaine["id_type_seance"]]*$nbHeuresCours1;

			

			print("<TD ALIGN=CENTER WIDTH=155 HEIGHT=15>\n");

			print("<FONT SIZE=1>\n");

			print($eqTD);

			print("</FONT>\n");

			print("</TD>\n");

			

			$totalEqTD+=$eqTD;

			}

		}

		

		for($i=$nbCours;$i<20;$i++)

		{

			print("<TR>\n");

			

			print("<TD ALIGN=CENTER WIDTH=270 HEIGHT=15>\n");

			print("&nbsp;</TD>");

			

			print("<TD ALIGN=CENTER WIDTH=100 HEIGHT=15>\n");

			print("&nbsp;</TD>\n");		

			

			print("<TD ALIGN=CENTER WIDTH=150 HEIGHT=15>\n");

			print("&nbsp;</TD>\n");

			

			print("<TD ALIGN=CENTER WIDTH=125 HEIGHT=15>\n");

			print("&nbsp;</TD>\n");

			

			print("<TD ALIGN=CENTER WIDTH=155 HEIGHT=15>\n");

			print("&nbsp;</TD>\n");

		}

	

		print("<TR>\n");

		

		print("<TD ALIGN=CENTER WIDTH=270 HEIGHT=15>\n");

		print("&nbsp;</TD>");

		

		print("<TD ALIGN=CENTER WIDTH=100 HEIGHT=15>\n");

		print("&nbsp;</TD>\n");		

		

		print("<TD ALIGN=CENTER WIDTH=150 HEIGHT=15>\n");

		print("&nbsp;</TD>\n");

		

		print("<TD ALIGN=CENTER WIDTH=125 HEIGHT=15>\n");

		print("&nbsp;</TD>\n");

		

		print("<TD ALIGN=CENTER WIDTH=155 HEIGHT=15>\n");

			print("<TABLE BORDER=1 WIDTH=155 CELLSPACING=0 CELLPADDING=0>\n");

			print("<TR>\n<TD ALIGN=LEFT VALIGN=TOP>\n");

			print("TOTAL EQ. TD\n");

			print("</TD>\n</TABLE>\n");

		print("</TD>\n");		

	

	print("</TABLE>\n");

	

	print("</TD>\n</TABLE>\n");

	print("<TD ALIGN=LEFT VALIGN=BOTTOM WIDTH=100 HEIGHT=350>\n");

		print($totalEqTD." x ".$nbCorres." semaines\n");

	print("</TD>\n");

	print("<TR>\n");

	print("<TD ALIGN=LEFT VALIGN=BOTTOM WIDTH=100 HEIGHT=15>\n");

	print("<TABLE BORDER=1 WIDTH=100 CELLSPACING=0 CELLPADDING=0>\n");

	print("<TR>\n<TD WIDTH=100 HEIGHT=15>\n");

		print(($totalEqTD*$nbCorres)." h équ TD\n");

	print("</TD>\n</TABLE>\n");

	

	print("<TR>\n");

	print("<TD ALIGN=LEFT VALIGN=BOTTOM WIDTH=100 HEIGHT=1>\n");

	print("</TD>\n");

	

	print("</TD>\n</TABLE>\n");

	

	print("<CENTER>Signature :</CENTER>\n");

	

  }else{

	print("<H3> Pas d'enregistrement trouv&eacute; </H3>");

  }


}

	print("</BODY>\n</HTML>\n");

?>
Return current item: EmploiNet : a timetable web manager