<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <h1 class="page-header">Label verwalten</h1>

    <div class="row">
        <form action="" method="POST">
            <input type="hidden" name="labelId" value="<?php echo $this->_['label']->getId(); ?>">
            <div class="form-group">
                <label for="labelName">Name</label>
                <input type="text" class="form-control" id="labelName" name="labelName" value="<?php echo $this->_['label']->getName(); ?>">
            </div>
            <div class="form-group">
                <label>Zugewiesene Mailaccounts</label>
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>Account</th>
                            <th>Folder</th>
                            <th></th>
                            <th></th>
                        </tr>
                        <?php
                            foreach($this->_['mailboxFolders'] as $mailboxFolder) {
                                echo '<tr>';
                                echo '<td>' . $mailboxFolder->getId() . '</td>';
                                echo '<td>' . Mailbox::getMailboxNameFromMailaccountId($mailboxFolder->getMailboxId()) . '</td>';
                                echo '<td>' . $mailboxFolder->getFolderName() . '</td>';
                                echo '<td><a class="manage-mailboxfolder fancybox.ajax" data-uid="' . $this->_['user']->getUserId() . '" href="ajax.php?action=manageMailboxFolder&mfId=' . $mailboxFolder->getId() . '&mbId=' . $mailboxFolder->getMailboxId() . '" data-id="' . $mailboxFolder->getId() . '"><i class="fa fa-wrench"></i></a></td>';
                                echo '<td><a class="remove-mailboxfolder" href="#" data-id="' . $mailboxFolder->getId() . '"><i class="fa fa-minus-circle"></i></a></td>';
                                echo '</tr>';
                            }
                        ?>
                    </thead>
                    <tr>
                        <td><a id="add-mailboxfolder" href="#" data-uid="<?php echo $this->_['user']->getUserId(); ?>" data-lid="<?php echo $this->_['label']->getId(); ?>"><i class="fa fa-plus-circle"></i></a></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                </table>
            </div>
        </form>
    </div>
</div>
