Alfaverze GUI na tisk štítků
authorThomas Mudrunka <tomas@mudrunka.cz>
Fri, 14 Jun 2013 22:15:19 +0000 (00:15 +0200)
committerThomas Mudrunka <tomas@mudrunka.cz>
Fri, 14 Jun 2013 22:15:19 +0000 (00:15 +0200)
assistants/print-labels.inc.php [new file with mode: 0644]
locale/cs/messages.inc.php

diff --git a/assistants/print-labels.inc.php b/assistants/print-labels.inc.php
new file mode 100644 (file)
index 0000000..d2c6d46
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+       if(isset($_POST['print'])) {
+               $prefix = time().'SPOJE';
+               $enctype = 'code128b';
+               $geometry = '';
+               $count = $_POST['cols']*$_POST['rows']*$_POST['pages'];
+
+               $table = '-p A4 -t '.escapeshellarg(
+                       $_POST['cols'].'x'.$_POST['rows'].
+                       '+'.$_POST['left'].'+'.$_POST['bottom'].'-'.$_POST['right'].'-'.$_POST['top']
+               );
+
+               $barcodes = '';
+               for($i=0;$i<$count;$i++) $barcodes.=' -b '.escapeshellarg($prefix.$i);
+
+               switch($_POST['print']) {
+                       case 'pdf':
+                               $convert='| convert - pdf:-';
+                               header('Content-Type: application/pdf');
+                               break;
+                       default: case 'ps':
+                               $convert='';
+                               header('Content-Type: application/postscript');
+                               header("Content-Disposition: attachment; filename=labels.ps");
+                               break;
+               }
+               error_reporting(0);
+               system("barcode -e $enctype $geometry $table $barcodes $convert");
+               die();
+       }
+?>
+<form action="?" method="POST">
+       <input type="number" name="cols" value="3" /> Sloupců<br />
+       <input type="number" name="rows" value="8" /> Řádků<br />
+       <input type="number" name="pages" value="1" /> Stran<br />
+       <table>
+               <tr><td></td><td><input type="number" name="top" value="0" /></td><td></td></tr>
+               <tr><td><input type="number" name="left" value="10" /></td><td>Okraje</td><td><input type="number" name="right" value="10" /></td></tr>
+               <tr><td></td><td><input type="number" name="bottom" value="0" /></td><td></td></tr>
+       </table>
+       <input type="submit" name="print" value="ps" />
+       <input type="submit" name="print" value="pdf" />
+</form>
index 94e86f40f925718d5f2d6e354293a406dd400c02..6c0d5a2b74fd3750cc2837a1daca29e3957ba5a3 100644 (file)
@@ -115,6 +115,7 @@ $LOCALE_MESSAGES = array(
                'stats' => 'statistiky',
                'roster' => 'inventurní soupiska',
                'set-margin' => 'nastavit přirážku',
+               'print-labels' => 'tisknout štítky',
                'store' => 'naskladnit',
                'store-single' => 'pridat model a naskladnit',
                'category-tree' => 'strom kategorií',
This page took 0.114591 seconds and 4 git commands to generate.