1+ <?php
2+ /*
3+ * OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
4+ * Copyright (C) DevCode s.r.l.
5+ *
6+ * This program is free software: you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License as published by
8+ * the Free Software Foundation, either version 3 of the License, or
9+ * (at your option) any later version.
10+ *
11+ * This program is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ * GNU General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU General Public License
17+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
18+ */
19+
20+ include_once __DIR__ .'/../../core.php ' ;
21+
22+ $ id_record = get ('id_record ' );
23+ $ id_parent = get ('id_parent ' );
24+
25+ $ barcode = $ dbo ->table ('mg_articoli_barcode ' )->where ('id ' ,$ id_record )->first ();
26+
27+ echo '
28+ <div class="row">
29+ <div class="col-md-3">
30+ {[ "type": "number", "label": " ' .tr ('Q.tà ' ).'", "name": "qta", "required": 1, "value": "1", "decimals":"0", "help":" ' .tr ('Definisci quante etichette stampare per questo barcode ' ).'" ]}
31+ </div>
32+ <div class="col-md-3">
33+ {[ "type": "select", "label": " ' .tr ('Tipologia stampa ' ).'", "name": "tipologia", "required": 1, "values": "list=\"singola\":\"Singola\",\"a4\":\"Formato A4\"", "value": "singola" ]}
34+ </div>
35+ </div>
36+ <div class="row">
37+ <div class="col-md-12 text-right">
38+ <a class="btn btn-primary" onclick="stampaBarcode();"><i class="fa fa-print"></i> ' .tr ('Stampa ' ).'</a>
39+ </div>
40+ </div> ' ;
41+
42+ echo '
43+ <script>
44+
45+ function stampaBarcode() {
46+ let qta = input("qta").get();
47+
48+ if ($("#tipologia").val() == "singola") {
49+ var id_print = ' .Prints::getPrints ()['Barcode ' ].';
50+ } else {
51+ var id_print = ' .Prints::getPrints ()['Barcode bulk ' ].';
52+ }
53+
54+ window.open(" ' .$ rootdir .'/pdfgen.php?id_print=" + id_print + "&id_record= ' .$ id_parent .'&idbarcode= ' .$ id_record .'&qta=" + qta, "_blank");
55+ }
56+
57+ </script> ' ;
0 commit comments