Prettify the COItem pages
[cs356-p2-videostore.git] / app / views / coitem / overdue.rhtml
diff --git a/app/views/coitem/overdue.rhtml b/app/views/coitem/overdue.rhtml
new file mode 100644 (file)
index 0000000..d6f525e
--- /dev/null
@@ -0,0 +1,32 @@
+<h1>Listing Overdue Items</h1>
+
+<table border="1">
+  <tr>
+    <th>Customer</th>
+    <th>Customer Phone #</th>
+    <th>Customer Email</th>
+    <th>Type</th>
+    <th>Title</th>
+    <th>Overdue</th>
+    <th>Date Checked Out</th>
+    <th>Due Date</th>
+  </tr>
+  
+<% for coitem in @coitems %>
+  <tr>
+    <td><%=link_to coitem.customer.name, :controller => 'customer', :action => 'show', :id => coitem.customer.id %></td>
+    <td><%=h coitem.customer.phone %></td>
+    <td><%=h coitem.customer.email %></td>
+    <td><%=h coitem.rentable.type %></td>
+    <td><%=h coitem.rentable.title %></td>
+    <td><%=h tf_to_yesno(coitem.overdue?) %></td>
+    <td><%=h coitem.out_date %></td>
+    <td><%=h coitem.due_date %></td>
+    <td><%= link_to 'View', :action => 'show', :id => coitem %></td>
+  </tr>
+<% end %>
+</table>
+
+<%= link_to 'Previous page', { :page => @coitem_pages.current.previous } if @coitem_pages.current.previous %>
+<%= link_to 'Next page', { :page => @coitem_pages.current.next } if @coitem_pages.current.next %> 
+