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

This commit is contained in:
Yan
2017-11-15 12:06:55 +06:30
19 changed files with 147 additions and 71 deletions

View File

@@ -77,6 +77,11 @@
<span><%= t :transactions %></span>
</a>
<ul class="ml-menu">
<% if can? :menage, Booking %>
<li>
<a href="<%= transactions_bookings_path %>"><%= t :bookings %></a>
</li>
<% end %>
<% if can? :menage, Order %>
<li>
<a href="<%= transactions_orders_path %>"><%= t :orders %></a>

View File

@@ -83,17 +83,21 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
var to_date = new Date($('#to').val());
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
var from_date = new Date($('#from').val());
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
var period = 0;
var period_type = 1;

View File

@@ -141,20 +141,21 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
console.log(from);
console.log(to);
var to_date = new Date($('#to').val());
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
var from_date = new Date($('#from').val());
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
var period = 0;
var period_type = 1;
if(to != '' && from != ''){

View File

@@ -147,17 +147,21 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
var to_date = new Date($('#to').val());
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
var from_date = new Date($('#from').val());
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
var period = 0;
var period_type = 1;

View File

@@ -211,17 +211,19 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
var to_date = new Date($('#to').val());
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
var from_date = new Date($('#from').val());
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
var period = 0;
var period_type = 1;

View File

@@ -145,18 +145,21 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
console.log(date);
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
var to_date = new Date($('#to').val());
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
var from_date = new Date($('#from').val());
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
var period = 0;
var period_type = 1;

View File

@@ -105,17 +105,19 @@
// OK button is clicked
$('#from').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#from').val(date.format("DD-MM-YYYY"))
$('#from').val(date)
search_by_date();
});
$('#to').bootstrapMaterialDatePicker().on('beforeChange', function(e, date){
$('#to').val(date.format("DD-MM-YYYY"))
$('#to').val(date)
search_by_date();
});
function search_by_date(){
var from = $('#from').val();
var to = $('#to').val();
var to_date = new Date($('#to').val());
var to = to_date.getDate() + "-" + to_date.getMonth() + "-" + to_date.getFullYear();
var from_date = new Date($('#from').val());
var from = from_date.getDate() + "-" + from_date.getMonth() + "-" + from_date.getFullYear();
var period = 0;
var period_type = 1;