add survey update function
This commit is contained in:
@@ -5,43 +5,79 @@
|
||||
<%= simple_form_for(@survey, :url => origami_create_surveys_path) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
<div class="form-inputs p-l-10">
|
||||
<% if !@survey_data.nil? %>
|
||||
<%= f.input :child, input_html: { value: @survey_data.child, class: 'col-md-10' }%>
|
||||
<%= f.input :adult, input_html: { value: @survey_data.adult, class: 'col-md-10' }%>
|
||||
<%= f.input :male , input_html: { value: @survey_data.male, class: 'col-md-10' }%>
|
||||
<%= f.input :female , input_html: { value: @survey_data.female, class: 'col-md-10' }%>
|
||||
<%= f.input :total_customer, input_html: { value: @survey_data.total_customer, class: 'col-md-10'} %>
|
||||
<%= f.input :local , input_html: { value: @survey_data.local, class: 'col-md-10' }%>
|
||||
|
||||
<%= f.input :child , input_html: { class: 'col-md-10' }%>
|
||||
<%= f.input :adult , input_html: { class: 'col-md-10' }%>
|
||||
<%= f.input :male , input_html: { class: 'col-md-10' }%>
|
||||
<%= f.input :female , input_html: { class: 'col-md-10' }%>
|
||||
<%= f.input :total_customer, input_html: { class: 'col-md-10'} %>
|
||||
<%= f.input :local , input_html: { class: 'col-md-10' }%>
|
||||
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<label class="p-l-10">Foreigner</label>
|
||||
<!-- <input type="text" class="form-control" name="survey[foreigner][]"> -->
|
||||
<select class="form-control col-md-12 selectpicker show-tick" name="survey[foreigner][]" style="height: " >
|
||||
<% Lookup.where("lookup_type = ?", "country" ).each do |ct| %>
|
||||
<option value="<%= ct.value %>">
|
||||
<%= ct.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<label class="p-l-10">Foreigner</label>
|
||||
<!-- <input type="text" class="form-control" name="survey[foreigner][]"> -->
|
||||
<select class="form-control col-md-12 selectpicker show-tick" name="survey[foreigner][]" style="height: " >
|
||||
<% Lookup.where("lookup_type = ?", "country" ).each do |ct| %>
|
||||
<option value="<%= ct.value %>">
|
||||
<%= ct.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<label class="p-l-10">Number</label>
|
||||
<input type="number" name="survey[foreigner][]" class="form-control">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<label class="p-l-10">Number</label>
|
||||
<input type="number" name="survey[foreigner][]" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 ">
|
||||
<br>
|
||||
<button type="button" class="btn btn-success" id="addForeigner">Add</button>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 ">
|
||||
<br>
|
||||
<button type="button" class="btn btn-success" id="addForeigner">Add</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= f.input :child , input_html: { class: 'col-md-10' }%>
|
||||
<%= f.input :adult , input_html: { class: 'col-md-10' }%>
|
||||
<%= f.input :male , input_html: { class: 'col-md-10' }%>
|
||||
<%= f.input :female , input_html: { class: 'col-md-10' }%>
|
||||
<%= f.input :total_customer, input_html: { class: 'col-md-10'} %>
|
||||
<%= f.input :local , input_html: { class: 'col-md-10' }%>
|
||||
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<label class="p-l-10">Foreigner</label>
|
||||
<!-- <input type="text" class="form-control" name="survey[foreigner][]"> -->
|
||||
<select class="form-control col-md-12 selectpicker show-tick" name="survey[foreigner][]" style="height: " >
|
||||
<% Lookup.where("lookup_type = ?", "country" ).each do |ct| %>
|
||||
<option value="<%= ct.value %>">
|
||||
<%= ct.name %></option>
|
||||
<%end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 ">
|
||||
<div class="form-group p-l-10 p-r-10">
|
||||
<label class="p-l-10">Number</label>
|
||||
<input type="number" name="survey[foreigner][]" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 ">
|
||||
<br>
|
||||
<button type="button" class="btn btn-success" id="addForeigner">Add</button>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="hidden" id="newTemplate" >
|
||||
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="survey_id" value="<%=@survey.id%>">
|
||||
<% if !@survey_data.nil? %>
|
||||
<input type="hidden" name="survey_id" value=<%= @survey_data.id %> />
|
||||
<% else %>
|
||||
<input type="hidden" name="survey_id" />
|
||||
<% end %>
|
||||
<input type="hidden" name="table_id" value="<%=@dining_facility.id%>">
|
||||
<%= f.input :dining_name, :as => :hidden, :input_html => { :value => @dining_facility.name } %>
|
||||
<%= f.input :created_by, :as => :hidden, :input_html => { :value => current_login_employee.name } %>
|
||||
|
||||
Reference in New Issue
Block a user