28 if (!defined(
'NOCSRFCHECK')) define(
'NOCSRFCHECK',
'1');
29 if (!defined(
'NOTOKENRENEWAL')) define(
'NOTOKENRENEWAL',
'1');
30 if (!defined(
'NOREQUIREMENU')) define(
'NOREQUIREMENU',
'1');
31 if (!defined(
'NOREQUIREHTML')) define(
'NOREQUIREHTML',
'1');
32 if (!defined(
'NOREQUIREAJAX')) define(
'NOREQUIREAJAX',
'1');
34 require
'../main.inc.php';
35 require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
37 $langs->loadLangs(array(
"bills",
"orders",
"commercial",
"cashdesk"));
39 $floor =
GETPOST(
'floor',
'int');
40 if ($floor ==
"") $floor = 1;
42 $action =
GETPOST(
'action',
'aZ09');
43 $left =
GETPOST(
'left',
'alpha');
46 $place = (
GETPOST(
'place',
'aZ09') ?
GETPOST(
'place',
'aZ09') : 0);
48 $newname =
GETPOST(
'newname',
'alpha');
49 $mode =
GETPOST(
'mode',
'alpha');
51 if (empty($user->rights->takepos->run)) {
60 if ($action ==
"getTables")
62 $sql =
"SELECT rowid, entity, label, leftpos, toppos, floor FROM ".MAIN_DB_PREFIX.
"takepos_floor_tables where floor=".$floor;
65 while ($row = $db->fetch_array(
$resql)) {
67 $result = $invoice->fetch(
'',
'(PROV-POS'.$_SESSION[
'takeposterminal'].
'-'.$row[
'rowid'].
')');
68 if ($result > 0) $row[
'occupied'] =
"red";
71 echo json_encode($rows);
75 if ($action ==
"update")
77 if ($left > 95) $left = 95;
78 if ($top > 95) $top = 95;
79 if ($left > 3 or $top > 4) $db->query(
"UPDATE ".MAIN_DB_PREFIX.
"takepos_floor_tables set leftpos=".$left.
", toppos=".$top.
" WHERE rowid='".$place.
"'");
80 else $db->query(
"DELETE from ".MAIN_DB_PREFIX.
"takepos_floor_tables where rowid='".$place.
"'");
83 if ($action ==
"updatename")
85 $newname = preg_replace(
"/[^a-zA-Z0-9\s]/",
"", $newname);
86 if (strlen($newname) > 3) $newname = substr($newname, 0, 3);
87 $db->query(
"UPDATE ".MAIN_DB_PREFIX.
"takepos_floor_tables set label='".$db->escape($newname).
"' WHERE rowid='".$place.
"'");
92 $sql =
"INSERT INTO ".MAIN_DB_PREFIX.
"takepos_floor_tables(entity, label, leftpos, toppos, floor) VALUES (".$conf->entity.
", '', '45', '45', ".$floor.
")";
93 $asdf = $db->query($sql);
94 $db->query(
"update ".MAIN_DB_PREFIX.
"takepos_floor_tables set label=rowid where label=''");
103 $title =
'TakePOS - Dolibarr '.DOL_VERSION;
104 if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $title =
'TakePOS - '.$conf->global->MAIN_APPLICATION_TITLE;
105 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
107 <link rel=
"stylesheet" href=
"css/pos.css.php?a=xxx">
108 <style
type=
"text/css">
110 background-image:url(img/table.gif);
111 -moz-background-size:100% 100%;
112 -webkit-background-size:100% 100%;
113 background-size:100% 100%;
130 var DragDrop=
'<?php echo $langs->trans("DragDrop"); ?>';
132 function updateplace(idplace, left, top) {
133 console.log(
"updateplace idplace="+idplace+
" left="+left+
" top="+top);
137 data: { action:
"update", left: left, top: top, place: idplace }
138 }).done(
function( msg ) {
139 window.location.href=
'floors.php?mode=edit&floor=<?php echo $floor; ?>';
143 function updatename(
rowid) {
144 var after=$(
"#tablename"+
rowid).text();
145 console.log(
"updatename rowid="+
rowid+
" after="+after);
149 data: { action:
"updatename", place:
rowid, newname: after }
150 }).done(
function( msg ) {
151 window.location.href=
'floors.php?mode=edit&floor=<?php echo $floor; ?>';
155 function LoadPlace(place){
156 parent.location.href=
'index.php?place='+place;
160 $( document ).ready(
function() {
161 $.getJSON(
'./floors.php?action=getTables&floor=<?php echo $floor; ?>',
function(data) {
162 $.each(data,
function(key, val) {
163 <?php
if ($mode ==
"edit") {?>
164 $(
'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>');
165 $(
"#tablename"+val.rowid ).draggable(
168 $(
"#add").html(
"<?php echo $langs->trans("Delete
"); ?>");
171 var left=$(
this).offset().left*100/$(window).width();
172 var top=$(
this).offset().top*100/$(window).height();
173 updateplace($(
this).attr(
'id').substr(9), left, top);
178 $(
'#'+val.label).draggable().bind(
'click',
function(){
182 $(
'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>');
190 <body style=
"overflow: hidden">
191 <?php
if ($user->admin) {?>
192 <div style=
"position: absolute; left: 0.1%; top: 0.8%; width:8%; height:11%;">
193 <?php
if ($mode ==
"edit") {?>
194 <a
id=
"add" onclick=
"window.location.href='floors.php?mode=edit&action=add&floor=<?php echo $floor; ?>';"><?php echo $langs->trans(
"AddTable"); ?></a>
196 <a onclick=
"window.location.href='floors.php?mode=edit&floor=<?php echo $floor; ?>';"><?php echo $langs->trans(
"Edit"); ?></a>
202 <div style=
"position: absolute; left: 25%; bottom: 8%; width:50%; height:3%;">
205 <?php
if ($floor > 1) { ?>
206 <img
class=
"valignmiddle" src=
"./img/arrow-prev.png" width=
"5%" onclick=
"location.href='floors.php?floor=<?php if ($floor > 1) { $floor--; echo $floor; $floor++; } else echo "1
"; ?>';">
208 <span
class=
"valignmiddle"><?php echo $langs->trans(
"Floor").
" ".$floor; ?></span>
209 <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.
</td >< tdcolspan="3">< spanclass="opacitymedium"></span ></td ></tr >< trclass="liste_total"> CREANCES DETTES< tdcolspan="3"class="right"></td >< tdcolspan="3"class="right"></td ></tr > CREANCES DETTES RECETTES DEPENSES trips CREANCES DETTES Y m expensereport p date_valid Y m expensereport pe datep $db idate($date_start)."' AND $column < p rowid
top_htmlhead($head, $title= '', $disablejs=0, $disablehead=0, $arrayofjs= '', $arrayofcss= '', $disablejmobile=0, $disablenofollow=0)
Ouput html header of a page.
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(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Class to manage invoices.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type