" . $value . "";
}
return $return;
}
public static function recErrorInput(string $_string)
{
if (empty($_SESSION["alert"]["input"])) {
$_SESSION["alert"]["input"] = array();
}
array_push($_SESSION["alert"]["input"], $_string);
}
public static function ifErrorInput(string $_string)
{
return (in_array($_string, $_SESSION["alert"]["input"])) ? TRUE : FALSE;
}
private static function printToast(string $_idAlert, string $_style, string $_icon, ?array $_texte = NULL)
{
$text = ($_texte != NULL) ? self::printAlert($_texte) : NULL;
echo '
';
}
public static function show()
{
historique::recordLogs();
echo '';
$idAlert = "printToastSuccess";
$texte1 = (self::getSuccess()) ? self::getSuccess() : NULL;
$style = 'background:#d4edda;';
$icon = icon::getFont(["type" => "info", "color" => "green", "size" => "18px"]) . ' Succès';
self::printToast($idAlert, $style, $icon, $texte1);
$idAlert = "printToastWarning";
$texte2 = (self::getWarning()) ? self::getWarning() : NULL;
$style = 'background:#fff3cd;';
$icon = icon::getFont(["type" => "warning", "color" => "orange", "size" => "18px"]) . ' Attention';
self::printToast($idAlert, $style, $icon, $texte2);
$idAlert = "printToastError";
$texte3 = (self::getError()) ? self::getError() : NULL;
$style = 'background:#f8d7da;';
$icon = icon::getFont(["type" => "alert", "color" => "red", "size" => "18px"]) . ' Erreur';
self::printToast($idAlert, $style, $icon, $texte3);
echo '
';
echo ($texte1 == NULL) ? '' : '';
echo ($texte2 == NULL) ? '' : '';
echo ($texte3 == NULL) ? '' : '';
self::destroyAlert();
}
public static function destroyAlert()
{
unset($_SESSION["alert"]);
}
}