<?php echo !defined("GUVENLIK") ? die("Erisim Engellendi!.") : null;?>
<?php
if(strip_tags(isset($_GET['id'])))
{
	$DETAYSorgu = $db->prepare("SELECT * FROM haberler WHERE seo = ? AND dil = ?");
	$DETAYSorgu->execute(array($_GET['id'],$_SESSION['k_dil']));
	if($DETAYSorgu->rowCount())
	{
		$DETAYSonuc = $DETAYSorgu->fetch(PDO::FETCH_ASSOC);
	}
	else
	{
		header("Location:".$url.(altklasor == "1" ? '/' : '')."404".$html."");
		exit();
	}
}
else
{
	$DETAYSorgu = $db->prepare("SELECT * FROM haberler WHERE dil = ? ORDER BY id ASC");
	$DETAYSorgu->execute(array($_SESSION['k_dil']));
	if($DETAYSorgu->rowCount())
	{
		$DETAYSonuc = $DETAYSorgu->fetch(PDO::FETCH_ASSOC);
	}
	else
	{
		header("Location:".$url."/404.html");
		exit();
	}
}
$menubul 	= $db->query("SELECT * FROM menu WHERE menu_url = '".$htc['haberurl']."' OR link = '".$htc['haberurl']."' AND dil = '{$_SESSION['k_dil']}'")->fetch(PDO::FETCH_ASSOC);
$menubas 	= $db->query("SELECT * FROM menu WHERE id = '{$menubul['menu_ust']}' AND dil = '{$_SESSION['k_dil']}'")->fetch(PDO::FETCH_ASSOC);		
?>
<!-- Start main-content -->
<div class="main-content">
    <!-- Section: inner-header -->
     <section class="inner-header bg-lighter">
		<div class="container pt-10 pb-10">
			<!-- Section Content -->
			<div class="section-content">
				<div class="row d-ortala">
					<div class="col-md-11">
						<h3 class="font-30 mb-0 mt-10"><?php echo $DETAYSonuc['adi'];?></h3>
						<ol class="breadcrumb text-black mt-0 mb-10">
							<li><a href="<?php echo $htc['anaurl'];?><?php echo $html;?>"><?=@$dil['txt56'];?></a></li>
							<?php if($menubas['menu_isim'] != ""){?>
							<li><a href="<?php echo($menubas['menu_url'] == "0" ? $menubas['link'] : $menubas['menu_url'].$html);?>"><?php echo ilkbuyuk($menubas['menu_isim']);?></a></li>
							<?php }?>
							<li><a href="<?php echo $htc['haberurl'];?><?php echo $html;?>"><?=@$dil['txt102'];?></a></li>
							<li class="active text-theme-colored"><?php echo $DETAYSonuc['adi'];?></li>
						</ol>
					</div>
					<div class="col-md-1">
						<a href="javascript:history.back();" class="sayfa-geri"><span class="icon"><i class="fas fa-arrow-left"></i></span><?=@$dil['txt57'];?></a>
					</div>
				</div>
			</div>
		</div>
	</section>

    <!-- Section: Blog -->
    <section>
        <div class="container pt-50 pb-50">
            <div class="row">
                <div class="col-md-9">
                    <div class="blog-posts single-post">
                        <article class="post clearfix mb-0">
                            <div class="entry-header">
                                <div class="post-thumb thumb"> 
									<img src="<?php echo tema;?>/uploads/haberler/<?php echo $DETAYSonuc['resim'];?>" alt="<?php echo $DETAYSonuc['adi']; ?>" class="img-responsive img-fullwidth"> 
								</div>
                            </div>
                            <div class="entry-content">
                                <div class="entry-meta media no-bg no-border mt-15 pb-20">
                                    <div class="media-body">
                                        <div class="event-content pull-left flip">
                                            <h4 class="entry-title m-0 font-weight-700"><?php echo $DETAYSonuc['adi']; ?></h4>
                                            <span class="mb-10 text-gray-darkgray mr-10 font-13"><i class="far fa-clock mr-5 text-theme-colored"></i> <?php echo tarih2($DETAYSonuc['tarih']);?></span>
                                        </div>
                                    </div>
                                </div>
                                <?php echo $DETAYSonuc['aciklama']; ?>
								<?php if($DETAYSonuc['videoid']){?>
								<iframe style="width:100%;height:500px;" src="https://www.youtube.com/embed/<?php echo $DETAYSonuc['videoid']; ?>?rel=0&amp;showinfo=0" frameborder="0" allow="encrypted-media" allowfullscreen></iframe>
								<?php }?>
								
								<?php $ISorgu = $db->prepare("SELECT * FROM haberfoto WHERE resimid = ? ORDER BY id ASC");
								$ISorgu->execute(array($DETAYSonuc['id']));
								$Iislem = $ISorgu->fetchALL(PDO::FETCH_ASSOC);?>
								<?php if($ISorgu->rowCount() != "0"){?>
								<div class="row">									
									<div class="popup-gallery">
										<?php foreach ( $Iislem as $ISonuc ){?>
										<div class="col-lg-4 col-md-4 mb-20">
											<a href="<?php echo tema;?>/uploads/haberler/fotogaleri/<?php echo $ISonuc['resim']; ?>" title="<?php echo $DETAYSonuc['adi']; ?>"><img src="<?php echo tema;?>/uploads/haberler/fotogaleri/<?php echo $ISonuc['resim']; ?>" alt="<?php echo $DETAYSonuc['adi']; ?>"></a>
										</div>
										<?php }?>
									</div>
								</div>
								<?php }?>
								
                                <div class="mt-30 mb-0">
                                    <h5 class="pull-left mt-10 mr-20 text-theme-colored"><?=@$dil['txt96'];?></h5>
                                    <div class="addthis_inline_share_toolbox_34zm" style="display: inline-block;margin-top: 5px;"></div>
                                </div>
                            </div>
                        </article>
                        <div class="tagline p-0 pt-20 mt-5">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="tags">
                                        <p class="mb-0"><i class="fa fa-tags text-theme-colored"></i> <span><?=@$dil['txt103'];?></span> 
										<?php $parcala = explode(",",$DETAYSonuc['keywords']);
										$last_key = end(array_keys($parcala));
										foreach($parcala as $key => $ozellik){?>
											<?php echo $ozellik;?><?php echo($key == $last_key ? '' : ',');?>
										<?php }?>
										</p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="sidebar sidebar-left mt-sm-30">
                        <div class="widget">
                            <h5 class="widget-title line-bottom"><?=@$dil['txt102'];?></h5>
                            <div class="latest-posts">
							<?php $SSorgu = $db->prepare("SELECT * FROM haberler WHERE durum = ? AND dil = ? ORDER BY id DESC limit 6");
							$SSorgu->execute(array("1",$_SESSION['k_dil']));
							$islem = $SSorgu->fetchALL(PDO::FETCH_ASSOC);?>
								<?php foreach ( $islem as $SSonuc ){?>	
                                <article class="post media-post clearfix pb-0 mb-10">
                                    <a class="post-thumb" href="<?php echo $htc['haberdetayurl']; ?>/<?php echo $SSonuc['seo']; ?><?php echo $html;?>"><img src="<?php echo tema;?>/uploads/haberler/<?php echo $SSonuc['resim']; ?>" alt="<?php echo $SSonuc['adi']; ?>"></a>
                                    <div class="post-right">
                                        <h5 class="post-title mt-0"><a href="<?php echo $htc['haberdetayurl']; ?>/<?php echo $SSonuc['seo']; ?><?php echo $html;?>"><?php echo $SSonuc['adi']; ?></a></h5>
                                        <p><i class="far fa-clock mr-5 text-theme-colored"></i> <?php echo tarih2($SSonuc['tarih']);?></p>
                                    </div>
                                </article>
								<?php }?>								
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<!-- end main-content -->