Merge branch 'settings_backend' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Yan
2017-06-22 09:52:22 +06:30
8 changed files with 105 additions and 8 deletions

View File

@@ -94,7 +94,7 @@
<!-- tabs - End -->
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-primary btn-block"> Refresh </button>
<button id="refreshbutton" type="button" class="btn btn-block" style="border-radius:5px;color:#fff;background-color:red;"> Refresh off </button>
</div>
</div>
<!-- Column One -->
@@ -117,4 +117,70 @@ $(document).ready(function(){
window.location.href = '/origami/order/' + order_id;
})
});
$(function() {
var timer;
function start() {
timer = setTimeout(function() { console.log("refresh");window.location.reload()}, 30000); //10000
};
function stop() {
clearTimeout(timer);
};
if(localStorage.getItem("refreshflag") != null){
if (localStorage.getItem("refreshflag") == 0) {
$('#refreshbutton').html("Refresh off");
$('#refreshbutton').css("background-color","red");
stop();
}
else{
$('#refreshbutton').html("Refresh on");
$('#refreshbutton').css("background-color","green");
start();
}
}
else{
localStorage.setItem("refreshflag", 0);
}
var url = location.href;
if (location.href.slice(-1) == "/"){
url = url.substring(0, url.length - 1);
}
var arr = url.split("/");
if(arr[arr.length-1] != "origami"){
stop();
}
$('#refreshbutton').bind("click", function(){
if(localStorage.getItem("refreshflag") == "0"){
localStorage.setItem("refreshflag", 1);
$(this).html("Refresh on");
$(this).css("background-color","green");
// $(this).html("Auto Refresh on<span class='glyphicon glyphicon-ok'></span>");
start();
}
else{
stop();
localStorage.setItem("refreshflag", 0);
$(this).html("Refresh off");
$(this).css("background-color","red");
}
});
function refreshing(){
if(localStorage.getItem("refreshflag") == "0"){
localStorage.setItem("refreshflag", 1);
$(this).html("Refresh on");
$(this).css("background-color","green");
// $(this).html("Auto Refresh on<span class='glyphicon glyphicon-ok'></span>");
start();
}
else{
stop();
localStorage.setItem("refreshflag", 0);
$(this).html("Refresh off");
$(this).css("background-color","red");
}
}
});
</script>

View File

@@ -134,6 +134,7 @@ $(document).on('click', '.cashier_number', function(event){
case 'del' :
var cash=$('#amount').text();
$('#amount').text(cash.substr(0,cash.length-1));
break;
case 'nett':
var remain_amount = $('#validamount').val();
$('#amount').text(remain_amount);

View File

@@ -133,6 +133,7 @@ $(document).on('click', '.cashier_number', function(event){
case 'del' :
var cash=$('#amount').text();
$('#amount').text(cash.substr(0,cash.length-1));
break;
case 'nett':
var remain_amount = $('#validamount').val();
$('#amount').text(remain_amount);

View File

@@ -133,6 +133,7 @@ $(document).on('click', '.cashier_number', function(event){
case 'del' :
var cash=$('#amount').text();
$('#amount').text(cash.substr(0,cash.length-1));
break;
case 'nett':
var remain_amount = $('#validamount').val();
$('#amount').text(remain_amount);

View File

@@ -106,14 +106,14 @@
<div class="col-md-4" id="others"><%= @other %></div>
</div>
<% else %>
<div class="row payment other-payment-color" id="card_payment" >
<div class="row payment other-payment-color" id="card_payment" style="line-height:30px;height: 30px;margin-bottom: 0px;" >
<div class="col-md-12">Other Payments</div>
</div>
<% end %>
<!-- mpu -->
<% if @other != 0.0 %>
<div class="row payment other-payment-color" >
<div class="row payment other-payment-color" style="line-height:30px;height: 30px;margin-bottom: 0px;">
<div class="col-md-5"></div>
<div class="col-md-3">MPU</div>
<div class="col-md-4" id="others"><%= @other %></div>
@@ -127,7 +127,7 @@
<% end %>
<!-- paypar -->
<% if @ppamount != 0.0 %>
<div class="row">
<div class="row payment other-payment-color" style="line-height:30px;height: 30px;margin-bottom: 0px;">
<div class="col-md-5"></div>
<div class="col-md-3">Paypar</div>
<div class="col-md-4" id="ppamount"><%= @ppamount %></div>
@@ -141,7 +141,7 @@
<% end %>
<!-- Visa -->
<% if @visacount != 0.0 %>
<div class="row">
<div class="row payment other-payment-color" style="line-height:30px;height: 30px;margin-bottom: 0px;">
<div class="col-md-5"></div>
<div class="col-md-3">Visa</div>
<div class="col-md-4" id="visacount"><%= @visacount %></div>
@@ -155,7 +155,7 @@
<% end %>
<!-- JCB -->
<% if @jcbcount != 0.0 %>
<div class="row">
<div class="row payment other-payment-color" style="line-height:30px;height: 30px;margin-bottom: 0px;">
<div class="col-md-5"></div>
<div class="col-md-3">JCB</div>
<div class="col-md-4" id="jcbcount"><%= @jcbcount %></div>
@@ -169,7 +169,7 @@
<% end %>
<!-- Master -->
<% if @mastercount != 0.0 %>
<div class="row">
<div class="row payment other-payment-color" style="line-height:30px;height: 30px;margin-bottom: 0px;">
<div class="col-md-5"></div>
<div class="col-md-3">Master</div>
<div class="col-md-4" id="mastercount"><%= @mastercount %></div>

View File

@@ -129,6 +129,7 @@ $(document).on('click', '.cashier_number', function(event){
case 'del' :
var cash=$('#used_amount').text();
$('#used_amount').text(cash.substr(0,cash.length-1));
break;
case 'nett':
alert($('#valid_amount').text())
$('#used_amount').text($('#valid_amount').text());

View File

@@ -133,6 +133,7 @@ $(document).on('click', '.cashier_number', function(event){
case 'del' :
var cash=$('#amount').text();
$('#amount').text(cash.substr(0,cash.length-1));
break;
case 'nett':
var remain_amount = $('#validamount').val();
$('#amount').text(remain_amount);