Prosím napište nám na email.
Díky za pochopení.'); } echo ''; echo ''; echo ''; echo ''; echo '
Na komentáře dané stránky již nebudete upozorňováni!'; echo '
'; echo ''; exit; } include_once 'lib/class-comments.php'; //$rq = substr($_SERVER['REQUEST_URI'], strlen('pobyty/')); // localhost $rq = $_SERVER['REQUEST_URI']; $q = query("SELECT `to` FROM redirs WHERE `from`='%s'", $rq); if ($r = db_array($q)) { header("location: ".$r['to'], true, 301); exit; } include "resamps.php"; function furl($name = '') { $str = ''; $first = true; foreach($_GET as $id => $value) { if($id == $name || (is_array($name) && in_array($id, $name))) continue; $str.= ($first ? '' : '&').$id.'='.urlencode($value); $first = false; } return '/?'.$str; } function bezdiakritiky($s) { $co = array( 'é','ě','É','Ě','ř','Ř','ť','Ť','ž','Ž','ú','Ú','ů','Ů','ü','Ü','í','Í','ó','Ó','á','Á','š','Š','ď','Ď', 'ý','Ý','č','Č','ň','Ň','ä','Ä','ĺ','Ĺ','ľ','Ľ','ŕ','Ŕ','ö','Ö' ); $cim = array( 'e','e','E','E','r','R','t','T','z','Z','u','U','u','U','u','U','i','I','o','O','a','A','s','S','d','D', 'y','Y','c','C','n','N','a','A','l','L','l','L','r','R','o','O' ); return str_replace($co, $cim, $s); } function autoImgResamp(&$html) { global $autoImgs; include_once 'func_images.php'; $html = preg_replace_callback( '~src\s*=\s*(["\'])\s*'.ROOT.'([^"\']+)_(\d+)x(\d+)(c?)\.(jpg|gif|png)\s*\\1~is', 'autoImgResamp_callback', $html ); } //--- CALLBACK function autoImgResamp_callback($m) { $destfile = $m[2].'_'.$m[3].'x'.$m[4].$m[5].'.'.$m[6]; $dirfile = $m[2].'.'.$m[6]; if (file_exists($destfile) || !file_exists($dirfile)) { return $m[0]; } $w = $m[3]; $h = $m[4]; $crop = $m[5] == 'c' ? true : false; storeImage($dirfile, $destfile, $w, $h, null, true, $crop); return 'src="'.ROOT.$destfile.'"'; } function handleText($str, $row = null) { if (isset($row)) { $str = str_replace('{CENA}', cena($row['cena']), $str); } $str = preg_replace('~(src|href)="/~i', '$1="'.ROOT, $str); // relativni odkazy autoImgResamp($str); // projdeme obrazky a provedeme auto resamp $str = preg_replace('~\*([^*\\n]+)\*~i', '\1', $str); // text mezi hvezdami je tucne $str = my_list($str); // odrazky // tam kde je href="#" doplnime URL obrazku $str = preg_replace('~]+)href="#"([^>]+onclick="return ph\.show\(this\)"[^>]*>]+src=["\']([^"\']+)_(\d+x\d+c?)\.(jpg|gif|png)["\'])~i', '$1', $in); $in = preg_replace('~(?|"([^"]+)"|(\S+)):([a-z/](\s|$|[^/][^ ]+))~', '$1', $in); $line.= $in; $line.= ''; } elseif ($line != '') { // neni odrazka if ($ul) { $ul = false; $line = '' . $line; } } } if ($ul) $line.= ''; $str = implode("\n", $lines); return $str; } list($SITE, $SITE2) = explode("/", $_REQUEST['site']); include 'admin/stats_fn.php'; $host = 'http://'.$_SERVER['HTTP_HOST']; if($_SERVER['HTTP_REFERER'] && substr($_SERVER['HTTP_REFERER'], 0, strlen($host)) != $host && ($_SESSION['ref'] == '' || $_SESSION['ref'] != $_SERVER['HTTP_REFERER']) ){ query("INSERT INTO gstats(datetime, ip, referer, server, keywords, site)" ." VALUES(NOW(), '".$_SERVER['REMOTE_ADDR']."', '%s', '%s','%s', '%s')", $_SERVER['HTTP_REFERER'], getServer($_SERVER['HTTP_REFERER']), keywords($_SERVER['HTTP_REFERER']), $_REQUEST['site']); $_SESSION['ref'] = $_SERVER['HTTP_REFERER']; } function az_only($s) { $a = 'ěščřžýáíéĚŠČŘŽÝÁÍÉůúŮÚďťňĎŤŇ'; $b = 'escrzyaieESCRZYAIEuuUUdtnDTN'; return strtr($s, $a, $b); } // ---------------------------------------------------------------- FOTO+VIDEO if(substr($SITE, 0, 7) == 'obrazky') { $SITE = substr($_REQUEST['site'], 0, -1); $pos = strrpos($SITE, "-"); $id = substr($SITE, $pos+1); if(!is_numeric($id)) die('chyba'); $pro = myucfirst(urldecode(substr(substr($SITE, 0, $pos), 8))); include('obrazky.php'); exit; } //-------------------------------------------------------------------------- $DBTABLE = false; // bud je v kosiku nebo v (kategorii / podstrance) if($SITE == 'kosik') { $title = 'Nákupní košík'; $ROW['url'] = 'kosik'; } else { $q = query("(SELECT url,'podstranky' FROM podstranky)" ." UNION ALL (SELECT url,'categories' FROM categories)" ." UNION ALL (SELECT url,'produkty' FROM produkty)"); while($r = mysql_fetch_row($q)) { if ($r[0] == $SITE.'/'.$SITE2) { $SITE = $SITE.'/'.$SITE2; $SITE2 = ''; $DBTABLE = $r[1]; break; // tady dame break, u kratkych ne } elseif ($SITE == $r[0]) { $DBTABLE = $r[1]; } } echo mysql_error(); if(!$DBTABLE) { header("HTTP/1.1 404 Not Found"); header("Location: ".ROOT); // neexistujici stranka exit; } else { $q = query("SELECT * FROM $DBTABLE WHERE url='".$SITE."' LIMIT 1"); $ROW = db_array($q); if(!$ROW['obsah'] && $ROW['en']) $ROW['obsah'] = $ROW['en']; if(!isset($_COOKIE['url-'.$SITE]) && $DBTABLE == 'podstranky') { query("UPDATE $DBTABLE SET zobrazeno=zobrazeno+1 WHERE id='".$ROW['id']."'"); query("UPDATE counter SET visits=visits+1 WHERE type='$DBTABLE' AND obj_id=".$ROW['id']." AND date=CURRENT_DATE()"); if (mysql_affected_rows() < 1) { query("INSERT INTO counter(visits,type,obj_id,date) VALUES(1,'$DBTABLE',".$ROW['id'].",NOW())"); } setCookie('url-'.$SITE, 1, time()+60*60*24*30, '/'); } if ($DBTABLE == 'produkty') { $COM = new comments($ROW['id']); // komenty $q = query("SELECT * FROM produkty_kategorie WHERE idpro=".$ROW['id']); while ($r = db_array($q)) { $PROCATS[$r['idkat']] = $r['idkat']; } } } $title = $ROW['title'] ? $ROW['title'] : ($ROW['nazev'] ? $ROW['nazev'] : $ROW['cz']); } $TITLE = $title.($ROW['url'] ? $titleEnd : ''); include('lib/lib-jscookies.php'); $jsc = new jscookies(array('pform', 'opts')); $celkemks = 0; foreach($jsc->data2['pform'] as $r) { $celkemks+= $r[1]; } $cats = array(); $subcats = array(); $subcats_active = array(); $q = query("SELECT * FROM categories WHERE url!='' ORDER BY poradi, cz"); while ($r = db_array($q)) { if ($r['url'] == $ROW['url']) { $r['_on'] = true; } if ($r['level']) { $subcats[$r['level']][] = $r; if ($r['_on']) { $subcats_active[$r['level']] = 1; } } $cats[$r['id']] = $r; } //----------- ob_start(); $i = 0; foreach ($cats as $r) { if ($r['level'] != 0) continue; $i++; $open = isset($subcats[$r['id']]) && ($r['_on'] || $subcats_active[$r['id']]); $bold = isset($PROCATS[$r['id']]); $class = null; if ($r['_on']) $class[] = 'on'; //(isset($subcats[$r['id']]) ? '' : ' hasChilds'); if ($open) $class[] = 'on-child'; if ($bold) $class[] = 'on-product'; if ($class) $class = ' class="'.implode(' ', $class).'"'; echo ''; echo '

