kind of everything, lets be real
parent
4150b74666
commit
147a41aa0c
@ -1 +0,0 @@
|
|||||||
<?php include("view/footer.php"); ?>
|
|
@ -1 +0,0 @@
|
|||||||
<?php include("view/footer.php"); ?>
|
|
@ -1 +0,0 @@
|
|||||||
<?php include("view/footer.php"); ?>
|
|
@ -1 +0,0 @@
|
|||||||
<?php include("view/footer.php"); ?>
|
|
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
require_once("model/db.php");
|
||||||
|
require_once("controller/getRecord.php");
|
||||||
|
|
||||||
|
require("view/header.php");
|
||||||
|
|
||||||
|
$record = getRecord($pdo, "article", $_GET["id"] );
|
||||||
|
$title = $record["title"];
|
||||||
|
$description = $record["body"];
|
||||||
|
$date = $record["time"];
|
||||||
|
|
||||||
|
|
||||||
|
require("view/mainContent/mainContent.php");
|
||||||
|
|
||||||
|
require("view/sidebar.php");
|
||||||
|
|
||||||
|
include("view/footer.php");
|
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
require_once("model/db.php");
|
||||||
|
require_once("controller/getRecord.php");
|
||||||
|
|
||||||
|
require("view/header.php");
|
||||||
|
|
||||||
|
$record = getRecord($pdo, "beer", $_GET["id"] );
|
||||||
|
$title = $record["name"];
|
||||||
|
$alc = $record["alc"];
|
||||||
|
$ibu = $record["ibu"];
|
||||||
|
$description = $record["description"];
|
||||||
|
$brewery_id = $record["brewery_id"];
|
||||||
|
$date = $record["time"];
|
||||||
|
|
||||||
|
|
||||||
|
require("view/mainContent/mainContent.php");
|
||||||
|
|
||||||
|
require("view/sidebar.php");
|
||||||
|
|
||||||
|
include("view/footer.php");
|
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
require_once("model/db.php");
|
||||||
|
require_once("controller/getRecord.php");
|
||||||
|
|
||||||
|
require("view/header.php");
|
||||||
|
|
||||||
|
$record = getRecord($pdo, "brewery", $_GET["id"] );
|
||||||
|
$title = $record["name"];
|
||||||
|
$description = $record["description"];
|
||||||
|
$date = $record["time"];
|
||||||
|
$region = $record["region"];
|
||||||
|
|
||||||
|
|
||||||
|
require("view/mainContent/mainContent.php");
|
||||||
|
|
||||||
|
|
||||||
|
require("view/sidebar.php");
|
||||||
|
|
||||||
|
include("view/footer.php");
|
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
function getRecord($pdo, $from, $where ){
|
||||||
|
$conn = $pdo;
|
||||||
|
try {
|
||||||
|
$sql = "SELECT * FROM $from WHERE id = $where";
|
||||||
|
$stmt = $conn->prepare($sql);
|
||||||
|
$stmt->execute();
|
||||||
|
$result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
|
||||||
|
$record = $stmt->fetch();
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
echo "Error in $from: Not Found";
|
||||||
|
}
|
||||||
|
return $record;
|
||||||
|
}
|
@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
function listLatestBeers($pdo, $where){
|
||||||
|
$conn = $pdo;
|
||||||
|
try {
|
||||||
|
$sql = "SELECT * FROM beer ORDER BY time DESC LIMIT $where";
|
||||||
|
$stmt = $conn->prepare($sql);
|
||||||
|
$stmt->execute();
|
||||||
|
$result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
|
||||||
|
$arrayOfBeers = $stmt->fetchAll();
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
echo "Error in Beers: " . $e->getMessage();
|
||||||
|
}
|
||||||
|
return $arrayOfBeers;
|
||||||
|
}
|
||||||
|
|
||||||
|
function listLatestBreweries($pdo, $where){
|
||||||
|
$conn = $pdo;
|
||||||
|
try {
|
||||||
|
$sql = "SELECT * FROM brewery ORDER BY time DESC LIMIT $where";
|
||||||
|
$stmt = $conn->prepare($sql);
|
||||||
|
$stmt->execute();
|
||||||
|
$result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
|
||||||
|
$arrayOfBreweries = $stmt->fetchAll();
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
echo "Error in Breweries: " . $e->getMessage();
|
||||||
|
}
|
||||||
|
return $arrayOfBreweries;
|
||||||
|
}
|
||||||
|
|
||||||
|
function listLatestUsers($pdo, $where){
|
||||||
|
$conn = $pdo;
|
||||||
|
try {
|
||||||
|
|
||||||
|
$stmt = $conn->prepare("SELECT * FROM user ORDER BY time DESC LIMIT $where");
|
||||||
|
$stmt->execute();
|
||||||
|
$result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
|
||||||
|
$arrayOfBreweries = $stmt->fetchAll();
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
echo "Error in Beers: " . $e->getMessage();
|
||||||
|
}
|
||||||
|
return $arrayOfUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
function listLatestArticle($pdo, $where){
|
||||||
|
$conn = $pdo;
|
||||||
|
try {
|
||||||
|
|
||||||
|
$stmt = $conn->prepare("SELECT * FROM article ORDER BY time DESC LIMIT $where");
|
||||||
|
$stmt->execute();
|
||||||
|
$result = $stmt->setFetchMode(PDO::FETCH_ASSOC);
|
||||||
|
$arrayOfArticles = $stmt->fetchAll();
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
echo "Error in Beers: " . $e->getMessage();
|
||||||
|
}
|
||||||
|
return $arrayOfArticles;
|
||||||
|
}
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if(isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true){
|
||||||
|
require("view/header.php");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
require("view/sidebar.php");
|
||||||
|
include("view/footer.php");
|
||||||
|
} else {
|
||||||
|
header("location: index.php");
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
header("location: index.php");
|
@ -1,22 +0,0 @@
|
|||||||
<div class="content">
|
|
||||||
<div class="box">
|
|
||||||
<article>
|
|
||||||
<h2>News - Lorem Ipsum!</h2> <time pubdate="pubdate"> 07-02-2022 </time>
|
|
||||||
<p><em> This is a placeholder for news </em></p>
|
|
||||||
</article>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="box">
|
|
||||||
<article>
|
|
||||||
<h2>Why do we use it?</h2> <time pubdate="pubdate"> 07-02-2022 </time>
|
|
||||||
<p><em>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</em></p>
|
|
||||||
</article>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="box">
|
|
||||||
<article>
|
|
||||||
<h2>Where does it come from?</h2> <time pubdate="pubdate"> 07-02-2022 </time>
|
|
||||||
<p><em>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.</em></p>
|
|
||||||
</article>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -0,0 +1,9 @@
|
|||||||
|
<div class="content">
|
||||||
|
<div class="box">
|
||||||
|
<article>
|
||||||
|
<h2><?= $title ?></h2>
|
||||||
|
<em>In our database from:</em><time pubdate="pubdate"> <?= $date ?> </time>
|
||||||
|
<p><?= $description ?></p>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
require_once("model/db.php");
|
||||||
|
require_once("controller/listLatest.php");
|
||||||
|
?>
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$where = "5";
|
||||||
|
$what = "article";
|
||||||
|
$array = listLatestArticle($pdo, $where);
|
||||||
|
|
||||||
|
?>
|
||||||
|
<h2>NEWS:</h2>
|
||||||
|
<?php foreach($array as $row) : ?>
|
||||||
|
<div class="box">
|
||||||
|
<article>
|
||||||
|
<a href="<?= $what ?>.php?id=<?= $row['id'] ?>" ><h2><?= $row['title'] ?></h2></a> Published on:<time pubdate="pubdate"> <?= $row['time'] ?> </time>
|
||||||
|
<p><em> <?= substr($row['body'],0 ,120) ?>...</em></p>
|
||||||
|
</article>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
@ -0,0 +1,22 @@
|
|||||||
|
<nav>
|
||||||
|
<div>
|
||||||
|
<form id="nigol" method="post" action="verify.php" class="menu">
|
||||||
|
<input id="prihlasovaciJmeno" name="prihlasovaciJmeno" type="text" placeholder="Nickname" size="22" >
|
||||||
|
<input id="prihlasovaciHeslo" name="prihlasovaciHeslo" type="password" placeholder="Passphrase" size="22" >
|
||||||
|
<input id="SearchButton" type="image" alt="Enter !" src="src/key-ico.png">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="login"> //Honeypot
|
||||||
|
<form id="login" method="post" action="verify.php" class="login">
|
||||||
|
<input name="user" type="text" placeholder="Username" size="22" >
|
||||||
|
<input name="password" type="password" placeholder="Password" size="22" >
|
||||||
|
<input id="loginButton" type="image" alt="Enter !" src="src/key-ico.png">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<?php
|
||||||
|
if(isset($_SESSION["wrongCr"]) && $_SESSION["wrongCr"] === true){
|
||||||
|
echo '<script>alert("Wrong Credentials")</script>';
|
||||||
|
$_SESSION["wrongCr"] = false;
|
||||||
|
}
|
||||||
|
?>
|
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
?>
|
||||||
|
<nav>
|
||||||
|
<div class="profile">
|
||||||
|
<div class="slice">
|
||||||
|
<ul>
|
||||||
|
<li>Yo, <b><?php echo htmlspecialchars($_SESSION["username"]); ?></b>! Another one on the tab?</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="slice">
|
||||||
|
<ul>
|
||||||
|
<li><a href="myList.php" >Beer List of Mine</a></li>
|
||||||
|
<li><a href="passChange.php" >Reset Your Password</a></li>
|
||||||
|
<li><a href="logout.php" >Log out.</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</nav>
|
@ -1,26 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
require_once("model/db.php");
|
||||||
|
require_once("controller/listLatest.php");
|
||||||
|
?>
|
||||||
|
|
||||||
<aside>
|
<aside>
|
||||||
|
|
||||||
<div>
|
<?php
|
||||||
<h3>New Beers</h3>
|
|
||||||
<ul>
|
$title = "LATEST Beers";
|
||||||
<li><a href="BLM/article.php">Zichovec</a></li>
|
$where = "5";
|
||||||
<li>Matuska</li>
|
$what = "beer";
|
||||||
<li>Siberia</li>
|
$array = listLatestBeers($pdo, $where);
|
||||||
<li>Cestmir</li>
|
|
||||||
<li>Pilsner</li>
|
require("sidebar/sidebarLister.php")
|
||||||
</ul>
|
|
||||||
</div>
|
?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
<div>
|
$title = "LATEST Breweries";
|
||||||
<h3>New Breweries</h3>
|
$where = "5";
|
||||||
<ul>
|
$what = "brewery";
|
||||||
<li>Zichovec</li>
|
|
||||||
<li>Matuska</li>
|
$array = listLatestBreweries($pdo, $where);
|
||||||
<li>Siberia</li>
|
|
||||||
<li>Cestmir</li>
|
require("sidebar/sidebarLister.php");
|
||||||
<li>Pilsner</li>
|
|
||||||
</ul>
|
?>
|
||||||
</div>
|
|
||||||
</aside>
|
</aside>
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h3><?= $title ?></h3>
|
||||||
|
<ul>
|
||||||
|
<?php foreach($array as $row) : ?>
|
||||||
|
<li><a href="<?= $what ?>.php?id=<?= $row['id'] ?>">--> <?= $row['name'] ?></a></li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
Loading…
Reference in New Issue