<?php  
  
ECHO "<div class='navi'>";
ECHO "<a href='?'>".ICONS('home', 25)."</a>";
ECHO "".ICONS('angle-right', 22, 'fa-fw')."";
ECHO "<a href='?path=system'>".LG('Настройки системы')."</a> ";
ECHO "".ICONS('angle-right', 22, 'fa-fw')."";
ECHO "".LG('Alpha установщик')."";
ECHO "</div>";

//Удаление компонента
REQUIRE ROOT.'/panel/alpha_install/plugins/delete_components.php';

//Показ деталей
REQUIRE ROOT.'/panel/alpha_install/plugins/details.php';

ECHO "<div class='fon'>";

/*
-------------------------
Загрузка компонента в zip
-------------------------
*/

ECHO LG('Вы можете загрузить и распаковать ZIP архив для установки нового компонента')." (".LG('Макс.').": <span class='count'>".SIZE_FILE(CONFIG('MAXFILESIZE'))."</span>):<br /><br />";

FILE::UPLOAD('/files/receiver/alpha_install.php', 'Загрузить ZIP архив');

/*
----------------------------------
Вывод не установленных компонентов
----------------------------------
*/

ECHO "<div id='file-content'>";

$count = DB::GET_COLUMN("SELECT COUNT(*) FROM `PANEL_ALPHA_INSTALL` WHERE `ACT` = '0'");

IF ($count > 0){ ECHO "<div class='file-content2'>"; }

$data = DB::GET_STRING_ALL("SELECT * FROM `PANEL_ALPHA_INSTALL` WHERE `ACT` = '0' ORDER BY `TIME` DESC");

WHILE ($list = $data->FETCH()){
  
  ECHO "<div class='file-list'>";
  ECHO "<table style='width: 100%;'><tr>";
  
  ECHO "<td class='td-file'>";
  ECHO "".FILE::ICONS($list['EXT'])."";
  ECHO "</td>";
  
  ECHO "<td class='td-file2'>";
  ECHO "<b>".TEXT_ABSOLUTE($list['NAME'])."</b><p>";
  ECHO ICONS('clock-o', 15, 'fa-fw');
  ECHO FTIME($list['TIME']);
  ECHO " <span class='count'>".SIZE_FILE($list['SIZE'])."</span>";
  ECHO "</p></td>";
  
  ECHO "</tr></table>";
  
  ECHO "<a href='?path=alpha_install&id=".$list['ID']."' class='panel-button'>".ICONS('gear', 15, 'fa-fw')." ".LG('Установить')."</a> ";
  ECHO "<a href='?path=system&section=alpha_install&delete=".$list['ID']."' class='panel-button'>".ICONS('trash', 15, 'fa-fw')." ".LG('Удалить')."</a> ";
  
  ECHO "</div>";

}

IF ($count > 0){ ECHO "</div>"; }

ECHO "</div>";

/*
-------------------------------------
Удаление не установленных компонентов
-------------------------------------
*/

REQUIRE (ROOT.'/panel/alpha_install/plugins/delete_archive.php');

ECHO "</div>";

/*
--------------------------------
Список установленных компонентов
--------------------------------
*/

ECHO "<div class='fon2'>";

$count = DB::GET_COLUMN("SELECT COUNT(*) FROM `PANEL_ALPHA_INSTALL` WHERE `ACT` = '1'");

ECHO "<div class='list-title'><b>".LG('Установленные компоненты')." <span class='count2'>$count</span></b></div>";

IF ($count == 0){ 
  
  HTML::EMPTY();
  
}

$data = DB::GET_STRING_ALL("SELECT * FROM `PANEL_ALPHA_INSTALL` WHERE `ACT` = '1' ORDER BY `TIME` DESC");

WHILE ($list = $data->FETCH()){
  
  ECHO "<div class='list'>";
  
  ECHO "<table style='width: 100%;'><tr>";
  
  ECHO "<td class='td-file'>";
  ECHO "".FILE::ICONS('code')."";
  ECHO "</td>";
  
  ECHO "<td class='td-file2'>";
  
  IF ($list['SYSTEM'] == 1){
    
    ECHO "".ICONS('lock', 15, 'fa-fw')." ";
    
  }
  
  ECHO "<b>".TEXT_ABSOLUTE($list['NAME'])."</b><p>";
  ECHO "".ICONS('clock-o', 15, 'fa-fw')." ".LG('Установлен').": ";
  ECHO FTIME($list['TIME']);
  ECHO " <span class='count'>".SIZE_FILE($list['SIZE'])."</span>";
  ECHO "</p></td>";
  
  ECHO "</tr></table>";
  
  ECHO "<a href='?path=system&section=alpha_install&id=".$list['ID']."&details=show' class='panel-button'>".LG('Детали')." ".ICONS('angle-double-right', 15, 'fa-fw')."</a> ";
  
  IF ($list['SYSTEM'] == 0){
    
    ECHO "<a href='?path=system&section=alpha_install&id=".$list['ID']."&delete_components=stop' class='panel-button'>".ICONS('trash', 15, 'fa-fw')." ".LG('Удалить')."</a> ";
    
  }
  
  ECHO "</div>";
  
}

ECHO "</div>";

?>