<?php
ini_set("display_errors", 0);
error_reporting(0);
include_once "admin/config.php";

$ip = $_SERVER['REMOTE_ADDR'];
$dnesnidatum = StrFTime("%Y-%m-%d %H:%M:%S", Time());
$banlist = mysql_query("SELECT * FROM jtcms_banlist WHERE ip='".mysql_real_escape_string($ip)."' and druh='2' LIMIT 1");
$banlist_r = mysql_num_rows($banlist);

if ($banlist_r != 0) {
  $banlist = mysql_fetch_array($banlist);
  Header("Location: admin/error.php?error=3&datum=".rawurlencode($result['datum'])."&duvod=".rawurlencode($result["duvod"]));
  echo '<script type="text/javascript">location.replace("admin/error.php?error=3&datum='.rawurlencode($result['datum']).'&duvod='.rawurlencode($result["duvod"]).'")</script>';
};

switch ($jtcms_menu) {

case "kategorie" :

  $query = mysql_query("SELECT * FROM jtcms_kategorie WHERE menu_zob='1' ORDER BY menu_por");
  
  while ($result = mysql_fetch_array($query)) {
    $pocet = mysql_query("SELECT COUNT(*) AS pocet FROM jtcms_clanky WHERE kategorie='".$result['id']."'");
    $pocet = mysql_fetch_array($pocet);
    $pocet = $pocet['pocet'];
    
    include "admin/stuff/templates/template_5.php";
  };

break;

case "stranky" :

  $query = mysql_query("SELECT * FROM jtcms_stranky WHERE menu_zob='1' ORDER BY menu_por");
  
  while ($result = mysql_fetch_array($query)) { 
    include "admin/stuff/templates/template_6.php";
  };

break;

case "stitky" :

  $query = mysql_query("SELECT * FROM jtcms_stitky");
  
  while ($result = mysql_fetch_array($query)) { 
    include "admin/stuff/templates/template_12.php";
  };
  
break;

};
unset($jtcms_menu);
?>