Podgląd pliku: / books / borrow_history.php
<?php
/*****************************************************
* System biblioteczny *
*****************************************************
* Wersja: 1.3 Stable *
* Data: 17.06.2012 (15:07) *
* Autor: Jacek Kowalski (http://jacekk.info) *
* *
* Utwor rozprowadzany na licencji *
* http://creativecommons.org/licenses/by-nc-sa/2.5/ *
*****************************************************/
include('./includes/std.php');
validate::KOD($_GET['kod']);
$title = 'Historia wypożyczeń książki';
include('./design/top.php');
$nastrone = 5;
if(ctype_digit($_GET['strona'])) {
$strona = $nastrone*($strona-1);
}
else
{
$strona = 0;
}
gotowe::informacje($_GET['kod']);
$num = db2::num('pozycz', '*', array('id' => $_GET['kod']));
$dane = db2::get('pozycz', '*', array('id' => $_GET['kod']), array('do' => 'DESC'), $strona, $nastrone);
echo '
<table id="bhist">
<tr> <th>Pożyczający</th> <th>Od</th> <th>Do</th> </tr>
';
foreach($dane as $o) {
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";
}
echo '</table>
<p>';
for($i=0; $i<$num; $i+=$nastrone) {
$str = ($i/$nastrone)+1;
if($i>=$strona && $i<$strona+$nastrone)
echo '<b> [ '.$str.' ] </b> ';
else
echo '<a href="borrow_history.php?kod='.$_GET['kod'].'&strona='.$str.'"> [ '.$str.' ] </a> ';
}
include('./design/bottom.php');
?>
Browse Code © 2010 by Jacek Kowalski