<?php echo !defined("GUVENLIK") ? die("Erisim Engellendi!.") : null;?>
<?php
if(strip_tags(isset($_GET['id'])))
{
	$Sorgu = $db->prepare("SELECT * FROM video_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 video_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['videourl']."' OR link = '".$htc['videourl']."' 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 bg-lighter">
    <!-- Section: inner-header -->
    <section class="inner-header bg-white">
		<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><a href="<?php echo $htc['videourl'];?><?php echo $html;?>"><?=@$dil['txt146'];?></a></li>
							<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="video-detail-showcase">
				<div class="row no-gutters">
					<div class="video-detail-player col-lg-9 col-md-8">
						<iframe src="https://www.youtube.com/embed/<?php echo $Sonuc['kod']; ?>?rel=0&amp;autoplay=1" frameborder="0" allowfullscreen=""></iframe>
					</div>
					
					<div class="video-detail-other-videos col-lg-3 col-md-4">
						<div class="heading">
							 <?=@$dil['txt147'];?><a class="all-videos" href="<?php echo $htc['videourl'];?><?php echo $html;?>"><?=@$dil['txt148'];?></a>
						</div>
						<ul class="video-detail-list">
						<?php $DETAYSorgu = $db->prepare("SELECT * FROM video_galeri WHERE durum = ? AND dil = ? ORDER BY id DESC");
						$DETAYSorgu->execute(array("1",$_SESSION['k_dil']));
						$DETAYislem = $DETAYSorgu->fetchALL(PDO::FETCH_ASSOC);?>
							<?php foreach ( $DETAYislem as $DETAYSonuc ){?>
							<li>
								<a href="<?php echo $htc['videodetayurl']; ?>/<?php echo $DETAYSonuc['seo']; ?><?php echo $html;?>">
									<div class="video-left col-auto">
										<img src="<?php echo tema;?>/uploads/videogaleri/kapak/<?php echo $DETAYSonuc['resim']; ?>">
										<span class="icon"><i class="fab fa-youtube"></i></span>
									</div>
									<div class="video-right col">
										<h3 class="title"><?php echo $DETAYSonuc['adi']; ?></h3>
									</div>
								</a>
							</li>
							<?php }?>
						</ul>
					</div>
					<div class="clearfix"></div>
					<div class="mt-10"><?php echo $Sonuc['aciklama']; ?></div>
				</div>
			</div>
        </div>
    </section>
</div>
<!-- end main-content -->