<?php
include("../../../functions.inc.php");
include("../functions.inc.php");
include("../../servizi/functions.inc.php");

dbConnect();
checkLogin('adm');
?>

<div>
    <div class="modal-d-title">Stampe</div>
    <form class="form-horizontal" action="../print_presenze/" role="form" method="get" onSubmit="setTimeout('closeDialog()',500)">
    
    <div class="modal-body modal-body-diag">
        <span class="text-danger"><strong>Stampa presenze</strong></span>
        <div class="form-group">
            <div class="col-sm-6">
                <label class="control-label">Mese</label>
                <select class="form-control" name="mm">
                <?php
                for($i=1;$i<=12;$i++)
                    echo '<option value="'.str_pad($i,2,'0',STR_PAD_LEFT).'"'. ($i == date("m") ? ' selected' : '') .'>'.mese_ita($i).'</option>';
                ?>
                </select>
            </div>
            <div class="col-sm-6">
                <label class="control-label">Anno</label>
                <select class="form-control" name="yyyy">
                <?php
                for($i=date("Y")-1;$i<=date("Y")+1;$i++)
                    echo '<option value="'.$i.'"'. ($i == date("Y") ? ' selected' : '') .'>'.$i.'</option>';
                ?>
                </select>
            </div>
        </div>


        <div class="form-group">
            <div class="col-sm-6">
                <label class="control-label">Scuola</label>
                <select class="form-control" name="grp" onChange="selXmlPop('#print-sottogruppi','sottogruppi',this.value)">
                <option value="">Tutte</option>
 				<?php
				foreach(get_gruppi('men') as $id=>$val)
					echo '<option value="'.$id.'">'.$val.'</option>';
				?>               
                </select>
            </div>
            <div class="col-sm-6">
				<label class="control-label">Classe</label>
                <select class="form-control" name="grp_sub" id="print-sottogruppi">
                <option value="">Tutte</option>
                </select>
            </div>
        </div>        



    </div>
    
    <div class="modal-footer">
        <button id="okButton" type="submit" class="btn btn-primary">OK</button>
        <button type="button" class="btn btn-default" data-dismiss="modal">Chiudi</button>
    </div>
    
    </form>
</div>