<?php

/*
----------------------------
Функция оповещения об успехе
----------------------------
*/
  
FUNCTION SUCCESS($text, $method = 'session') {
  
  IF ($method == 'forward'){
    
    ECHO "<div id='success_id'>";
    ECHO "<div class='success'><div class='green stripes'><div class='proccess'>";
    ECHO "<i class='fa fa-check fa-lg fa-fw'></i> ".TEXT_ABSOLUTE(LG($text))."";
    ECHO "</div>";
    ECHO "</div>";
    ?>
    <button onclick="hide_info('success_id')" style="position: absolute; right: 2px; bottom: 5px; border: 0; background: none;">
    <font color="white"><i class='fa fa-times fa-lg'></i></font></button>
    <?
    ECHO "</div>";
    ECHO "</div>";
  
  }ELSE{

    $_SESSION['SUCCESS'] = $text;
  
  }
  
}

IF (ISSET($_SESSION['SUCCESS']))
{

  ECHO "<div id='success_id'>";
  ECHO "<div class='success'><div class='green stripes'><div class='proccess'>";
  ECHO "<i class='fa fa-check fa-lg fa-fw'></i> ".TEXT_ABSOLUTE(LG($_SESSION['SUCCESS']))."";
  ECHO "</div>";
  ECHO "</div>";
  ?>
  <button onclick="hide_info('success_id')" style="position: absolute; right: 2px; bottom: 5px; border: 0; background: none;">
  <font color="white"><i class='fa fa-times fa-lg'></i></font></button>
  <?
  ECHO "</div>";
  ECHO "</div>";
  
  $_SESSION['SUCCESS'] = NULL;

}

/*
----------------------------
Функция оповещения об ошибке
----------------------------
*/
  
FUNCTION ERROR($text, $method = 'session') {
  
  IF ($method == 'forward'){
    
    ECHO "<div id='error_id'>";
    ECHO "<div class='error'><div class='red stripes'><div class='proccess'>";
    ECHO "<i class='fa fa-exclamation-triangle fa-lg fa-fw'></i> ".TEXT_ABSOLUTE(LG($text))."";
    ECHO "</div>";
    ECHO "</div>";
    ?>
    <button onclick="hide_info('error_id')" style="position: absolute; right: 2px; bottom: 5px; border: 0; background: none;">
    <font color="white"><i class='fa fa-times fa-lg'></i></font></button>
    <?
    ECHO "</div>";
    ECHO "</div>";
  
  }ELSE{

    $_SESSION['ERROR'] = $text;
  
  }
  
}

IF (ISSET($_SESSION['ERROR']))
{
  
  ECHO "<div id='error_id'>";
  ECHO "<div class='error'><div class='red stripes'><div class='proccess'>";
  ECHO "<i class='fa fa-exclamation-triangle fa-lg fa-fw'></i> ".TEXT_ABSOLUTE(LG($_SESSION['ERROR']))."";
  ECHO "</div>";
  ECHO "</div>";
  ?>
  <button onclick="hide_info('error_id')" style="position: absolute; right: 2px; bottom: 5px; border: 0; background: none;">
  <font color="white"><i class='fa fa-times fa-lg'></i></font></button>
  <?
  ECHO "</div>";
  ECHO "</div>";
  
  $_SESSION['ERROR'] = NULL;

}

?>