1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-26 05:42:22 +00:00
plateforme-tfjm2/server_files/classes/PaymentMethod.php
2020-01-01 21:53:46 +01:00

62 lines
1.3 KiB
PHP

<?php
class PaymentMethod
{
const CREDIT_CARD = 1;
const BANK_CHECK = 2;
const BANK_TRANSFER = 3;
const CASH = 4;
const SCHOLARSHIP = 5;
const NOT_PAID = 0;
public static function getTranslatedName($status) {
switch ($status) {
case self::CREDIT_CARD:
return "Carte bancaire";
case self::BANK_CHECK:
return "Chèque";
case self::BANK_TRANSFER:
return "Virement";
case self::CASH:
return "Espèce";
case self::SCHOLARSHIP:
return "Je suis boursier";
default:
return "Pas encore payé";
}
}
public static function getName($status) {
switch ($status) {
case self::CREDIT_CARD:
return "CREDIT_CARD";
case self::BANK_CHECK:
return "BANK_CHECK";
case self::BANK_TRANSFER:
return "BANK_TRANSFER";
case self::CASH:
return "CASH";
case self::SCHOLARSHIP:
return "SCHOLARSHIP";
default:
return "NOT_PAID";
}
}
public static function fromName($name) {
switch ($name) {
case "CREDIT_CARD":
return self::CREDIT_CARD;
case "BANK_CHECK":
return self::BANK_CHECK;
case "BANK_TRANSFER":
return self::BANK_TRANSFER;
case "CASH":
return self::CASH;
case "SCHOLARSHIP":
return self::SCHOLARSHIP;
default:
return self::NOT_PAID;
}
}
}