added a new vulnerability plus completed the work info page

This commit is contained in:
Ken Johnson
2013-05-31 11:41:54 -04:00
parent 97ca13632d
commit f8e21af3e0
4 changed files with 91 additions and 1 deletions
+1
View File
@@ -1,5 +1,6 @@
class WorkInfoController < ApplicationController class WorkInfoController < ApplicationController
def index def index
@user = current_user
end end
end end
+7 -1
View File
@@ -1,4 +1,10 @@
class WorkInfo < ActiveRecord::Base class WorkInfo < ActiveRecord::Base
attr_accessible :DoB, :SSN, :bonuses, :income, :user_id, :years_worked attr_accessible :DoB, :SSN, :bonuses, :income, :years_worked
belongs_to :user belongs_to :user
# We should probably use this
def last_four
"***-**-" << self.SSN[-4,4]
end
end end
+41
View File
@@ -0,0 +1,41 @@
<div class="dashboard-wrapper">
<div class="main-container">
<div class="row-fluid">
<div class="span12">
<div class="widget">
<div class="widget-header">
<div class="title">
<span class="fs1" aria-hidden="true" data-icon="&#xe088;"></span> Employee Information
</div>
</div>
<div class="widget-body">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="width:16%">Full Name</th>
<th style="width:16%">Income</th>
<th style="width:16%">Bonuses</th>
<th style="width:16%">Years w/ MetaCorp</th>
<th style="width:16%">SSN</th>
<th style="width:16%">DoB</th>
</tr>
</thead>
<tbody>
<tr>
<td><%= "#{@user.first_name} #{@user.last_name}" %></td>
<td><%= @user.work_info.income %></td>
<td><%= @user.work_info.bonuses %></td>
<td><%= @user.work_info.years_worked %></td>
<td><%= @user.work_info.SSN %></td>
<td><%= @user.work_info.DoB %></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
+42
View File
@@ -143,6 +143,42 @@ paid_time_off = [
} }
] ]
work_info = [
{
:user_id => 2,
:income => "$50,000",
:bonuses => "$10,000",
:years_worked => 2,
:SSN => "555-55-5555",
:DoB => "01-01-1980"
},
{
:user_id => 3,
:income => "$40,000",
:bonuses => "$10,000",
:years_worked => 1,
:SSN => "333-33-3333",
:DoB => "01-01-1979"
},
{
:user_id => 4,
:income => "$60,000",
:bonuses => "$12,000",
:years_worked => 3,
:SSN => "444-44-4444",
:DoB => "01-01-1981"
},
{
:user_id => 5,
:income => "$30,000",
:bonuses => "7,000",
:years_worked => 1,
:SSN => "222-22-2222",
:DoB => "01-01-1982"
}
]
users.each do |user_info| users.each do |user_info|
@@ -168,4 +204,10 @@ schedule.each do |event|
sched = Schedule.new(event.reject {|k| k == :user_id}) sched = Schedule.new(event.reject {|k| k == :user_id})
sched.user_id = event[:user_id] sched.user_id = event[:user_id]
sched.save sched.save
end
work_info.each do |wi|
info = WorkInfo.new(wi.reject {|k| k == :user_id})
info.user_id = wi[:user_id]
info.save
end end