commit | author | age
|
175a52
|
1 |
<?php |
JK |
2 |
include('./includes/std.php'); |
|
3 |
|
|
4 |
validate::KOD($_GET['kod']); |
|
5 |
|
|
6 |
$title = 'Historia wypożyczeń książki'; |
|
7 |
include('./design/top.php'); |
|
8 |
|
|
9 |
$nastrone = 5; |
|
10 |
|
|
11 |
if(ctype_digit($_GET['strona'])) { |
|
12 |
$strona = $nastrone*($strona-1); |
|
13 |
} |
|
14 |
else |
|
15 |
{ |
|
16 |
$strona = 0; |
|
17 |
} |
|
18 |
|
|
19 |
gotowe::informacje($_GET['kod']); |
|
20 |
|
|
21 |
$num = db2::num('pozycz', '*', array('id' => $_GET['kod'])); |
|
22 |
$dane = db2::get('pozycz', '*', array('id' => $_GET['kod']), array('do' => 'DESC'), $strona, $nastrone); |
|
23 |
|
|
24 |
echo ' |
|
25 |
|
|
26 |
<table id="bhist"> |
|
27 |
<tr> <th>Pożyczający</th> <th>Od</th> <th>Do</th> </tr> |
|
28 |
'; |
|
29 |
|
|
30 |
foreach($dane as $o) { |
|
31 |
echo '<tr> <td>'.$o['kto'].'</td> <td>'.date('Y-m-d H:i:s', $o['od']).'</td> <td>'.($o['do'] ? date('Y-m-d H:i:s', $o['do']) : '').'</td> </tr>'."\n"; |
|
32 |
} |
|
33 |
|
|
34 |
echo '</table> |
|
35 |
|
|
36 |
<p>'; |
|
37 |
|
|
38 |
for($i=0; $i<$num; $i+=$nastrone) { |
|
39 |
$str = ($i/$nastrone)+1; |
|
40 |
if($i>=$strona && $i<$strona+$nastrone) |
|
41 |
echo '<b> [ '.$str.' ] </b> '; |
|
42 |
else |
|
43 |
echo '<a href="borrow_history.php?kod='.$_GET['kod'].'&strona='.$str.'"> [ '.$str.' ] </a> '; |
|
44 |
} |
|
45 |
|
|
46 |
|
|
47 |
include('./design/bottom.php'); |
|
48 |
?> |