Small fix
This commit is contained in:
miroman-afk
2022-12-22 12:52:42 +03:00
parent d24bba305f
commit 723e9a8768
15 changed files with 213 additions and 117 deletions

View File

@@ -38,7 +38,7 @@ class GETClientInfo extends HRCCommand implements HRCCommandInterface
'email' => $email, 'email' => $email,
'address' => $address, 'address' => $address,
'order_count' => $orders_count, 'order_count' => $orders_count,
'order_sum' => $orders_sum, 'order_sum' => round($orders_sum, 2),
'presale' => $presale, 'presale' => $presale,
'bonus' => intval($bonus), 'bonus' => intval($bonus),
) )

View File

@@ -17,29 +17,21 @@ class GETClientOrders extends HRCCommand implements HRCCommandInterface
if (isset($input['id'])) { if (isset($input['id'])) {
$client = Client::where('id', $input['id'])->first(); $client = Client::where('id', $input['id'])->first();
$client_guid = $client['user_code']; $client_guid = $client['user_code'];
$exchange_orders = ExchangeOrders::where('client_code', $client_guid)->where('is_returned', 0)->where('is_deleted', 0)->orderByDesc('closed')->get(); $exchange_orders = ExchangeOrders::select('code', 'opened', 'closed', 'order_sum', 'sale_sum')
$online_orders = ShiftOnlineOrders::where('client_code', $client_guid)->where('is_returned', 0)->where('is_deleted', 0)->orderByDesc('closed')->get(); ->where('client_code', $client_guid)
$orders = []; ->where('is_returned', 0)
foreach ($online_orders as $online_order) { ->where('is_deleted', 0)
$orders[] = array( ->orderByDesc('closed')
'id' => $online_order['code'], ->get()
'opened' => $online_order['opened'], ->toArray();
'closed' => $online_order['closed'], $online_orders = ShiftOnlineOrders::select('code', 'opened', 'closed', 'order_sum', 'sale_sum')
'sum' => $online_order['order_sum'], ->where('client_code', $client_guid)
'discount' => $online_order['sale_sum'], ->where('is_returned', 0)
'shift_id' => 0 ->where('is_deleted', 0)
); ->orderByDesc('closed')
} ->get()
foreach ($exchange_orders as $exchange_order) { ->toArray();
$orders[] = array( $orders = array_merge($online_orders, $exchange_orders);
'id' => $exchange_order['code'],
'opened' => $exchange_order['opened'],
'closed' => $exchange_order['closed'],
'sum' => $exchange_order['order_sum'],
'discount' => $exchange_order['sale_sum'],
'shift_id' => $exchange_order['shift_id']
);
}
return [ return [
'status' => 'success', 'status' => 'success',
'orders' => $orders, 'orders' => $orders,

View File

@@ -5,6 +5,7 @@ namespace App\Commands;
use App\Component\Models\Dishes; use App\Component\Models\Dishes;
use App\Component\Models\ExchangeActions; use App\Component\Models\ExchangeActions;
use App\Component\Models\ExchangeDeleted; use App\Component\Models\ExchangeDeleted;
use App\Component\Models\ExchangeItems;
use App\Component\Models\ExchangeOrders; use App\Component\Models\ExchangeOrders;
use App\Component\Models\ExchangeShifts; use App\Component\Models\ExchangeShifts;
use App\Component\Models\Reasons; use App\Component\Models\Reasons;
@@ -739,6 +740,36 @@ class GETDataReport extends HRCCommand implements HRCCommandInterface
'deleted' => $deleted 'deleted' => $deleted
]; ];
} }
if ($input['type'] == 'abc') {
if (isset($input['start_date']) && isset($input['end_date'])) {
$end_date = date('Y-m-d H:i:s', strtotime($input['end_date']));
$start_date = date('Y-m-d H:i:s', strtotime($input['start_date']));
$orders_shifts = ExchangeOrders::where('opened', '>=', $start_date)
->where('closed', '=<', $end_date)
->where('is_deleted', 0)
->where('is_returned', 0)
->where('is_closed', 1)
->groupBy('shift_id')
->get();
$orders = ExchangeOrders::where('opened', '>=', $start_date)
->where('closed', '=<', $end_date)
->where('is_deleted', 0)
->where('is_returned', 0)
->where('is_closed', 1)
->get();
$revenue = 0;
foreach ($orders_shifts as $orders_shift) {
$shift_revenue = ExchangeShifts::where('shift_id', $orders_shift['shift_id'])
->first();
$revenue += $shift_revenue['revenue'];
}
foreach ($orders as $order) {
$order_items = ExchangeItems::where('order_code', $order['code'])
->where('shift_id', $order['shift_id'])
->get();
}
}
}
} else { } else {
return [ return [
'status' => 'success', 'status' => 'success',

View File

@@ -14,15 +14,16 @@ class POSTBonus extends HRCCommand implements HRCCommandInterface
public function command($input, $output = null) public function command($input, $output = null)
{ {
$client_guid = $input['client_id']; $client_guid = $input['client_id'];
$bonus_amount = $input['amount']; $bonus_amount = abs($input['amount']);
$staff_id = $input['who']; $staff_id = $input['who'];
$bonus_time = $input['date_transaction']; $bonus_time = $input['date_transaction'];
ClientsBonus::bonusReg($client_guid, $bonus_amount); $type = $input['type'];
ClientsBonus::bonusReg($client_guid, $bonus_amount, $type);
ClientsBonus::bonusLog($client_guid, $bonus_amount, $bonus_time, $staff_id); ClientsBonus::bonusLog($client_guid, $bonus_amount, $bonus_time, $staff_id);
if ($bonus_amount > 0) { if ($type == 'in') {
$message = 'Начислено ' . $bonus_amount . ' бонусов'; $message = 'Начислено ' . $bonus_amount . ' бонусов';
} else { } elseif ($type == 'out') {
$message = 'Списано ' . abs($bonus_amount) . ' бонусов'; $message = 'Списано ' . $bonus_amount . ' бонусов';
} }
$bonus_result = ClientsBonus::getBonus($client_guid); $bonus_result = ClientsBonus::getBonus($client_guid);
return [ return [

View File

@@ -13,15 +13,16 @@ class POSTPresale extends HRCCommand implements HRCCommandInterface
public function command($input, $output = null) public function command($input, $output = null)
{ {
$client_guid = $input['client_id']; $client_guid = $input['client_id'];
$presale_amount = $input['amount']; $presale_amount = abs($input['amount']);
$staff_id = $input['who']; $staff_id = $input['who'];
$presale_time = $input['date_transaction']; $presale_time = $input['date_transaction'];
ClientsPresale::presaleReg($client_guid, $presale_amount); $type = $input['type'];
ClientsPresale::presaleReg($client_guid, $presale_amount, $type);
ClientsPresale::presaleLog($client_guid, $presale_amount, $presale_time, $staff_id); ClientsPresale::presaleLog($client_guid, $presale_amount, $presale_time, $staff_id);
if ($presale_amount > 0) { if ($type == 'in') {
$message = 'Внесен аванс на сумму ' . $presale_amount . ' BYN'; $message = 'Внесен аванс на сумму ' . $presale_amount . ' BYN';
} else { } elseif ($type == 'out') {
$message = 'Зачтен аванс на сумму ' . abs($presale_amount) . ' BYN'; $message = 'Зачтен аванс на сумму ' . $presale_amount . ' BYN';
} }
$presale_result = ClientsPresale::getPresale($client_guid); $presale_result = ClientsPresale::getPresale($client_guid);
return [ return [

View File

@@ -1,6 +1,6 @@
{ {
"name": "hrc-admin/hello-world", "name": "hrc-admin/hello-world",
"version": "2.24", "version": "2.25",
"require": { "require": {
"horeca/admin-php-module-core": "dev-master", "horeca/admin-php-module-core": "dev-master",
"guzzlehttp/guzzle": "^7.4", "guzzlehttp/guzzle": "^7.4",

View File

@@ -4,7 +4,7 @@
.provider('adrConfig', function adrConfigProvider() { .provider('adrConfig', function adrConfigProvider() {
//defaults //defaults
var defaultConfig = { var defaultConfig = {
iconPosition: [0, 0], iconPosition: [-1, 10],
mode: 'all', mode: 'all',
modes: ['all', 'horizontal', 'vertical'] modes: ['all', 'horizontal', 'vertical']
}; };
@@ -28,15 +28,18 @@
var doc = {}; var doc = {};
var el = {}; var el = {};
//create button for resizing //create button for resizing
var btn = document.createElement("span"); //var btn = document.createElement("span");
btn.style.width = '15px'; var btn = document.createElement("i");
btn.style.height = '15px'; btn.classList.add('fa');
btn.innerHTML = btn.classList.add('fa-expand');
"<i class='fa fa-expand fa-rotate-90'></i>" btn.classList.add('fa-rotate-90');
; btn.style.border = '25px solid transparent';
btn.style.bottom = iconPosition[0] + 6 + 'px';
btn.style.right = iconPosition[1] + 5 + 'px'; /* btn.innerHTML =
btn.style.position = 'absolute'; "<i class='fa fa-expand fa-rotate-90' style='width: 25px;height: 25px; bottom: 10%; position: absolute;'></i>"
;*/
btn.style.position = 'fixed';
btn.style.visibility = 'hidden'; btn.style.visibility = 'hidden';
if (mode == 'horizontal') { if (mode == 'horizontal') {
btn.style.cursor = 'ew-resize'; btn.style.cursor = 'ew-resize';
@@ -50,22 +53,21 @@
switch ($event.which) { switch ($event.which) {
case 1: case 1:
$event.stopImmediatePropagation(); $event.stopImmediatePropagation();
/* console.log(element.offsetParent().prevObject[0].parentNode.parentNode.getBoundingClientRect().bottom);
console.log(element[0].parentNode);
console.log(element[0].parentNode.parentNode);
console.log(element[0].parentNode.parentNode.parentNode);*/
doc.left = element[0].parentNode.parentNode.getBoundingClientRect().left; doc.left = element[0].parentNode.parentNode.getBoundingClientRect().left;
doc.top = element[0].parentNode.parentNode.getBoundingClientRect().top; doc.top = element[0].parentNode.parentNode.getBoundingClientRect().top;
doc.bottom = element[0].parentNode.parentNode.getBoundingClientRect().bottom; doc.bottom = element[0].parentNode.parentNode.getBoundingClientRect().bottom;
doc.right = element[0].parentNode.parentNode.getBoundingClientRect().right; doc.right = element[0].parentNode.parentNode.getBoundingClientRect().right;
el.width = element[0].getBoundingClientRect().width; el.width = element[0].getBoundingClientRect().width;
el.height = element[0].getBoundingClientRect().height; el.height = element[0].getBoundingClientRect().height;
console.log('doc.left: ' + doc.left);
console.log('doc.top: ' + doc.top);
console.log('doc.bottom: ' + doc.bottom);
console.log('doc.right: ' + doc.right);
position.x = $event.clientX; position.x = $event.clientX;
position.y = $event.clientY; position.y = $event.clientY;
dimension.width = element.prop('offsetWidth'); dimension.width = element.prop('offsetWidth');
dimension.height = element.prop('offsetHeight'); dimension.height = element.prop('offsetHeight');
console.log('dimension.width: ' + dimension.width); btn.style.visibility = 'hidden';
console.log('dimension.height: ' + dimension.height);
$document.bind('mousemove', mousemove); $document.bind('mousemove', mousemove);
$document.bind('mouseup', mouseup); $document.bind('mouseup', mouseup);
return false; return false;
@@ -77,18 +79,24 @@
switch ($event.which) { switch ($event.which) {
case 1: case 1:
if ($event.clientX < doc.right) {
if ($event.clientX < doc.right && $event.clientY < doc.bottom) {
var deltaWidth = dimension.width - (position.x - $event.clientX); var deltaWidth = dimension.width - (position.x - $event.clientX);
var deltaHeight = dimension.height - (position.y - $event.clientY); if (deltaWidth < 100) {
} else { deltaWidth = 100;
var deltaWidth = el.width; }
var deltaHeight = el.height; }
if ($event.clientY < doc.bottom) {
var deltaHeight = dimension.height - (position.y - $event.clientY);
if (deltaHeight < 100) {
deltaHeight = 100;
}
}
if ($event.clientX > doc.right) {
deltaWidth = element[0].getBoundingClientRect().width;
}
if ($event.clientY > doc.bottom ) {
deltaHeight = element[0].getBoundingClientRect().height;
} }
/* console.log('deltaWidth: ' + deltaWidth);
console.log('deltaHeight: ' + deltaHeight);
console.log('position.x: ' + position.x);
console.log('position.y: ' + position.y);*/
var newDimensions = {}; var newDimensions = {};
if (mode == 'horizontal') { if (mode == 'horizontal') {
newDimensions = { newDimensions = {
@@ -105,6 +113,9 @@
}; };
} }
element.css(newDimensions); element.css(newDimensions);
element[0].children[0].style.setProperty('width', deltaWidth + 'px');
element[0].children[0].style.setProperty('height', deltaHeight + 'px');
//console.log(element[0].children[0]);
return false; return false;
break; break;
} }
@@ -113,14 +124,20 @@
function mouseup() { function mouseup() {
$document.unbind('mousemove', mousemove); $document.unbind('mousemove', mousemove);
$document.unbind('mouseup', mouseup); $document.unbind('mouseup', mouseup);
btn.style.visibility = 'hidden';
} }
element.append(btn); element.append(btn);
//show button on hover //show button on hover
element.bind('mouseover', function () { element.bind('mouseover', function () {
/*console.log(element[0].children[1].children[0]);*/
btn.style.top = element[0].getBoundingClientRect().top + element[0].getBoundingClientRect().height - 50 + 'px';
btn.style.left = element[0].getBoundingClientRect().left + element[0].getBoundingClientRect().width - 50 + 'px';
btn.style.visibility = 'visible'; btn.style.visibility = 'visible';
}); });
element.bind('mouseout', function () { element.bind('mouseout', function () {
/* console.log(element);*/
btn.style.visibility = 'hidden'; btn.style.visibility = 'hidden';
}); });
} }
@@ -160,17 +177,34 @@
var posdy = position.y + dy; var posdy = position.y + dy;
var posdx = position.x + dx; var posdx = position.x + dx;
if (posdy > doc.top && posdx > doc.left && (posdx + element[0].getBoundingClientRect().width) < doc.right && (posdy + element[0].getBoundingClientRect().height) < doc.bottom) { if (posdy > doc.top) {
element.css({ var top = posdy;
top: posdy + 'px',
left: posdx + 'px'
});
} else {
element.css({
top: position.y + 'px',
left: position.x + 'px'
});
} }
if (posdx > doc.left){
var left = posdx;
}
if ((posdx + element[0].getBoundingClientRect().width) < doc.right) {
left = posdx;
}
if ((posdy + element[0].getBoundingClientRect().height) < doc.bottom){
top = posdy;
}
if (posdy < doc.top) {
top = doc.top;
}
if (posdx < doc.left) {
left = doc.left;
}
if ((posdx + element[0].getBoundingClientRect().width) > doc.right) {
left = doc.right - element[0].getBoundingClientRect().width;
}
if ((posdy + element[0].getBoundingClientRect().height) > doc.bottom) {
top = doc.bottom - element[0].getBoundingClientRect().height;
}
element.css({
top: top + 'px',
left: left + 'px'
});
return false; return false;
break; break;

View File

@@ -27,15 +27,20 @@ class ClientsBonus extends Model
/** /**
* Save bonus value. * Save bonus value.
*/ */
public static function bonusReg($guid, $value) public static function bonusReg($guid, $value, $type)
{ {
$bonus_value = ClientsBonus::where('client_guid', $guid)->first(); $bonus_value = ClientsBonus::where('client_guid', $guid)->first();
$bonus = ClientsBonus::updateOrCreate( if ($type == 'in') {
['client_guid' => $guid], ClientsBonus::updateOrCreate(
['value' => $bonus_value['value'] + $value] ['client_guid' => $guid],
); ['value' => $bonus_value['value'] + $value]
);
return $bonus['value']; } elseif ($type == 'out') {
ClientsBonus::updateOrCreate(
['client_guid' => $guid],
['value' => $bonus_value['value'] - $value]
);
}
} }
/** /**

View File

@@ -27,15 +27,20 @@ class ClientsPresale extends Model
/** /**
* Save presale value. * Save presale value.
*/ */
public static function presaleReg($guid, $value) public static function presaleReg($guid, $value, $type)
{ {
$presale_value = ClientsPresale::where('client_guid', $guid)->first(); $presale_value = ClientsPresale::where('client_guid', $guid)->first();
$presale = ClientsPresale::updateOrCreate( if ($type == 'in') {
['client_guid' => $guid], ClientsPresale::updateOrCreate(
['value' => $presale_value['value'] + $value] ['client_guid' => $guid],
); ['value' => $presale_value['value'] + $value]
);
return $presale['value']; } elseif ($type == 'out') {
ClientsPresale::updateOrCreate(
['client_guid' => $guid],
['value' => $presale_value['value'] - $value]
);
}
} }
/** /**

View File

@@ -18,7 +18,7 @@ class ExchangeOrders extends Model
$close_time = $order['closed']; $close_time = $order['closed'];
$who_open = Staff::getName($order['who_open']); $who_open = Staff::getName($order['who_open']);
$who_close = Staff::getName($order['who_close']); $who_close = Staff::getName($order['who_close']);
$items = ExchangeItems::where('order_code', $order_id)->where('shift_id', $shift_id)->get(); $items = ExchangeItems::where('order_code', $order_id)->where('dishes_code', '<>', 0)->where('shift_id', $shift_id)->get();
$order_status = ''; $order_status = '';
if ($order['is_deleted'] > 0) { if ($order['is_deleted'] > 0) {
$order_status = 'Удален'; $order_status = 'Удален';
@@ -47,7 +47,7 @@ class ExchangeOrders extends Model
} }
$order_info[] = array( $order_info[] = array(
'id' => $key + 1, 'id' => $key + 1,
'name' => Dishes::getName($item['dish_code']), 'name' => Dishes::getName($item['menu_code']),
'count' => $item['count'], 'count' => $item['count'],
'price' => $item['real_price'], 'price' => $item['real_price'],
'sale_price' => $item['sale_price'], 'sale_price' => $item['sale_price'],

View File

@@ -17,8 +17,13 @@ class ShiftOnlineOrders extends Model
$open_time = $order['opened']; $open_time = $order['opened'];
$close_time = $order['closed']; $close_time = $order['closed'];
$who_open = Staff::getName($order['who_open']); $who_open = Staff::getName($order['who_open']);
$who_close = Staff::getName($order['who_close']); if ($order['who_close'] == 0) {
$items = ShiftOnlineItems::where('order_code', $order_id)->get(); $who_close = '';
} else {
$who_close = Staff::getName($order['who_close']);
}
$items = ShiftOnlineItems::where('order_code', $order_id)->where('modificator_code', 0)->get();
$order_status = ''; $order_status = '';
if ($order['is_deleted'] > 0) { if ($order['is_deleted'] > 0) {
$order_status = 'Удален'; $order_status = 'Удален';
@@ -54,7 +59,7 @@ class ShiftOnlineOrders extends Model
'cof' => $item['cof'], 'cof' => $item['cof'],
'unit' => Units::getName($item['units_id']), 'unit' => Units::getName($item['units_id']),
'amount' => round($item['sale_price'] * $item['count'], 2), 'amount' => round($item['sale_price'] * $item['count'], 2),
'discount' => round($discount, 2) 'discount' => round($discount, 0)
); );
$amount += round($item['sale_price'] * $item['count'], 2); $amount += round($item['sale_price'] * $item['count'], 2);
$full_price += round($realPrice,2); $full_price += round($realPrice,2);

View File

@@ -1,5 +1,5 @@
[info] [info]
name=V1 name=V1
version=2.24 version=2.25
[build] [build]
version=2.24 version=2.25

View File

@@ -123,7 +123,7 @@
<div class="p-y text-center text-sm-center col-sm-12"> <div class="p-y text-center text-sm-center col-sm-12">
<a href="" class="inline p-x text-center"> <a href="" class="inline p-x text-center">
<span class="h5 block m-0">{{currentClient.info.order_sum}} BYN</span> <span class="h5 block m-0">{{currentClient.info.order_sum | curr}} BYN</span>
<small class="text-xs text-muted">Сумма заказов</small> <small class="text-xs text-muted">Сумма заказов</small>
</a> </a>
<a href="" class="inline p-x b-l text-center"> <a href="" class="inline p-x b-l text-center">
@@ -132,7 +132,7 @@
</a> </a>
<a href="" class="inline p-x b-l b-r text-center" <a href="" class="inline p-x b-l b-r text-center"
ng-if="currentClient.info.presale > 0"> ng-if="currentClient.info.presale > 0">
<span class="h5 block m-0">{{currentClient.info.presale}} BYN</span> <span class="h5 block m-0">{{currentClient.info.presale | curr}} BYN</span>
<small class="text-xs text-muted">Аванс</small> <small class="text-xs text-muted">Аванс</small>
</a> </a>
<a href="" class="inline p-x text-center" ng-if="currentClient.info.bonus > 0"> <a href="" class="inline p-x text-center" ng-if="currentClient.info.bonus > 0">
@@ -201,14 +201,14 @@
<div class="row align-items-center" style="margin-right: 0px;"> <div class="row align-items-center" style="margin-right: 0px;">
<div class="sl-content"> <div class="sl-content">
<div class="col-lg-12 col-sm-6"> <div class="col-lg-12 col-sm-6">
<a ng-click="getItems(order.id, order.opened, order.closed)"> <a ng-click="getItems(order.code, order.opened, order.closed)">
<div class="sl-date text-muted">Заказ открыт: <div class="sl-date text-muted">Заказ открыт:
{{order.opened}} {{order.opened}}
</div> </div>
<div class="sl-date text-muted">Заказ закрыт: <div class="sl-date text-muted" ng-if="order.closed > '0000-00-00 00:00:00'">Заказ закрыт:
{{order.closed}} {{order.closed}}
</div> </div>
<p>Сумма заказа: {{order.sum | curr}} BYN <span ng-if="order.discount > 0">(Скидка: {{order.discount | curr}} BYN)</span></p> <p>Сумма заказа: {{order.order_sum | curr}} BYN <span ng-if="order.discount > 0">(Скидка: {{order.sale_sum | curr}} BYN)</span></p>
</a> </a>
</div> </div>

View File

@@ -402,7 +402,7 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-12 col-xl-8"> <div class="col-md-12 col-xl-8" style="max-height: 620px; overflow-y: hidden;">
<div class="box"> <div class="box">
<div class="box-header"> <div class="box-header">
<h3>Топ продаваемых товаров</h3> <h3>Топ продаваемых товаров</h3>
@@ -470,7 +470,7 @@
<div class="box-body"> <div class="box-body">
<p class="text-muted text-center" ng-if="tables.length == 0">Занятых столов нет</p> <p class="text-muted text-center" ng-if="tables.length == 0">Занятых столов нет</p>
<div class="table-responsive" ng-if="tables.length > 0"> <div class="table-responsive" ng-if="tables.length > 0" style="max-height: 510px;">
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
<thead> <thead>
<tr> <tr>

View File

@@ -1,11 +1,21 @@
<div id="container-places" style="bottom: 20px; right: 20px; position: fixed;"> <div id="container-places" style="bottom: 20px; right: 20px; position: fixed;">
<div class="m-b"> <div class="m-b">
<div class="btn-group"> <div class="btn-group">
<button id="create_place" type="button" class="btn info btn-outline b-info" ng-click="createPlace()">Добавить зал</button> <button id="create_place" type="button" class="btn info btn-outline b-info" ng-click="createPlace()">
<button id="back" type="button" class="btn info p-x-md pull-left" data-toggle="modal" data-target="#back_places">Назад</button> Добавить зал
<button id="create_table" type="button" class="btn info btn-outline b-info" ng-click="createTable(place_id)">Добавить стол</button> </button>
<button id="save_tables" type="button" class="btn info btn-outline b-info" ng-click="saveTables(place_id, tables)">Сохранить</button> <button id="back" type="button" class="btn info p-x-md pull-left" data-toggle="modal"
<button id="save_places" type="button" class="btn info btn-outline b-info" ng-click="savePlaces(roommap)">Сохранить</button> data-target="#back_places">Назад
</button>
<button id="create_table" type="button" class="btn info btn-outline b-info"
ng-click="createTable(place_id)">Добавить стол
</button>
<button id="save_tables" type="button" class="btn info btn-outline b-info"
ng-click="saveTables(place_id, tables)">Сохранить
</button>
<button id="save_places" type="button" class="btn info btn-outline b-info" ng-click="savePlaces(roommap)">
Сохранить
</button>
</div> </div>
</div> </div>
@@ -19,7 +29,9 @@
<div class="confirm-box-footer"> <div class="confirm-box-footer">
<button type="button" class="btn dark-white p-x-md" data-dismiss="modal" ng-click="back()">Нет</button> <button type="button" class="btn dark-white p-x-md" data-dismiss="modal" ng-click="back()">Нет</button>
<button type="button" class="btn danger p-x-md" ng-model="tables" data-dismiss="modal" ng-click="saveTables(place_id, tables)">Да</button> <button type="button" class="btn danger p-x-md" ng-model="tables" data-dismiss="modal"
ng-click="saveTables(place_id, tables)">Да
</button>
</div> </div>
</div> </div>
</div> </div>
@@ -68,9 +80,10 @@
</div> </div>
<div class="padding" id="background_1" ng-style="{'max-width':(maxWidth) + 'px', 'width':(screenWidth) + 'vw'}"> <div class="padding" id="background_1" ng-style="{'max-width':(maxWidth) + 'px', 'width':(screenWidth) + 'vw'}">
<div class="box"> <div class="box">
<div class="padding" id="background" > <div class="padding" id="background">
<!--<div id="tables" class="box" ng-style="{'height':(windowHeight) + 'px'}">--> <!--<div id="tables" class="box" ng-style="{'height':(windowHeight) + 'px'}">-->
<div id="tables" class="box" ng-style="{'height':(windowHeight) + 'px'}" data-target="tables_editor" context-menu> <div id="tables" class="box" ng-style="{'height':(windowHeight) + 'px'}" data-target="tables_editor"
context-menu>
<div class="dropdown" id="tables_editor" style="position: fixed; z-index: 2;"> <div class="dropdown" id="tables_editor" style="position: fixed; z-index: 2;">
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
@@ -83,28 +96,38 @@
</div> </div>
<div ng-repeat="table in tables" ng-model="tables" context-menu> <div ng-repeat="table in tables" ng-model="tables" context-menu>
<div ng-if="table.type == 0" id="{{ 'table_' + $index }}" class="demo-div" draggable resize context-menu <div ng-if="table.type == 0" id="{{ 'table_' + $index }}" class="demo-div" draggable resize
context-menu
data-target="table-{{ $index }}" data-target="table-{{ $index }}"
ng-mouseup="getCoords($event, $index, table.table_id, table.place_id)" ng-mouseup="getCoords($event, $index, table.table_id, table.place_id)"
ng-style="{'width':'' + table.width * percentWidth + 'px', 'height':'' + table.height * percentHeight + 'px', 'top':'calc(' + top + 'px + ' + table.x * percentHeight + 'px)', 'left': 'calc(' + left + 'px + ' + table.y * percentWidth + 'px)'}" ng-style="{'width':'' + table.width * percentWidth + 'px', 'height':'' + table.height * percentHeight + 'px', 'top':'calc(' + top + 'px + ' + table.x * percentHeight + 'px)', 'left': 'calc(' + left + 'px + ' + table.y * percentWidth + 'px)'}"
style="position: fixed;cursor: default;font-family: sans-serif;text-align: center;background-color: #FFFFFF;border: 2px solid #183147; z-index: 1; border-radius: 5%"> style="position: fixed;cursor: default;font-family: sans-serif;text-align: center;background-color: #FFFFFF;border: 2px solid #2196f3; z-index: 1; border-radius: 5%">
<div class="box-header"> <div class="box-header">
<small>{{table.name}}</small> <small>{{table.name}}</small>
<small>{{table.table_id}}</small> <small>{{table.table_id}}</small>
</div> </div>
</div> </div>
<div ng-if="table.type == 1" id="{{ 'table_' + $index }}" class="demo-div" draggable resize context-menu
<div ng-if="table.type == 1" id="{{ 'table_' + $index }}" class="demo-div" draggable resize
context-menu
data-target="table-{{ $index }}" data-target="table-{{ $index }}"
ng-mouseup="getCoords($event, $index, table.table_id, table.place_id)" ng-mouseup="getCoords($event, $index, table.table_id, table.place_id)"
ng-style="{'width':'' + table.width * percentWidth + 'px', 'height':'' + table.height * percentHeight + 'px', 'top':'calc(' + top + 'px + ' + table.x * percentHeight + 'px)', 'left': 'calc(' + left + 'px + ' + table.y * percentWidth + 'px)'}" ng-style="{'width':'' + table.width * percentWidth + 'px', 'height':'' + table.height * percentHeight + 'px', 'top':'calc(' + top + 'px + ' + table.x * percentHeight + 'px)', 'left': 'calc(' + left + 'px + ' + table.y * percentWidth + 'px)'}"
style="position: fixed;cursor: default;font-family: sans-serif;text-align: center;background-color: #FFFFFF;border: 2px solid #183147; z-index: 1; border-radius: 50%"> style="position: fixed;cursor: default;font-family: sans-serif;text-align: center;background-color: #FFFFFF;border: 2px solid #2196f3; z-index: 1; border-radius: 50%">
<div class="box"
<div class="box-header"> ng-style="{'width':'' + table.width * percentWidth + 'px', 'height':'' + table.height * percentHeight + 'px'}"
<small>{{table.name}}</small> style="background: transparent; box-shadow: 0 0px 0px transparent;">
<small>{{table.table_id}}</small> <div class="box-header">
<small>{{table.name}}</small>
<small>{{table.table_id}}</small>
</div>
<div class="box-footer"></div>
</div> </div>
</div> </div>
<div class="dropdown" id="table-{{ $index }}" style="position: fixed; z-index: 2;"> <div class="dropdown" id="table-{{ $index }}" style="position: fixed; z-index: 2;">
<ul class="dropdown-menu" role="menu"> <ul class="dropdown-menu" role="menu">
<li> <li>
@@ -131,7 +154,6 @@
</div> </div>
<div class="modal fade" id="table-edit" data-backdrop="true"> <div class="modal fade" id="table-edit" data-backdrop="true">
<div ui-include="'../views/roommap/items/edit-table.html'"></div> <div ui-include="'../views/roommap/items/edit-table.html'"></div>
</div> </div>