1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-25 19:37:26 +02:00
This commit is contained in:
Yohann
2020-01-02 00:09:02 +01:00
parent 64ffcedbcc
commit 4b6d6f24ea
10 changed files with 182 additions and 64 deletions

View File

@ -270,6 +270,7 @@ class DocumentType
const SANITARY_PLUG = 2;
const SOLUTION = 3;
const SYNTHESIS = 4;
const SCHOLARSHIP = 5;
public static function getTranslatedName($type) {
switch ($type) {
@ -279,6 +280,8 @@ class DocumentType
return "Autorisation de droit à l'image";
case self::SANITARY_PLUG:
return "Fiche sanitaire";
case self::SCHOLARSHIP:
return "Notification de bourse";
case self::SOLUTION:
return "Solution";
default:
@ -294,6 +297,8 @@ class DocumentType
return "PHOTO_CONSENT";
case self::SANITARY_PLUG:
return "SANITARY_PLUG";
case self::SCHOLARSHIP:
return "SCHOLARSHIP";
case self::SOLUTION:
return "SOLUTION";
default:
@ -309,6 +314,8 @@ class DocumentType
return self::PHOTO_CONSENT;
case "SANITARY_PLUG":
return self::SANITARY_PLUG;
case "SCHOLARSHIP":
return self::SCHOLARSHIP;
case "SOLUTION":
return self::SOLUTION;
default:

View File

@ -54,6 +54,16 @@ class Payment
return $this->amount;
}
/**
* @param mixed $amount
*/
public function setAmount($amount)
{
global $DB;
$this->amount = $amount;
$DB->prepare("UPDATE `payments` SET `amount` = ? WHERE `id` = ?;")->execute([$amount, $this->id]);
}
/**
* @return int
*/
@ -137,6 +147,6 @@ class Payment
{
global $DB;
$this->validation_status = $validation_status;
$DB->prepare("UPDATE `payments` SET `$validation_status` = ? WHERE `id` = ?;")->execute([ValidationStatus::fromName($validation_status), $this->id]);
$DB->prepare("UPDATE `payments` SET `validation_status` = ? WHERE `id` = ?;")->execute([ValidationStatus::getName($validation_status), $this->id]);
}
}

View File

@ -436,7 +436,9 @@ class User
$req = $DB->prepare("INSERT INTO `payments`(`user`, `tournament`, `amount`, `method`, `transaction_infos`, `validation_status`) VALUES (?, ?, ?, ?, ?, ?);");
$req->execute([$this->id, $tournament->getId(), 0, PaymentMethod::getName(PaymentMethod::NOT_PAID), "L'inscription n'est pas encore payée.", ValidationStatus::getName(ValidationStatus::NOT_READY)]);
}
return $this->getPayment();
}
public function getOrganizedTournaments()
{