<?php
	$path="../../"; include("../../map.php");
	include("../../scripts.php");
 ?>
<style>
	.qty{
		position:absolute; margin-top: 0px; left: 15px;
		padding: 0px 5px;
		background: aliceblue;
	}
	.op_ads{
		position:absolute; margin-top: 0px; right: 15px;
		padding: 0px 5px;
		background: aliceblue;
	}
	.op_ads i{
		font-size:18px;
	}
</style>
<div class="v3-row" title="<?php if($module["mode_catalogue"]==1){echo "Katalog";}else{echo "Ürün";}?>">
<?php if($module["mode_catalogue"]==1){?>
	<?php
		$sqla = mysqli_query($conn, "select id,t5,s5,pb1 from t1 where ne='post' and s19='".$_GET["id"]."' order by id desc"); while($rsa=mysqli_fetch_assoc($sqla)){
		$sqlu = mysqli_query($conn, "select id,t1,t10,s13 from ".$_SESSION['lang']." where ne='kayit' and t5='".$rsa["t5"]."' order by id desc"); $rsu=mysqli_fetch_assoc($sqlu)
	?>
		<div class="v3-col-md-2 hdiv">
			<div class="qty"><?php echo $rsa["s5"];?> <?php echo $rsu["t10"];?></div>
			<div class="op_ads" style="padding:5px;">
				<a href="<?php echo $weburl;?>/crmplus?islem=dkayit&ne=kayit&id=<?php echo $rsu["id"];?>" target="_blank"><i class="fa fa-edit"></i></a>
				<a style="cursor:pointer;" class="btn-delete-div" data-href="<?php echo $weburl."/".$crmpath?>/modules/clients/client_ads.php?spost=<?php echo $rsa["id"];?>"><i class="fa fa-times"></i></a>
				<a><i class="fa fa-check"></i></a>
			</div>
			<a class="v3-thumbnail" style="height:140px; overflow:hidden; margin-bottom: 0px;">
				<img src="<?php echo medya($rsu["id"],1,"resim","t1","", $weburl)?>" alt="<?php echo $rsu["t1"];?>">
			</a>
			<p class="v3-bg-info p5 mp5" style="height:50px; overflow:auto;"><?php echo $rsu["t1"];?><span style="float: right;"><?php echo wprice($rsa["pb1"]);?> <i class="fa fa-<?php echo strtolower($rsu["t2"]);?>"></i></span></p>
		</div>
	<?php }?>
<?php }else{?>
<?php $sqlu = mysqli_query($conn, "select id,s5,s13,t1,t10 from ".$_SESSION['lang']." where ne='kayit' and s19='".$_GET["id"]."' order by id desc"); while($rsu=mysqli_fetch_assoc($sqlu)){ ?>
		<div class="v3-col-md-2 hdiv">
			<div class="qty"><?php echo $rsu["s5"];?> <?php echo $rsu["t10"];?></div>
			<div class="op_ads" style="padding:5px;">
				<a href="<?php echo $weburl."/".$crmpath?>?islem=dkayit&ne=kayit&id=<?php echo $rsu["id"];?>" target="_blank"><i class="fa fa-edit"></i></a>
				<a style="cursor:pointer;" class="btn-delete-div" data-href="<?php echo $weburl."/".$crmpath?>?ne=kayit&islem=kayitlar&id=<?php echo $rsu["id"];?>&durum=skayit"><i class="fa fa-times"></i></a>
				<a onclick="AjaxGet('<?php echo $weburl."/".$crmpath?>?ne=kayit&islem=kayitlar&durum=s13&id=<?php echo $rsu["id"];?>&s13=<?php if($rsu["s13"]=="1"){echo "0";}else{echo "1";}?>','#');"><i class="fa fa-<?php if($rsu["s13"]==1){echo "check";}else{echo "ban";}?>"></i></a>
			</div>
			<a class="v3-thumbnail" style="height:140px; overflow:hidden; margin-bottom: 0px;">
				<img src="<?php echo medya($rsu["id"],1,"resim","t1","", $weburl)?>" alt="<?php echo $rsu["t1"];?>">
			</a>
			<p class="v3-bg-info p5 mp5" style="height:50px; overflow:auto;"><?php echo $rsu["t1"];?><span style="float: right;"><?php echo wprice($rsa["pb1"]);?> <i class="fa fa-<?php echo strtolower($rsu["t2"]);?>"></i></span></p>
		</div>
	<?php }?>
<?php }?>
</div>
<?php
	if($_GET["spost"]<>""){
		$sql = mysqli_query($conn, "delete from t1 where id=".$_GET["spost"]);
	}elseif($_GET["s13"]<>""){
		$Sql = mysqli_query($conn, "update t1 set s13='".$_GET["s13"]."' where id=".$_GET["pid"]."");
	}
?>