You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.3 KiB
PHTML

<?php
session_start();
require("model/db.php");
require("controller/listLatest.php");
require("view/mainContent/userButtons.php");
3 years ago
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");