<?php session_start(); ?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Notes Récitations</title>

<meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<style type="text/css">
<!--
.style1 {
	font-size: 18px;
	font-weight: bold;
}
body,td,th {
	color: #000033;
}
body {
	background-color: #FFF;
}
-->
</style>

<body>

<div>
<form method="post" action="_ecrirenoterecitprof.php">
<?php 
include 'header';
$id=$_SESSION['id'];
echo '<p>Récitation:<select name="recit" class="w3-select w3-border w3-light-grey">';
 echo '<option value="1">Récitation 1</option>
       <option value="2">Récitation 2</option>
	   <option value="3">Récitation 3</option>
	   <option value="4">Contrôle 1</option>
	   <option value="5">Contrôle 2</option>
	   <option value="6">Contrôle 3</option>
	   </select>';

include("_serveur.php");
$sql = 'SELECT * FROM teachersSubsubjects  join subSubjects on teachersSubsubjects.subsubjectID=subSubjects.id
                                       	join classes on teachersSubsubjects.classID=classes.id
										join subjects on teachersSubsubjects.subjectID=subjects.id
										join gradesSubjects on gradesSubjects.classID=classes.id and subSubjects.id=gradesSubjects.subSubjectID
									    join classesSemesters on classesSemesters.classID=classes.id
									    join semesters on classesSemesters.semesterID=semesters.id 
									    
	                                    where userID= "'.$id.'"and classesSemesters.teachersActive=1 order by semesters.id,classes.id,subjects.ordering,subSubjects.id';
if(!(mysqli_query($link, $sql))){
    echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
}
$req=  mysqli_query($link, $sql);
echo '<p>Classes:<select name="cont" class="w3-select w3-border w3-light-grey">';

while ($data = mysqli_fetch_array($req)) {

$classID=$data[7];
$classen=$data[8];
$ctrlID=$data[21];
$ctrl=$data[22];
$subject=$data[11];
$subSubjectID=$data[3];
$matiere=$data[6];

  echo' <option value="'.$classID.";".$ctrlID.";".$subSubjectID.'">'.$classen." - ".$ctrl." - ".$subject." - ".$matiere.'</option>';
	
}
echo '</select>';

echo 'Cofficient:<input type="number" name="coef">';
echo '<button class="w3-btn w3-blue" name="envoyer">Afficher</button></p>';				   
if (isset ($_POST['envoyer'])){
//On récupère les valeurs entrées par l'utilisateur :
$cont1=$_POST['cont'];
$cellm=explode(";",$cont1);
 $classe1=$cellm[0];
 $ctrl1=$cellm[1];
$subSubjectID=$cellm[2];
$coef=$_POST['coef'];
$recit=$_POST['recit'];
$_SESSION['classe1']=$classe1;
$_SESSION['ctrl1']=$ctrl1;
$_SESSION['subSubjectID']=$subSubjectID;
$_SESSION['coef']=$coef;
$_SESSION['recit']=$recit;

 echo '<META HTTP-EQUIV="Refresh" Content="0; URL=continuerrecitprof.php">';    
}



?>
</body>
</html>
