<%= title l(:label_rfq) %>
<%= render partial: "wkrfq/render_purchasing_tabs" %>

<%
    rfq_name =session[controller_name].try(:[], :rfq_name)
    rfq_date =session[controller_name].try(:[], :rfq_date)
%>
 <%= form_tag({:controller => 'wkrfq', :action => 'index'}, :method => :get, :id => 'query_form') do %>
	<fieldset>
		<div style="float:right">
			<%= link_to l(:label_new_rfq), url_for(:controller => controller_name, :action => 'edit'), :class => 'icon icon-add' %>
		</div>
		<%= hidden_field_tag 'tab', "wkrfq" %>
		<%= hidden_field_tag 'searchlist', "wkrfq" %>
		<table>
			<tr>
				<th><label for='name'><%= l(:field_name) %></label></th>
				<td><%= text_field_tag 'rfq_name', rfq_name, :size => 30 %></td>
				<th><label style="padding-left: 10px;"><%= l(:label_date) %></label></th>
				<td><%= date_field_tag('rfq_date', rfq_date, :size => 10) %> <%= calendar_for('rfq_date') %></td>
				<td><%= submit_tag l(:button_apply), :class => "small", :name => nil %></td>
				<td><%= link_to l(:button_clear), {tab: controller_name, clear: true}, :class => 'icon icon-reload' %></td>
			</tr>
		</table>
	</fieldset>
 <% end %>

<% if @rfqEntries.present? %>
	<%= render :partial => 'wkrfq/rfq_list'%>
	<% other_formats_links do |f| %>
		<%= f.link_to_with_query_parameters 'CSV', {} %>
	<% end %>
<% else %>
	<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
