Class index PDO
- Szczegóły
- Kategoria: PDO
- Opublikowano: środa, 03, lipiec 2013 20:42
- Super User
- Odsłony: 58440
Plik index.php podzieliłem na części, a wygląd importuje z folderu template.
index.php by Adam Berger is licensed under a Creative Commons Uznanie autorstwa-Użycie niekomercyjne-Bez utworów zależnych 3.0 Unported License.
W oparciu o utwór dostępny pod adresem www.joomla-cms.com.pl
index.php
session_start();
echo '<!doctype html>
<html lang="pl"><head>';
$czas_start = (float)microtime();
include_once (dirname(__FILE__) . '/'.basename('router.php'));
?>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head><body>
<div class="gora">
<?php
try
{
if(!empty($_POST['login']))
{
$userDane = $user->zaloguj($_POST['login'], $_POST['pass']);
}
if($session->sprawdzsesje() == true)
{
?>
<header id="header">
<div id="logo">
<h3><a href="#">Logo naszej strony</a></h3>
</div>
<nav id="menu">
<?php
include_once (dirname(__FILE__) . '/template/'.basename('menu.php'));
?>
</nav>
</header>
<?php
if($user->admin() == true)
{echo "Witaj Adminie<br/>";}
echo "Witaj ". $user->user();
?>
<section style="margin-left:0px;">
<?php
include_once $url->url();
</section>
<?php
}else{
?>
<header>
<nav id="menu">
<div style="list-style: none;">
<span><a href="/<?php echo htmlentities(addslashes($url->adres(1)),ENT_QUOTES,'UTF-8'); ?>" target="">Start</a></span>
<span><a href="/<?php echo htmlentities(addslashes($url->adres(10)),ENT_QUOTES,'UTF-8'); ?>" target="">Chat Publiczny</a></span>
<span><a href="/<?php echo htmlentities(addslashes($url->adres(2)),ENT_QUOTES,'UTF-8'); ?>" target="">Faq</a></span>
<span><a href="/<?php echo htmlentities(addslashes($url->adres(3)),ENT_QUOTES,'UTF-8'); ?>" target="">Regulamin</a></span>
</div>
</nav>
<div class="zaloguj">
<?php
include_once (dirname(__FILE__) . '/pliki/'.basename('zaloguj.php'));
?>
</div>
</header>
<section class="content" id="">
<article class="body_srod">
<?php
include_once $url->url();
?>
</article>
</section>
<?php
}
}
catch(Exception $e)
{
echo 'Połączenie nie mogło zostać : ' . $e->getMessage();
}
?>
<div style="clear: both; height: 1px;"></div>
<section><div id="stopka_dol">
<?php
include_once (dirname(__FILE__) . '/template/'.basename('dol.php'));
?>
</div></section>
</body>
</html>