<table class="table table-bordered" style="width: auto;">
    <tr>
        <td>
            <label>Kunde:
                <select class="form-control" ng-model="current.kunde" ng-options="k for k in options.kunde" ng-change="data={}"></select>
            </label>
        </td>
        <td>
            <label>Datum:
                <select class="form-control" ng-model="current.datum" ng-options="dateFormat(v) for v in options.datum[current.kunde]" ng-change="refresh()"></select>
            </label>
        </td>
        <td>
            <label>Tabelle:
                <select class="form-control" ng-model="current.tabelle" ng-options="v for v in options.tabelle"></select>
            </label>
        </td>
		<td>
			<button class="form-control btn btn-default" ng-click="csvExport()" ng-show="current.tabelle">CSV-Export </button>
		</td>
    </tr>
</table>

<div ng-show="current.tabelle=='versand' ">
    <label>E-Mail-Empfänger</label><br/>
    <textarea>{{emails()}}</textarea>

</div>

<table class="table table-bordered table-condensed table-striped" style="width: auto;">
    <tr>
        <th></th>
        <th ng-repeat="(col, v) in domain[current.tabelle]">{{col}}</th>
    </tr>
    <tr>
        <td></td>
        <td ng-repeat="(col, dom) in domain[current.tabelle]">
            <div class="dropdown">
                <a class="btn dropdown-toggle" role="button" data-toggle="dropdown">{{filter[current.tabelle][col]||'alle'}}&nbsp;<b class="caret"></b></a>
                <ul class="dropdown-menu" role="menu">
                    <li><a ng-click="filter[current.tabelle][col]=''">alle</a></li>
                    <li class="divider"></li>
                    <li ng-repeat="e in dom"><a ng-click="filter[current.tabelle][col]=e">{{e}}</a></li>
                </ul>
            </div>
        </td>
    </tr>
    <tr ng-repeat="row in data[current.tabelle] | filter: filter[current.tabelle] | limitTo: 200">
        <th>{{$index+1}}</th>
        <td ng-repeat="col in row">
            {{col}}
        </td>
    </tr>
</table>