Merge branch 'oqs' of bitbucket.org:code2lab/sxrestaurant into adminbsb_material_ui
This commit is contained in:
@@ -61,7 +61,7 @@ $(document).ready(function(){
|
||||
var date = new Date(data[field]["created_at"]);
|
||||
var show_date = date.getDate() + "-" + date.getMonth() + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes();
|
||||
|
||||
row ='<div class="card queue_station" data-date="'+data[field]["order_id"]+'">'
|
||||
row ='<div class="card queue_station animated " data-date="'+data[field]["order_id"]+'">'
|
||||
+'<div class="card-block">'
|
||||
+'<h4 class="card-title">'
|
||||
+'<span class="order-zone-type">'+data[field]["table_type"]+'- </span>'
|
||||
|
||||
@@ -1,5 +1,81 @@
|
||||
$(function(){
|
||||
//click menu sidebar menu category
|
||||
$(".product").on("click", function(){
|
||||
var url = $(this).attr('data-ref');
|
||||
show_product_list(url);
|
||||
console.log(url)
|
||||
});
|
||||
//show menu item list when click menu category
|
||||
function show_product_list(url_item){
|
||||
|
||||
var menu_list = $('.menu_items_list');
|
||||
menu_list.empty();
|
||||
//Start Ajax
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url_item,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
|
||||
var menu_items_list = $('.menu_items_list');
|
||||
menu_items_list.empty();
|
||||
product = data;
|
||||
|
||||
for(var field in product) {
|
||||
console.log(product[field].name);
|
||||
if (product[field].unit_price > 0) {
|
||||
console.log("hi");
|
||||
qty = 1;
|
||||
options = [];
|
||||
item_attributes = [];
|
||||
|
||||
if (product[field].image_path) {
|
||||
image_path = product[field].image_path.url;
|
||||
}else{
|
||||
image_path = "/image/logo.png";
|
||||
}
|
||||
|
||||
row = '<div class="card custom-card testimonial-card animated fadeInRight" style="">'
|
||||
+'<div class="custom-card-head card-head" style="line-height:14px;">'
|
||||
+'<small class="col-md-9">'+ product[field].name +'</small>'
|
||||
+"<div class='col-md-3 add_icon' data-item-code='"
|
||||
+ product[field].item_code +"' data-name='"
|
||||
+ product[field].name +"' data-qty = '"+ qty +"' data-price = '"
|
||||
+ product[field].unit_price +"' data-instance-code = '"+ product[field].item_code +"' data-instance = '"
|
||||
+ product[field].name +"' data-promotion-price = '"+ 1 +"' data-attributes = '"
|
||||
+ JSON.stringify(item_attributes) +"' data-options = '"
|
||||
+ options +"' data-image='"+image_path+"'>"
|
||||
+"<i class='fa fa-plus '"
|
||||
+ 'style="margin-top:4px;">'
|
||||
+'</i>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
|
||||
+"<div class='menu_item_box' data-item-code='"
|
||||
+ product[field].item_code +"' data-instance = '"
|
||||
+JSON.stringify(item_attributes)+"' data-id = '"
|
||||
+JSON.stringify(item_attributes)+"' data-item = '"
|
||||
+JSON.stringify(item_attributes)+"' data-option = '"
|
||||
+JSON.stringify(item_attributes)+"' data-item-sets = '"
|
||||
+JSON.stringify(item_attributes)+"' data-toggle='modal' data-target='.sx_item_detailModal'>"
|
||||
|
||||
+"<div class='card-block custom-card-block'>"
|
||||
+"<img id='logo' src='"+image_path+"'>"
|
||||
+"</div>"
|
||||
|
||||
+'<div class="card-footer custom-card-footer">'
|
||||
+'<small>'+ product[field].unit_price +'</small>'
|
||||
+'</div>'
|
||||
+'</div>';
|
||||
$('.menu_items_list').append(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
//end Ajax
|
||||
}
|
||||
//end show list function
|
||||
//click menu sidebar menu category
|
||||
$(".menu_category").on("click", function(){
|
||||
var menu_id = $(this).find(".menu-id").text();
|
||||
@@ -69,38 +145,38 @@ $(function(){
|
||||
image_path = "/image/logo.png";
|
||||
}
|
||||
|
||||
row = '<div class="card custom-card">'
|
||||
+'<div class="custom-card-head card-head" style="line-height:14px;">'
|
||||
+'<small class="col-md-9">'+ menu_items[field].name +'</small>'
|
||||
+"<div class='col-md-3 add_icon' data-item-code='"
|
||||
+ menu_items[field].code +"' data-name='"
|
||||
+ menu_items[field].name +"' data-qty = '"+ qty +"' data-price = '"
|
||||
+ price +"' data-instance-code = '"+ code +"' data-instance = '"
|
||||
+ name +"' data-promotion-price = '"+ promotion_price +"' data-attributes = '"
|
||||
+ JSON.stringify(item_attributes) +"' data-options = '"
|
||||
+ options +"' data-image='"+image_path+"'>"
|
||||
+"<i class='fa "+fa_plus+" '"
|
||||
+ 'style="margin-top:4px;">'
|
||||
+'</i></div>'
|
||||
+'</div>'
|
||||
row = '<div class="card custom-card testimonial-card animated fadeInRight" style="">'
|
||||
+'<div class="custom-card-head card-head" style="line-height:14px;">'
|
||||
+'<small class="col-md-9">'+ menu_items[field].name +'</small>'
|
||||
+"<div class='col-md-3 add_icon' data-item-code='"
|
||||
+ menu_items[field].code +"' data-name='"
|
||||
+ menu_items[field].name +"' data-qty = '"+ qty +"' data-price = '"
|
||||
+ price +"' data-instance-code = '"+ code +"' data-instance = '"
|
||||
+ name +"' data-promotion-price = '"+ promotion_price +"' data-attributes = '"
|
||||
+ JSON.stringify(item_attributes) +"' data-options = '"
|
||||
+ options +"' data-image='"+image_path+"'>"
|
||||
+"<i class='fa "+fa_plus+" '"
|
||||
+ 'style="margin-top:4px;">'
|
||||
+'</i>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
|
||||
+"<div class='"+menu_item_box+"' data-item-code='"
|
||||
+ menu_items[field].code +"' data-instance = '"
|
||||
+JSON.stringify(menu_items[field].instances)+"' data-id = '"
|
||||
+JSON.stringify(menu_items[field].attributes)+"' data-item = '"
|
||||
+JSON.stringify(item_attributes)+"' data-option = '"
|
||||
+JSON.stringify(menu_items[field].options)+"' data-item-sets = '"
|
||||
+JSON.stringify(menu_items[field].item_sets)+"' data-toggle='modal' data-target='."+data_target+"'>"
|
||||
+"<div class='"+menu_item_box+"' data-item-code='"
|
||||
+ menu_items[field].code +"' data-instance = '"
|
||||
+JSON.stringify(menu_items[field].instances)+"' data-id = '"
|
||||
+JSON.stringify(menu_items[field].attributes)+"' data-item = '"
|
||||
+JSON.stringify(item_attributes)+"' data-option = '"
|
||||
+JSON.stringify(menu_items[field].options)+"' data-item-sets = '"
|
||||
+JSON.stringify(menu_items[field].item_sets)+"' data-toggle='modal' data-target='."+data_target+"'>"
|
||||
|
||||
+"<div class='card-block custom-card-block'>"
|
||||
+"<img id='logo' src='"+image_path+"'>"
|
||||
+"<div class='card-block custom-card-block'>"
|
||||
+"<img id='logo' src='"+image_path+"'>"
|
||||
+"</div>"
|
||||
|
||||
+"</div>"
|
||||
|
||||
+'<div class="card-footer custom-card-footer">'
|
||||
+'<small>'+ price +'</small>'
|
||||
+'</div>'
|
||||
+'</div>';
|
||||
+'<div class="card-footer custom-card-footer">'
|
||||
+'<small>'+ price +'</small>'
|
||||
+'</div>'
|
||||
+'</div>';
|
||||
$('.menu_items_list').append(row);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ App.order_queue_station = App.cable.subscriptions.create('OrderQueueStationChann
|
||||
|
||||
if (oqs_id == items[field]["order_queue_station_id"]) {
|
||||
|
||||
row ='<div class="card queue_station queue_station_box" data-date="'+items[field]["order_id"]+'">'
|
||||
row ='<div class="card queue_station animated shake queue_station_box" data-date="'+items[field]["order_id"]+'">'
|
||||
+'<strong class="hidden">'+items[field]["order_id"]+'</strong>'
|
||||
+'<div class="card-block">'
|
||||
+'<h4 class="card-title">'
|
||||
|
||||
Reference in New Issue
Block a user