check user agent and token when webview is loaded

This commit is contained in:
phyusin
2018-04-06 15:36:08 +06:30
parent dac1a58b64
commit a2e4863c9d
22 changed files with 119 additions and 45 deletions

View File

@@ -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'))