<?php echo !defined("GUVENLIK") ? die("Erisim Engellendi!.") : null;?>
<?php
if(strip_tags(isset($_GET['id'])))
{
	$Sorgu = $db->prepare("SELECT * FROM foto_galeri WHERE seo = ? AND durum = ? AND dil = ?");
	$Sorgu->execute(array($_GET['id'],"1",$_SESSION['k_dil']));
	if($Sorgu->rowCount())
	{
		$Sonuc = $Sorgu->fetch(PDO::FETCH_ASSOC);
	}
	else
	{
		header("Location:".$url.(altklasor == "1" ? '/' : '')."404".$html."");
		exit();
	}
}
else
{
	$Sorgu = $db->prepare("SELECT * FROM foto_galeri WHERE durum = ? AND dil = ? ORDER BY id ASC");
	$Sorgu->execute(array("1",$_SESSION['k_dil']));
	if($Sorgu->rowCount())
	{
		$Sonuc = $Sorgu->fetch(PDO::FETCH_ASSOC);
	}
	else
	{
		header("Location:".$url.(altklasor == "1" ? '/' : '')."404".$html."");
		exit();
	}
}
$menubul 	= $db->query("SELECT * FROM menu WHERE menu_url = '".$htc['fotourl']."' OR link = '".$htc['fotourl']."' 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 $Sonuc['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 class="active text-theme-colored"><?php echo $Sonuc['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: Course gird -->
    <section>
        <div class="container pt-50 pb-50">
            <div class="row">
                <div class="col-md-12 blog-pull-right">
					
                    <div class="row foto-widget">
						<div class="col-sm-12">
							<?php echo $Sonuc['aciklama'];?>
						</div>
						<?php $ISorgu = $db->prepare("SELECT * FROM fotograflar WHERE resimid = ? ORDER BY id ASC");
						$ISorgu->execute(array($Sonuc['id']));
						$Iislem = $ISorgu->fetchALL(PDO::FETCH_ASSOC);?>
						<?php foreach ( $Iislem as $ISonuc ){?>
						<div class="col-lg-3 col-md-6 col-sm-12 col-6">
							<figure class="post-thumb">
								<img src="<?php echo tema;?>/uploads/fotogaleri/diger/<?php echo $ISonuc['resim']; ?>" alt="<?php echo $Sonuc['adi']; ?>"><a href="<?php echo tema;?>/uploads/fotogaleri/diger/<?php echo $ISonuc['resim']; ?>" class="overlay-box" data-lightbox-gallery="gallery" data-caption="<?php echo $Sonuc['adi']; ?>" title="<?php echo $Sonuc['adi']; ?>"><span class="icon far fa-image"></span></a>
							</figure>
						</div>
						<?php }?>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<!-- end main-content -->