<?
class content
{
	var $VERSION=1.02;

	function content() {
		global $X;
//		if(empty($_SESSION['backend']['is_root'])) exit;
		if(stristr(URL,'/index.php')) $X->URL->go(str_replace('/index.php','/',URL));


		switch($_GET['module']) {
			default:
				$this->MAIN_PAGE=$X->T->MAIN_PAGE=true;
				require_once(CLASSES.'/_main_page.php');
				$module=$MAIN_PAGE->init();
			break;

			case 'page':
				require_once(CLASSES.'/page.php');
				$module=$PAGE->init();
			break;

			case 'error_404':
				$module=$X->T->error_404();
			break;
		}


		$this->TITLE			= $module['title'];
		$this->KEYWORDS		= $module['keywords'];
		$this->DESCRIPTION	= $module['description'];
		$this->HTML				= $module['html'];

		$this->generate_addons();
		$this->generate_html();
	}


	function generate_addons() {
		global $X;

		$X->JS_FIRST['js'] = ROOT.'/js.js?v='.$this->VERSION;
		$X->CSS[]=ROOT.'/css.css?v='.$this->VERSION;
		$X->CSS[]=INC.'/fonts/font-awesome.css';
		$X->CSS[]=INC.'/fonts/glyphicons.css';

		//////////////////////////////////////////////
		if(count($X->CSS)>0) foreach(@array_unique($X->CSS) as $css_id => $css) $this->CODE['HEAD'].="<link rel=\"stylesheet\"".(!empty($css_id) && !is_numeric($css_id) ? ' id="'.$css_id.'"':'')." href=\"".$css."\" type=\"text/css\" />\n";
		$this->CODE['HEAD'].="<link rel=\"stylesheet\" href=\"../custom.css\" type=\"text/css\" />\n";
		if(count($X->JS_FIRST)>0) foreach(@array_unique($X->JS_FIRST) as $js_id => $js) $this->CODE['HEAD'].="<script type=\"text/javascript\"".(!empty($js_id) ? ' id="'.$js_id.'"':'')." src=\"".$js."\"></script>\n";
		if(count($X->JS)>0) foreach(@array_unique($X->JS) as $js_id => $js) $this->CODE['HEAD'].="<script type=\"text/javascript\"".(!empty($js_id) && !is_numeric($js_id) ? ' id="'.$js_id.'"':'')." src=\"".$js."\"></script>\n";
		if(count($X->JS_BODY)>0) foreach(@array_unique($X->JS_BODY) as $js_id => $js) $this->CODE['BODY'].="<script type=\"text/javascript\"".(!empty($js_id) ? ' id="'.$js_id.'"':'')." src=\"".$js."\"></script>\n";
	}

	
	function generate_html() {
		global $X;



/////////////////////
/*///*/$ENTIRE_BODY='

<div id="simple_tip"><span id="simple_tip_arrow" class="gfx g_tip_arrow_r"></span><div id="simple_tip_content"></div></div>

<div class="root">
	<div class="top'.($this->MAIN_PAGE!=true ? ' sub':'').'">
		<div class="container">
			<a class="logo" href="/"><img src="images/logo.png" alt="Perfect Dent Bielsko-Biała" /></a>
        	<div class="menu">
				'.$X->T->menu_top().'
			</div>
		</div>
	</div>


	'.$this->HTML.'


	'.($this->MAIN_PAGE==true || $_GET['page_key']=='kontakt' ? '
		<div class="main_page_contact">
			<div class="container">
				<div class="row">
					<div class="col-sm-24 col-md-11">
						<div class="header">
							<span class="glyphicon glyphicon-time"></span> GODZINY OTWARCIA
						</div>

						<div class="godziny" itemscope="" itemtype="http://schema.org/Dentist">
							<div class="godziny_title">Poniedziałek, Czwartek, Piątek</div>
							<div class="godziny_value">8.00 - 20.00</div>
							<div class="godziny_sep"></div>

							<div class="godziny_title">Wtorek, Środa</div>
							<div class="godziny_value">14.00 - 20.00</div>
							<div class="godziny_sep"></div>

							<div class="godziny_title">Sobota, Niedziela</div>
							<div class="godziny_value">Nieczynne</div>
							<div class="godziny_sep"></div>
						</div>
					</div>

					<div class="col-sm-24 col-md-11 col-md-offset-2">
						<div class="t40 visible-sm"></div>
						<div class="header">
							<span class="glyphicon glyphicon-home"></span> &nbsp;NZOZ PERFECT DENT
						</div>

						<div class="kontakt">
							ul. Legionów 27<br>
							43-300 Bielsko-Biała<br>
							woj. śląskie<br>
							NIP: 937-12-85-817<br>
							<div style="position:relative; font-size:24px; margin-top:20px; color:#2B96CC;">
								<a href="tel:338125869" class="nrTel"><span class="glyphicon glyphicon-earphone" style="position:absolute; margin:7px 0px 0px -34px;"></span> <span style="vertical-align:top"><b>33 812 58 69</b></span></a>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>


		<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d10295.28278833818!2d19.0545516!3d49.8270351!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x8e490819e40b43d7!2sPerfect-Dent.%20NZOZ.%20Gabinet%20stomatologiczny.%20%C5%81odziana%20E.!5e0!3m2!1spl!2spl!4v1633505097373!5m2!1spl!2spl" width="100%" height="600" style="border:0;" allowfullscreen="" loading="lazy"></iframe>
	':'').'


	<div class="bottom">
		<div class="container">
        	<div class="menu">
				'.$X->T->menu_bottom().'
			</div>

			<div class="copy_cont">
				<a href="/"><img src="images/logo-bottom.png" alt="Perfect Dent Bielsko-Biała" /></a>


				<div class="copy">
					<span>
					  <span>ul. Legionów 27</span><br>
					  <span>43-300</span> <span>Bielsko-Biała</span><br>
					  <span>woj. śląskie</span><br>
					</span>
					tel. <span><a href="tel:338125869">33 812 58 69</a></span><br><br>
					Copyright ©2015 &nbsp;<b><span>PERFECT DENT</span></b><br>
					Wykonanie: &nbsp;<a href="https://digihex.pl/" target="_blank" rel="nofollow">DigiHex Systems</a>
				</div>


			</div>
			<div class="clr"></div>
		</div>
	</div>
</div>

'; //////////////////
/////////////////////


echo '<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge" /><![endif]-->
<title>'.$this->TITLE.'</title>
<meta name="keywords" content="'.$this->KEYWORDS.'" />
<meta name="description" content="'.$this->DESCRIPTION.'" />
<meta name="author" content="Tomasz Kwaśny, DigiHex Systems - digihex.pl" />
<meta name="viewport" content="width=640">
<base href="'.BASE.'" />
<script type="text/javascript">var SID="'.session_id().'";</script>
<!--[if lt IE 9]>
	<script src="'.JS.'/html5shiv.js"></script>
	<script src="'.JS.'/respond.min.js"></script>
<![endif]-->
'.$this->CODE['HEAD'].'
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&amp;subset=latin-ext,latin" rel="stylesheet" type="text/css" />
<meta name="robots" content="index,follow" />

<script type="application/ld+json">{"@context":"http://schema.org","@type":"Dentist","address":{"@type":"PostalAddress","addressLocality":"Bielsko-Biała","streetAddress":"Legionów 27","postalCode":"43-300","addressRegion":"śląskie"},"name":"NZOZ Perfect Dent","description":"Zabiegi z zakresu stomatologii zachowawczej i profilaktyki próchnicy, chirurgii, endodoncji oraz protetyki","slogan":"Leczenie zębów nie musi być bolesne!","openingHours":["Mo 08:00-20:00","Tu-We 14:00-20:00","Th-Fr 08:00-20:00"],"telephone":"338125869","vatID":"9371285817","image":"https://www.bielsko-dentysta.pl/images/logo.png","priceRange":"$$"}</script>

</head>

<body>

<script>
  (function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,"script","https://www.google-analytics.com/analytics.js","ga");

  ga("create", "UA-77120020-1", "auto");
  ga("send", "pageview");

</script>

'.$this->CODE['BODY'].'
'.$ENTIRE_BODY.'
';

//</body> in sys_end
	}
}
$CONTENT=new content();
?>