<?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="programci-ekle">Programci Ekle</a></li>
            <li class="breadcrumb-item active">Programci 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="programci-ekle" class="btn btn-warning"><i class="fa fa-plus-square"></i> Programci 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">Slider 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>Resim</th>
             <th>Programcı</th>
             <th width="15%">Program</th>  
             <th width="15%">E-Mail</th>  
             <th width="1%">Durum</th>
             <th>Tarih</th>
             
             <th width="10%">İşlemler</th>
           </tr>
         </thead> 
         <tbody>
           <?php 
           while($row=$query->fetch(PDO::FETCH_ASSOC)) { ?>
            <tr> 
             <td align="center">
              <input type="checkbox" class="minimal" name="deleteslider[]" value="<?= $row['id'] ?>">
            </td> 
             <td><?= $row['id'] ?></td>
                <td align="center"> 
              <img src="<?=public_url()."".$row['image'] ?>" class="img-circle img-size-32 mr-2">
            </td>
            <td><?= $row['programci'] ?></td>
            <td><?= $row['program'] ?></td> 
            <td><?= $row['email'] ?></td> 
            <td class="project-state">
              <?php 
             if ($row['durum']=="yes") {?>
              <span class="badge badge-success">Aktif</span>
            <?php  } else {?>
              <span class="badge badge-danger">Pasif</span>
            <?php } ?>
          </td>
          <td><?= $row['edit_date'] ?></td> 

          <td>
            <a href="programci-edit?id=<?= $row['id'] ?>" class="btn btn-primary btn-sm"><i class="fas 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'); ?>