Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -21,9 +21,9 @@
|
||||
|
||||
$(document).ready(function(){
|
||||
// auto refresh every 60 seconds
|
||||
setTimeout(function(){
|
||||
window.location.reload(1);
|
||||
}, 60000);
|
||||
// setTimeout(function(){
|
||||
// window.location.reload(1);
|
||||
// }, 60000);
|
||||
|
||||
// For selected order return
|
||||
var order_status = "";
|
||||
|
||||
@@ -10,14 +10,19 @@ class HomeController < ApplicationController
|
||||
@login_form.emp_id = params[:login_form][:emp_id]
|
||||
@login_form.password = params[:login_form][:password]
|
||||
@employee = Employee.login(@login_form.emp_id, @login_form.password)
|
||||
if @employee.role == "administrator"
|
||||
session[:session_token] = @employee.token_session
|
||||
redirect_to dashboard_path
|
||||
elsif @employee.role == "cashier"
|
||||
session[:session_token] = @employee.token_session
|
||||
redirect_to origami_root_path
|
||||
|
||||
if @employee != nil
|
||||
if @employee.role == "administrator"
|
||||
session[:session_token] = @employee.token_session
|
||||
redirect_to dashboard_path
|
||||
elsif @employee.role == "cashier"
|
||||
session[:session_token] = @employee.token_session
|
||||
redirect_to origami_root_path
|
||||
else
|
||||
render :index
|
||||
end
|
||||
else
|
||||
render :index
|
||||
redirect_to origami_root_path, :notice => "Username and Password dosn't match!"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-sm-6 col-md-offset-4 col-sm-offset-3">
|
||||
<%= simple_form_for(@login_form, url: login_path, method: "POST") do |f| %>
|
||||
<div class="card">
|
||||
<h4 class="card-title text-center" style="margin:10px">Login</h4>
|
||||
<div class="content" style="margin:10px">
|
||||
<div class="form-group">
|
||||
<%= f.input :emp_id, required: false, autofocus: true, class: "form-control" %>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<%= f.input :password, required: false, class: "form-control" %>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-sm-6 col-md-offset-4 col-sm-offset-3">
|
||||
<%= simple_form_for(@login_form, url: login_path, method: "POST") do |f| %>
|
||||
<div class="card">
|
||||
<h4 class="card-title text-center" style="margin:10px">Login</h4>
|
||||
<div class="content" style="margin:10px">
|
||||
<div class="form-group">
|
||||
<%= f.input :emp_id, required: false, autofocus: true, class: "form-control" %>
|
||||
</div>
|
||||
<div class="footer text-center" style="margin:10px">
|
||||
<%= f.button :submit, "Log in", class: "form-control btn btn-fill btn-warning btn-wd" %>
|
||||
|
||||
<div class="form-group">
|
||||
<%= f.input :password, required: false, class: "form-control" %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="footer text-center" style="margin:10px">
|
||||
<%= f.button :submit, "Log in", class: "form-control btn btn-fill btn-warning btn-wd" %>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<%= render 'layouts/header' %>
|
||||
<div class="container-fluid">
|
||||
<% flash.each do |type, message| %>
|
||||
<div class="alert fade in">
|
||||
<div class="alert fade-in">
|
||||
<button class="close" aria-hidden="true" data-dismiss="alert" type="button">×</button>
|
||||
<%= message %>
|
||||
</div>
|
||||
|
||||
16
db/seeds.rb
16
db/seeds.rb
@@ -76,17 +76,23 @@ booking_status = Lookup.create([{lookup_type:'booking_status', name: 'Available'
|
||||
account_type = Lookup.create([{lookup_type:'account_type', name: 'Income', value: 'income'},
|
||||
{lookup_type:'account_type', name: 'Expense', value: 'expense'}])
|
||||
|
||||
# sale void reason
|
||||
void_reason = Lookup.create([{lookup_type:'void_reason', name: 'Approve By Manager', value: 'Approve By Manager'},
|
||||
{lookup_type:'void_reason', name: 'Customer Mistake', value: 'Customer Mistake'},
|
||||
{lookup_type:'void_reason', name: 'Cashier Mistake', value: 'Cashier Mistake'},
|
||||
{lookup_type:'void_reason', name: 'Waiter Mistake', value: 'Waiter Mistake'}])
|
||||
|
||||
#WALK CUSTOMER - Default CUSTOMER (take key 1)
|
||||
customer = Customer.create({name:"WALK-IN", email: "cus1@customer.com", contact_no:"000000000"})
|
||||
customer2 = Customer.create({name:"TAKEAWAY", email: "cus2@customer.com", contact_no:"111111111"})
|
||||
|
||||
#Default ZOne
|
||||
zone = Zone.create({id:1, name: "Normal Zone", is_active:true, created_by: "SYSTEM DEFAULT"})
|
||||
zone2 = Zone.create({id:2, name: "VIP Zone", is_active:true, created_by: "SYSTEM DEFAULT"})
|
||||
# zone = Zone.create({id:1, name: "Normal Zone", is_active:true, created_by: "SYSTEM DEFAULT"})
|
||||
# zone2 = Zone.create({id:2, name: "VIP Zone", is_active:true, created_by: "SYSTEM DEFAULT"})
|
||||
|
||||
#Default dining_facilities
|
||||
table = Table.create({name:"Table 1", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
room = Room.create({name:"Table 2", zone: zone2, status:"available", seater: 4 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
# table = Table.create({name:"Table 1", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
# room = Room.create({name:"Table 2", zone: zone2, status:"available", seater: 4 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
|
||||
#Tax Profile
|
||||
tax_profiles = TaxProfile.create({id:1, name: "Commerical Tax", rate:5.0, order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
@@ -132,7 +138,7 @@ zone_order_queue_station = OrderQueueStation.create({station_name: "Zone 1 Queue
|
||||
|
||||
|
||||
#Default Order Queue Process By Zone
|
||||
zone_queue_station = OrderQueueProcessByZone.create({order_queue_station: zone_order_queue_station, zone: zone2})
|
||||
#zone_queue_station = OrderQueueProcessByZone.create({order_queue_station: zone_order_queue_station, zone: zone2})
|
||||
|
||||
|
||||
#Create Adminstrator employee
|
||||
|
||||
@@ -576,5 +576,44 @@ menu_category19 = MenuCategory.create({menu: menu, code:"C0018", name: "Beer", a
|
||||
menu_category20 = MenuCategory.create({menu: menu, code:"C0019", name: "Signature Hot Tea", alt_name: "Chicken", order_by: 19, created_by: "SYSTEM DEFAULT"})
|
||||
puts "Beauty in the pot's menu setup"
|
||||
|
||||
zone = Zone.create({id:1, name: "H1", is_active:true, created_by: "SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"61", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"62", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"53", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"54", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"24", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"25", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"26", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"34", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"35", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"45", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"46", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"47", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"48", zone: zone, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
|
||||
zone2 = Zone.create({id:2, name: "H2", is_active:true, created_by: "SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"51", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"52", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"11", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"12", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"21", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"22", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"23", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"31", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"32", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"33", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"41", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"42", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"43", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"44", zone: zone2, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
zone3 = Zone.create({id:3, name: "H3", is_active:true, created_by: "SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"71", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"72", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"73", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"74", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"75", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"76", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"77", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
table = Table.create({name:"78", zone: zone3, status:"available", seater: 2 , order_by:1, created_by:"SYSTEM DEFAULT"})
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user