Hezci samolepky
[mirrors/SokoMan.git] / assistants / print-labels.inc.php
index b1978bad7be16e404aaccad802ac658db6a72f69..80f37eb09880f5f01e49416c4a1efd89236f7729 100644 (file)
@@ -1,6 +1,7 @@
 <?php
        if(isset($_POST['print'])) {
-               $prefix = time().'SPOJE';
+               $time = round(microtime(true)*100);
+               $prefix = 'SPOJE';
                $enctype = 'code128b';
                $geometry = '';
                $count = $_POST['cols']*$_POST['rows']*$_POST['pages'];
                );
 
                $barcodes = '';
-               for($i=0;$i<$count;$i++) $barcodes.=' -b '.escapeshellarg($prefix.$i);
+               for($i=0;$i<$count;$i++) $barcodes.=' -b '.escapeshellarg(strtoupper($prefix.base_convert($time+$i,10,36)));
 
                switch(strtolower($_POST['print'])) {
+                       case 'debug': case 'dbg':
+                               break;
                        case 'pdf':
                                $convert='| ps2pdf -dCompatibility=1.2 - -';
                                header('Content-Type: application/pdf');
@@ -25,7 +28,9 @@
                                break;
                }
                error_reporting(0);
-               system("barcode -e $enctype $geometry $table $barcodes $convert");
+               $cmd="barcode -e $enctype $geometry $table $barcodes $convert";
+               if($_POST['print']=='Debug') die($cmd);
+               system($cmd);
                die();
        }
 ?>
        <input type="number" name="rows" value="13" /> &varr; Řádků<br />
        <input type="number" name="pages" value="1" /> &crarr; Stran<br />
        <table>
-               <tr><td></td><td><input type="number" name="top" value="25" /></td><td></td></tr>
+               <tr><td></td><td><input type="number" name="top" value="20" /></td><td></td></tr>
                <tr><td><input type="number" name="left" value="2" /></td><td>Okraje</td><td><input type="number" name="right" value="1" /></td></tr>
-               <tr><td></td><td><input type="number" name="bottom" value="20" /></td><td></td></tr>
+               <tr><td></td><td><input type="number" name="bottom" value="25" /></td><td></td></tr>
        </table>
+       <input type="submit" name="print" value="Debug" />
        <input type="submit" name="print" value="PS" />
        <input type="submit" name="print" value="PDF" />
 </form>
+Pozor! Každý arch vytiskni jen jednou a radši ho hned po vytištění smaž!
This page took 0.139653 seconds and 4 git commands to generate.