-
Notifications
You must be signed in to change notification settings - Fork 0
/
seller.php
32 lines (32 loc) · 1.01 KB
/
seller.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
<?php
session_set_cookie_params(0, '/', 'localhost', false, true);
session_start();
require_once ('database/connection.php');
require_once ('database/items.php');
require_once('templates/common.php');
require_once('database/users.php');
require_once('templates/categories.php');
require_once('templates/transactions.php');
$db = getDatabaseConnection();
if (!isset($_SESSION['csrf'])) {
$_SESSION['csrf'] = generate_random_token();
}
$seller = $_GET['seller'];
$items = getItems($db);
$cats = getCategories($db);
output_header();
output_categories($db, $cats);
?>
<h1><?= getNameSeller($db, $seller) ?>'s profile</h1>
<aside id="random_items">
<?php foreach ($items as $item) {
if(getSeller($db, $item['id']) == $seller){
if (isItemForSale($db, htmlspecialchars($item['id']))) {
outputItem($db, $item);
}
}
} ?>
</aside>
<?php
output_footer();
?>