<?php echo !defined("GUVENLIK") ? die("Erisim Engellendi!.") : null;?>
<?php
if(strip_tags(isset($_GET['id'])))
{
	$Sorgu = $db->prepare("SELECT * FROM etkinlikler 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 etkinlikler 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();
	}
}
$tarihler 	= explode(" ",unixtarih($Sonuc['baslama_tarih']));
$tarihler2 	= $tarihler[0];
$tarihler1 	= $tarihler[1];
$tarihler3 	= explode("-",$tarihler2); 
$menubul 	= $db->query("SELECT * FROM menu WHERE menu_url = '".$htc['etkinlikurl']."' OR link = '".$htc['etkinlikurl']."' 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 col-xs-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 class="bg-theme-colored-transparent">
        <div class="container pt-50 pb-50">
            <div class="row text-center">
                <div class="col-md-12">
                    <h2 id="basic-coupon-clock" class="text-white"></h2>
                    <!-- Final Countdown Timer Script -->
                    <script type="text/javascript">
                        $(document).ready(function() {
                            $('#basic-coupon-clock').countdown('<?php echo $tarihler3[2];?>/<?php echo $tarihler3[1];?>/<?php echo $tarihler3[0];?> <?php echo $tarihler1;?>:00', function(event) {
                                $(this).html(event.strftime('<?=@$dil['txt89'];?> %D <?=@$dil['txt90'];?> %H:%M:%S'));
                            });
                        });
                    </script>
                </div>
            </div>
        </div>
    </section>

    <section>
        <div class="container">
            <div class="row">
                <div class="col-md-4">
                    <ul>
                        <li>
                            <h5><b><?=@$dil['txt91'];?></b></h5>
                            <p><?php echo $Sonuc['adi'];?></p>
                        </li>
                        <li>
                            <h5><b><?=@$dil['txt92'];?></b></h5>
                            <p><?php echo $Sonuc['yer'];?></p>
                        </li>
                        <li>
                            <h5><b><?=@$dil['txt93'];?></b></h5>
                            <p><?php echo unixtarih($Sonuc['baslama_tarih']);?></p>
                        </li>
                        <li>
                            <h5><b><?=@$dil['txt94'];?></b></h5>
                            <p><?php echo unixtarih($Sonuc['bitis_tarih']);?></p>
                        </li>
						<?php if($Sonuc['gmap']){?>
						<li>                            
                            <p><a target="_blank" href="<?php echo $Sonuc['gmap'];?>"><?=@$dil['txt95'];?></a></p>
                        </li>
						<?php }?>
                        <li>
                            <h5><b><?=@$dil['txt96'];?></b></h5>
                            <div class="styled-icons icon-sm icon-gray icon-circled">
                                <div class="addthis_inline_share_toolbox_34zm"></div>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="col-md-8">
                    <img src="<?php echo tema;?>/uploads/etkinlikler/<?php echo $Sonuc['resim']; ?>" alt="<?php echo $Sonuc['adi'];?>">
                </div>
            </div>
            <div class="row mt-60">
                <div class="col-md-12">
                    <h4 class="mt-0"><?=@$dil['txt97'];?></h4>
                    <p><?php echo $Sonuc['aciklama']; ?></p>
                </div>
            </div>
        </div>
    </section>


</div>
<!-- end main-content -->