Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define('ROOT', $_SERVER['DOCUMENT_ROOT']);
- require ROOT . '/lib/db.php';
- $categories = R::find('categories');
- ?>
- <!doctype html>
- <html lang="en">
- <head>
- <link rel="stylesheet" href="/css/style.css">
- <meta charset="UTF-8">
- <meta name="viewport"
- content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Document</title>
- </head>
- <body>
- <?php foreach ($categories
- as $category) {
- $products = R::find('products', 'category_id', array($category['id']));
- ?> <img src="/images/<?php echo $category['image']; ?>" width="200" height="200"> <?php
- foreach ($products
- as $product){
- ?>
- <table class="catalog">
- <thead>
- <tr>
- <th>Артикул</th>
- <th>Имя</th>
- <th>Описание</th>
- <th>Ед/измерения</th>
- <th>Количество</th>
- <th>Цена</th>
- </tr>
- </thead>
- <tbody>
- <tr id="5">
- <td><?php echo $product['name']; ?></td>
- <td>gg</td>
- <td>ff</td>
- <td>123</td>
- <td>66</td>
- <td>24</td>
- </tr>
- </tbody>
- <?php }
- } ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment