1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-11-27 02:13:06 +00:00
plateforme-tfjm2/server_files/classes/PaymentMethod.php

62 lines
1.3 KiB
PHP
Raw Normal View History

<?php
class PaymentMethod
{
2020-01-01 20:53:46 +00:00
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) {
2020-01-01 20:53:46 +00:00
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";
2020-01-01 20:53:46 +00:00
default:
return "Pas encore payé";
}
}
public static function getName($status) {
switch ($status) {
2020-01-01 20:53:46 +00:00
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:
2020-01-01 20:53:46 +00:00
return "NOT_PAID";
}
}
public static function fromName($name) {
switch ($name) {
2020-01-01 20:53:46 +00:00
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:
2020-01-01 20:53:46 +00:00
return self::NOT_PAID;
}
}
}