Commit df7f7f65 authored by mbriand's avatar mbriand
Browse files

Pas de date de naissance -> null

parent 9be33327
......@@ -327,7 +327,9 @@ else if ( $site->comptoir->client->id > 0 )
$today = mktime();
$secondes = ($today > $dob)? $today - $dob : $dob - $today;
$annees = date('Y', $secondes) - 1970;
if($annees < 16)
if(is_null($dob))
$cts->add_paragraph('Attention, l\'age de ce cotisant est inconnu','linfo');
elseif($annees < 16)
$cts->add_paragraph('Attention, ce cotisant n\'a pas 16 ans et ne peut donc pas acheter d\'alcool','linfo');
elseif($annees < 18)
$cts->add_paragraph('Attention, ce cotisant n\'a pas 18 ans et ne peut donc pas acheter d\'alcool fort','linfo');
......
......@@ -124,7 +124,7 @@ class userinfo extends stdcontents
$this->buffer .= "</div>";
if ($user->date_naissance != strtotime("01 january 1970"))
if (! is_null($user->date_naissance))
{
if ( $user->sexe == 1 )
$this->buffer .= "N&eacute; ";
......@@ -239,7 +239,7 @@ class userinfo extends stdcontents
$this->buffer .= "<div class=\"others_infos\" style=\"position: relative; float: left;\">";
$this->buffer .= "<br/>";
if ($user->date_naissance != strtotime("01 january 1970"))
if (! is_null($user->date_naissance))
{
if ( $user->sexe == 1 )
$this->buffer .= "N&eacute; ";
......
......@@ -1152,7 +1152,8 @@ class utilisateur extends stdentity
"pass_utl" => $this->pass,
"hash_utl" => "",
"sexe_utl" => $this->sexe,
"date_naissance_utl" => date("Y-m-d",$this->date_naissance),
"date_naissance_utl" => (is_null($this->date_naissance)
? null : date("Y-m-d",$this->date_naissance)),
"etudiant_utl" => $this->etudiant,
"utbm_utl" => $this->utbm,
"droit_image_utl" => $this->droit_image,
......@@ -1328,7 +1329,8 @@ class utilisateur extends stdentity
"pass_utl" => $this->pass,
"hash_utl" => "",
"sexe_utl" => $this->sexe,
"date_naissance_utl" => date("Y-m-d",$this->date_naissance),
"date_naissance_utl" => (is_null($this->date_naissance)
? null : date("Y-m-d",$this->date_naissance)),
"etudiant_utl" => $this->etudiant,
"utbm_utl" => $this->utbm,
"droit_image_utl" => $this->droit_image,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment