dolibarr 21.0.0-alpha
auto_order.php
Go to the documentation of this file.
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
24if (!defined("NOLOGIN")) {
25 define("NOLOGIN", '1'); // If this page is public (can be called outside logged session)
26}
27if (!defined('NOIPCHECK')) {
28 define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
29}
30if (!defined('NOBROWSERNOTIF')) {
31 define('NOBROWSERNOTIF', '1');
32}
33
34// Load Dolibarr environment
35require '../../main.inc.php';
36
37if (!getDolGlobalString('TAKEPOS_AUTO_ORDER')) {
38 accessforbidden('Auto order is not allwed'); // If Auto Order is disabled never allow access to this page (that is a NO LOGIN access)
39}
40
41$_SESSION["basiclayout"] = 1; // For the simple layout for public submission
42$_SESSION["takeposterminal"] = getDolGlobalInt('TAKEPOS_TERMINAL_NB_FOR_PUBLIC', 1); // Default terminal for public submission is 1
43
44define('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE', 1);
45if (GETPOSTISSET("mobilepage")) {
46 require DOL_URL_ROOT.'/takepos/invoice.php';
47} elseif (GETPOSTISSET("genimg")) {
48 require DOL_DOCUMENT_ROOT.'/takepos/genimg/index.php';
49} else {
50 require DOL_URL_ROOT.'/takepos/phone.php';
51}
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.