Example #1
0
 function szukaj_ISBN($kod)
 {
     YAZ::connect($this->yaz_server);
     YAZ::search(self::zapytanie_info($kod));
     if (substr($kod, 0, 3) == '978') {
         YAZ::search(self::zapytanie_info(convert::ISBN13_to_ISBN10($kod)));
     }
     return YAZ::return_arrays();
 }
Example #2
0
 static function znajdz($KOD, $ISBN, $dir = 'covers')
 {
     if (strlen($KOD) <= 8 && ctype_digit($KOD)) {
         validate::KOD($KOD);
         if (file_exists('./' . $dir . '/own/' . $KOD)) {
             return './' . $dir . '/own/' . $KOD;
         }
     }
     if (strlen($ISBN) == 13) {
         validate::EAN($ISBN);
         if (substr($ISBN, 0, 3) == '978') {
             $ISBN10 = convert::ISBN13_to_ISBN10($ISBN);
         } else {
             $ISBN10 = $ISBN;
         }
         if (file_exists('./' . $dir . '/own/' . $ISBN)) {
             return './' . $dir . '/own/' . $ISBN;
         }
         if (self::librarything($ISBN, $dir) !== FALSE) {
             return './' . $dir . '/' . $ISBN;
         }
     }
     return FALSE;
 }
Example #3
0
    static function informacje($kod, $dane = NULL)
    {
        if (is_null($dane)) {
            $dane = ksiazki::szukaj_KOD($kod);
        }
        if ($dane['wycofana']) {
            $class = 'wyc';
            $info = '<p>Książka wycofana' . ($dane['powod'] ? ' <br /> ' . $dane['powod'] : '') . '</p>';
        } else {
            if (!pozycz::pozyczona($dane['id'])) {
                $class = 'norm';
                $info = '

<fieldset>
<legend>Wypożyczanie</legend>
<p>Książka w bibliotece</p>
<form action="borrow_book.php" method="post" onsubmit="return ffalse(\'step1\')">
<p>Pożycz <input type="text" name="kod" value="' . $dane['id'] . '" readonly="readonly" /><br />
Komu? <input type="text" name="kto" id="step11" required="required" /></p>
<p><input type="submit" value="Pożycz" /></p>

<script type="text/javascript">
document.getElementById(\'step11\').focus();
</script>
</form>
</fieldset>

';
            } else {
                $class = 'poz';
                $info = '

<fieldset>
<legend>Wypożyczanie</legend>
<p>Wypożyczył(a) ' . $dane['kto'] . ' w dniu ' . date('d.m.Y', $dane['od']) . '</p>

<form action="borrow_back.php" method="post">
<p><input type="hidden" name="kod" value="' . $dane['id'] . '" /> <input type="submit" value="Zwrot"  id="step11" /></p>

<script type="text/javascript">
document.getElementById(\'step11\').focus();
</script>
</form>
</fieldset>

';
            }
        }
        // Okładka
        $cover = ksiazki::okladka($dane['id'], $dane['ISBN']);
        echo '<div class="' . $class . '" id="book">
' . ($cover ? '<a href="cover.php?KOD=' . $dane['id'] . '&amp;ISBN=' . $dane['ISBN'] . '"><img src="' . $cover . '" alt="Okładka" /></a>
' : '') . '<h4>' . $dane['tytul'] . '</h4>
<h5>' . $dane['autor'] . ($dane['regal'] ? ' <span>(' . $dane['regal'] . ($dane['polka'] ? '/' . $dane['polka'] : '') . ($dane['rzad'] ? '/' . $dane['rzad'] : '') . ')</span>' : '') . '</h5>
' . ($dane['wydanie'] ? '<p>Wydanie ' . $dane['wydanie'] . '</p>' : '') . '
<p>' . ($dane['wydawnictwo'] ? $dane['wydawnictwo'] . '<br />
' : '') . $dane['miejsce'] . ' ' . $dane['rok'] . ($dane['ISBN'] ? '<br />
ISBN-13: ' . $dane['ISBN'] : '') . (substr($dane['ISBN'], 0, 3) == '978' ? '<br />
ISBN-10: ' . convert::ISBN13_to_ISBN10($dane['ISBN']) : '') . ($dane['ISSN'] ? '<br />
ISSN-13: ' . $dane['ISSN'] . '<br />
ISSN-10: ' . convert::ISSN13_to_ISSN8($dane['ISSN']) : '') . '</p>
' . $info . '
<form action="edit.php" method="get" style="float:left;">
<p><input type="hidden" name="kod" value="' . $dane['id'] . '" /> <input type="submit" value="Edytuj" /></p>
</form>

<form action="del.php" method="get" style="float:left;">
<p><input type="hidden" name="kod" value="' . $dane['id'] . '" /> <input type="submit" value="Usuń" /></p>
</form>
' . ($dane['od'] ? '
<form action="borrow_history.php" method="get" style="float:right;">
<p><input type="hidden" name="kod" value="' . $dane['id'] . '" /> <input type="submit" value="Historia wypożyczeń" /></p>
</form>' : '') . '
</div>';
    }