Location: PHPKode > projects > EmploiNet : a timetable web manager > EmploiNet/v0.8.0/Formulaire/FormulairePromotion.php3
<?
	include("../edt/fonctions_edt.php3");
	
	include("../BarreDeMenu.php3");
	
    include("../Session/security.php");

// Entete
    buildHeader("Emploi du temps promotion");

// Verification de la session
	$autorisation_list[0]=0; // Administrateur
	$autorisation_list[1]=1; // Professeur
	$autorisation_list[2]=2; // Etudiant
	$autorisation_list[3]=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,"FormulairePromotion.php3",false);
		$user_id=getUserID($id_session);

// Ouverture de la connexion avec la base de donnees
	    $connection = openConnection($databaseName);

        $n = count($id_promotion);
        switch ($choice)
	    {
            case -1: // changement de promotion
            {
                $id_groupe = -1;
			break;
		  }
		  case -2: // changement de groupe
		  {
			if ($id_groupe != -1)
			{
                    $result2 = mysql_query("SELECT * FROM associer WHERE id_groupe=$id_groupe");
    	          $n = mysql_num_rows($result2); 
            	    for ($i=0;$i<$n;$i++)
        	          {
            	        $une_promotion = mysql_fetch_array($result2);
	   	    		  $id_promotion[$i] = $une_promotion["id_promotion"];
			    }
     	  	}	 
			break; 
		  }
		  case -3: // changement de periode
		  {
			unset($s_semaine);
			break;
		  }
        }

  // *************** DEBUT DU FORMULAIRE ***************
        print("<FORM name=form1 ACTION=\"FormulairePromotion.php3\">\n");
        print("      <input type=\"hidden\" name=\"login\" value=\"$login\">\n");
        print("      <input type=\"hidden\" name=\"choice\" value=\"-1\">\n");
        print("      <input type=\"hidden\" name=\"id_session\" value=\"$id_session\">\n");
        print("      <input type=\"hidden\" name=\"user_type\" value=\"$user_type\">\n");
        print("      <input type=\"hidden\" name=\"user_id\" value=\"$user_id\">\n");
        print("      <input type=\"hidden\" name=\"display\" value=\"$display\">\n");

        print("<table align=center border=0 cellspacing=0 cellpading=0 width=700 bgcolor=\"#C0C000\">\n");
        print("  <tr>\n");

// Liste des promotions	
        print("          <td valign=top width=100 nowrap><font size=3><i>Promotion :</i></font></td>\n");
	    print("          <td width=250 valign=top>\n");
        include("../Liste/liste_promotion.php");
	    print("          </td>\n");

// Periode
        print("  <tr>\n");
        print("          <td valign=top width=100 nowrap><font size=3><i>P&eacute;riode :</i></font></td>\n");
        print("          <td valign=top width=250>\n");
        include("../Liste/liste_periode.php");
        print("          </td>\n");
        print("  </tr>\n"); 

// Semaine	
        print("  <tr>\n");
        print("          <td colspan=4 align=center>\n");
        include("../Liste/liste_semaine.php");
        print("          </td>\n");
        print("  </tr>\n"); 
	
        print("</table><br>\n");
        print("</FORM>\n"); 

        print("<FORM name=form2 ACTION=\"../edt/EmploiPromotion.php3\">\n");
        print("      <input type=\"hidden\" name=\"login\" value=\"$login\">\n");
        print("      <input type=\"hidden\" name=\"id_session\" value=\"$id_session\">\n");
        print("      <input type=\"hidden\" name=\"user_type\" value=\"$user_type\">\n");
        print("      <input type=\"hidden\" name=\"user_id\" value=\"$user_id\">\n");
        print("      <input type=\"hidden\" name=\"display\" value=\"$display\">\n");

        print("      <input type=\"hidden\" name=\"id_promotion\" value=\"$id_promotion[0]\">\n");
        print("      <input type=\"hidden\" name=\"ma_semaine\" value=\"$s_semaine\">\n");
        print("</FORM>\n");

        if (isset($s_semaine) && $s_semaine!=-1)
        {
            print("<script language=\"JavaScript\">\n");
            print("document.form2.submit();\n");
            print("</script>\n");
        } 
	}
	buildEndOfPage();
?>



Return current item: EmploiNet : a timetable web manager