<?php
  
$speed = DB::GET_STRING("SELECT * FROM `PANEL_SPEED` LIMIT 1");

IF (POST('interval')){
  
  DB::GET_SET("UPDATE `PANEL_SPEED` SET `INTERVAL` = '".INTVAL(POST('interval'))."' LIMIT 1");
  
  SUCCESS('Изменения успешно приняты', 'session');
  REDIRECT('?path=system&section=speed_set');
  
}
  
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 "<a href='?path=system&section=speed'>".LG('Скорость загрузки сайта')."</a> ";
ECHO "".ICONS('angle-right', 22, 'fa-fw')."";
ECHO "".LG('Настройки')."";
ECHO "</div>";  

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

ECHO "<form method='post'>";

ECHO "<b>".LG('Интервал обновления данных').":</b><br />";
ECHO "<select name='interval' class='form-control-select'>";

ECHO "<option value='60' ".($speed['INTERVAL'] == 60?" selected='selected'" : NULL)."> 1 ".LG('минута')."</option>";
ECHO "<option value='120' ".($speed['INTERVAL'] == 120?" selected='selected'" : NULL)."> 2 ".LG('минуты')."</option>";
ECHO "<option value='180' ".($speed['INTERVAL'] == 180?" selected='selected'" : NULL)."> 3 ".LG('минуты')."</option>";
ECHO "<option value='240' ".($speed['INTERVAL'] == 240?" selected='selected'" : NULL)."> 4 ".LG('минуты')."</option>";
ECHO "<option value='300' ".($speed['INTERVAL'] == 300?" selected='selected'" : NULL)."> 5 ".LG('минут')."</option>";
ECHO "<option value='360' ".($speed['INTERVAL'] == 360?" selected='selected'" : NULL)."> 6 ".LG('минут')."</option>";
ECHO "<option value='420' ".($speed['INTERVAL'] == 420?" selected='selected'" : NULL)."> 7 ".LG('минут')." (".LG('рекомендуется').")</option>";
ECHO "<option value='480' ".($speed['INTERVAL'] == 480?" selected='selected'" : NULL)."> 8 ".LG('минут')."</option>";
ECHO "<option value='540' ".($speed['INTERVAL'] == 540?" selected='selected'" : NULL)."> 9 ".LG('минут')."</option>";
ECHO "<option value='600' ".($speed['INTERVAL'] == 600?" selected='selected'" : NULL)."> 10 ".LG('минут')."</option>";

ECHO "</select>";

ECHO "<br /><br />";

HTML::BUTTON('panel-button2', 'ok', 'save', 'Сохранить изменения');

ECHO "</form>";

ECHO "</div>";

?>