<?php
include("../../../functions.inc.php");
include("../functions.inc.php");
dbConnect();
checkLogin('adm');
?>

<div>
    <div class="modal-d-title">Seleziona servizio</div>
    <form class="form-horizontal" action="./" role="form" method="get">
    
    <div class="modal-body modal-body-diag">
    
        <div class="form-group">
			<label class="control-label col-sm-3">Servizio</label>
            <div class="col-sm-9">
                <select class="form-control" name="flt_serv_cod" onChange="selXmlPop('#gruppi','gruppi',this.value); selClear('#sottogruppi')">
                <option value="">Tutti</option>
                <?php
                $servizi = get_ente_servizi();
                foreach($servizi as $v){
                    echo '<option'.($_GET['cod'] == $v['serv_cod'] ? ' selected="selected"' : '').' value="'.$v['serv_cod'].'">'.$v['serv_name'].'</option>';
                }
                ?>
                </select>
	        </div>
        </div>
        
        <div class="form-group">
			<label class="control-label col-sm-3">Gruppi</label>
            <div class="col-sm-9">
                <select class="form-control" name="flt_grp" id="gruppi" onChange="selXmlPop('#sottogruppi','sottogruppi',this.value)">
                <option value="">Tutti</option>
                </select>
            </div>
        </div>

        <div class="form-group">
			<label class="control-label col-sm-3">Sottogruppi</label>
            <div class="col-sm-9">
                <select class="form-control" name="flt_grp_sub" id="sottogruppi">
                <option value="">Tutti</option>
                </select>
            </div>
        </div>        

        <div class="form-group">
			<label class="control-label col-sm-3">Anno</label>
            <div class="col-sm-4">
                <select class="form-control" name="flt_year">
               		<option value="">Corrente</option>
					<?php
                    for($i=date("Y")+1;$i>=2014;$i--){
                   		echo '<option value="'.$i.'">'.$i.'</option>';
                    }
					?>
                </select>
            </div>
        </div>        
        
    </div>
    
    <div class="modal-footer">
        <button id="okButton" type="submit" class="btn btn-primary">Visualizza</button>
        <button type="button" class="btn btn-default" data-dismiss="modal">Annulla</button>
    </div>
    
    </form>
</div>