<?php
    $table = "videos";
    if (!DEMO) {
        $report = form_delete($table);
    }
    /*$
    //обновление (загрузка файла)
    fields = ["img"=>"file",];
    $report = form_update_fields($table, $fields);*/
?>

<div id="page-wrapper">
    <?php include(ROOT."/adg/pages/show_report.php"); ?>
    <div class="container-fluid">
            <!-- Flot Charts -->
        <div class="row">
            <div class="col-lg-12">
                <h2 class="page-header"><?php echo $page_title; ?></h2>
            </div>
        </div>
        <!-- /.row -->
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-primary">
                    <div class="panel-heading">
                        <h3 class="panel-title"><i class="fa fa-bar-chart-o"></i> Список</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>
                                                <th>Дата добавления</th>
                                                <th>Ссылка</th>
                                                <th>Заголовок</th>
                                                <th>Удалить</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php foreach (get_list($table) as $item) { ?>
                                                <tr>
                                                    <td>
                                                        <?php echo bm_date($item['date']); ?>
                                                    </td>
                                                    <td>
                                                        <?php echo escape($item['link']); ?>
                                                    </td>
                                                    <td>
                                                        <?php echo escape($item['title']); ?>
                                                    </td>
                                                    <td>
                                                        <?php button_delete($item['id']); ?>
                                                    </td>
                                                </tr>
                                            <?php } ?>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <a href="/adg.php?page=add_videos" style="margin-left: 15px;" class="btn btn-default">Добавить видео-отзыв</a>
        </div>
    </div>
    <!-- /.container-fluid -->
</div>
<!-- /#page-wrapper -->
