forked from pawel-zawadzki/ibd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsidebar.php
59 lines (55 loc) · 2.14 KB
/
sidebar.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
56
57
58
59
<?php
use Ibd\Ksiazki;
$ksiazki = new Ksiazki();
$bestsellery = $ksiazki->pobierzBestsellery();
?>
<div class="col-md-3">
<?php if (empty($_SESSION['id_uzytkownika'])): ?>
<h1>Logowanie</h1>
<form method="post" action="logowanie.php">
<div class="form-group">
<label for="login">Login:</label>
<input type="text" id="login" name="login" class="form-control input-sm" />
</div>
<div class="form-group">
<label for="haslo">Hasło:</label>
<input type="password" id="haslo" name="haslo" class="form-control input-sm" />
</div>
<div class="form-group">
<button type="submit" name="zaloguj" id="submit" class="btn btn-primary btn-sm">Zaloguj się</button>
<a href="rejestracja.php" class="btn btn-link btn-sm">Zarejestruj się</a>
<input type="hidden" name="powrot" value="<?= basename($_SERVER['SCRIPT_NAME']) ?>" />
</div>
</form>
<?php else: ?>
<p class="text-right">
Zalogowany: <strong><?= $_SESSION['login'] ?></strong>
<a href="wyloguj.php" class="btn btn-secondary btn-sm">wyloguj się</a>
</p>
<?php endif; ?>
<h1>Koszyk</h1>
<p>
Suma wartości książek w koszyku:
<strong>0</strong> PLN
</p>
<h1>Bestsellery</h1>
<table class="table">
<?php foreach($bestsellery as $bs) : ?>
<tr>
<td>
<a href="ksiazki.szczegoly.php?id=<?= $bs['id'] ?>" title="szczegóły">
<?php if (!empty($bs['zdjecie'])) : ?>
<img src="zdjecia/<?= $bs['zdjecie'] ?>" alt="<?= $bs['tytul'] ?>" class="img-thumbnail" />
<?php else : ?>
brak zdjęcia
<?php endif; ?>
<h6><?=$bs['tytul']?></h6>
<?=$bs['imie']?>
<?=$bs['nazwisko']?>
</a>
</td>
</tr>
<?php endforeach;?>
</table>
</div>