-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtilisateur.class.php
More file actions
59 lines (50 loc) · 1.34 KB
/
Utilisateur.class.php
File metadata and controls
59 lines (50 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
class Utilisateur
{
//Attirbuts
private $m_user_name;
private $m_user_pass;
private $m_DateNaissance;
private $m_Sexe;
//Constructeur
public function __construct($p_user, $p_pass){
$this->m_user_name = $p_user;
$this->m_user_pass = $p_pass;
}
//GETTER SETTER
public function getNom(){
return $this->m_user_name;
}
public function setNom($p_user_name){
$this->m_user_name = $p_user_name;
}
public function setPasse($p_user_pass){
$this->m_user_pass =$p_user_pass;
}
public function setDate($p_DateN){
$this->m_DateNaissance = $p_DateN;
}
public function setSexe ($p_Sexe){
$this->m_Sexe = $p_Sexe;
}
//METHODES
public function verifPass($p_pass){
return $p_pass == $this->m_user_pass;
}
public function getAge(){
$aujd = new daateTime();
if ($this->m_DateNaissence<>'' AND $aujd > $this->m_DateNaissance){
$siff = date_diff($this->m_dateNaissance, $aujd);
return $diff->format("%y ans");
}
return "La date de naissance est invalide";
}
public function getGenre(){
if (strtoupper($this->m_Sexe)=='M'){
return 'Homme';
}
if (strtoupper($this->m_Sexe)=='F'){
return 'Femme';
}
}
}