1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-25 10:20:28 +02:00

Adaptation de la plateforme aux besoins des correspondances (en cours)

This commit is contained in:
galaxyoyo
2019-09-11 01:17:05 +02:00
parent e908ad1923
commit 07e7b94f5c
18 changed files with 65 additions and 520 deletions

View File

@ -7,18 +7,8 @@ class User
private $pwd_hash;
public $surname;
public $first_name;
public $birth_date;
public $gender;
public $address;
public $postal_code;
public $city;
public $country;
public $phone_number;
public $school;
public $class;
public $responsible_name;
public $responsible_phone;
public $responsible_email;
public $description;
private $role;
private $team_id;
@ -66,18 +56,8 @@ class User
$this->pwd_hash = $data["pwd_hash"];
$this->surname = $data["surname"];
$this->first_name = $data["first_name"];
$this->birth_date = $data["birth_date"];
$this->gender = $data["gender"];
$this->address = $data["address"];
$this->postal_code = $data["postal_code"];
$this->city = $data["city"];
$this->country = $data["country"];
$this->phone_number = $data["phone_number"];
$this->school = $data["school"];
$this->class = SchoolClass::fromName($data["class"]);
$this->responsible_name = $data["responsible_name"];
$this->responsible_phone = $data["responsible_phone"];
$this->responsible_email = $data["responsible_email"];
$this->description = $data["description"];
$this->role = Role::fromName($data["role"]);
$this->team_id = $data["team_id"];
@ -145,90 +125,6 @@ class User
$DB->prepare("UPDATE `users` SET `first_name` = ? WHERE `id` = ?;")->execute([$first_name, $this->getId()]);
}
public function getBirthDate()
{
return $this->birth_date;
}
public function setBirthDate($birth_date)
{
global $DB;
$this->birth_date = $birth_date;
$DB->prepare("UPDATE `users` SET `birth_date` = ? WHERE `id` = ?;")->execute([$birth_date, $this->getId()]);
}
public function getGender()
{
return $this->gender;
}
public function setGender($gender)
{
global $DB;
$this->gender = $gender;
$DB->prepare("UPDATE `users` SET `gender` = ? WHERE `id` = ?;")->execute([$gender, $this->getId()]);
}
public function getAddress()
{
return $this->address;
}
public function setAddress($address)
{
global $DB;
$this->address = $address;
$DB->prepare("UPDATE `users` SET `address` = ? WHERE `id` = ?;")->execute([$address, $this->getId()]);
}
public function getPostalCode()
{
return $this->postal_code;
}
public function setPostalCode($postal_code)
{
global $DB;
$this->postal_code = $postal_code;
$DB->prepare("UPDATE `users` SET `postal_code` = ? WHERE `id` = ?;")->execute([$postal_code, $this->getId()]);
}
public function getCity()
{
return $this->city;
}
public function setCity($city)
{
global $DB;
$this->city = $city;
$DB->prepare("UPDATE `users` SET `city` = ? WHERE `id` = ?;")->execute([$city, $this->getId()]);
}
public function getCountry()
{
return $this->country;
}
public function setCountry($country)
{
global $DB;
$this->country = $country;
$DB->prepare("UPDATE `users` SET `country` = ? WHERE `id` = ?;")->execute([$country, $this->getId()]);
}
public function getPhoneNumber()
{
return $this->phone_number;
}
public function setPhoneNumber($phone_number)
{
global $DB;
$this->phone_number = $phone_number;
$DB->prepare("UPDATE `users` SET `phone_number` = ? WHERE `id` = ?;")->execute([$phone_number, $this->getId()]);
}
public function getSchool()
{
return $this->school;
@ -253,42 +149,6 @@ class User
$DB->prepare("UPDATE `users` SET `class` = ? WHERE `id` = ?;")->execute([SchoolClass::getName($class), $this->getId()]);
}
public function getResponsibleName()
{
return $this->responsible_name;
}
public function setResponsibleName($responsible_name)
{
global $DB;
$this->responsible_name = $responsible_name;
$DB->prepare("UPDATE `users` SET `responsible_name` = ? WHERE `id` = ?;")->execute([$responsible_name, $this->getId()]);
}
public function getResponsiblePhone()
{
return $this->responsible_phone;
}
public function setResponsiblePhone($responsible_phone)
{
global $DB;
$this->responsible_phone = $responsible_phone;
$DB->prepare("UPDATE `users` SET `responsible_phone` = ? WHERE `id` = ?;")->execute([$responsible_phone, $this->getId()]);
}
public function getResponsibleEmail()
{
return $this->responsible_email;
}
public function setResponsibleEmail($responsible_email)
{
global $DB;
$this->responsible_email = $responsible_email;
$DB->prepare("UPDATE `users` SET `responsible_email` = ? WHERE `id` = ?;")->execute([$responsible_email, $this->getId()]);
}
public function getDescription()
{
return $this->description;