printqr.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /* Copyright (C) 2020 Andreu Bisquerra Gaya <jove@bisquerra.com>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. */
  17. /**
  18. * \file htdocs/takepos/admin/printqr.php
  19. * \ingroup takepos
  20. * \brief Print QR Menu
  21. */
  22. // Load Dolibarr environment
  23. require '../../main.inc.php';
  24. // Security check
  25. if (!$user->admin) {
  26. accessforbidden();
  27. }
  28. $langs->load("cashdesk");
  29. $id = GETPOST('id', 'int');
  30. $_GET['optioncss'] = "print";
  31. print '<center>';
  32. if (GETPOSTISSET("id")) {
  33. print '<h1><b>'.$langs->trans("ScanToOrder").'</b></h1>';
  34. print "<img src='".DOL_URL_ROOT."/takepos/genimg/qr.php?key=".dol_encode($id)."' width='30%'>";
  35. } else {
  36. print '<h1><b>'.$langs->trans("ScanToMenu").'</b></h1>';
  37. print "<img src='".DOL_URL_ROOT."/takepos/genimg/qr.php' width='30%'>";
  38. }
  39. print '<h1><b>'.$mysoc->name.'</b></h1>';
  40. print '</center>';
  41. llxFooter();
  42. $db->close();