dolibarr  16.0.5
printbox.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2018 Andreu Bisquerra <jove@bisquerra.com>
3  * Copyright (C) 2020 Laurent Destailleur <eldy@users.sourceforge.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
25 //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
26 //if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
27 //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
28 //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
29 if (!defined('NOCSRFCHECK')) {
30  define('NOCSRFCHECK', '1');
31 }
32 if (!defined('NOTOKENRENEWAL')) {
33  define('NOTOKENRENEWAL', '1');
34 }
35 if (!defined('NOREQUIREMENU')) {
36  define('NOREQUIREMENU', '1');
37 }
38 if (!defined('NOREQUIREHTML')) {
39  define('NOREQUIREHTML', '1');
40 }
41 if (!defined('NOREQUIREAJAX')) {
42  define('NOREQUIREAJAX', '1');
43 }
44 
45 require '../main.inc.php'; // Load $user and permissions
46 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
47 
48 global $langs, $db;
49 
50 $langs->loadLangs(array("bills", "cashdesk"));
51 
52 $facid = GETPOST('facid', 'int');
53 
54 $action = GETPOST('action', 'aZ09');
55 
56 if (empty($user->rights->takepos->run)) {
58 }
59 
60 
61 /*
62  * View
63  */
64 
65 $arrayofcss = array('/takepos/css/pos.css.php');
66 $arrayofjs = array('/takepos/js/jquery.colorbox-min.js');
67 
68 $head = '';
69 top_htmlhead($head, '', 0, 0, $arrayofjs, $arrayofcss);
70 ?>
71 <script>
75  function Save() {
76  console.log("We click so we call page receipt.php with facid=<?php echo $facid; ?>");
77  parent.$.colorbox.close();
78  $.colorbox({href:"receipt.php?facid=<?php echo $facid; ?>&action=<?php echo $action; ?>&label="+$('#label').val()+"&qty="+$('#qty').val(), width:"40%", height:"90%", transition:"none", iframe:"true", title:'<?php echo dol_escape_js($langs->trans("PrintTicket")); ?>'});
79  }
80 
81  jQuery(document).ready(function(){
82  $('#label').focus()
83  });
84 </script>
85 </head>
86 <body>
87 <br>
88 <center>
89 <?php
90 if ($action == "without_details") {
91  $label_default = getDolGlobalString('TAKEPOS_PRINT_WITHOUT_DETAILS_LABEL_DEFAULT');
92  $qty_default = 1;
93 
94  print '<input type="text" id="label" name="label" class="takepospay" value="' . $label_default . '" style="width:40%;" placeholder="' . $langs->trans('Label') . '">';
95  print '<input type="text" id="qty" name="qty" class="takepospay" value="' . $qty_default . '" style="width:10%;" placeholder="' . $langs->trans('Qty') . '">';
96 }
97 ?>
98 <input type="button" class="button takepospay clearboth" value="OK" onclick="Save();">
99 </center>
100 
101 </body>
102 </html>
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
top_htmlhead
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Ouput html header of a page.
Definition: main.inc.php:1482
getDolGlobalString
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
Definition: functions.lib.php:80
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
type
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
Definition: repair.php:119