Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <% form_tag({:controller => "timesheet_details", :action => "create"}) do %>
- <table class="records">
- <tr>
- <th></th>
- <th colspan="3" style="text-align:center;border-left:1px solid #ccc;">Normal Time</th>
- <th colspan="3" style="text-align:center;border-left:1px solid #ccc;">Over Time</th>
- </tr>
- <tr>
- <th>Date</th>
- <th style="border-left:1px solid #ccc;">Time In</th>
- <th>Time Out</th>
- <th>Lunch</th>
- <th style="border-left:1px solid #ccc;">Time In</th>
- <th>Time Out</th>
- <th>Dinner</th>
- </tr>
- <% (@timesheet.work_month).upto(@last_day) do |day| %>
- <% ts = @timesheet.timesheet_details.find_by_day(day.mday) %>
- <% if @holiday_ids.include?(day.mday) %>
- <tr style="background-color:#ffefef">
- <% elsif [0, 6].include?(day.wday) %>
- <tr style="background-color:#ffffe6">
- <% end %>
- <td class=<%= "now" if day.mday == Date.today.day %>><%= day.mday %></td>
- <span style="display:none;"><input type='text' name='timesheet_detail_<%= day.mday %>[timesheet_id]' value="<%= @timesheet.id %>"/></span>
- <span style="display:none;"><input type='text' name='timesheet_detail_<%= day.mday %>[day]' value="<%= day.mday %>"/></p></span>
- <td><input type='text' class="<%= (day.mday < Date.today.day && day.month == Date.today.month) ? "fill_in " : "" %>timesheet_detail_normal_time_in" name="timesheet_detail_<%= day.mday %>[normal_time_in]" size="9" value="<%= ts.normal_time_in if ts %>"/></td>
- <td><input type='text' class="<%= (day.mday < Date.today.day && day.month == Date.today.month) ? "fill_out " : "" %>timesheet_detail_normal_time_out" name='timesheet_detail_<%= day.mday %>[normal_time_out]' size="9" value="<%= ts.normal_time_out if ts %>"/></td>
- <td><input type='text' class="<%= (day.mday < Date.today.day && day.month == Date.today.month) ? "fill_lunch " : "" %>timesheet_detail_lunch" name='timesheet_detail_<%= day.mday %>[lunch]' size="9" value="<%= ts.lunch if ts %>"/></td>
- <td><input type='text' class="timesheet_detail_over_time_in" name='timesheet_detail_<%= day.mday %>[over_time_in]' size="9" value="<%= ts.over_time_in if ts %>"/></td>
- <td><input type='text' class="timesheet_detail_over_time_out" name='timesheet_detail_<%= day.mday %>[over_time_out]' size="9" value="<%= ts.over_time_out if ts %>"/></td>
- <td><input type='text' class="timesheet_detail_dinner" name='timesheet_detail_<%= day.mday %>[dinner]' size="9" value="<%= ts.dinner if ts %>"/></td>
- </tr>
- <% end %>
- </table>
- <%= submit_tag "Submit" %>
- <% end -%>
Add Comment
Please, Sign In to add comment