<?php require admin_view('include/header'); ?>
<!-- DataTables -->
<link rel="stylesheet" href="<?= admin_public_url(); ?>plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
<link rel="stylesheet" href="<?= admin_public_url(); ?>plugins/datatables-responsive/css/responsive.bootstrap4.min.css">


<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
  <!-- Content Header (Page header) -->
  <section class="content-header">
    <div class="container-fluid">
      <div class="row mb-2">

        <div class="col-sm-12">
          <ol class="breadcrumb float-sm-right">
            <li class="breadcrumb-item"><a href="index">Görsel Panel</a></li>
            <li class="breadcrumb-item"><a href="video-ekle">Video Ekle</a></li>
            <li class="breadcrumb-item active">Video Listele</li>
          </ol>
        </div>
      </div>
    </div><!-- /.container-fluid -->
  </section>

  <!-- Main content -->
  <section class="content">
    <form action="" method="post" enctype="multipart/form-data">
     <div class="col-sm-12">
      <a href="video-ekle" class="btn btn-warning"><i class="fa fa-plus-square"></i> Video Ekle</a>
      <button type="submit" class="btn btn-danger" onclick="return confirm('Bu işlemi gerçekten yapmak istiyor musunuz?')"><i class="fa fa-trash"></i> Seçilenleri Sil</button>
    </div>
    <br> 
    <!-- Default box -->
    <div class="card">
      <div class="card-header">
        <h3 class="card-title">Video Liste</h3>
      </div>
      <!-- /.card-header -->
      <div class="card-body">
        <table id="example1" class="table table-bordered table-striped">
          <thead>
            <tr>
             <th id="checkbox-toggle" width="1%">Seç</th> 
             <th>Sıra</th>
             <th>Başlık</th>
             <th>Resim</th>
             <th>Açıklama</th> 
             <th>İşlemler</th>
           </tr>
         </thead> 
         <tbody>
           <?php 
           while($row=$query->fetch(PDO::FETCH_ASSOC)) { ?>
            <tr> 
             <td align="center"><input type="checkbox" class="minimal" name="deletevideo[]" value="<?= $row['id'] ?>"></td> 
             <td><?= $row['id'] ?></td>
             <td><?= $row['baslik'] ?></td>
              <td align="center"> 
              <img src="<?=public_url()."".$row['image'] ?>" class="img-rounded img-size-50 mr-2">
            </td>
            <td><?= $row['aciklama'] ?></td> 
            <td>
              <a href="video-edit?id=<?= $row['id'] ?>" class="btn btn-primary btn-sm"><i class="fa fa-edit"></i>Düzenle</a> 
            </td>
          </tr>  
        <?php } ?>
      </tbody>

    </table>
  </div>
  <!-- /.card-body -->
</div>
<!-- /.card -->
</form>
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->

<?php require admin_view('include/footer'); ?>