| | |
| | | <?php |
| | | $title = 'Inwentaryzacja - rozpoczęcie'; |
| | | include('design/top.php'); |
| | | include('../includes/config.php'); |
| | | include('../includes/db2.php'); |
| | | |
| | | require('../includes/config.php'); |
| | | require('../includes/PDOO.php'); |
| | | |
| | | try { |
| | | $fields = array('tytul', 'autor', 'miejsce', 'rok', 'wydawnictwo'); |
| | | |
| | | $data = sql::query('SELECT * FROM `ksiazki` WHERE `wycofana`=\'0\' ORDER BY `regal` ASC, `polka` ASC, `rzad` ASC'); |
| | | $PDO = PDOO::Singleton(); |
| | | |
| | | $st = $PDO->query('SELECT * FROM `ksiazki` WHERE `wycofana`=\'0\' ORDER BY `regal` ASC, `polka` ASC, `rzad` ASC'); |
| | | |
| | | $fp = fopen('list.xml', 'w'); |
| | | if($fp === FALSE) { |
| | | throw new Exception('Otwarcie pliku inwentaryzacja/list.xml nie powiodło się.'); |
| | | } |
| | | |
| | | fwrite($fp, '<?xml version="1.0" encoding="utf-8" ?> |
| | | <!DOCTYPE inwentaryzacja [ |
| | | <!ENTITY % quot """> |
| | |
| | | |
| | | $lastplace = NULL; |
| | | |
| | | while( ($entry = sql::fetchone($data)) !== FALSE ) { |
| | | while($entry = $st->fetch()) { |
| | | if($lastplace != $entry['regal'].'/'.$entry['polka'].'/'.$entry['rzad']) { |
| | | if($lastplace !== NULL) { |
| | | fwrite($fp, '</lokalizacja>'."\n"); |
| | |
| | | </form> |
| | | |
| | | <?php |
| | | } |
| | | catch(Exception $e) { |
| | | echo '<p style="color:red">Wystąpił błąd: '.$e->getMessage().'</p>'; |
| | | } |
| | | |
| | | include('design/bottom.php'); |
| | | ?> |