check foreigner lists
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
<% total_female = 0 %>
|
||||
<% total_local = 0 %>
|
||||
<% total_customer = 0 %>
|
||||
<% total_foreigner = 0 %>
|
||||
<% if !@surveys.nil? %>
|
||||
<% @surveys.each do |survey| %>
|
||||
<% total_child = total_child.to_i + survey.child.to_i %>
|
||||
@@ -80,8 +81,11 @@
|
||||
<% foreigner_lists = foreign.split(",") %>
|
||||
<% if !foreigner_lists.empty? %>
|
||||
<% foreigner_lists.each do |fgn| %>
|
||||
<% unless fgn.match(/[^[:digit:]]+/)
|
||||
total_foreigner = total_foreigner.to_i + fgn.to_i
|
||||
end %>
|
||||
<% if !fgn.scan(/\D/).empty? %>
|
||||
<%= fgn %> :<% end %> <%= fgn.to_i unless fgn.match(/[^[:digit:]]+/) %><br>
|
||||
<%= fgn %> :<% end %> <%= fgn.to_i unless fgn.match(/[^[:digit:]]+/) %><br>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
@@ -97,7 +101,8 @@
|
||||
<td><strong><%= total_male %></strong></td>
|
||||
<td><strong><%= total_female %></strong></td>
|
||||
<td><strong><%= total_customer %></strong></td>
|
||||
<td colspan="2"><strong><%= total_local %></strong></td>
|
||||
<td><strong><%= total_local %></strong></td>
|
||||
<td><strong><%= total_foreigner %></strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user