Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dsn = 'mysql:host=localhost;dbname=basvulk_basvulk';
- $username = 'root';
- $password = '';
- try {
- $db = new PDO($dsn, $username, $password);
- } catch (PDOException $e) {
- $error_message = $e->getMessage();
- echo 'error';
- include('../errors/database_error.php');
- exit();
- }
- function make_a_query($query_to_execute) {
- mysql_set_charset('UTF8');
- global $db;
- $db->exec('set names utf8');
- $query = $query_to_execute;
- $statement = $db->prepare($query);
- $statement->execute();
- $products = $statement->fetchAll();
- $statement->closeCursor();
- return $products;
- }
- global $prods;
- global $sub;
- $prods = make_a_query('SELECT * FROM categories WHERE type="vipal"');
- require_once 'src/siteEN/site_head.php';
- render_head('Вулканизационни материали');
- ?>
- <body class='products'>
- <nav>
- <div class="container">
- <a href="#">
- <img style="width:50px;height:50px" src="../assets/images/logo-bg.png">
- </a>
- <ul>
- <li>
- <a href="./../index.html">начало</a>
- </li>
- <li>
- <a href="./products.html">продукти</a>
- </li>
- <li class="dropdown">за нас ▼
- <ul>
- <li>
- <a href="./about.html">за фирмата</a>
- </li>
- <li>
- <a href="./partners.html">партньори</a>
- </li>
- <li>
- <a href="./events.html">новини</a>
- </li>
- </ul>
- </li>
- <li>
- <a href="./distributors.html">дистрибутори</a>
- </li>
- <li>
- <a href="./resources.html">ресурси</a>
- </li>
- <li>
- <a href="./catalogues.html">каталози</a>
- </li>
- </ul>
- <span class="nav-toggle">☰</span>
- </div>
- </nav>
- <header>
- <h1>Продукти</h1>
- </header>
- <div class="container">
- <?php foreach ($prods as $prod): ?>
- <?php $sub = make_a_query('SELECT * FROM products WHERE product_cat='.$prod['cat_id']); ?>
- <div class='detailed-product'>
- <h3><?php echo $prod['cat_name_bg'] ?></h3>
- <ul>
- <?php foreach ($sub as $subb) : ?>
- <li><?php echo $subb['product_name_bg'] ?>
- <?php echo $subb['product_desc_bg']; ?>
- <img src=<?php echo $subb['pic']; ?> >
- </li>
- <?php endforeach; ?>
- </ul>
- </div>
- <?php endforeach; ?>
- </div>
- <footer>
- <div class="container">
- <div class="row">
- <ul>
- <li>
- <a href="./../index.html">начало</a>
- </li>
- <li>
- <a href="./about.html">за нас</a>
- </li>
- <li>
- <a href="./partners.html">партньори</a>
- </li>
- <li>
- <a href="./events.html">новини</a>
- </li>
- </ul>
- <ul>
- <li>
- <a href="./distributors.html">дистрибутори</a>
- </li>
- <li>
- <a href="#">каталози</a>
- </li>
- <li>
- <a href="./resources.html">ресурси</a>
- </li>
- <li>
- <a href="./resources.html">Контакт</a>
- </li>
- </ul>
- <figure>
- <img src="../assets/images/logo-bg.png">
- <figcaption>
- <div class='address'>
- <span>ул Цар Освободител 86</span>
- <span>Кюстендил 2500, България</span>
- <span>Телефон/Факс: +359 78 52 61 01</span>
- <span>e-mail: info@basvulk.com</span>
- </div>
- </figcaption>
- </figure>
- <p class="rights">
- 2014 БАСВУЛК® Всички права запазени.
- </p>
- </div>
- </div>
- </footer>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement