<?php require admin_view('include/header'); ?>
<!-- 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-6">
          <h1>Foto Galeri</h1>
        </div>
        <div class="col-sm-6">
          <ol class="breadcrumb float-sm-right">
            <li class="breadcrumb-item"><a href="index">Genel Ayarlar</a></li>
            <li class="breadcrumb-item active">Foto Galeri</li>
          </ol>
        </div>
      </div>
    </div><!-- /.container-fluid -->
  </section>

  <!-- Main content -->
  <section class="content">

   <div class="card card-info">
    <div class="card-header">
      <h3 class="card-title">Foto Galeri</h3>
    </div>
    <form action="" method="POST" enctype="multipart/form-data">
      <div class="box-body">
        <div class="row">
          <?php  while ($row=$query->fetch(PDO::FETCH_ASSOC)) { ?>
            <div class="col-xs-6 col-lg-3">
              <div class="box-header">
                <div class="box-tools">
                  <input type="hidden" name="image" value="<?= $row['image'] ?>">
                  <input type="hidden" name="gallery_id" value="<?= $row['gallery_id'] ?>">
                  <button type="submit" onclick="return confirm('Bu işlemi gerçekten yapmak istiyor musunuz?')" class="btn btn-box-tool" name="deletephotos"><i class="fa fa-trash text-red"></i></button>
                </div>
              </div>
              <div class="box-body">
                <img class="img-responsive pad" src="<?= public_url('')."".$row['image'] ?>">
              </div>
            </div>
          <?php } ?>
        </div>
      </div>
    </form> 
  </div>  
</section>

<!-- /.card-body -->
<div class="card-footer">
 <form action="" method="POST" enctype="multipart/form-data">
  <div class="box-body">
    <div class="row">
      <div class="col-lg-12">
        <div class="form-group">
          <label>Resim (ler) seçin</label>
          <input type="file" class="form-control" name="image[]" multiple="multiple" required="">
        </div>
      </div>
    </div>
  </div>
  <div class="box-footer">
    <button type="submit" name="newphotos" class="btn btn-md btn-primary pull-right">Güncelle</button>
  </div>
</form>
</div>
<!-- /.card-footer-->
</div>
 
<!-- /.content-wrapper -->
<?php require admin_view('include/footer'); ?>