commit | author | age
|
175a52
|
1 |
<?php |
JK |
2 |
include('./includes/std.php'); |
|
3 |
|
|
4 |
require_once('includes/generate_html.php'); |
|
5 |
require_once('includes/generate_codabar.php'); |
|
6 |
|
|
7 |
foreach(explode("\n", $_POST['kody']) as $i) { |
|
8 |
$i = trim($i); |
|
9 |
|
|
10 |
if($i=='') { |
|
11 |
continue; |
|
12 |
} |
|
13 |
|
|
14 |
if(($pos=strpos($i, '-'))!==FALSE) { |
|
15 |
$from = trim(substr($i, 0, $pos)); |
|
16 |
$to = trim(substr($i, $pos+1)); |
|
17 |
|
|
18 |
validate::KOD($from); |
|
19 |
validate::KOD($to); |
|
20 |
|
|
21 |
for($from=(int)$from; $from<=$to; $from++) { |
|
22 |
$kody[] = $from; |
|
23 |
} |
|
24 |
} |
|
25 |
else |
|
26 |
{ |
|
27 |
validate::KOD($i); |
|
28 |
|
|
29 |
$kody[] = $i; |
|
30 |
} |
|
31 |
} |
|
32 |
|
|
33 |
echo GENERATE_STYLE; |
|
34 |
|
|
35 |
echo '<table cellspacing="0"> |
|
36 |
<tr>'; |
|
37 |
|
|
38 |
$column = 0; |
|
39 |
$row = 0; |
|
40 |
foreach($kody as $i) { |
|
41 |
while(true) { |
|
42 |
if(!$_POST['no_'.$row.'_'.$column]) { |
|
43 |
break; |
|
44 |
} |
|
45 |
else |
|
46 |
{ |
|
47 |
echo '<td></td>'; |
|
48 |
column($column, $row); |
|
49 |
continue; |
|
50 |
} |
|
51 |
} |
|
52 |
|
|
53 |
$kod = str_pad($i, 8, '0', STR_PAD_LEFT); |
|
54 |
|
|
55 |
echo '<td style="padding-left: '.margin($column%4).'mm;"> |
|
56 |
<img src="data:image/gif;base64,'.base64_encode(kod($kod)).'" alt=""><br>'.$kod.' |
|
57 |
</td> |
|
58 |
'; |
|
59 |
|
|
60 |
column($column, $row); |
|
61 |
} |
|
62 |
|
|
63 |
while($row != 10 OR $column != 3) { |
|
64 |
echo '<td></td>'; |
|
65 |
column($column, $row); |
|
66 |
} |
|
67 |
|
|
68 |
column($column, $row); |
|
69 |
|
|
70 |
echo GENERATE_END; |
|
71 |
?> |