<div class="p-l-15">
	<%= form_tag report_path, :method => :get, :id=>"frm_report", :class => "form" do %>
	<% if period_type != false %>
	<div class="row">
		<div class="col-lg-2 col-md-2 col-sm-2">
			<label class="font-14"><%= t("views.right_panel.detail.select_period") %></label>
			<select name="period" id="sel_period" class="form-control">
				<option value=""><%= t("views.right_panel.detail.select_period") %></option>
				<option value="0">Today</option>
				<option value="1">Yesterday</option>
				<option value="2">This week</option>
				<option value="3">Last week</option>
				<option value="4">Last 7 days</option>
				<option value="5">This month</option>
				<option value="6">Last month</option>
				<option value="7">Last 30 days</option>
				<option value="8">This year</option>
				<option value="9">Last year</option>
			</select>
		</div>
		<% if defined? providers %>
		<div class="col-lg-2 col-md-2 col-sm-2">
			<label class="font-14"><%= t("views.right_panel.detail.select_providers") %></label>
			<%= select_tag "provider", options_for_select(@providers, :selected => params[:provider]), :class => "form-control" %>	
		</div>
		<% end %>
		<div class="col-lg-2 col-md-2 col-sm-2">					
			<!-- <label class="">Select Shift Period</label> -->
			<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
			<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="from" id="from" type="text" placeholder="From date" style="height: 32px;">
		</div>
		<div class="col-lg-2 col-md-2 col-sm-2">
			<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
			<input data-behaviour='datepicker' class="form-control datepicker m-t-3" name="to" id="to" type="text" placeholder="To date" style="height: 32px;">
		</div>
		<div class="col-lg-2 col-md-2 col-sm-2">
			<label class="font-14"><%= t("views.right_panel.detail.all_shift") %></label>
			<select class="form-control select" name="shift_name" id="shift_name" >
			</select>
		</div>
		<div class="col-lg-1 col-md-1 col-sm-1 margin-top-20">
			<br>
			<input type="submit" value="Generate Report" class='btn btn-primary'>
		</div>							
	</div>													
	<% end %>

	<% end %>	
</div>	

<script type="text/javascript">
	<% if params[:shift_name].to_i > 0%>
	shift_id = '<%= params[:shift_name] %>'
	local_date = '<%= @shift_from %> - <%= @shift_to %> '
	var shift = $('#shift_name');
	str = '<option value="'+ shift_id +'" '+ 'selected = "selected"' +'>' + local_date + '</option>';
	shift.append(str);
	<% end %>

	$("#from").val("<%=params[:from] rescue '-'%>");
	$("#to").val("<%=params[:to] rescue '-'%>");
	$("#sel_period").val(<%=params[:period] rescue '-'%>);
</script>
