mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-25 19:37:26 +02:00
Paiement
This commit is contained in:
@ -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:
|
||||
|
@ -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]);
|
||||
}
|
||||
}
|
@ -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()
|
||||
{
|
||||
|
Reference in New Issue
Block a user