Created
March 22, 2013 19:37
-
-
Save valous/5224113 to your computer and use it in GitHub Desktop.
Vše
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Valenta David <[email protected]> | |
* @version 1.0.0 | |
* Web školních novin | |
*/ | |
/** | |
* function Autoload | |
* @version 1.0.0 | |
*/ | |
function AutoLoad($class) { | |
$file = "./class/" . $class . ".php"; | |
if(isset($class)) { | |
if(file_exists($file)) { | |
require_once $file; | |
} | |
} | |
} | |
/** | |
* Volání funkce AutoLoad | |
*/ | |
spl_autoload_register("AutoLoad"); | |
require_once './view/index.php'; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id='kontejner'> | |
<div id='pruh'> | |
</div> | |
<a href='/index.php'> | |
<div id='logo'> | |
</div> | |
</a> | |
<div id='pruh'> | |
</div> | |
<div id='navhore'> | |
<?php | |
$kontrola->instance("Menu"); | |
$kontrola->metoda("nactiPolozky","kategoriehore","1"); | |
$kontrola->metoda("posliPolozky","",""); | |
$kontrola->view("menuHorni"); | |
?> | |
</div> | |
<div id='rubrika'> | |
<h1>RUBRIKA</h1> | |
</div> | |
<div id='blok'> | |
<?php | |
?> | |
</div> | |
<div id='bok'> | |
<div id='bokneco'> | |
<h1>Pod-kategorie</h1> | |
</div> | |
<div id='boknecodole'> | |
<br /> | |
<?php | |
$kontrola->instance("Menu"); | |
$kontrola->metoda("nactiPolozky","kategorie","kde='" . $_GET['kategorie'] . "'"); | |
$kontrola->metoda("posliPolozky","",""); | |
$kontrola->view("menuBocni"); | |
?> | |
</div> | |
<div id='bokneco'> | |
<h1>Přihlášení</h1> | |
</div> | |
<div id='boknecodole'> | |
<?php | |
$login = new Log; | |
$login->form("login"); | |
?> | |
</div> | |
</div> | |
</div> | |
<div id='pata'> | |
<hr /> | |
<p><small> © Valenta David | 2013-2103 | Projekt: web školních novin</small></p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Třída Kontroleru!!! | |
* @version 1.0.0 | |
*/ | |
class Kontroler { | |
private $class; | |
private $metoda; | |
public function instance($class) { | |
$this->class = new $class(); | |
} | |
public function metoda($metoda,$param1,$param2) { | |
$this->metoda = $this->class->$metoda($param1,$param2); | |
} | |
public function view($sablona) { | |
require_once './view/sablony/' . $sablona . '.php'; | |
} | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* třída pro připojení k Mysql | |
* @version 1.0.0 | |
*/ | |
class mysql { | |
private $dotaz; | |
/** | |
* @var string server | |
*/ | |
private $server = "localhost"; | |
/** | |
* @var string login | |
*/ | |
private $login = "root"; | |
/** | |
* @var string pass | |
*/ | |
private $pass = ""; | |
/** | |
* @var string db | |
*/ | |
private $db = "casopis"; | |
/** | |
* Připojení k DB | |
*/ | |
public function __construct() { | |
mysql_connect($this->server, $this->login, $this->pass) or die(mysql_error()); | |
mysql_select_db($this->db) or die(mysql_error()); | |
} | |
/** | |
* SELECT z DB | |
*/ | |
public function select($from,$where) { | |
if(isset($where)) { | |
$this->dotaz = mysql_query("SELECT * FROM `$from` WHERE $where") or die(mysql_error()); | |
} else { | |
$this->dotaz = mysql_query("SELECT * FROM `$from`") or die(mysql_error()); | |
} | |
return $this->dotaz; | |
} | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="cs-cz"> | |
<head> | |
<title></title> | |
<meta charset="UTF-8" /> | |
<meta name="description" content="" /> | |
<meta name="keywords" content="" /> | |
<link rel='stylesheet' href='./view/css/css.css' type='text/css' /> | |
</head> | |
<body> | |
<?php | |
/** | |
* Include Hlavní šablony | |
*/ | |
$kontrola = new Kontroler(); | |
require_once 'indexes.php'; | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment