This repository has been archived by the owner on Sep 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprodotti.php
55 lines (34 loc) · 2.14 KB
/
prodotti.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
require_once "includes/connection.php";
require_once "includes/utilities.php";
use DB\DBAccess;
$template = file_get_contents('layouts/layout.html');
$pageID = 'prodotti';
$title = "Prodotti - Pop Tech";
$breadcrumbs = '<p>Ti trovi in: <a href="index.php" lang="en">Home</a> > Prodotti</p> ';
$connection = new DBAccess;
$content = '<h1>I Nostri Prodotti</h1>';
if ($connection->open_connection()) {
$categories = $connection->exec_select_query('SELECT id, nome FROM categoria ORDER BY nome;');
$content .= '<div class="categoryList">';
foreach($categories as $category){
$content .= '<a href="#cat-'.$category['id'].'" class="button">'.parse_lang($category['nome']).'</a>';
}
$content .= '</div>';
foreach($categories as $category){
$content .= '<div class="comic_box" id="cat-'.$category['id'].'"><h2 class="categoryTitle">'.parse_lang($category['nome']).'</h2> <a href="categoria.php?id='.$category['id'].'" class="button" title="Vedi i prodotti in '.parse_lang($category['nome']).'">Vedi Tutti</a></div>';
$products = $connection->exec_select_query('SELECT id, nome, immagine, descrizione, origine, marca, modello, dimensione, peso, categoria, prezzo FROM prodotto WHERE categoria='.$category['id'].';');
$content .= '<div class="productsRow">';
foreach($products as $product){
$content .= get_product_tile($product);
}
$content .= "</div>";
}
$connection->close_connection();
}else{
$content .= getDBConnectionError();
}
$menu = get_menu();
$template = str_replace('{{menu}}',$menu,$template);
echo replace_in_page($template,$title,$pageID,$breadcrumbs,'fumetti, manga, action figures, giochi da tavolo, videogiochi, abbigliamento, abbigliamento gamer, gaming','Scopri i nostri prodotti dai Fumetti e i Manga ai Giochi da Tavolo, Videogiochi e molto altro ancora.',$content,'addScrollEventListener()');
?>