diff --git a/controller/listLatest.php b/controller/listLatest.php index 6f332da..ba9e458 100644 --- a/controller/listLatest.php +++ b/controller/listLatest.php @@ -1,6 +1,6 @@ getMessage(); } return $arrayOfBreweries; -}*/ +} function listLatestUsers($pdo, $where){ $conn = $pdo; diff --git a/search.bak b/search.bak new file mode 100644 index 0000000..4a4441c --- /dev/null +++ b/search.bak @@ -0,0 +1,92 @@ +"; + +if($_GET["type"]=="tag"){ + $array=listBeersByTag($pdo, $tag); +} +if($_GET["type"]=="beer"){ + $name=$_GET["keyword"]; + $array=listBeersByName($pdo, $name); + foreach($arrayOfBeers as $row): + echo " +
+
+

"; + echo $row["name"]; + echo " "; + echo $row["degree"]; + echo "˚

"; + echo "
"; + echo "
+
"; + 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 "
"; + echo "
"; + echo "\" >

"; + echo $row['title']; + echo "?>

"; + echo "Published on:"; + echo "

"; + echo substr($row['body'],0 ,120); + echo "...

"; + echo ""; + echo "
"; + endforeach; +} +if($_GET["type"]=="all"){ + $name=$_GET["keyword"]; + $array=listArticleByName($pdo, $name); + foreach($array as $row) : + echo "
"; + echo "
"; + echo "\" >

"; + echo $row['title']; + echo "?>

"; + echo "Published on:"; + echo "

"; + echo substr($row['body'],0 ,120); + echo "...

"; + echo ""; + echo "
"; + endforeach; + + $array=listBreweryByName($pdo, $name); + + $array=listBeersByName($pdo, $name); + + $array=listBeersByTag($pdo, $tag); +} + + +echo ""; +include("view/footer.php");*/ \ No newline at end of file diff --git a/search.php b/search.php index 2d2aa33..87664e9 100755 --- a/search.php +++ b/search.php @@ -1,93 +1,2 @@ "; - -if($_GET["type"]=="tag"){ - $array=listBeersByTag($pdo, $tag); -} -if($_GET["type"]=="beer"){ - $name=$_GET["keyword"]; - $array=listBeersByName($pdo, $name); - foreach($arrayOfBeers as $row): - echo " -
-
-

"; - echo $row["name"]; - echo " "; - echo $row["degree"]; - echo "˚

"; - echo "
"; - echo "
-
"; - 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 "
"; - echo "
"; - echo "\" >

"; - echo $row['title']; - echo "?>

"; - echo "Published on:"; - echo "

"; - echo substr($row['body'],0 ,120); - echo "...

"; - echo ""; - echo "
"; - endforeach; -} -if($_GET["type"]=="all"){ - $name=$_GET["keyword"]; - $array=listArticleByName($pdo, $name); - foreach($array as $row) : - echo "
"; - echo "
"; - echo "\" >

"; - echo $row['title']; - echo "?>

"; - echo "Published on:"; - echo "

"; - echo substr($row['body'],0 ,120); - echo "...

"; - echo ""; - echo "
"; - endforeach; - - $array=listBreweryByName($pdo, $name); - - $array=listBeersByName($pdo, $name); - - $array=listBeersByTag($pdo, $tag); -} - - -echo ""; -include("view/footer.php"); -//header("location: index.php"); \ No newline at end of file +header("location: index.php"); diff --git a/view/sidebar.php b/view/sidebar.php index 9fa6df7..ce31c48 100755 --- a/view/sidebar.php +++ b/view/sidebar.php @@ -1,21 +1,15 @@ - -