<?php echo $this->partial('template/menu.phtml', array('menu' => 'modalita')); ?>

<div class="row">
    <div class="span6">
        <h4>Lista Programma Modalità</h4>
    </div>
    <div class="span6">
        <p class="text-right">
            <a class="btn btn-success"
               href="<?php echo $this->url('programma_modalita/default', array('action' => 'aggiungi', 'utente' => $this->utente)); ?>">
                <i class="icon-plus icon-white"></i> Aggiungi Programma Modalità
            </a>
        </p>
    </div>
</div>

<div class="row">
    <div class="span12">

        <?php if ($this->message): ?>
            <div class="alert alert-success">
                <?php echo $this->message[0]; ?>
            </div>
        <?php endif; ?>

        <?php if (count($this->modalita) > 0): ?>
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>Modalita</th>
                    <th>Data Inizio</th>
                    <th>Data Fine</th>
                    <th>Modifica</th>
                    <th>Cancella</th>
                </tr>
                </thead>
                <tbody>
                <?php foreach ($this->modalita as $row): ?>
                    <tr>
                        <td><?php echo $this->escapehtml($row['nome_modalita']); ?></td>
                        <td><?php echo $this->escapehtml($row['data_inizio']); ?></td>
                        <td><?php echo $this->escapehtml($row['data_fine']); ?></td>

                        <td>
                            <a class="btn btn-warning"
                               href="<?php echo $this->url('programma_modalita/default', array('action' => 'modifica', 'utente' => $row['id_utente'], 'id' => $row['id'])); ?>"><i
                                    class="icon-edit icon-white"></i> Modifica</a>
                        </td>
                        <td>
                            <a class="btn btn-danger"
                               href="#deleteModal-<?php echo $this->escapehtml($row['id']); ?>" data-toggle="modal"><i
                                    class="icon-trash icon-white"></i> Cancella</a>
                            <div id="deleteModal-<?php echo $this->escapehtml($row['id']); ?>" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
                                    <h3 id="myModalLabel">Cancella</h3>
                                </div>
                                <div class="modal-body">
                                    <p>Sei sicuro di voler eliminare questo record?</p>
                                </div>
                                <div class="modal-footer">
                                    <a class="btn btn-danger" href="<?php echo $this->url('programma_modalita/default', array('action' => 'elimina', 'utente' => $row['id_utente'], 'id' => $row['id'])); ?>">SI</a>
                                </div>
                            </div>
                        </td>
                    </tr>
                <?php endforeach; ?>
                </tbody>
            </table>
        <?php endif ?>
    </div>
</div>