auto_order.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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/public/auto_order.php
  19. * \ingroup takepos
  20. * \brief Public orders for customers
  21. */
  22. if (!defined("NOLOGIN")) {
  23. define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
  24. }
  25. if (!defined('NOIPCHECK')) {
  26. define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
  27. }
  28. if (!defined('NOBROWSERNOTIF')) {
  29. define('NOBROWSERNOTIF', '1');
  30. }
  31. // Load Dolibarr environment
  32. require '../../main.inc.php';
  33. if (!$conf->global->TAKEPOS_AUTO_ORDER) {
  34. accessforbidden(); // If Auto Order is disabled never allow NO LOGIN access
  35. }
  36. $_SESSION["basiclayout"] = 1;
  37. $_SESSION["takeposterminal"] = 1;
  38. define('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE', 1);
  39. if (GETPOSTISSET("mobilepage")) {
  40. require '../invoice.php';
  41. } elseif (GETPOSTISSET("genimg")) {
  42. require DOL_DOCUMENT_ROOT.'/takepos/genimg/index.php';
  43. } else {
  44. require '../phone.php';
  45. }