Location: PHPKode > projects > EmploiNet : a timetable web manager > EmploiNet/v0.8.0/Administration/periode.php3
<?
    
    include("Functions.php3");
    include("Navigation.php3");
    include("../BarreDeMenu.php3");
    include("class_periode.php3");
    
    include("../Session/security.php");



// Entete

    buildHeader("P&eacute;riode");



// Verification de la session

	$autorisation_list[0]=0; // Administrateur

	$autorisation_list[1]=3; // Gestionnaire

	$user_type = validateSession($id_session);

	if ($user_type == -1 || !security($id_session,$autorisation_list)) print("Accès refusé");

    else

    {

// Barre de menu

		buildMenuBar($id_session,$user_type,"periode.php3",false);

// Ouverture de la connexion avec la base de donnees

	    $connection = openConnection($databaseName);



  $G_periode = new Periode(-1,0,0,0,0);



  



      function remplir_formulaire($index, $result)



      {



		global $G_periode;



      



        if (mysql_data_seek($result,$index))



        {



          $une_periode = mysql_fetch_array($result);   



          $G_periode->id_periode = $une_periode["id_periode"];



          $G_periode->id_promotion = $une_periode["id_promotion"];



          $G_periode->numero = $une_periode["numero"];



          $G_periode->numero_semaine_debut = $une_periode["numero_semaine_debut"];



          $G_periode->nb_semaines = $une_periode["nb_semaines"];



        }



        else



          print("Error: mysql_data_seek"); 



      }







      function selectRecords()



      {



        return mysql_query("SELECT * FROM periode ORDER BY id_promotion");



      }



    



      function deleteRecord($keyValue)



      {



        mysql_query("DELETE FROM periode WHERE (id_periode='$keyValue')");



      }







      function modifyRecord($keyValue)



      {



	    global $id_promotion;



		global $numero;



 	    global $numero_semaine_debut;



		global $nb_semaines;







        mysql_query("UPDATE periode SET id_promotion='$id_promotion',numero='$numero',numero_semaine_debut='$numero_semaine_debut',nb_semaines='$nb_semaines' WHERE id_periode=$keyValue");



      }







      function newRecord()



      {



		global $id_periode;



	    global $id_promotion;



		global $numero;



 	    global $numero_semaine_debut;



		global $nb_semaines;



		global $G_periode;







	    $id_periode = getKeyValue("id_periode");



	    mysql_query("INSERT INTO periode VALUES('$id_periode','$id_promotion','$numero','$numero_semaine_debut','$nb_semaines')");



	    return $id_periode;



      }



//***********************************************************************************************

//* Navigation et rechercheId

//***********************************************************************************************



      perform($id_periode,"id_periode");



//***********************************************************************************************

//* Fin de la navigation

//***********************************************************************************************



// Formulaire de saisie



      function buildCustomFields()

	  {

	  }



	  $form["Name"]=array("","Promotion","Num&eacute;ro","Num&eacute;ro de la premi&egrave;re semaine","Nombre de semaines");

	  $form["Type"]=array(0,5,1,1,1);

	  $form["FieldName"]=array("id_periode","id_promotion","numero","numero_semaine_debut","nb_semaines");

	  $form["Value"]=array($G_periode->id_periode,$G_periode->id_promotion,$G_periode->numero,$G_periode->numero_semaine_debut,$G_periode->nb_semaines);

	  $form["KeyName"]=array("","id_promotion","","","");

	  $form["Request"]=array("","SELECT id_promotion,diplome.libelle as L1,promotion.libelle as L2 FROM promotion,diplome WHERE promotion.id_diplome=diplome.id_diplome ORDER BY diplome.libelle","","","");

	  $form["Fields"]=array("",array("L1","L2"),"","","");

	  $form["Length"]=array(0,1,10,10,10);

	  $form["NewLine"]=array(false,true,true,true,true);



	  buildForm("periode.php3",$form,$id_session,$user_type,$user_id,$display);

  }

  buildEndOfPage();

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