Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into oqs
This commit is contained in:
@@ -81,4 +81,16 @@
|
||||
padding-top: 5%;
|
||||
border-radius: 100px;
|
||||
z-index: 1101;
|
||||
}
|
||||
|
||||
#container {
|
||||
margin: 0px auto;
|
||||
width: 480px;
|
||||
height: 375px;
|
||||
|
||||
}
|
||||
#videoElement {
|
||||
width: 480px;
|
||||
height: 375px;
|
||||
|
||||
}
|
||||
@@ -23,7 +23,7 @@ class Promotion < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.is_between_promo_datetime(current_day,current_time) #database is not local time
|
||||
promoList = Promotion.where("(Date_Format(promo_start_date, 'YYYY-MM-DD') <=? AND Date_Format(promo_end_date, 'YYYY-MM-DD') >=?) AND (promo_start_hour < ? AND promo_end_hour > ?)", current_day, current_day, current_time, current_time)
|
||||
promoList = Promotion.where("(Date_Format(promo_start_date, '%Y-%m-%d') <=? AND Date_Format(promo_end_date, '%Y-%m-%d') >=?) AND (promo_start_hour < ? AND promo_end_hour > ?)", current_day, current_day, current_time, current_time)
|
||||
return promoList
|
||||
end
|
||||
|
||||
|
||||
@@ -92,9 +92,12 @@ json.options opt_format
|
||||
json.instances item.menu_item_instances do |is|
|
||||
# Convert id to name for attributes
|
||||
instance_attr = []
|
||||
|
||||
is.item_attributes.each do |ia|
|
||||
# mItemAttr = MenuItemAttribute.find(is)
|
||||
instance_attr.push(ia)
|
||||
# instance_attr.push(ia)
|
||||
mItemAttr = MenuItemAttribute.find(ia).name
|
||||
instance_attr.push(mItemAttr)
|
||||
end
|
||||
|
||||
json.id is.id
|
||||
|
||||
@@ -138,7 +138,29 @@
|
||||
<div id="sxModal">
|
||||
<div id="sxModal-Content"><h3>Card Tap</h3></div>
|
||||
</div>
|
||||
<!-- The modal -->
|
||||
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="modalLabelLarge" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" style="margin-left:-380px">
|
||||
<div class="modal-content">
|
||||
|
||||
<!-- <div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title" id="modalLabelLarge">Large Shoes</h4>
|
||||
</div> -->
|
||||
|
||||
<div class="modal-body">
|
||||
<div id="container">
|
||||
<video autoplay="true" id="videoElement">
|
||||
|
||||
</video>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
// Read Card Reader
|
||||
|
||||
@@ -33,6 +33,11 @@
|
||||
</div>
|
||||
<% end %>
|
||||
<button id="member_acc_no" class="btn btn-success btn-md"><span class="fa fa-credit-card"></span> Member Card</button>
|
||||
<button id="qr_code" class="btn btn-danger btn-md">
|
||||
<span class="fa fa-credit-card"></span> QR CODE
|
||||
</button>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -91,6 +96,7 @@
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
|
||||
$('.datepicker').datepicker({
|
||||
format : 'dd-mm-yyyy',
|
||||
autoclose: true
|
||||
@@ -108,6 +114,27 @@ $(function() {
|
||||
$("#filter_form").submit();
|
||||
},100);
|
||||
});
|
||||
|
||||
// QR Code Reader
|
||||
$("#qr_code").on('click', function(e){
|
||||
var code = "";
|
||||
setTimeout(function(){
|
||||
var hi=getQRCode();
|
||||
alert(hi);
|
||||
},100);
|
||||
});
|
||||
|
||||
// Read qrcode from java
|
||||
function getQRCode(){
|
||||
return code2lab.readQRCode();
|
||||
}
|
||||
|
||||
// get QRCode from Java
|
||||
function setQRCode(code){
|
||||
$("#qr_code").text(code);
|
||||
$("#search").val(code);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$(document).on('click',".customer_tr",function(){
|
||||
|
||||
@@ -147,6 +147,7 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$("#redeem").click(function(){
|
||||
valid_amount = $("#valid_amount").val();
|
||||
sale_id = $("#valid_amount").attr('data-value');
|
||||
|
||||
Reference in New Issue
Block a user