'; echo ''.$r['cz'].''; echo '

'; if (($bold || $open) && isset($subcats[$r['id']])) // podkategorie { $ROW['_subcats'] = 1; $ROW['level_cz'] = $r['cz']; $ROW['level_url'] = $r['url']; echo '
    '; foreach ($subcats[$r['id']] as $subcat) { $class = ''; if ($subcat['_on']) { $class = ' class="on"'; } elseif ( isset($PROCATS[$subcat['id']]) ) { $class = ' class="on-product"'; } echo ''; // subcat echo '

    '; echo ''.$subcat['cz'].''; echo '

    '; echo ''; } echo '
'; } echo ''; } $li_kategorie = ob_get_contents(); ob_end_clean(); function produkt($r, $step = 2, $tag = 'h2') { global $pro_i, $total, $SITE; $tag = strtolower($tag); echo '
'; echo '<'.$tag.' class="nazev-pobytu">'.$r['nazev'].''; echo '
'; $r['popis'] = handleText($r['popis'], $r); if ($r['popis']{0} != '<') echo '

'; echo $r['popis']; if ($r['popis']{0} != '<') echo '

'; echo '
'; // 3 fota echo '
'; $IMAGES = explode("\n", $r['foto']); $i = 0; foreach ($IMAGES as $line) { if (!$line) continue; $i++; if ($i > 3) break; list($img, $alt) = explode(",", $line); echo ''; echo ''.$alt.''; echo ''; } echo '
'; echo '
'; echo '››› Více o hotelu…'; echo '
'; echo '
'; // categories foreach ($r['cats'] as $i => $catid) { $cat = $GLOBALS['cats'][$catid]; echo ($i == 0 ? '' : ' | ').''.$cat['cz'].''; } echo '
'; echo '
'; $pro_i++; } ?> <?= $TITLE ?>
>
'; echo '

