<table id="example" class="display" cellspacing="0" width="100%">
    <thead>
    <tr>
        <th>ID</th>
        <th>Kunde</th>
        <th>Email</th>
        <th>Bonusguthaben</th>
        <th>Echtes Guthaben</th>
        <th>&nbsp;</th>
    </tr>
    </thead>
    <tfoot>
    <tr>
        <th>ID</th>
        <th>Kunde</th>
        <th>Email</th>
        <th>Bonusguthaben</th>
        <th>Echtes Guthaben</th>
        <th>&nbsp;</th>
    </tr>
    </tfoot>
    <tbody>
    {foreach from=$bonuses item=bonus name=bonusForeach }
        <tr data-id="{$bonus->id}" data-sum="{$bonus->sum}">
            <td>{$bonus->id}</td>
            <td class="name">{$bonus->kunde->cVorname} {$bonus->kunde->cNachname}</td>
            <td class="email">{$bonus->kunde->cMail}</td>
            <td>{$bonus->sum}</td>
            <td>{$bonus->sumLocalized}</td>
            <td>
                <a href="#" class="btn btn-small btn-primary add-bonus" data-target="#modal-add"><i class="fa fa-plus"></i></a>
                <a href="#" class="btn btn-small btn-warning remove-bonus" data-target="#modal-add"><i class="fa fa-minus"></i></a>
            </td>
        </tr>
    {/foreach}
    </tbody>
</table>

<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">History</h4>
            </div>
            <div class="modal-body">
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="modal-add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">Bonusmünzen für <span class="user"></span> hinzufügen</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12">
                        <form action="{$actionUrl}" method="post">
                            <div class="form-group">
                                <label for="bonus_value">Value</label>
                                <input type="number" class="form-control" id="bonus_value" name="bonus_value" min="0.01" step="0.01"/>
                            </div>
                            <input type="hidden" name="bonus_id"/>
                            <button type="submit" class="btn btn-success" name="add_bonus">Add</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="modal-remove" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">Bonusmünzen für <span class="user"></span> abziehen</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12">
                        <form action="{$actionUrl}" method="post">
                            <div class="form-group">
                                <label for="bonus_value">Value</label>
                                <input type="number" class="form-control" id="bonus_value" name="bonus_value" min="0.01" step="0.01"/>
                            </div>
                            <input type="hidden" name="bonus_id"/>
                            <button type="submit" class="btn btn-warning" name="reduce_bonus">Reduce</button>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>