28 if (!defined(
'NOCSRFCHECK')) {
29 define(
'NOCSRFCHECK',
'1');
31 if (!defined(
'NOTOKENRENEWAL')) {
32 define(
'NOTOKENRENEWAL',
'1');
34 if (!defined(
'NOREQUIREMENU')) {
35 define(
'NOREQUIREMENU',
'1');
37 if (!defined(
'NOREQUIREHTML')) {
38 define(
'NOREQUIREHTML',
'1');
40 if (!defined(
'NOREQUIREAJAX')) {
41 define(
'NOREQUIREAJAX',
'1');
44 require
'../main.inc.php';
45 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
47 $langs->loadLangs(array(
"bills",
"orders",
"commercial",
"cashdesk"));
49 $floor =
GETPOST(
'floor',
'int');
54 $action =
GETPOST(
'action',
'aZ09');
55 $left =
GETPOST(
'left',
'alpha');
58 $place = (
GETPOST(
'place',
'aZ09') ?
GETPOST(
'place',
'aZ09') : 0);
60 $newname =
GETPOST(
'newname',
'alpha');
61 $mode =
GETPOST(
'mode',
'alpha');
63 if (empty($user->rights->takepos->run)) {
72 if ($action ==
"getTables") {
73 $sql =
"SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX.
"takepos_floor_tables where floor = ".((int) $floor);
76 while ($row = $db->fetch_array(
$resql)) {
78 $result = $invoice->fetch(
'',
'(PROV-POS'.$_SESSION[
'takeposterminal'].
'-'.$row[
'rowid'].
')');
80 $row[
'occupied'] =
"red";
84 echo json_encode($rows);
88 if ($action ==
"update") {
95 if ($left > 3 or $top > 4) {
96 $db->query(
"UPDATE ".MAIN_DB_PREFIX.
"takepos_floor_tables set leftpos = ".((
int) $left).
", toppos = ".((
int) $top).
" WHERE rowid = ".((
int) $place));
98 $db->query(
"DELETE from ".MAIN_DB_PREFIX.
"takepos_floor_tables where rowid = ".((
int) $place));
102 if ($action ==
"updatename") {
103 $newname = preg_replace(
"/[^a-zA-Z0-9\s]/",
"", $newname);
104 if (strlen($newname) > 3) {
105 $newname = substr($newname, 0, 3);
107 $resql = $db->query(
"UPDATE ".MAIN_DB_PREFIX.
"takepos_floor_tables set label='".$db->escape($newname).
"' WHERE rowid = ".((int) $place));
110 if ($action ==
"add") {
111 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"takepos_floor_tables(entity, label, leftpos, toppos, floor) VALUES (".$conf->entity.
", '', '45', '45', ".((int) $floor).
")";
112 $asdf = $db->query($sql);
113 $db->query(
"update ".MAIN_DB_PREFIX.
"takepos_floor_tables set label=rowid where label=''");
122 $title =
'TakePOS - Dolibarr '.DOL_VERSION;
123 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) {
124 $title =
'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
126 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
128 <link rel=
"stylesheet" href=
"css/pos.css.php?a=xxx">
129 <style
type=
"text/css">
131 background-image:url(img/table.gif);
132 -moz-background-size:100% 100%;
133 -webkit-background-size:100% 100%;
134 background-size:100% 100%;
149 var DragDrop=
'<?php echo $langs->trans("DragDrop"); ?>';
151 function updateplace(idplace, left, top) {
152 console.log(
"updateplace idplace="+idplace+
" left="+left+
" top="+top);
155 url:
"<?php echo DOL_URL_ROOT.'/takepos/floors.php'; ?>",
156 data: { action:
"update", left: left, top: top, place: idplace, token:
'<?php echo currentToken(); ?>' }
157 }).done(
function( msg ) {
158 window.location.href=
'floors.php?mode=edit&floor=<?php echo urlencode($floor); ?>';
162 function updatename(
rowid) {
163 var after=$(
"#tablename"+
rowid).text();
164 console.log(
"updatename rowid="+
rowid+
" after="+after);
167 url:
"<?php echo DOL_URL_ROOT.'/takepos/floors.php'; ?>",
168 data: { action:
"updatename", place:
rowid, newname: after, token:
'<?php echo currentToken(); ?>' }
169 }).done(
function( msg ) {
170 window.location.href=
'floors.php?mode=edit&floor=<?php echo urlencode($floor); ?>';
174 function LoadPlace(place){
175 parent.location.href=
'index.php?place='+place;
179 $( document ).ready(
function() {
180 $.getJSON(
'./floors.php?action=getTables&floor=<?php echo $floor; ?>',
function(data) {
181 $.each(data,
function(key, val) {
182 <?php
if ($mode ==
"edit") {?>
183 $(
'body').append(
'<div class="tablediv" contenteditable onblur="updatename('+val.rowid+
');" style="position: absolute; left: '+val.leftpos+
'%; top: '+val.toppos+
'%;" id="tablename'+val.rowid+
'">'+val.label+
'</div>');
184 $(
"#tablename"+val.rowid ).draggable(
187 $(
"#add").html(
"<?php echo $langs->trans("Delete
"); ?>");
190 var left=$(
this).offset().left*100/$(window).width();
191 var top=$(
this).offset().top*100/$(window).height();
192 updateplace($(
this).attr(
'id').substr(9), left, top);
197 $(
'#'+val.label).draggable().bind(
'click',
function(){
201 $(
'body').append(
'<div class="tablediv '+val.occupied+
'" onclick="LoadPlace('+val.rowid+
');" style="position: absolute; left: '+val.leftpos+
'%; top: '+val.toppos+
'%;" id="tablename'+val.rowid+
'">'+val.label+
'</div>');
209 <body style=
"overflow: hidden">
210 <?php
if ($user->admin) {?>
211 <div style=
"position: absolute; left: 0.1%; top: 0.8%; width:8%; height:11%;">
212 <?php
if ($mode ==
"edit") {?>
213 <a
id=
"add" onclick=
"window.location.href='floors.php?mode=edit&action=add&token=<?php echo newToken() ?>&floor=<?php echo $floor; ?>';"><?php echo $langs->trans(
"AddTable"); ?></a>
215 <a onclick=
"window.location.href='floors.php?mode=edit&token=<?php echo newToken() ?>&floor=<?php echo $floor; ?>';"><?php echo $langs->trans(
"Edit"); ?></a>
221 <div style=
"position: absolute; left: 25%; bottom: 8%; width:50%; height:3%;">
224 <?php
if ($floor > 1) { ?>
225 <img
class=
"valignmiddle" src=
"./img/arrow-prev.png" width=
"5%" onclick=
"location.href='floors.php?floor=<?php if ($floor > 1) {
226 $floor--; echo $floor; $floor++;
231 <span
class=
"valignmiddle"><?php echo $langs->trans(
"Floor").
" ".$floor; ?></span>
232 <img src=
"./img/arrow-next.png" class=
"valignmiddle" width=
"5%" onclick=
"location.href='floors.php?floor=<?php $floor++; echo $floor; ?>';">
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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 ...
if(isModEnabled('facture')&&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur')&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)&&$user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice')&&$user->rights->supplier_invoice->lire)) if(isModEnabled('don')&&!empty($user->rights->don->lire)) if(isModEnabled('tax')&&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture')&&isModEnabled('commande')&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
top_htmlhead($head, $title= '', $disablejs=0, $disablehead=0, $arrayofjs= '', $arrayofcss= '', $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Ouput html header of a page.
Class to manage invoices.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
print *****$script_file(".$version.") pid c cd cd cd description as p label as s rowid