<?php include("header.php");?>

<?php
if(g('islem')=="sil")
{
	$id = g('id');
	$resim_bul=Sonuc(Sorgu("SELECT * FROM video WHERE id='$id'"));
	$resim_sil=unlink("../resimler/video/".$resim_bul->resim);
	$resim_sil2=unlink("../resimler/video/kucuk/".$resim_bul->resim);
	
	$sayfa_sil_sorgu = Sorgu("DELETE FROM video WHERE id='$id'");
	
	$bilgi = '	 <div class="alert alert-success">
										Başarı ile Silinmiştir !
				  </div>' ;
	
}

?>

  <link rel="stylesheet" type="text/css" href="css/gallery.css" />
 <!--main content start-->
      <section id="main-content">
          <section class="wrapper">
              <!-- page start-->
              <section class="panel">
                  <header class="panel-heading">
                   Video
                  </header>
				  
                  <div class="panel-body">              <div class="box-header">
                <a href="videoekle.php" class="btn btn-shadow btn-warning">
				<i class="fa fa-plus"></i> Video Ekle</a>
                </div><!-- /.box-header --><br>
                      <ul class="grid cs-style-3">
					  
					  
					  
					  							  
					<?php $SayfaSorgu = Sorgu("SELECT * FROM video ORDER BY id DESC");
					$say = 1;
					while($SayfaSonuc = Sonuc($SayfaSorgu)){?>
					  
					  
					  
                          <li>
                              <figure>
                                  	  <?php if($SayfaSonuc->resim == ""){?>
                                  <img width="30px" height="30px" src="https://placeholdit.imgix.net/~text?txtsize=19&bg=efefef&txtclr=aaaaaa%26text%3Dno%2Bimage&txt=no+image&w=200&h=150">
								  <?php }else{?>
								 <img width="352px" height="264px" src="../resimler/video/<?php echo $SayfaSonuc->resim; ?>">
								   <?php } ?>
                                  <figcaption>
                                      <h3><?php echo $SayfaSonuc->adi; ?></h3>
                                    
                                   
                                  </figcaption>
                              </figure>  </br><a  href="?islem=sil&id=<?php echo $SayfaSonuc->id;?>" onclick="return confirm('Silmek istediğinize emin misiniz ?')" class="btn btn-danger btn-xs"><i class="fa fa-trash-o "></i></a>
									 
									 
									   <a  href="videoekle.php?islem=duzenle&id=<?php echo $SayfaSonuc->id;?>""  class="btn btn-primary btn-xs"><i class="fa fa-pencil"></i></a>
                          </li>
                         
						 
						 
						 	    <?php } ?>  
						 
						 
						 
						 
                      </ul>

                  </div>
              </section>

              <!-- page end-->
          </section>
      </section>

<?php include("footer.php");?>