check user agent and token when webview is loaded
This commit is contained in:
@@ -2,13 +2,23 @@ class Origami::AddordersController < BaseOrigamiController
|
||||
# before_action :set_dining, only: [:detail]
|
||||
|
||||
def index
|
||||
@tables = Table.all.active.order('zone_id asc').group("zone_id")
|
||||
@rooms = Room.all.active.order('zone_id asc').group("zone_id")
|
||||
@all_table = Table.all.active.order('status desc')
|
||||
@all_room = Room.all.active.order('status desc')
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@tables = Table.all.active.order('zone_id asc').group("zone_id")
|
||||
@rooms = Room.all.active.order('zone_id asc').group("zone_id")
|
||||
@all_table = Table.all.active.order('status desc')
|
||||
@all_room = Room.all.active.order('status desc')
|
||||
end
|
||||
|
||||
def detail
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
today = DateTime.now
|
||||
day = Date.today.wday
|
||||
@menus = Menu.all
|
||||
|
||||
@@ -9,7 +9,6 @@ class Origami::CustomersController < BaseOrigamiController
|
||||
end
|
||||
|
||||
def get_customer
|
||||
|
||||
filter = params[:filter]
|
||||
type = params[:type]
|
||||
|
||||
@@ -47,7 +46,11 @@ class Origami::CustomersController < BaseOrigamiController
|
||||
end
|
||||
|
||||
def add_customer
|
||||
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@sale_id = params[:sale_id]
|
||||
@cashier_type = params[:type]
|
||||
@page = params[:page]
|
||||
|
||||
@@ -3,6 +3,11 @@ class Origami::DiscountsController < BaseOrigamiController
|
||||
|
||||
#discount page show from origami index with selected order
|
||||
def index
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
sale_id = params[:id]
|
||||
@cashier_type = params[:type]
|
||||
if Sale.exists?(sale_id)
|
||||
|
||||
@@ -5,10 +5,8 @@ class Origami::HomeController < BaseOrigamiController
|
||||
def index
|
||||
@webview = false
|
||||
if check_mobile
|
||||
puts "request data"
|
||||
@webview = true
|
||||
end
|
||||
puts @webview == false
|
||||
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@@ -21,6 +19,11 @@ class Origami::HomeController < BaseOrigamiController
|
||||
|
||||
# origami table detail
|
||||
def show
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
class Origami::OrdersController < BaseOrigamiController
|
||||
def show
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
|
||||
|
||||
@@ -2,6 +2,11 @@ class Origami::OtherChargesController < BaseOrigamiController
|
||||
authorize_resource :class => false
|
||||
|
||||
def index
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
sale_id = params[:sale_id]
|
||||
@cashier_type = params[:type]
|
||||
if Sale.exists?(sale_id)
|
||||
|
||||
@@ -5,9 +5,18 @@ class Origami::RoomsController < BaseOrigamiController
|
||||
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
|
||||
@orders = Order.where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||
# @shift = ShiftSale.current_open_shift(current_user.id)
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and sale_status != 'new'",DateTime.now.strftime('%Y-%m-%d'))
|
||||
|
||||
@@ -2,6 +2,11 @@ class Origami::SplitBillController < BaseOrigamiController
|
||||
authorize_resource :class => false
|
||||
|
||||
def index
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
dining_id = params[:dining_id]
|
||||
@cashier_type = params[:type]
|
||||
@table = DiningFacility.find(dining_id)
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
class Origami::SurveysController < BaseOrigamiController
|
||||
def new
|
||||
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
end
|
||||
|
||||
@survey = Survey.new
|
||||
@id = params[:id]
|
||||
@cashier_type = params[:type]
|
||||
|
||||
Reference in New Issue
Block a user