From f84915fbde3aeaad125bb48821bbb5f70a68224b Mon Sep 17 00:00:00 2001 From: Jacek Kowalski <Jacek@jacekk.info> Date: Fri, 22 Mar 2013 20:15:39 +0000 Subject: [PATCH] Poprawka błędnego zapytania przy wyszukiwaniu książek z MATCH ... AGAINST ... --- includes/gotowe.php | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/includes/gotowe.php b/includes/gotowe.php index 5b66686..b81299c 100644 --- a/includes/gotowe.php +++ b/includes/gotowe.php @@ -112,6 +112,26 @@ return $ord; } + static function historia($kod) { + $st = PDOO::Singleton()->prepare( + 'SELECT * FROM pozycz_historia WHERE id=?'."\n" + .'UNION'."\n" + .'SELECT *, \'\' AS do FROM pozycz WHERE id=? ORDER BY od ASC' + ); + $st->execute(array($kod, $kod)); + $dane = $st->fetchAll(); + + $info = '<table id="bhist"> +<tr> <th>Pożyczający</th> <th>Od</th> <th>Do</th> </tr> +'; + + foreach($dane as $o) { + $info .= '<tr> <td>'.htmlspecialchars($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 $info.'</table>'; + } + static function informacje($kod, $dane=NULL) { if(is_null($dane)) { $dane = ksiazki::szukaj_KOD($kod); -- Gitblit v1.9.1