<?php
  
IF (STR($account_settings['STATUS']) > 0 && $account['ID'] != $user['ID']){ 
  
  ECHO "<div class='status'>";
  
  ECHO TEXT($account_settings['STATUS'], 0, 1, 0, 0);
  
  ECHO "</div>";
  
}

IF ($account['ID'] == $user['ID']){
  
  ECHO "<div class='status'>";
  
  ?><a id="upload-status" onclick="modal_open('#status')" load="none"><?=ICONS('pencil', 15, 'fa-fw')?></a><?
  ECHO " ".TEXT($account_settings['STATUS'], 0, 1, 0, 0)."";
  
  ECHO "</div>";
  
  ECHO "<div class='overlay'>";
  
  ECHO "<div class='modal' id='status'>";
  
  ECHO "<div class='modal-title'>";
  ECHO "<b>".LG('Статус')."</b>";
  ?><a onclick="modal_close('#status')" load="none" class="btn-modal-close"><?=ICONS('times', 20, 'fa-fw')?></a><?
  ECHO "</div>";
  
  ECHO "<div class='modal-optimize'>";
  
  ECHO "<div class='list-menu'>";
  
  IF (POST('ok')){
    
    $message = ADSL(POST('message'));
    
    IF (STR($message) > 150){
      
      ERROR('Содержимое не может быть больше 150 символов', 'session');
      REDIRECT('/id'.$user['ID'].'');
      
    }
    
    DB::GET_SET("UPDATE `USERS_SETTINGS` SET `STATUS` = '".$message."' WHERE `USER_ID` = '".$user['ID']."' LIMIT 1");
    
    SUCCESS('Изменения успешно приняты', 'session');
    REDIRECT('/id'.$user['ID'].'');
    
  }
  
  ECHO "<div id='upload-status-show'></div>";

  ECHO "</div>";
  
  ECHO "</div>";
  
  ECHO "</div>";
  
  ECHO "</div>";

}
  
?>