<?php
  
/*
------------
Левая панель
------------
*/ 
  
ECHO '<div id="sidebar_wrap">';
ECHO '<div style="padding: 25px;"></div>';

ECHO "<div class='menu-sidebar'>";
ECHO "<div class='panel-left-menu-fon'>";

ECHO '<div style="padding: 2px;"></div>';

/*
-------------------
Панель пользователя
-------------------
*/

IF (ISSET($user)){
  
  $background = "#85949B";
  $shadow = "#56676F";
  
  $style = "style='background-color: ".$background."; 
  
  text-shadow: 1px 1px ".$shadow.",
  2px 2px ".$shadow.", 
  3px 3px ".$shadow.", 
  4px 4px ".$shadow.", 
  5px 5px ".$shadow.", 
  6px 6px ".$shadow.", 
  7px 7px ".$shadow.", 
  8px 8px ".$shadow.", 
  9px 9px ".$shadow.", 
  10px 10px ".$shadow.", 
  11px 11px ".$shadow.", 
  12px 12px ".$shadow.", 
  13px 13px ".$shadow.", 
  14px 14px ".$shadow.", 
  15px 15px ".$shadow.", 
  16px 16px ".$shadow.", 
  17px 17px ".$shadow.", 
  18px 18px ".$shadow.", 
  19px 19px ".$shadow.", 
  20px 20px ".$shadow.", 
  21px 21px ".$shadow.", 
  22px 22px ".$shadow.", 
  23px 23px ".$shadow.", 
  24px 24px ".$shadow.", 
  25px 25px ".$shadow.", 
  26px 26px ".$shadow.", 
  27px 27px ".$shadow.", 
  28px 28px ".$shadow.", 
  29px 29px ".$shadow.", 
  30px 30px ".$shadow.";
  
  '";
  
  ECHO "<div class='left-optimize'>";
  
  ECHO "<div class='left-title'>".LG('Панель пользователя')."</div>";
  
  ECHO "<div class='list-menu'>";
  
  ECHO "<a href='/id".$user['ID']."'>".USER::AVATAR($user['ID'], 50)." <span style='position: relative; left: 5px; color: black;'><b>".$user['LOGIN']."</b></span></a>";
  
  ECHO "<br /><br />";
  
  ECHO "<a href='/?get=exit' class='btn' load='none'>".ICONS('power-off', 15, 'fa-fw')."</a>";
  ECHO "<a href='/users/profile/?path=settings' class='btn'>".ICONS('gear', 15, 'fa-fw')."</a>";
  
  ECHO "</div>";
  
  IF (MANAGEMENT == 1){
    
    ECHO "<a href='/panel/' load='none'><div class='list-menu hover'>"; 
    ECHO "<span class='menu-icons-small' ".$style.">";
    ECHO "".ICONS('gear', 12, 'fa-fw')."";
    ECHO "</span> ";
    ECHO "<span class='menu-icons-optimize'>".LG('Панель управления')."<br /><font color='#7D8A92'>(".LG('версия').":
  ".CONFIG('ACMS_VERSION').")</font></span>";
    ECHO "</div></a>";
  
  }
  
  ECHO "<a href='/users/cabinet/'><div class='list-menu hover'>"; 
  ECHO "<span class='menu-icons-small' ".$style.">";
  ECHO "".ICONS('gear', 12, 'fa-fw')."";
  ECHO "</span> ";
  ECHO "<span class='menu-icons-optimize'>".LG('Кабинет')."</span>";
  ECHO "</div></a>";
  
  ECHO "<a href='/users/shop/'><div class='list-menu hover'>"; 
  ECHO "<span class='menu-icons-small' ".$style.">";
  ECHO "".ICONS('shopping-basket', 11, 'fa-fw')."";
  ECHO "</span> ";
  ECHO "<span class='menu-icons-optimize'>".LG('Магазин услуг')."</span>";
  ECHO "</div></a>";
  
  ECHO "</div>";
  
}

/*
-----------------
Меню пользователя
-----------------
*/

IF (ISSET($user)){
  
  ECHO "<div class='left-optimize'>";
  
  ECHO "<div class='left-title'>".LG('Меню пользователя')."</div>";
  
  $result = SCANDIR(ROOT.'/users/cabinet/components/', SCANDIR_SORT_ASCENDING);
  
  FOR ($i = 0; $i < COUNT($result); $i++){
    
    IF (PREG_MATCH('#\.php$#i',$result[$i])){       
      
      REQUIRE (ROOT.'/users/cabinet/components/'.$result[$i]);
    
    }
  
  }
  
  ECHO "</div>";
  
}

/*
-----------
Авторизация
-----------
*/

IF (!ISSET($user)){
  
  ECHO "<div class='left-optimize'>";
  
  ECHO "<div class='left-title'>".LG('Авторизация')."</div>";
  
  ECHO "<div class='list-menu'>";
  
  ECHO "<form method='post' action='/?get=login'>";
  
  HTML::INPUT('login', 'Логин', 'Ваш логин:');
  HTML::INPUT('password', 'Пароль', 'Ваш пароль:', '32', '', 'form-control-100', 'password');
  
  ECHO "<a href='/?get=password'>";
  ECHO ICONS('question-circle', 17, 'fa-fw');
  ECHO " ".LG('Забыли пароль')."?";
  ECHO "</a><br /><br />";
  
  HTML::BUTTON('btn-login', 'ok', 'sign-in', 'ВОЙТИ НА САЙТ');
  
  ECHO "<a href='/?get=registration' class='btn-registration' style='color: white;'>";
  ECHO ICONS('mail-forward', 17, 'fa-fw');
  ECHO " ".LG('РЕГИСТРАЦИЯ')."</a>";
  
  ECHO "</form>";
  
  ECHO "</div>";
  
  ECHO "</div>";
  
} 

/*
----------
Меню сайта
----------
*/
  
ECHO "<div class='left-optimize'>";
  
ECHO "<div class='left-title'>".LG('Меню сайта')."</div>";
  
$result = SCANDIR(ROOT.'/main/components/small/', SCANDIR_SORT_ASCENDING);

FOR ($i = 0; $i < COUNT($result); $i++){
  
  IF (PREG_MATCH('#\.php$#i',$result[$i])){ 
    
    REQUIRE (ROOT.'/main/components/small/'.$result[$i]);
  
  }

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

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

ECHO "</div>";

?>