Subversion Repositories c2i-annu

Rev

Rev 42 | Rev 59 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php

require_once('section-class.inc.php');
require_once('sconet-xml.php');
require_once('mysql.inc.php');
require_once('note-class.inc.php');

// pupil view page.

function pupil_init_menu() {

  global $smarty;
  $user = $_SESSION['user'];
 
  $lien_menu = array('infos' => menu_link('menuform','pupil','infos'),
                     'validation' => menu_link('menuform','pupil','validation'),
                     'logout'=>menu_link('menuform','logout','logout')   
                     );
 
  $smarty->assign('lien_menu',$lien_menu);
 
}


function pupil_infos() {
 
    global $smarty;
    $user = $_SESSION['user'];
   
    $pupil= new people($user->uid);
   
    $smarty->assign('header_title'," Donn&eacute;es personnelles ");
    $smarty->assign('pupil',(array) $pupil);  
    $smarty->display('pupil_view_profile.tpl');
   
}

function pupil_validation() {

    global $smarty;
    $user = $_SESSION['user'];
   
    $pupil= new people($user->uid);
   
    $smarty->assign('header_title'," Validation de l'examen ");
    $smarty->assign('pupil',(array) $pupil);  
    $smarty->display('pupil_validation.tpl');
 
}

function pupil_process_validation() {
    global $smarty;
    $user = $_SESSION['user'];
   
    $pupil= new people($user->uid);
    $localisation=$_POST['localisation'];

    if (version_compare(PHP_VERSION,'5.3.0','<')) {
        if (get_magic_quotes_gpc()) {
            $localisation=stripslashes($localisation);
        }
    }

    if (!preg_match('/^([[:alpha:]]|\s|\(|\)|\'|-)*$/',$localisation)) {
        $error_message = " La syntaxe du lieu de naissance ".htmlentities($localisation)." n'est pas correcte ";
        $smarty->assign('header_title'," Validation de l'examen ");
        $smarty->assign('error_message',$error_message);
        $smarty->assign('pupil',(array) $pupil);  
        $smarty->display('pupil_validation.tpl');
       
    } else {
        $pupil->localisation=$localisation;
        $pupil->insert_into_ldap();
        pupil_infos();
    }  

}

function pupil_view_profile() {
    global $smarty;
    $user=$_SESSION['user'];
    $smarty->assign('user',(array) $user);
}
?>