commit | author | age
|
85c65e
|
1 |
<?php |
JK |
2 |
$title = 'Inwentaryzacja - zakończenie'; |
|
3 |
include('design/top.php'); |
|
4 |
|
|
5 |
require('../includes/config.php'); |
|
6 |
require('../includes/PDOO.php'); |
|
7 |
$PDO = PDOO::Singleton(); |
|
8 |
?> |
|
9 |
|
|
10 |
<h3>Krok 3 z 3: Zakończenie inwentaryzacji</h3> |
|
11 |
|
|
12 |
<p>Wykonano następujące operacje:</p> |
|
13 |
|
|
14 |
<ul> |
|
15 |
<?php |
|
16 |
$st = $PDO->prepare('UPDATE ksiazki SET regal=?, polka=?, rzad=? WHERE id=?'); |
|
17 |
foreach($_POST['move'] as $id => $placed) { |
|
18 |
if(strlen($placed) == 0) continue; |
|
19 |
|
|
20 |
$place = explode('/', $placed, 3); |
|
21 |
if($place[2] == '') { |
|
22 |
$place[2] = NULL; |
|
23 |
if($place[1] == '') { |
|
24 |
$place[1] = NULL; |
|
25 |
if($place[0] == '') { |
|
26 |
$place[0] = NULL; |
|
27 |
} |
|
28 |
} |
|
29 |
} |
|
30 |
|
|
31 |
echo '<li>Zmiana miejsca '.$id.' na '.htmlspecialchars($placed).'</li>'."\n"; |
|
32 |
$st->execute(array($place[0], $place[1], $place[2], $id)); |
|
33 |
} |
|
34 |
|
|
35 |
$date = date('d.m.Y H:i'); |
|
36 |
$st = $PDO->prepare('UPDATE ksiazki SET wycofana=\'1\', powod=\'Inwentaryzacja '.$date.'\' WHERE id=?'); |
|
37 |
|
|
38 |
foreach($_POST['repulse'] as $id => $placed) { |
|
39 |
if(!$placed) continue; |
|
40 |
|
|
41 |
echo '<li>Wycofanie '.$id.'</li>'."\n"; |
|
42 |
$st->execute(array($id)); |
|
43 |
} |
|
44 |
|
|
45 |
echo '<li>Usunięcie listy książek do inwentaryzacji</li>'."\n"; |
|
46 |
unlink('list.xml'); |
|
47 |
?> |
|
48 |
</ul> |
|
49 |
|
|
50 |
<?php |
|
51 |
include('design/bottom.php'); |
|
52 |
?> |