'.$r['nazev'].'

'; if (!$r['aktivni']): echo '
Bohužel tento pobyt není k dispozici :-(

Podobné pobyty
'; else: echo '
'; $r['popis'] = handleText($r['popis'], $r); if ($r['popis']{0} != '<') echo '

'; echo $r['popis']; if ($r['popis']{0} != '<') echo '

'; echo '
'; // 3 fota echo '
'; $IMAGES = explode("\n", $r['foto']); $i = 0; foreach ($IMAGES as $line) { if (!$line) continue; $i++; if ($i > 3) break; list($img, $alt) = explode(",", $line); echo ''; echo ''.$alt.''; echo ''; } echo '
'; ?>
OBJEDNAT TENTO POBYT'; ?>   ...přidáno do košíku.

Cena balíčku pro 2 osoby:

'; $IMAGES = explode("\n", $r['foto']); $i = 0; foreach ($IMAGES as $line) { if (!$line) continue; $i++; if ($i <= 3) continue; list($img, $alt) = explode(",", $line); echo ''; echo ''.$alt.''; echo ''; } echo '
'; echo '
'; // categories $i = 0; foreach ($PROCATS as $catid) { $cat = $GLOBALS['cats'][$catid]; echo ($i == 0 ? '' : ' | ').''.$cat['cz'].''; $i++; } echo '
'; echo ''; $count = $COM->total; $COM->output(); endif; echo '
'; // pobyt } #################################################################################### // KATEGORIE elseif($DBTABLE == 'categories' || isset($_REQUEST['search'])) { $catid = null; $hledej = isset($_REQUEST['search']); $where = ''; if ($hledej) { function strip($v, $k) { return stripslashes($v); } array_walk($_REQUEST, 'strip'); $ps = array(); if ($_REQUEST['hotel'] != '') { $ps[] = 'hotel="'.mysql_real_escape_string($_REQUEST['hotel']).'"'; } if ($_REQUEST['misto'] != '') { $ps[] = '(misto="'.mysql_real_escape_string($_REQUEST['misto']).'" OR kraj="'.mysql_real_escape_string($_REQUEST['misto']).'")'; } if ($_REQUEST['pes'] == "1") { $ps[] = 'pes=1'; } if (is_numeric($_REQUEST['cena_do'])) { $ps[] = 'cena<='.$_REQUEST['cena_do']; } if ($_REQUEST['obsahuje'] != '') { $ps[] = "CONCAT(specifikace, popis, nazev) LIKE '%".mysql_real_escape_string($_REQUEST['obsahuje'])."%'"; } if (is_numeric($_GET['cat'])) { $catid = $_GET['cat']; // nedavame k ps!! } if ($ps) $where = ' AND ('.implode(' AND ', $ps).')'; else $where = ' AND 1'; } else { $catid = $ROW['id']; // kategorie / podkategorie } $pro_cats = array(); $q = query("SELECT * FROM produkty_kategorie"); while ($r = db_array($q)) { $pro_cats[$r['idpro']][] = $r['idkat']; } $q = query("SELECT SQL_CALC_FOUND_ROWS *".($hledej ? ", GROUP_CONCAT(b.idkat) idkats" : null)." FROM produkty a" ." LEFT JOIN produkty_kategorie b ON b.idpro=a.id" ." WHERE aktivni=1" .($catid ? " AND b.idkat".(is_array($catid) ? ' IN('.implode(',', $catid).')' : "=".(int)$catid ) : "" ) .$where ." GROUP BY a.id" ." ORDER BY ".($hledej ? "cena" : "poradi, nazev, cena") ." LIMIT ".$_GET['page']*$PER_PAGE.", $PER_PAGE" ); echo mysql_error(); $q2 = query("SELECT FOUND_ROWS()"); $r = db_array($q2); $total = $r[0]; $totalpages = ceil($total/$PER_PAGE); if($hledej) { echo '

Inteligentní vyhledávání

'; // ('.$total.') if ($total > 0) { echo ''; } } else { $catid = $ROW['id']; // kategorie / podkategorie //if($ROW['level'] > 0) echo ''; //echo ''; echo '

'; echo ($ROW['h1'] ? $ROW['h1'] : $ROW['cz']); echo '

'; } if (!$hledej && $ROW['obsah']) { echo '
'.handleText($ROW['obsah']).'
'; } if( !$hledej && $subcats[$ROW['id']] ) { echo '
'; } //------------------------------------------------------------------------------------------------------------------ if($total > 0 && $_GET['page'] < $totalpages) { echo '
'; $pro_i = 0; while($r = db_array($q)) { $r['cats'] = $pro_cats[ $r['id'] ]; produkt($r); } echo '
'; } else { header("HTTP/1.1 404 Not Found"); echo '
'; echo '



Nebyl nalezen žádný produkt.

'; if ($hledej) echo '

Zkuste změnit parametry vyhledávání.

'; echo '
'; } if ($totalpages > 1) { echo '
  • Celkem '.$total.' pobytů:
  • '; for($i=0; $i<$totalpages; $i++) { echo '
  • '.($i+1).'
  • '; } if ($_GET['page'] < $totalpages-1) echo '
  • Další strana
  • '; echo '
'; } } //--------------------------------------------- STRANKY elseif($DBTABLE == 'podstranky') { if ($ROW['h1']) { echo '

'.$ROW['h1'].'

'; } //---------------------------------------------------------------- KONTAKTY if(isset($_POST['yourname']) && $_POST['yourname'] == '11') { if (!$_POST['vzkaz'] || !$_POST['kontakt']) { if (isset($_POST['hotel'])) { echo '
Prosím zadejte Váš email / telefon a speciální požadavek.
'; } else { echo '
Prosím zadejte Váš email / telefon a text zprávy.
'; } } else { include('lib/class-email.php'); //----------------------------- muj predmet $file = dirname(__FILE__).'/cislo.txt'; if ( !file_exists($file) || date("Y-m-d", filemtime($file)) != date("Y-m-d") ) { $num = 1; } else { $num = file_get_contents($file)+1; } file_put_contents($file, $num); $my_subject = ' #'.date("ymd").str_pad($num, 3, '0', STR_PAD_LEFT); //---------------- $e = new email; if (isset($_POST['hotel'])) { $e->subject = $_SERVER['HTTP_HOST'].' - Pobyt na míru'.$my_subject; } else { $e->subject = $_SERVER['HTTP_HOST'].' - Formulář'.$my_subject; } $e->from = 'robot@'.$_SERVER['HTTP_HOST']; $e->rcpt = $main_email; $e->html = ''; if (isset($_POST['hotel'])) $e->html.= ''; if (isset($_POST['cena_do'])) $e->html.= ''; $e->html.= '
Jméno:'.htmlspecialchars($_POST['jmeno']).'
Kontakt:'.htmlspecialchars($_POST['kontakt']).'
Hotel od:'.htmlspecialchars($_POST['hotel']).'
Cena do:'.htmlspecialchars($_POST['cena_do']).'
Text:'.htmlspecialchars($_POST['vzkaz']).'
Odkud přišel:'.$_SESSION['ref'].'
IP:'.$_SERVER['REMOTE_ADDR'].'
'; if($e->send()) { $_POST = array(); echo '
Vaše zpráva byla odeslána!
'; } else { echo '
Vaši zprávu se nepodařilo odeslat, zkuste to znovu (F5)!
'; } } } $ROW['obsah'] = preg_replace('~{POST_(\w+)}~e', 'htmlspecialchars($_POST[strtolower(\1)])', $ROW['obsah']); //----------------------------------------------- VYPIS PRODUKTU $ROW['obsah'] = handleText($ROW['obsah'], $ROW); function html_eval2($string) { return preg_replace_callback("~<\?php(.*)\?>~sU","my_eval",$string); } function my_eval($arr) { return eval($arr[1]); } if(!$ROW['url']) { echo html_eval2($ROW['obsah']); } else { echo $ROW['obsah']; } } //--------------------------------------------- KOSIK elseif($SITE == 'kosik') { echo '

NÁKUPNÍ KOŠÍK

'; if($celkemks <= 0) { echo '
Váš nákupní košík je prázdný.
'; } else { define('IN_MAIN', true); include('_kosik.php'); } } ?>
'; $s.= '
    '; $s.= $li_kategorie; $s.= '
'; return $s; } function widget_aktualni() { global $SITE; $q = query("SELECT * FROM produkty WHERE aktualni>0 ORDER BY aktualni ASC, nazev"); $s.= '
'; $s.= '
'; return $s; } function cb_widgets($m) { $fn = 'widget_'.$m[1]; if (function_exists($fn)) return $fn(); return; } //------------------------------------------------------------------------------ $q = query("SELECT * FROM chlivky WHERE active=1 ORDER BY ordering"); $i = 0; while($r = db_array($q)) { $text = $r['text']; $text = handleText($text); $text = preg_replace_callback('~{widget_(.*)}~i', 'cb_widgets', $text); if ($r['classname']=='cart' && $SITE == 'kosik') continue; ?>
'; echo $text; if (strpos($text, '<') === false) echo '

'; ?>
?>