<div class="modal-body">
<div class="event_controller">
<!-- <form class="form-horizontal"> -->
	<%= form_for @event, :url =>panel_calendar_back_end_event_path(@event), :class=>"form-horizontal", :remote => true do |f| %>
	<div class="row-fluid">
		<button type="button" class="close btn-close" data-dismiss="modal" aria-hidden="true">×</button>
	</div>
	<div class="row-fluid">
		<%= f.text_field :title, :class=>"span12", :placeholder => "Event Name",:value=>@event.title %>
	</div>
	<div class="row-fluid">
		<label class="checkbox inline">
			<input type="checkbox" name="all_day" for="all_day" <%= @event.all_day == true ? "checked='checked'" : "" %> > All day
		</label>
		<label class="checkbox inline">
			<input type="checkbox"> Repeat
		</label>
	</div>
	<% if !@event.all_day %>
		<div id="non_all_day">
			<div class="row-fluid">
				<label class="control-label span3">From</label>
				<div class="row-fluid span9">
					<input class="span5" id="dpfrom" type="text" value="<%= @event.start_month.to_s + "/" + @event.start_date.to_s + "/" + @event.start_year.to_s %>" name="start_date">
					<select name="start_time" class="span4">
						<% @hours.each_with_index do |hour,i| %>
							<% if hour['val'] == @event.start_time %>
								<option value="<%= hour['val'] %>" selected="selected"><%= hour['title'] %></option>
							<% else %>
								<option value="<%= hour['val'] %>" ><%= hour['title'] %></option>
							<% end %>
						<% end %>
					</select>
					<select name="start_am_pm" class="span3">
						<% @ampm.each do |a| %>
							<% if @event.start_am_pm == a %>
								<option value="<%= a %>" selected="selected"><%= a %></option>
							<% else %>
								<option value="<%= a %>"><%= a %></option>	
							<% end %>
						<% end %>
					</select>
				</div>
			</div>
			<div class="row-fluid">
				<label class="control-label span3">To</label>
				<div class="row-fluid span9">
					<input class="span5" id="dpto" type="text" value="<%= @event.end_month.to_s + "/" + @event.end_date.to_s + "/" + @event.end_year.to_s %>" name="end_date">
					<select name="end_time" class="span4">
						<% @hours.each_with_index do |hour,i| %>
							<% if hour['val'] == @event.end_time %>
								<option value="<%= hour['val'] %>" selected="selected"><%= hour['title'] %></option>
							<% else %>
								<option value="<%= hour['val'] %>" ><%= hour['title'] %></option>
							<% end %>
						<% end %>
					</select>
					<select name="end_am_pm" class="span3">
						<% @ampm.each do |a| %>
							<% if @event.end_am_pm == a %>
								<option value="<%= a %>" selected="selected"><%= a %></option>
							<% else %>
								<option value="<%= a %>"><%= a %></option>	
							<% end %>
						<% end %>
					</select>
				</div>
			</div>
		</div>
	<% else %>
		<div id="non_all_day" style="display:none;">
			<div class="row-fluid">
				<label class="control-label span3">From</label>
				<div class="row-fluid span9">
					<input class="span5" id="dpfrom" type="text" value="" name="start_date">
					<select name="start_time" class="span4">
						<% @hours.each_with_index do |hour,i| %>
							<% if i == 16 %>
								<option value="<%= hour['val'] %>" selected="selected"><%= hour['title'] %></option>
							<% else %>
								<option value="<%= hour['val'] %>" ><%= hour['title'] %></option>
							<% end %>
						<% end %>
					</select>
					<select name="start_am_pm" class="span3">
						<option value="AM">AM</option>
						<option value="PM">PM</option>
					</select>
				</div>
			</div>
			<div class="row-fluid">
				<label class="control-label span3">To</label>
				<div class="row-fluid span9">
					<input class="span5" id="dpto" type="text" name="end_date" value="<%= @placeholder %>" placeholder="<%= @placeholder %>">
					<select name="start_time" class="span4">
						<% @hours.each_with_index do |hour,i| %>
							<% if i == 18 %>
								<option value="<%= hour['val'] %>" selected="selected"><%= hour['title'] %></option>
							<% else %>
								<option value="<%= hour['val'] %>" ><%= hour['title'] %></option>
							<% end %>
						<% end %>
					</select>
					<select name="end_am_pm" class="span3">
						<option value="AM">AM</option>
						<option value="PM">PM</option>
					</select>
				</div>
			</div>
		</div>
	<% end %>
	<div class="row-fluid">
		<label for="" class="control-label span3">Calendars</label>
		<div class="row-fluid span9">
			<%= f.select(:cal_id, Cal.all.collect {|p| [ p.name, p.id ] },{:prompt => t("calendar.select_calendar")},:class => "validate", :selected => @event.cal_id) %>
		</div>
	</div>
	<div class="row-fluid">
		<label for="" class="control-label span3">Note</label>
		<div class="row-fluid span9">
			<%= f.text_area :note, :class=>"span12", :cols=>"30", :rows=>"3", :value => @event.note %>
		</div>
	</div>
	<div class="row-fluid">
		<div class="span9 offset3">
			<button class="btn btn-close">Cancel</button>
			<%= f.submit t("calendar.save"), :class=>"btn" %>
		</div>
	</div>
<% end %>
<!-- </form> -->
</div>
</div>