View file 2/3020.ru/system/connections/inform.php

File size: 1.52Kb
<?php
  
/*
----------------------------
Функция оповещения об успехе
----------------------------
*/
  
FUNCTION SUCCESS($text, $method = 'session') {
  
  IF ($method == 'forward'){
    
    ECHO "<div class='success'>";
    ECHO "<font size='+1'><i class='fa fa-check-circle-o fa-fw fa-lg'></i> ".LG('Успешно')."!</font><br /><br />";
    ECHO "".LG(TEXT_ABSOLUTE($text))."";
    ECHO "</div>";
  
  }ELSE{

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

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

  ECHO "<div class='success'>";
  ECHO "<font size='+1'><i class='fa fa-check-circle-o fa-fw fa-lg'></i> ".LG('Успешно')."!</font><br /><br />";
  ECHO "".LG(TEXT_ABSOLUTE($_SESSION['SUCCESS']))."";
  ECHO "</div>";
  
  $_SESSION['SUCCESS'] = NULL;

}

/*
----------------------------
Функция оповещения об ошибке
----------------------------
*/
  
FUNCTION ERROR($text, $method = 'session') {
  
  IF ($method == 'forward'){
    
    ECHO "<div class='error'>";
    ECHO "<font size='+1'><i class='fa fa-exclamation-triangle fa-fw fa-lg'></i> ".LG('Ошибка')."!</font><br /><br />";
    ECHO "".LG(TEXT_ABSOLUTE($text))."";
    ECHO "</div>";
  
  }ELSE{

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

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

  ECHO "<div class='error'>";
  ECHO "<font size='+1'><i class='fa fa-exclamation-triangle fa-fw fa-lg'></i> ".LG('Ошибка')."!</font><br /><br />";
  ECHO "".LG(TEXT_ABSOLUTE($_SESSION['ERROR']))."";
  ECHO "</div>";
  
  $_SESSION['ERROR'] = NULL;

}

?>