include_once "../lib/init_app.php";
include "../lib/class.participant.php";
$participant = new participant();
include_once "Savant3.php";
$tpl = new Savant3();
$tpl->addPath("template", dirname(dirname(__FILE__)));
$estLogue = $participant->estLogue();
// var_dump($participant);print "
";
// var_dump($estLogue);print "
";
// var_dump($_REQUEST);print "
";
// var_dump($_SESSION);print "
";
if (!$estLogue && $_REQUEST['login'])
{
if ($participant->login($_POST['courriel'],$_POST['motPasse']))
{
header("location: default.html");
exit();
}
$tpl->assignRef("champsLogin",$_POST);
$tpl->assign("erreurLogin",true);
}
$tpl->assignRef("estLogue", $estLogue);
$tpl->assignRef("participant", $_SESSION['participant']);
$lstParcours = array(1=>'radisson',2=>"verendrye",3=>"mackenzie",4=>"pierre");
$regs = array();
if (ereg("^([1-4])$",$_REQUEST['parcours'],$regs) && $_REQUEST['recommencer'])
{
$bd->query("DELETE FROM resultat WHERE parcour_resultat LIKE '".$lstParcours[$regs[1]]."%'");
header("location: parcours-".$regs[1].".html");
exit();
}
if (ereg("^[1-4]$",$_REQUEST['parcours']))
$tpl->display("parcours-".$_REQUEST['parcours'].".tpl.php");
else
$tpl->display("default.tpl.php");
?>