master
flejk 3 years ago
parent a8dde111d7
commit 92eeb27bab

@ -1,6 +1,6 @@
<?php <?php
/*function listLatestBeers($pdo, $where){ function listLatestBeers($pdo, $where){
$conn = $pdo; $conn = $pdo;
try { try {
$sql = "SELECT * FROM beer ORDER BY time DESC LIMIT $where"; $sql = "SELECT * FROM beer ORDER BY time DESC LIMIT $where";
@ -26,7 +26,7 @@ function listLatestBreweries($pdo, $where){
echo "Error in Breweries: " . $e->getMessage(); echo "Error in Breweries: " . $e->getMessage();
} }
return $arrayOfBreweries; return $arrayOfBreweries;
}*/ }
function listLatestUsers($pdo, $where){ function listLatestUsers($pdo, $where){
$conn = $pdo; $conn = $pdo;

@ -0,0 +1,92 @@
<?php
session_start();
require("model/db.php");
require("controller/listLatest.php");
require("view/mainContent/userButtons.php");
print_r($_GET);
require("view/header.php");
require("view/sidebar.php");
echo "<div class=\"content\">";
if($_GET["type"]=="tag"){
$array=listBeersByTag($pdo, $tag);
}
if($_GET["type"]=="beer"){
$name=$_GET["keyword"];
$array=listBeersByName($pdo, $name);
foreach($arrayOfBeers as $row):
echo "
<div class=\"box\">
<article>
<a href=\"beer.php?id=";
echo $row["id"];
echo "\"><h2>";
echo $row["name"];
echo " ";
echo $row["degree"];
echo "˚</h2></a>";
echo "</br>";
echo "</article>
</div>";
endforeach;
}
if($_GET["type"]=="brewery"){
$name=$_GET["keyword"];
$array=listBreweryByName($pdo, $name);
}
if($_GET["type"]=="article"){
$name=$_GET["keyword"];
$array=listArticleByName($pdo, $name);
foreach($array as $row) :
echo "<div class=\"box\">";
echo "<article>";
echo "<a href=\"article.php?id=";
echo $row["id"];
echo "?>\" ><h2>";
echo $row['title'];
echo "?></h2></a>";
echo "Published on:<time pubdate=\"pubdate\">";
echo $row['time'];
echo "</time>";
echo "<p><em>";
echo substr($row['body'],0 ,120);
echo "...</em></p> ";
echo "<a/rticle>";
echo "</div>";
endforeach;
}
if($_GET["type"]=="all"){
$name=$_GET["keyword"];
$array=listArticleByName($pdo, $name);
foreach($array as $row) :
echo "<div class=\"box\">";
echo "<article>";
echo "<a href=\"article.php?id=";
echo $row["id"];
echo "?>\" ><h2>";
echo $row['title'];
echo "?></h2></a>";
echo "Published on:<time pubdate=\"pubdate\">";
echo $row['time'];
echo "</time>";
echo "<p><em>";
echo substr($row['body'],0 ,120);
echo "...</em></p> ";
echo "<a/rticle>";
echo "</div>";
endforeach;
$array=listBreweryByName($pdo, $name);
$array=listBeersByName($pdo, $name);
$array=listBeersByTag($pdo, $tag);
}
echo "</div>";
include("view/footer.php");*/

@ -1,93 +1,2 @@
<?php <?php
session_start(); header("location: index.php");
require("model/db.php");
require("controller/listLatest.php");
require("view/mainContent/userButtons.php");
print_r($_GET);
require("view/header.php");
require("view/sidebar.php");
echo "<div class=\"content\">";
if($_GET["type"]=="tag"){
$array=listBeersByTag($pdo, $tag);
}
if($_GET["type"]=="beer"){
$name=$_GET["keyword"];
$array=listBeersByName($pdo, $name);
foreach($arrayOfBeers as $row):
echo "
<div class=\"box\">
<article>
<a href=\"beer.php?id=";
echo $row["id"];
echo "\"><h2>";
echo $row["name"];
echo " ";
echo $row["degree"];
echo "˚</h2></a>";
echo "</br>";
echo "</article>
</div>";
endforeach;
}
if($_GET["type"]=="brewery"){
$name=$_GET["keyword"];
$array=listBreweryByName($pdo, $name);
}
if($_GET["type"]=="article"){
$name=$_GET["keyword"];
$array=listArticleByName($pdo, $name);
foreach($array as $row) :
echo "<div class=\"box\">";
echo "<article>";
echo "<a href=\"article.php?id=";
echo $row["id"];
echo "?>\" ><h2>";
echo $row['title'];
echo "?></h2></a>";
echo "Published on:<time pubdate=\"pubdate\">";
echo $row['time'];
echo "</time>";
echo "<p><em>";
echo substr($row['body'],0 ,120);
echo "...</em></p> ";
echo "<a/rticle>";
echo "</div>";
endforeach;
}
if($_GET["type"]=="all"){
$name=$_GET["keyword"];
$array=listArticleByName($pdo, $name);
foreach($array as $row) :
echo "<div class=\"box\">";
echo "<article>";
echo "<a href=\"article.php?id=";
echo $row["id"];
echo "?>\" ><h2>";
echo $row['title'];
echo "?></h2></a>";
echo "Published on:<time pubdate=\"pubdate\">";
echo $row['time'];
echo "</time>";
echo "<p><em>";
echo substr($row['body'],0 ,120);
echo "...</em></p> ";
echo "<a/rticle>";
echo "</div>";
endforeach;
$array=listBreweryByName($pdo, $name);
$array=listBeersByName($pdo, $name);
$array=listBeersByTag($pdo, $tag);
}
echo "</div>";
include("view/footer.php");
//header("location: index.php");

@ -1,21 +1,15 @@
<?php <?php
require("model/db.php"); require("model/db.php");
echo "kappa";
require("controller/listLatest.php");
echo "kappa";
?> ?>
<aside> <aside>
<?php <?php
$title = "Beers"; $title = "Beers";
$where = "5"; $where = "5";
$what = "beer"; $what = "beer";
$array = listBeersNAN($pdo); $array = listBeersNAN($pdo);
require("sidebar/sidebarLister.php") require("view/sidebar/sidebarLister.php")
?> ?>
@ -27,7 +21,7 @@ $what = "brewery";
$array = listBreweriesNAN( $pdo ); $array = listBreweriesNAN( $pdo );
require("sidebar/sidebarLister.php"); require("view/sidebar/sidebarLister.php");
?> ?>

Loading…
Cancel
Save