<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */

# Allows to choose and evaluate a subject
# @author Igor Támara igor@tamarapatino.org
# Public domain. 2003. No warranties. http://structio.sourceforge.net/sigue

require_once "auth/confcol.php";
session_start();
$title="Recuperación de Materias de ".$_SESSION["teacher"];
require "header.php";
if (!isset($_SESSION["autenticado"])||$_SESSION["autenticado"]==false) {
  require "footer.php";
  exit;
}
if(isset($_SESSION["curso"])) {
	unset($_SESSION['curso']);
	session_unregister("curso");
}
require "TeacherCourses.php";
$my_courses = new TeacherCourses($GLOBALS["DIRCOL"],$_SESSION['año'],$_SESSION["teacherdir"]);
$courses=$my_courses->values();
$_SESSION['accion']="recuperar";

foreach ($courses as $key=>$course) {
  $my_course=explode(":",$course);
  $cursos[$key]=$my_course[1]." en ".$my_course[0];
}
$periodos=array();
foreach ($_SESSION['todosper'] as $k => $v) {
	if ($v<$_SESSION['periodo']) {
		$periodos[$v]=$v;
	}
}

if (sizeof($periodos)==0) {
	print "No hay periodos por recuperar";
}
else {
	print "<div align=\"center\">
<form action=\"valorarmateria.php\" method=\"post\">
<table border=\"0\">
<tr><th>Materia<th>Período<tr><td>";
	asort($cursos);
	showselect($cursos,"curso");
	print "<td align=\"center\">";
	showselect($periodos,"periodorec","",true);
	print "<tr align=\"center\"><td align=\"center\" colspan=\"2\"><input type=\"submit\" value=\"".$_SESSION['accion']."\">
</table>
</form>
</div>";
}
require "footer.php";
?>
