diff --git a/app/controllers/cards_controller.rb b/app/controllers/cards_controller.rb index 66c0759..8104783 100644 --- a/app/controllers/cards_controller.rb +++ b/app/controllers/cards_controller.rb @@ -34,7 +34,7 @@ class CardsController < ApplicationController def show if can? :read, DoorLog then card_num_R = @card.card_number.to_i(16)%32767 - @door_logs = DoorLog.where('key = ? AND data = ?', "R", card_num_R).order("created_at DESC") + @door_logs = DoorLog.where('key = ? AND data = ?', "G", card_num_R).order("created_at DESC") end respond_to do |format| format.html # show.html.erb diff --git a/app/views/door_logs/index.html.erb b/app/views/door_logs/index.html.erb index 7366721..e286c70 100644 --- a/app/views/door_logs/index.html.erb +++ b/app/views/door_logs/index.html.erb @@ -72,7 +72,7 @@ Guide to log keys and data: end %> <% @cardnum = (door_log.data.to_i+(@divided_tmp*32767)).to_s(16) %> <%= "Card: "+@cardnum %> - <% @card = Card.find(:first,:conditions=>['card_number LIKE ?', @cardnum]) %> + <% @card = Card.find(:first,:conditions=>['lower(card_number) = ?', @cardnum.downcase]) %> <%= "("+@card.user.name+")" unless @card.nil? %> <% else diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 828e8f1..7718e44 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -30,5 +30,6 @@
<%= raw(alert) %>
<%= yield %> +<%= raw Setting.analytics_code if Setting.present? %>