<%= form_tag({:action => "filter_columns"})  %>
<h1 class="head">Filterkriterien für Anlagen</h1>

<div class="form-abfrage">

    <table border="0" class="form--settings">
      <tr>
        <td>Berichtszeitraum:</td>
        <td><%=   select_tag :jahr, options_for_select(@reporting_periods, @act_period)  %></td>
        <td></td>
        <td></td>
      </tr>
    </table>

    <h2>Anlagenspezifisch</h2>
    <table border="0" class="form--settings form--selection-list">
      <tr>
         <td> Name oder Namensteil:</td>
        <td><input type="text" name="name"></td>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td>ID oder Teil-ID:</td>
        <td><input type="text" name="id"></td>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td>EU-Schlüssel oder Teilschlüssel:</td>
        <td><input type="text" name="eu_key"></td>
        <td></td>
        <td></td>
      </tr>
      <tr>
        <td>Bundesland</td>
        <td><%= select_tag :federal_state_id, options_for_select(@federal_states, @default_federal_state) %></td>
        <td></td>
        <td></td>
      </tr>
      <tr>
      <tr>
        <td>Jahr der Fertigstellung:</td>
        <td><input type="text" name="fertigstellung" onKeyup="checknumber(this)"></td>
        <td><label><input type="radio" name="fert" value ="1" checked>nach</label></td>
        <td><label><input type="radio" name="fert" value ="0">vor</label></td>
      </tr>
      <tr>
        <td>Ausbaugröße:</td>
        <td><input type="text" name="ausbaugroesse" onKeyup="checknumber(this)"></td>
        <td><label><input type="radio" name="ausbau" value ="1" checked>über</label></td>
        <td><label><input type="radio" name="ausbau" value ="0">unter</label></td>
      </tr>
      <tr>
        <td>Tatsächliche Belastung:</td>
        <td><input type="text" name="belastung" onKeyup="checknumber(this)"></td>
        <td><label><input type="radio" name="belast" value ="1" checked>über</label></td>
        <td><label><input type="radio" name="belast" value ="0">unter</label></td>
      </tr>
      <tr>
        <td>Konform nach Anhang 1:</td>
        <td>
          <select id="konform" name="konform">
            <option value ="-1" title="Alle anzeigen">Alle anzeigen</option>
            <option value="1"  title="Ja">Ja</option>
            <option value="2"  title="Nein">Nein</option>
          </select>
        </td>
      </tr>
    </table>


    <h2>Frachten</h2>
    <table class="form--settings form--selection-list">
      <tr>
        <td>CSB-Erlaubnis:</td>
        <td><input type="text" name="csb_erlaubnis" onKeyup="checknumber(this)"></td>
        <td><label><input type="radio" name="csb_erlaub" value ="1" checked>über</label></td>
        <td><label><input type="radio" name="csb_erlaub" value ="0">unter</label></td>
      </tr>
      <tr>
        <td>CSB-Anforderung Eingehalten:</td>
        <td><%=   select_tag :csb_eingeh, options_for_select(@compliance_levels)  %></td>
      </tr>
      <tr>
        <td>BSB<sup>5</sup>-Erlaubnis:</td>
        <td><input type="text" name="bsb_erlaubnis" onKeyup="checknumber(this)"></td>
        <td><label><input type="radio" name="bsb_erlaub" value ="1" checked>über</label></td>
        <td><label><input type="radio" name="bsb_erlaub" value ="0">unter</label></td>
      </tr>
      <tr>
        <td>BSB<sup>5</sup>-Anforderung Eingehalten:</td>
        <td><%=   select_tag :bsb_eingeh, options_for_select(@compliance_levels)  %></td>
      </tr>
      <tr>
        <td>N-Erlaubnis:</td>
        <td><input type="text" name="n_erlaubnis" onKeyup="checknumber(this)"></td>
        <td><label><input type="radio" name="n_erlaub" value ="1" checked>über</label></td>
        <td><label><input type="radio" name="n_erlaub" value ="0">unter</label></td>
      </tr>
      <tr>
        <td>N-Anforderung Eingehalten:</td>
        <td><%=   select_tag :n_eingeh, options_for_select(@compliance_levels)  %></td>
      </tr>
      <tr>
        <td>P-Erlaubnis:</td>
        <td><input type="text" name="p_erlaubnis" onKeyup="checknumber(this)"></td>
        <td><label><input type="radio" name="p_erlaub" value ="1" checked>über</label></td>
        <td><label><input type="radio" name="p_erlaub" value ="0">unter</label></td>
      </tr>
      <tr>
        <td>P-Anforderung Eingehalten:</td>
        <td><%=   select_tag :p_eingeh, options_for_select(@compliance_levels)  %></td>
      </tr>
    </table>


  <h2>Ausbauten</h2>

  <table border="0" class="form--checkbox-list form--settings form--selection-list">
    <tr>
      <td><label><input type="checkbox" name="ausbauten[]" value="plants.pl_uv" />UV-Desinfektion</label></td>
    </tr>
    <tr>
      <td><label><input type="checkbox" name="ausbauten[]" value="plants.pl_chlorination" />Chlor</label></td>
    </tr>
    <tr>
      <td><label><input type="checkbox" name="ausbauten[]" value="plants.pl_ozonation" />Ozonung</label></td>
    </tr>
    <tr>
      <td><label><input type="checkbox" name="ausbauten[]" value="plants.pl_sand_filtration" />Sandfiltration</label></td>
    </tr>
    <tr>
      <td><label><input type="checkbox" name="ausbauten[]" value="plants.pl_micro_filtration" />Mikro-Ultrafiltration</label></td>
    </tr>
    <tr>
      <td><label><input type="checkbox" name="ausbauten[]" value="plants.pl_other" />Andere</label></td>
    </tr>
  </table>

  <div class="from--submit">
    <button type="button" onclick="window.location='<%= url_for :action => "index" %>'">
      <i class="fa fa-times" aria-hidden="true"></i>
    </button>
    <button type="submit">
      <i class="fa fa-check" aria-hidden="true"></i>
    </button>
  </div>

</div>


<script type="text/javascript" language="javascript">

  function checknumber(feld)
  {
    if(isNaN(feld.value) == true)
    {
      feld.value=feld.value.slice(0,feld.value.length-1); //Eingegebener Buchstabe wird gelöscht
    }
  }
</script>
