<?php
$path="../../";
include("../../map.php");
$cpath="../../"; include("../../scripts.php");
include("../../secure.php");
if($_GET["q"]==""){
	if($_GET["ne"]=="sayfa" or $_GET["ne"]=="haber" or $_GET["ne"]=="msayfa" or $_GET["ne"]=="kayit" or $_GET["islem"]=="dsayfa"){
		$sql=mysqli_query($conn, "select * from ".$_SESSION['lang']." where id=".$_GET["id"].""); $rs=mysqli_fetch_assoc($sql);
		$risim=$rs["t1"];
	}else{
		$risim=$_GET["ne"];
	}
}else{
	$risim=$_GET["q"];
}
$i=0;$sqlr=mysqli_query($conn, "select * from medya where ne='resim' and t2 like '%".$risim."%' order by id desc limit 7"); while($rsr=mysqli_fetch_assoc($sqlr)){$i++;
	if($a5<>1){
		if (file_exists("../../../deppo/image/".$rsr["t1"]."")){
			$medya="../../../deppo/image/".$rsr["t1"]."";
			$kmedya="../../../deppo/image/".$rsr["t1"]."";
		}else{
			$medya="../../../deppo/tools/img/yok.png";
			$kmedya="../../../deppo/tools/img/yok.png";
		}
	}else{
		if (file_exists("../../../deppo/image/k_".$rsr["t1"]."")){
			$kmedya="../../../deppo/image/k_".$rsr["t1"]."";
		}elseif (file_exists("../../../deppo/image/".$rsr["t1"]."")){
			$kmedya="../../../deppo/image/".$rsr["t1"]."";
		}else{
			$kmedya="../../../deppo/tools/img/yok.png";
		}
		if (file_exists("../../../deppo/image/".$rsr["t1"]."")){
			$medya="../../../deppo/image/".$rsr["t1"]."";
		}else{
			$medya="../../../deppo/tools/img/yok.png";
		}
	}
	?>
	<div class="col-xs-6 col-md-3" style="height:180px; margin-bottom:10px; padding:5px;">
		<a href="?ne=<?php echo $_GET["ne"];?>&islem=<?php echo $_GET["islem"];?>&id=<?php echo $_GET["id"];?>&durum=addimage&mid=<?php echo $rsr["id"];?>" class="btn btn-warning" style="position:absolute; right: 10px; top: 10px; line-height: normal; border:0px; font-size: 28px; padding: 0px;" id="r<?php echo $rsr["id"]?>"><i class="fa fa-plus-square" style="padding: 0; font-size: 24px; background-color: unset !important;"></i></a>
		<code style="font-size:11px;position: absolute; bottom: -5px; width: 97%; padding: 5px; background-color: #00000021;">
			<span style="width:45px;display: inline-block;">Adı</span> :<?php echo kisalt(ihb($rsr["t2"]),3)?><br>
			<span style="width:45px;display: inline-block;">Modül</span> : <?php echo ihb($rsr["t3"])?><br>
			<span style="width:45px;display: inline-block;">İlişik</span> : #<?php echo $rsr["s1"]?>
		</code>
		<a href="<?php echo $medya;?>"  title="<?php echo $rsr["t2"]?>" class="thumbnail" data-fancybox="gallery" style="overflow:hidden; height:inherit; background-image:url('<?php echo $kmedya;?>');background-size: contain; background-position: center; background-repeat: no-repeat;"></a>
	</div>
<?php } ?>