<?php
ini_set("display_errors", 0);
error_reporting(0);

if (!isset($_GET['error'])) {$_GET['error'] = "default";};

if ($_GET['error'] == 2 or $_GET['error'] == 7) {
  $jazyk = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
  $jazyk = preg_replace("/,(.*)$/", "", $jazyk);
  $jazyk = str_replace("-", "_", $jazyk);
  
  if ($jazyk == "cs_CZ" or $jazyk == "sk_SK" or $jazyk == "cs" or $jazyk == "sk") {
    $lang_head = "cs-cz";
    include "stuff/lang/cs_CZ.php";
  } else {
    $lang_head = "en-gb";
    include "sutff/lang/en_GB.php";
  };


switch ($_GET['error']) {
  case "2" :
    $h1 = $lang['error_2_h1'];
    $title = $lang['error_2_title'];
    $p = $lang['error_2_p'];
  break;
  case "7" : 
    $h1 = $lang['error_7_h1'];
    $title = $lang['error_7_title'];
    $p = $lang['error_7_p'];
  break;
}; 
 
?>
<!DOCTYPE html>
<html lang="<?php echo $lang_head; ?>" dir="ltr">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title><?php echo $title.' | JT-CMS'; ?></title>

  <link href="stuff/img/favicon.ico" rel="shortcut icon" type="image/ico" />
  
  <meta name="author" content="all: Jan Tužil, mailto: Izolex@jantuzil.cz" />
<style type="text/css">
* {border: 0; outline: none; padding: 0; margin: 0;}

html, body {height: 100%;}
body {background-color: #d2d2d2; color: #333333; font-family: Arial;}
a {color: #333333;}
a:hover {text-decoration: none;}

#obal {width: 940px; margin-left: auto; margin-right: auto; min-height: 100%; text-align: center;}
.hlavicka {width: 100%; height: 200px; background: url('stuff/img/hlavicka.png') no-repeat scroll transparent center top;}
#footer {background-color: #b5b5b5; margin: -28px auto 0 auto; padding: 5px 10px 0 10px; height: 22px; width: 500px; border: solid 1px #d0d0d0; border-bottom: none; text-align: center;
         border-radius: 10px 10px 0 0; -moz-border-radius: 10px 10px 0 0; -webkit-border-radius: 10px 10px 0 0; font-size: 13px;}
</style>
</head>
<body>
<div id="obal">
   <div class="hlavicka"></div>

   <h1><?php echo $h1; ?></h1><br />
   <p><?php echo $p; ?></p>
   
  </div>
  <div id="footer">
  Powered by <a href="http://jt-cms.com"><strong>JT-CMS</strong></a> copyright © 2012 by <a href="http://jantuzil.cz/"><strong>Jan Tužil</strong></a>.
  </div>
</body>
</html>
<?php
exit();
};

include "config.php";

$theme = mysql_query("SELECT hodnota FROM jtcms_nastaveni WHERE typ='vzhled' LIMIT 1");
$theme = mysql_fetch_array($theme);
$theme = $theme['hodnota'];

  $query_lang = mysql_query("SELECT hodnota, hodnota2 FROM jtcms_nastaveni WHERE typ='jazyk' LIMIT 1");
  $query_lang = mysql_fetch_array($query_lang);
  $set_lang = $query_lang['hodnota'];
  $set_lang2 = $query_lang['hodnota2'];

include "stuff/lang/".$set_lang2.".php";
include "stuff/func/general.php";

switch ($_GET['error']) {

case "1" :
$h1 = $lang['error_1_h1'];
$p = $lang['error_1_p'];
$title = $lang['error_1_title'];
break;

/* 2 je bez configu */

case "3" :
$ip = $_GET['ip'];
$query = mysql_query("SELECT * FROM jtcms_banlist WHERE ip='".$ip."' LIMIT 1");
$result = mysql_fetch_array($query);
$radku = mysql_num_rows($query);

if ($radku == 0) {
  Header("Location: error.php");
  echo '<script type="text/javascript">location.replace("error.php")</script>';
};

$h1 = $lang['error_3_h1'];
$p = $lang['error_3_p_1'].' '.$result['datum'].' '.$lang['error_3_p_2'];;
if (!empty($result['duvod'])) {$p .= '<br /><br />'.$lang['error_3_p_3'].'<br />'.$result['duvod'];};
$title = $lang['error_3_title'];
break;

case "4" :
$ip = $_GET['ip'];
$query = mysql_query("SELECT * FROM jtcms_banlist WHERE ip='".$ip."' LIMIT 1");
$result = mysql_fetch_array($query);
$radku = mysql_num_rows($query);

if ($radku == 0) {
  Header("Location: error.php");
  echo '<script type="text/javascript">location.replace("error.php")</script>';
};

$h1 = $lang['error_4_h1'];
$p = $lang['error_4_p_1'].' '.$result['datum'].' '.$lang['error_4_p_2'];;
if (!empty($result['duvod'])) {$p .= '<br /><br />'.$lang['error_4_p_3'].'<br />'.$result['duvod'];};
$title = $lang['error_4_title'];
break;

case "5" :
$h1 = $lang['error_5_h1'];
$p = $lang['error_5_p'];
$title = $lang['error_5_title'];
break;

case "6" :
$h1 = $lang['error_6_h1'];
$p = $lang['error_6_p'];
$title = $lang['error_6_title'];
break;

/* 7 je bez configu */

case "8" :
$h1 = $lang['error_8_h1'];
$p = $lang['error_8_p'];
$title = $lang['error_8_title'];
break;

case "9" :
$h1 = $lang['error_9_h1'];
$p = $lang['error_9_p'];
$title = $lang['error_9_title'];
break;

case "10" :
$h1 = $lang['error_10_h1'];
$p = $lang['error_10_p'];
$title = $lang['error_10_title'];
break;

default :
$h1 = $lang['error_def_h1'];
$p = $lang['error_def_p'];
$title = $lang['error_def_title'];
};

include_head_short($title);

echo '<h1>'.$h1.'</h1><br />';
echo '<p class="tac">'.$p.'</p>';
   
include_end_short();
?>

