<?php
    //session_start();
    require_once($_SERVER['DOCUMENT_ROOT'] . '/conf.php');

    if (!auth_is_user()) {
        redirect("/");
    }

    if (session("groups") !== "admin") {
        redirect('/');
    }
?>

<!-- <?php echo $table_data['table_title']; ?> -->
<div class="tab-pane fade <?php echo $table_data['first'] ? 'active in' : ''; ?>" id="<?php echo $table_data['div_id']; ?>">
    <div class="panel panel-<?php echo $table_data['panel']; ?>">
        <div class="panel-heading">
            <h3 class="panel-title">
                <i class="fa fa-bar-chart-o"></i>
                <?php echo $table_data['table_title']; ?>
                <span style="float: right;">
                    <i class="fa fa-question-circle" aria-hidden="true" data-toggle="tooltip" data-placement="left"
                       title="<?php echo $table_data['toltip_title']; ?>"></i>
                </span>
            </h3>
        </div>

        <div class="panel-body">
            <div class="flot-chart">
                <div class="flot-chart-content" id="flot-line-chart">
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                                <tr id="<?php echo $table_data['thead_id']; ?>"></tr>
                            </thead>
                            <tbody id="<?php echo $table_data['tbody_id']; ?>">
                            <tbody>
                        </table>
                    </div>
                    <button class="loadRecords btn btn-default upload" name="loadRecords" data-table="<?php echo $table_data['button_table']; ?>" data-template="<?php echo $table_data['tbody_id']; ?>" data-status="<?php echo $table_data['button_status']; ?>" data-delete="1" value="1">Показать последние 10 записей</button>
                    <br><br>
                    <button class="loadRecordsAll btn btn-default upload" name="loadRecords" data-table="<?php echo $table_data['button_table']; ?>" data-template="<?php echo $table_data['tbody_id']; ?>" data-status="<?php echo $table_data['button_status']; ?>" data-delete="1" value="-1">Показать все записи</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- /. <?php echo $table_data['table_title']; ?> -->
<style>
    .upload {
        width: 100%;
    }
</style>