<div class="row">
	<script type="text/javascript">
		var $m = jQuery.noConflict();
		$m(function() {
			$m(".mfrm").click(function () {
				var theModal = $m(this).data("target"),
				frmSRC = $m(this).attr("data-url");
				$m(theModal + ' iframe').attr('src', frmSRC);
				$m(theModal + ' button.close').click(function () {
					$m(theModal + ' iframe').attr('src', 'about:blank');
				});
			});
		});
	</script>
	<?php
	$path="../../";
	include("../../map.php");
	if(!empty($_GET["id"])){
		$sql=mysqli_query($conn, "select * from medya where ne='".$_GET['nedir']."' and t3='".$_GET['ne']."' and s1='".$_GET['id']."' order by s3 asc,id desc");
	}else{
		$sql=mysqli_query($conn, "select * from medya where ne='".$_GET['nedir']."' and t3='".$_GET['ne']."' order by s3 asc,id desc");
	}
	while($rsm=mysqli_fetch_assoc($sql)){
		if($_GET["nedir"]=="resim"){
			$medya="../../../deppo/image/k_".$rsm["t1"]."";
			$link="../../../deppo/image/".$rsm["t1"]."";
		}elseif($_GET["nedir"]=="video"){
			if(substr($rsm["n2"],0,4)=="http"){
				$medya=$rsm["n2"];
			}else{
				$medya="../../../deppo/video/".$rsm["n2"]."";
			}
			$link="fonksiyon.php?isl em=izle&id=".$rsm["id"]."";
		}elseif($_GET["nedir"]=="dosya"){
			if($rsm["t5"]==""){
				$medya="../../assets/img/icons/".$rsm["t4"]."_b.png";
			}else{
				$medya="../../../deppo/dosya/".$rsm["t5"]."";
			}
			
			$link="../../../deppo/dosya/".$rsm["t1"]."";
		}
		?>
		<!---/Ana-div/-->
		<div data-id="<?php echo $rsm["id"];?>" class="col-xs-6 mdiv m<?php echo $rsm["ne"];?>" id="<?php echo $rsm["id"]; ?>" style="padding-bottom: 5px !important; width:48%; margin-right:5px;">
			<!---/Tick/-->
			<div style="position:absolute; right:-2px; padding:0px; width:15px; height:15px; top:-7px;">
				<a class="t<?php echo $rsm["ne"]?>" data-href="../ajax/ajax_medya_iframe.php?nedir=<?php echo $_GET["nedir"]; ?>&ne=<?php echo $_GET["ne"]; ?>&islem=<?php echo $_GET["islem"]; ?>&durum=mvitrin&id=<?php echo $_GET["id"]; ?>&mid=<?php echo $rsm["id"]; ?>&monay=<?php if($rsm["s2"]=="1"){echo 0;}else{ echo 1;}?>"><i class="fa fa<?php if($rsm["s2"]==1){?>-check<?php }?>-square-o" aria-hidden="true" style="font-size:20px; cursor:pointer;color:#fe8200"></i></a>
			</div>
			<!--/Tick/--> 
			<!---/Resim/-->
			<div style="overflow:hidden; border:1px #ccc; width:100%; height:<?php if($mobile<>""){echo "100";}else{echo "165";}?>px;">
				<a href="<?php echo $link; ?>" data-fancybox="gallery"><img src="<?php echo $medya; ?>" style="width:100%; min-height:<?php if($mobile<>""){echo "100";}else{echo "165";}?>px;border-radius: 10px 10px 0px 0px;" class="with-tip" title="<?php echo $rsm["t2"]; ?>"></a>
			</div>
			<div style="position:absolute; top:0px; left:0px; background-color:#fff; padding:2px; border-radius:5px 0px; ">
				<?php
				if ($m1<>""){$d=0; $diller = explode(',',$m1); foreach($diller as $dil) {$d++;
					if ($rsm["t6"]=="lang".$d.""){echo $dil;}}}else{echo $sdil[150];}
					?>
				</div>
				<!---/Resim/-->
				<!--/Form/-->
				<div style="overflow:hidden; border:1px #ccc; width:100%; margin-top:5px;">
					<div style="display:none;" id="i<?php echo $rsm["id"]; ?>"><?php echo $weburl; ?>/deppo/image/<?php echo $rsm["t1"]; ?></div>
					<form style="width:100%; padding:0px; margin:0px;" action="?nedir=<?php echo $_GET["nedir"]; ?>&ne=<?php echo $_GET["ne"]; ?>&islem=<?php echo $_GET["islem"]; ?>&durum=sira&id=<?php echo $_GET["id"]; ?>&mid=<?php echo $rsm["id"]; ?>" method="post">
						<input type="text" value="<?php echo $rsm["s3"];?>" onfocus="if(this.value == '0') { this.value = ''} "  onblur="if(this.value == '') { this.value='0'; }" name="s3" style="font-size:8pt; text-align:center;" size="1" class="mbtn25 btn btn-default" title="Sıra">
						<a style="cursor:pointer;" class="mbtn25 btn btn-danger btn-delete-div" data-href="../ajax/ajax_medya_iframe.php?nedir=<?php echo $_GET["nedir"]; ?>&ne=<?php echo $_GET["ne"]; ?>&islem=<?php echo $_GET["islem"]; ?>&durum=msil&id=<?php echo $_GET["id"]; ?>&mid=<?php echo $rsm["id"]; ?>" title="Kayıt Sil"><i class="fa fa-times" aria-hidden="true"></i></a> 
						<div style="float:right; font-size:11px; margin-right:5px; color:#ccc;">#<?php echo i2a($rsm["id"],7);?></div>
						<img class="mload" style="margin-top:1px; margin-left:4px; display: none;" src="../../assets/img/loading.gif">
					</form>
				</div>
				<!--/Form/--> 
			</div>
			<!---/Ana-div/-->
		<?php } ?>
		<div>
<?php
	if($_GET["durum"] == "mvitrin"){
		$Rs = mysqli_query($conn, "update medya set s2='".$_GET["monay"]."' where id=".$_GET["mid"]."");
	}elseif($_GET["durum"] == "msil"){
		$sql=mysqli_query($conn, "select * from medya where ne='".$_GET['nedir']."' and id=".$_GET["mid"].""); $rs=mysqli_fetch_assoc($sql);
		
		if($_GET["nedir"]=="resim"){
			$dosya1="../../../deppo/image/".$rs["t1"]."";unlink($dosya1);
			$dosya2="../../../deppo/image/k_".$rs["t1"]."";unlink($dosya2);
		}elseif($_GET["nedir"]=="video"){
			$video1="../../../deppo/video/".$rsv["t7"].".jpg";unlink($video1);
		}elseif($_GET["nedir"]=="dosya"){
			$dosya1="../../../deppo/dosya/".$rs["t1"]."";unlink($dosya1);
		}
		$Rs = mysqli_query($conn, "delete from medya where id=".$_GET["mid"]);
	}elseif($_GET["durum"] == "msira"){
		$Rs = mysqli_query($conn, "update medya set s3='".$_GET["s3"]."' where id=".$_GET["mid"]."");
	}
?>