Subversion Repositories c2i-annu

Rev

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

Rev Author Line No. Line
39 swirly 1
<?php
2
 
3
require_once('section-class.inc.php');
4
require_once('sconet-xml.php');
5
require_once('mysql.inc.php');
6
require_once('note-class.inc.php');
7
 
8
// pupil view page.
9
 
42 swirly 10
function pupil_init_menu() {
11
 
12
  global $smarty;
13
  $user = $_SESSION['user'];
14
 
43 swirly 15
  $lien_menu = array('infos' => menu_link('menuform','pupil','infos'),
16
                     'validation' => menu_link('menuform','pupil','validation'),
17
                     'logout'=>menu_link('menuform','logout','logout')   
18
                     );
42 swirly 19
 
20
  $smarty->assign('lien_menu',$lien_menu);
21
 
22
}
23
 
24
 
43 swirly 25
function pupil_infos() {
26
 
27
    global $smarty;
28
    $user = $_SESSION['user'];
29
 
30
    $pupil= new people($user->uid);
31
 
32
    $smarty->assign('header_title'," Donn&eacute;es personnelles ");
33
    $smarty->assign('pupil',(array) $pupil);  
34
    $smarty->display('pupil_view_profile.tpl');
35
 
36
}
42 swirly 37
 
43 swirly 38
function pupil_validation() {
39
 
40
    global $smarty;
41
    $user = $_SESSION['user'];
42
 
43
    $pupil= new people($user->uid);
44
 
45
    $smarty->assign('header_title'," Validation de l'examen ");
46
    $smarty->assign('pupil',(array) $pupil);  
47
    $smarty->display('pupil_validation.tpl');
48
 
49
}
50
 
51
function pupil_process_validation() {
52
    global $smarty;
53
    $user = $_SESSION['user'];
54
 
55
    $pupil= new people($user->uid);
56
    $localisation=$_POST['localisation'];
57
 
58
    if (version_compare(PHP_VERSION,'5.3.0','<')) {
59
        if (get_magic_quotes_gpc()) {
60
            $localisation=stripslashes($localisation);
61
        }
62
    }
63
 
64
    if (!preg_match('/^([[:alpha:]]|\s|\(|\)|\'|-)*$/',$localisation)) {
65
        $error_message = " La syntaxe du lieu de naissance ".htmlentities($localisation)." n'est pas correcte ";
66
        $smarty->assign('header_title'," Validation de l'examen ");
67
        $smarty->assign('error_message',$error_message);
68
        $smarty->assign('pupil',(array) $pupil);  
69
        $smarty->display('pupil_validation.tpl');
70
 
71
    } else {
72
        $pupil->localisation=$localisation;
73
        $pupil->insert_into_ldap();
74
        pupil_infos();
75
    }  
76
 
77
}
78
 
39 swirly 79
function pupil_view_profile() {
80
    global $smarty;
81
    $user=$_SESSION['user'];
82
    $smarty->assign('user',(array) $user);
83
}
84
?>