<?php
include_once('../style.php');
ShowHeader('Sestavéní RSS kanálu', 'RSS kanál');

if(array_key_exists('build', $_GET))
{
  $Select = '';
  foreach($_POST as $Index => $Item)
  {
    if(substr($Index, 0, 8) == 'category') $Select .= '-'.substr($Index, 8);
  }
  $Select = 'http://centrala.zdechov.net/aktuality/rss.php?select='.substr($Select, 1);
  echo('Výsledný RSS kanál: <a href="'.$Select.'">'.$Select.'</a>');
} else {
  echo('Vytvořte si vlastní RSS kanál, díky kterému budete moci automaticky sledovat novinky pomocí vaší RSS čtečky. Informace o technologii RSS a programech pro čtení kanálů najdete např. <a href="http://www.lupa.cz/clanky/prehled-rss-ctecek/">zde</a><br>'.
  '<br>Kategorie:<br>');
  echo('<form action="subscription.php?build=1" method="post">');
  $DbResult = $Database->select('news_category', '*', '1 ORDER BY caption');
  while($Category = $DbResult->fetch_array())
  {
    echo('<input type="checkbox" name="category'.$Category['id'].'">'.$Category['caption'].'<br>');
  }
  echo('<input type="submit" value="Sestavit ">');
  echo('</form>');
}

ShowFooter();
?>
