<div ng-show="view.errorMessage">
    <div class="alert alert-danger ng-scope ng-binding margin-top">{{view.errorMessage}}</div>
</div>

<div class="sql-result-block row-fluid margin-top" ng-show="view.rowCount > 0">
    <?php
    $this->load->view('_pagination');
    ?>
    <div class="horizontal-scroll sql-result-table-wrapper margin-bottom">
        <table class="table table-bordered float-left">
            <thead>
            <tr>
                <th class="sort-head" ng-repeat="head in view.tablehead" ng-click="sortReorder({col: head.nameToSort})">
                    <span>{{head.name}}<i
                                ng-class="{'icon-chevron-up':head.sort<0,'icon-chevron-down':head.sort>0}"></i></span>
                </th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="rows in view.rows">
                <td ng-repeat="column in rows  track by $index">
                    <span compile="column"></span>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <?php
    $this->load->view('_pagination');
    ?>
</div>

<div ng-show="view.rowCount == 0">
    <div class="alert alert-warning ng-scope ng-binding margin-top">There is no data to display</div>
</div>