<?php $path="../../"; include("../../map.php"); ?>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<script type="text/javascript">
	jQuery(function() {
		jQuery(".mfrm").click(function () {
			var theModal = jQuery(this).data("target"),
			frmSRC = jQuery(this).attr("data-url");
			jQuery(theModal + ' iframe').attr('src', frmSRC);
			jQuery(theModal + ' button.close').click(function () {
				jQuery(theModal + ' iframe').attr('src', 'about:blank');
			});
		});
	});
</script>
<style>
	#notifications li {filter: drop-shadow(2px 4px 6px black); opacity: 0.9;}
</style>
<?php
$data = file_get_contents('https://cdn.'.$cdnurl.'/data');
$ws 		=	json_decode($data);
if($_GET["islem"]=="haber"){
	foreach ($ws->data as $item){$m++;
		if($item->type=="hizmet" and $item->url==$_SERVER["SERVER_NAME"]){
			if($_COOKIE["sID".$item->id.""]=="" or $_COOKIE["sID".$item->id.""]<>date("dmY")){
				setcookie("sID".$item->id."",date("dmY"));
				echo "
					<li id=\"h".$item->id."\" class=\"bg-".$item->bg."\">
					<div><h1 style=\"font-size:14px;\"><i class=\"fas fa-history\" style=\"margin-right:5px;\"></i> <b>".ihb($item->title)."</b> ".ctranslate("Hizmetinizin Süresi")."</h1></div>
					<div style=\"font-size:10px;clear: both;\">".$item->description."</div> <br />
					<div style=\"width: 100%;\">
						".dtarih($item->date,"gg ka yy")."
						<a data-toggle=\"modal\" data-target=\"#myModal\" data-title=\"".$item->title."\" data-url=\"modules/public/notification.php?islem=dhaber&id=".$item->id."\" onclick=\"hide('h".$item->id."')\" style=\"float:right;\" class=\"v3-btn v3-btn-xs v3-btn-info mfrm\"> ".$sdil[207]."</a>
					</div>
					<div class=\"close-bt\" onclick=\"hide('h".$item->id."')\"></div>
					<div style=\"clear:both;\"></div>
					</li>
				";
			}
		}
		if($item->type=="haber" and $item->catID==163 and (($item->i1=="" or $item->i1==$_SERVER["SERVER_NAME"]) and ($item->i2=="" or $item->i2==$pow1) and ($item->i3=="" or $item->i3<>$pow2))){
			//$i++;$delay=8000+$i;
			if($_COOKIE["sID".$item->id.""]==""){
				setcookie("sID".$item->id."",date("dmY"));
				echo "
				<li id=\"h".$item->id."\" class=\"bg-info\">
				<div><h1 style=\"font-size:14px;\"><i class=\"fas fa-info-circle\" style=\"margin-right:5px;\"></i> ".$item->title." </h1></div>
				";
				$imageInfo = @getimagesize($item->image);
				if($imageInfo<>''){
					echo "<img src=\"".$item->image."\" style=\"max-width:100%;\">";
				}else{
					echo "<div style=\"font-size:10px;clear: both;\">".$item->description."</div> <br />";
				}
				echo "
				<div style=\"width: 100%;\">
					".dtarih($item->date,"gg ka yy")."
					<a data-toggle=\"modal\" data-target=\"#myModal\" data-title=\"".$item->title."\" data-url=\"modules/public/notification.php?islem=dhaber&id=".$item->id."\" onclick=\"hide('h".$item->id."')\" style=\"float:right;\" class=\"v3-btn v3-btn-xs v3-btn-danger mfrm\"> ".$sdil[207]."</a>
				</div>
				<div class=\"close-bt\" onclick=\"hide('h".$item->id."')\"></div>
				<div style=\"clear:both;\"></div>
				</li>
				";
			}
		}
		if($item->type=="haber" and $item->catID==157 and $item->i3<>$pow2 and (($item->i1=="" or $item->i1==$_SERVER["SERVER_NAME"]) and ($item->i2=="" or $item->i2==$pow1))){
				echo "<script>jQuery(document).ready(function(){jQuery('#untf').html('<i class=\"fa fa-exclamation-circle\" title=\"Güncelleme Mevcut!\"></i>')});</script>";
			if($_COOKIE["sID".$item->id.""]==""){
				setcookie("sID".$item->id."",date("dmY"));
				echo "
				<li id=\"h".$item->id."\" class=\"bg-warning\">
				<div><h1 style=\"font-size:14px;\"><i class=\"fa fa-exclamation-triangle text-danger\" style=\"margin-right:5px;\"></i> ".$item->title." </h1></div><br>
				<div style=\"font-size:10px;\">".$item->description."</div> <br />
				<div style=\"\">
					".dtarih($item->date,"gg ka yy")."
					<a href=\"modules/public/notification.php?islem=dhaber&id=$item->id\" target=\"logfrm\" onclick=\"hide('h".$item->id."')\" style=\"margin-left:10px;float:right;\" class=\"v3-btn v3-btn-xs v3-btn-warning mfrm\"> Ertele</a>
					<a data-toggle=\"modal\" data-target=\"#myModal\" data-title=\"Crmplus Updater ".$item->title."\" data-url=\"fonksiyon.php?islem=update&durum=restore&id=".$item->id."\" onclick=\"hide('h".$item->id."')\" style=\"float:right;\" class=\"v3-btn v3-btn-xs v3-btn-success mfrm\"> Kur</a>
				</div>
				<div class=\"close-bt\" onclick=\"hide('h".$item->id."')\"></div>
				<div style=\"clear:both;\"></div>
				</li>
				";
			}
		}
	}
}elseif($_GET["islem"]=="dhaber"){
		echo "
		<link rel=\"stylesheet\" href=\"//cdn.crmplus.com.tr/css/watolye.css\" type=\"text/css\" /> 
		<link rel=\"stylesheet\" href=\"//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css\">
		";
		foreach ($ws->data as $item){$m++;
		if($item->id==$_GET["id"]){
			setcookie("sID".$_GET["id"]."",date("dmY"));
			$_SESSION["sID".$_GET["id"].""]=date("dmY");
			echo "<h3>".ihb($item->title)."</h3>";
			$imageInfo = @getimagesize($item->image);
			if($imageInfo<>''){
				echo "<img src=\"".$item->image."\" style=\"max-width:100%;\">";
			}
			if($item->video_src<>''){
				echo "<iframe src=\"".$item->video_src."\" style=\"width: 100%; height: 380px; border: 0px;\"></iframe>";
			}
			echo "<p>".$item->detail."</p>";
			if($item->type=="hizmet"){
			echo "<br>".translate("+#Konu ile ilgili detaylı bilgi için lütfen hizmet sağlayıcınız ile iletişime geçiniz")."<br>".$pow1."<br>".$pow4."";
			}
		}
	}
}
?>