<?php 
include("madmin/include/baglan.php");
include("madmin/include/fonksiyonlar.php");

$seo=$_GET['seo'];

if($hizmetler=$db->query("select * from hizmetler where seo='$seo' and tur='hizmetler'")->fetch(PDO::FETCH_ASSOC)){
$hizmetlerid=$hizmetler['id'];
$hizmetlerkatadi=$hizmetler['kategori'];

$hizmetlerkat=$db->query("select * from hizmet_kategori where id='$hizmetlerkatadi'")->fetch(PDO::FETCH_ASSOC);		

}
else if($haberler=$db->query("select * from haberler where seo='$seo' and tur='haberler'")->fetch(PDO::FETCH_ASSOC)){
	$haberlerid=$haberler['id'];
}
else if($sayfalar=$db->query("select * from sayfalar where seo='$seo' and tur='sayfalar'")->fetch(PDO::FETCH_ASSOC)){
	$sayfalarid=$sayfalar['id'];
}
else if($urunler=$db->query("select * from urunler where seo='$seo' and tur='urunler'")->fetch(PDO::FETCH_ASSOC)){
	$urunlerid=$urunler['id'];
}
?>
<!DOCTYPE html>
<html lang="tr">
<head>
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-5R9EKE6F80"></script>
    <script>
        // ANALYTICS
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', 'G-5R9EKE6F80');
        // TAG MANAGER
        (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
        new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
        j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
        'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
        })(window,document,'script','dataLayer','GTM-PM8LSHJT');
    </script>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?=$haberler['adi']?><?=$sayfalar['adi']?><?=$hizmetler['adi']?><?=$urunler['adi']?> - <?=$ayar['site_title']?></title>
    <meta name="description" content="<?=$haberler['sayfa_description']?><?=$sayfalar['sayfa_description']?><?=$hizmetler['sayfa_description']?><?=$urunler['sayfa_description']?>">
    <meta name="keywords" content="<?=$haberler['etiket']?><?=$sayfalar['etiket']?><?=$hizmetler['etiket']?><?=$urunler['etiket']?>">
    <link rel="shortcut icon" type="image/x-icon" href="madmin/lib/images/logo/<?=$ayar['favicon']?>">
	<link rel="preconnect" href="https://fonts.gstatic.com/">
	<link href="https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400;1,600;1,700&amp;display=swap" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css2?family=Cabin:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&amp;display=swap" rel="stylesheet">
	<?php 
	include("bootstrap.php");
	include("style.php");
	include("colors.php");
	?>
	<link rel="stylesheet" href="css/responsive.css">
    <?=$ayar['head']?>
</head>

<body>
    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-PM8LSHJT" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>


	<div id="pageWrapper">

	<?php include("inc/header.php");?>
	
		<main>

    	<?php if($hizmetler['adi']!=''){ ?>
    
			<header class="pageMainHead d-flex position-relative bgCover w-100 text-white" style="background-image: url(madmin/lib/images/bannerler/<?=$banner['hizmetlerresim']?>);">
				<div class="alignHolder d-flex w-100 align-items-center">
					<div class="align w-100 position-relative">
						<div class="container">
							<h1 class="text-white mb-2"><?=$hizmetler['adi']?></h1>
							<nav aria-label="breadcrumb">
								<ol class="breadcrumb breadcrWhite rounded-0 border-0 p-0 fontAlter mb-0">
									<li class="breadcrumb-item"><a href="./">Anasayfa</a></li>
									<li class="breadcrumb-item active" aria-current="page"><?=$hizmetlerkat['kategori_adi']?></li>
								</ol>
							</nav>
						</div>
					</div>
				</div>
			</header>
 
			<article class="dsSingleContent pt-7 pb-2 pt-md-10 pb-md-1 pt-lg-16 pb-lg-10 pt-xl-10 pb-xl-16">
				<div class="container">
					<div class="row">
						<div class="col-12 col-lg-8 col-xl-9 order-lg-2 mb-6">
							<div class="pl-xl-14">
							<?php
							$resimkontrol=$hizmetler['banner'];
							if($resimkontrol!='resim-yok'){
							?>    
							<header class="dtlItemHeader mt-n1 mb-5">
								<div class="imgHolder">
									<img src="madmin/lib/images/hizmetler/<?=$hizmetler['banner']?>" class="img-fluid w-100" alt="<?=$hizmetler['adi']?>" style="width:100%;max-width:100%">
								</div>
							</header>
							<?php }?>    
							    
							<header class="fzMedium mb-9 hizdetay">
								<?=$hizmetler['aciklama']?>
							</header>

    						<article class="ueEveColumn__list position-relative px-4 py-3 px-lg-8 py-lg-3 mb-9">
    							<div class="d-lg-flex align-items-md-center">
    								<div class="d-md-flex align-items-md-center flex-grow-1">
    									<div class="imgHolder rounded-circle overflow-hidden flex-shrink-0 mr-4 mr-lg-10 mb-1 mb-md-0">
    										<a href="tel:<?=$ayar['firma_telefon1']?>"><img src="madmin/lib/telefon.jpg" class="img-fluid rounded-circle" alt="telefon"></a>
    									</div>
    									<div class="descrWrap flex-grow-1">
    										<strong class="tagTitle d-block text-secondary fwSemiBold mb-2"><?=$hizmetler['adi']?></strong>
    										<h3 class="fwMedium">
    											<a href="tel:<?=$ayar['firma_telefon1']?>">Hakkında Daha Fazla Bilgi İçin Bizimle İletişime Geçebilirsiniz</a>
    										</h3>
    										<ul class="list-unstyled ueScheduleList mb-0">
    											<li class="fwSemiBold">
    												<a href="tel:<?=$ayar['firma_telefon1']?>"><?=$ayar['firma_telefon1']?></a>
    											</li>
    										</ul>
    									</div>
    								</div>
    							</div>
    						</article>

							<div class="pr-lg-5 pr-xl-15 bodyFontAlter">
								<ul class="nav nav-tabs scgTabList fontAlter mb-8" id="scgTabs" role="tablist">
									<li class="nav-item">
										<a class="nav-link active" id="teklifal-tab" data-toggle="tab" href="#teklifal" role="tab" aria-controls="teklifal" aria-selected="true">Teklif Al</a>
									</li>
									
									<?php
									$cokimgkontrol=$db->query("select * from urun_img where urun_id='$hizmetlerid' and tur='hizmetler' order by id asc limit 1",PDO::FETCH_ASSOC);
									if($cokimgkontrol->rowCount()){foreach($cokimgkontrol as $cokimgkont){
									?>
									<li class="nav-item">
										<a class="nav-link" id="gorseller-tab" data-toggle="tab" href="#gorseller" role="tab" aria-controls="gorseller" aria-selected="false">Görseller</a>
									</li>
									<?php }}?>
									
									
        							<?php
        							$pdfhizmetkontrol=$hizmetler['pdf'];
        							if($pdfhizmetkontrol!='Dosya-yok'){
        							?>    
									<li class="nav-item">
										<a class="nav-link" id="pdf-tab" data-toggle="tab" href="#pdf" role="tab" aria-controls="pdf" aria-selected="false">PDF</a>
									</li>
									<?php }?>
								</ul>
								<div class="tab-content scgTabContent mb-10" id="scgTabsContent">
									<div class="tab-pane fade show active" id="teklifal" role="tabpanel" aria-labelledby="teklifal-tab">
        								<div class="commentFormWrap"> 
        									<h2 class="fwSemiBold h2vii mb-5">Teklif almak için formu doldurunuz</h2>
        									
        									
        									
                                            <?php
                                			if(isset($_POST['adi']) && isset($_POST['telefon']) && isset($_POST['email']) && isset($_POST['mesaj'])) {
                                				function epostakontrol($email){if (filter_var($email, FILTER_VALIDATE_EMAIL)){return 1;} else {return 0;}} 
                                				$gelen_mail = $_POST['email']; $mail_kontol=epostakontrol($gelen_mail);
                                				
                                			   if(empty($_POST['adi']) || empty($_POST['telefon']) || empty($_POST['email']) || empty($_POST['mesaj'])) 
                                			   {
                                				  $bilgi= '
                                                        <p style="color:#D50000"> Lütfen Boş Yer Bırakmayın.</p>                  
                                				  ';
                                				} 
                                				
                                				
                                				else if($mail_kontol == "0"){$bilgi= '
                                                <p style="color:#D50000"> Lütfen e-posta adresinizi doğru girin.</p>                  
                                				';} 
                                				
                                				else
                                				
                                				{
                                				  include 'class.phpmailer.php';
                                						$mail = new PHPMailer();
                                						$mail->IsSMTP();
                                						$mail->Host = $ayar['site_mail_host'];
                                                        $mail->Port = $ayar['site_mail_port'];
                                                        $mail->SMTPAuth = true;
                                                        $mail->SMTPSecure = 'ssl';
                                						$mail->Username = $ayar['site_mail'];
                                						$mail->Password = $ayar['site_mail_sifre'];
                                						$mail->SetFrom($mail->Username, "PromMashTest Form");
                                						$mail->AddAddress($ayar['gonderen_mail'], $ayar['site_title']);
                                						$mail->CharSet = 'UTF-8';
                                						$mail->Subject = "Hizmet Detay Form";
                                						$mail->MsgHTML('İsim:'.' '.$_POST["adi"].'<br/>
                                										Telefon:'.' '.$_POST["telefon"].'<br/>
                                										E-mail:'.' '.$_POST["email"].'<br/>
                                										Hizmet:'.' '.$hizmetler["adi"].'<br/>
                                										Mesaj:'.' '.$_POST["mesaj"].'');
                                			if($mail->Send()) 
                                			
                                			{
                                				$bilgi ='
                                				<p style="color:#00C853">Teklifiniz başarıyla gönderildi. En kısa sürede dönüş sağlanacaktır.</p>
                                				';
                                			;} 
                                			
                                			
                                			else 
                                			{ 
                                			
                                			$bilgi= '
                                            <p style="color:#D50000">Teklif mesajınız gönderilirken bir hata oluştu. Tekrar Deneyiniz.</p>
                                			'. $mail->ErrorInfo;  
                                 			}
                                			
                                			
                                			}}
                                			?>

        									<form method="POST" class="commentForm">
            								    <div class="row mx-n2"><?=$bilgi?></div>
        										<div class="row mx-n2">
        											<div class="col-12 col-sm-4 px-2">
        												<div class="form-group">
        													<input type="text" name="adi" class="form-control d-block w-100" placeholder="Adınız Soyadınız">
        												</div>
        											</div>
        											<div class="col-12 col-sm-4 px-2">
        												<div class="form-group">
        													<input type="text" name="telefon" class="form-control d-block w-100" placeholder="Telefon">
        												</div>
        											</div>
        											<div class="col-12 col-sm-4 px-2">
        												<div class="form-group">
        													<input type="email" name="email" class="form-control d-block w-100" placeholder="Email">
        												</div>
        											</div>
        											<div class="col-12 px-2">
        												<div class="form-group">
        													<textarea class="form-control w-100 d-block" name="mesaj" placeholder="Teklif Mesajınız"></textarea>
        												</div>
        											</div>
        										</div>
        										<button type="submit" class="btn btnTheme d-flex font-weight-bold text-capitalize position-relative border-0 p-0 mt-4 btnWidthSmall" data-hover="Gönder">
        											<span class="d-block btnText">Gönder</span>
        										</button>
        									</form>
        								</div>
									</div>
									<div class="tab-pane fade" id="gorseller" role="tabpanel" aria-labelledby="gorseller-tab">
										<div class="row mb-5 mb-sm-10 mx-sm-n2">
                    						<?php
                    						$hizmetcokimgcek=$db->query("select * from urun_img where urun_id='$hizmetlerid' and tur='hizmetler' order by id asc",PDO::FETCH_ASSOC);
                    						if($hizmetcokimgcek->rowCount()){foreach($hizmetcokimgcek as $hizmetcokimg){
                    						?>  
											<div class="col-12 col-sm-6 px-sm-2">
												<a href="madmin/lib/images/urunler/<?=$hizmetcokimg['img']?>" class="imgWarp mb-3 d-block lightbox" data-fancybox="true">
													<img src="madmin/lib/images/urunler/<?=$hizmetcokimg['img']?>" class="img-fluid" alt="<?=$hizmetler['adi']?>">
												</a>
											</div>
											<?php }}?>
										</div>
									</div>
									
        							<?php
        							$pdfhizmetkontrol=$hizmetler['pdf'];
        							if($pdfhizmetkontrol!='Dosya-yok'){
        							?>    
									<div class="tab-pane fade" id="pdf" role="tabpanel" aria-labelledby="pdf-tab">
										<div class="row cDonRow mb-2 mx-md-n2">
            								<ul class="list-unstyled drItemsList pl-0" style="width: 100%;">
            									<li>
            										<div class="drItemRow position-relative d-flex px-3 px-md-6 py-3">
            											<span class="icnWrap flex-shrink-0 pt-1 mr-3">
            												<img src="images/icopdf.png" class="img-fluid" alt="icon">
            											</span>
            											<div class="descrWrap">
            												<h4 class="fontBase font-weight-normal mb-1">
            													<a href="madmin/lib/images/hizmetler/<?=$hizmetler['pdf']?>" target="_blank"><?=$hizmetler['sayfa_title_it']?></a>
            												</h4>
            												<a href="madmin/lib/images/hizmetler/<?=$hizmetler['pdf']?>" target="_blank"><strong class="d-block fileSize font-weight-normal">PDF İncele</strong></a>
            											</div>
            										</div>
            									</li>
            								</ul>
										</div>
									</div>
									<?php }?>
								</div>
							</div>


							</div>
						
						</div>
						<div class="col-12 col-lg-4 col-xl-3 order-lg-1 mb-6">
							<aside class="dscSidebar pt-1 mr-xl-n5">
								<nav class="widget mb-6 mb-lg-10 widgetDepartsNav py-5 px-6">


    								<?php
    								$hizkatyanhcek=$db->query("select * from hizmet_kategori where durum='0' order by sira asc",PDO::FETCH_ASSOC);
    								if($hizkatyanhcek->rowCount()){foreach($hizkatyanhcek as $hizkatyanh){
    								$hizkathid=$hizkatyanh['id'];
    								?>    
    								<div class="mb-4 mt-1">
									<h3 class="fwSemiBold mb-1">
										<a href="javascript:void(0);" class="btnDcsBack align-middle mr-1"><i class="fas fa-chevron-right"><span class="sr-only">icon</span></i></a>
										<?=$hizkatyanh['kategori_adi']?>
									</h3>
									<ul class="list-unstyled pl-0 mx-n2 mb-0 mb-3">
        								<?php
        								$hizkyancek=$db->query("select * from hizmetler where durum='0' and kategori='$hizkathid' order by sira asc",PDO::FETCH_ASSOC);
        								if($hizkyancek->rowCount()){foreach($hizkyancek as $hizyan){
        								$hizkyanid=$hizyan['id'];
        								?>    
										<li <?php $active=$hizyan['seo'];if($active==$seo){?> class="active" <?php }?>>
											<a href="<?=$hizyan['seo']?>"><?=$hizyan['adi']?></a>
										</li>
										<?php }}?>
									</ul>
									</div>
									<?php }}?>
								    
									
								</nav>
							</aside>
						</div>
					</div>
				</div>
			</article>


    	<?php } else if($haberler['adi']!=''){?>
    
			<header class="pageMainHead d-flex position-relative bgCover w-100 text-white" style="background-image: url(madmin/lib/images/bannerler/<?=$banner['insankaynaklari']?>);">
				<div class="alignHolder d-flex w-100 align-items-center">
					<div class="align w-100 position-relative">
						<div class="container">
							<h1 class="text-white mb-2"><?=$haberler['adi']?></h1>
							<nav aria-label="breadcrumb">
								<ol class="breadcrumb breadcrWhite rounded-0 border-0 p-0 fontAlter mb-0">
									<li class="breadcrumb-item"><a href="./">Anasayfa</a></li>
									<li class="breadcrumb-item active" aria-current="page">Blog</li>
								</ol>
							</nav>
						</div>
					</div>
				</div>
			</header>
    
			<article class="ItemfullBlock pt-7 pb-7 pt-md-10 pb-md-9 pt-lg-14 pb-lg-13 pt-xl-10 pb-xl-10">
				<div class="container">
					<div class="row">
						<div class="col-12 col-lg-9 mb-6">
							<div class="pr-lg-5 pr-xl-15 bodyFontAlter">
								<header class="dtlItemHeader mt-n1 mb-10">
									<div class="imgHolder">
										<img src="madmin/lib/images/haberler/<?=$haberler['banner']?>" class="img-fluid w-100" alt="<?=$haberler['adi']?>">
									</div>
								</header>
								<div class="mb-6"><?=$haberler['aciklama']?></div>
							</div>

							
							<?php
							$pdfhiaberkontrol=$haberler['pdf'];
							if($pdfhiaberkontrol!='Dosya-yok'){
							?>    
							<section class="widget mb-6 mb-lg-10 widgetDocs">
								<ul class="list-unstyled drItemsList pl-0">
									<li>
										<div class="drItemRow position-relative d-flex px-3 px-md-6 py-3">
											<span class="icnWrap flex-shrink-0 pt-1 mr-3">
												<img src="images/icopdf.png" class="img-fluid" alt="icon">
											</span>
											<div class="descrWrap">
												<h4 class="fontBase font-weight-normal mb-1">
													<a href="madmin/lib/images/haberler/<?=$haberler['pdf']?>" target="_blank"><?=$haberler['sayfa_title_it']?></a>
												</h4>
												<a href="madmin/lib/images/haberler/<?=$haberler['pdf']?>" target="_blank"><strong class="d-block fileSize font-weight-normal">PDF İncele</strong></a>
											</div>
										</div>
									</li>
								</ul>
							</section>	
							<?php }?>
						
						</div>
						<div class="col-12 col-lg-3 mb-6">
							<div class="ml-lg-n5">
								<aside class="sidebar">
									<nav class="widget widgetArchiveList mb-6 mb-lg-10">
										<h3 class="fwMedium mb-5">Diğer Başlıklar</h3>
										<ul class="list-unstyled pl-0">
                						<?php
                						$blogiyancek=$db->query("select * from haberler where durum='0' and not id='$haberlerid' order by sira asc",PDO::FETCH_ASSOC);
                						if($blogiyancek->rowCount()){foreach($blogiyancek as $blogiyan){
                						?>  
											<li>
												<a href="<?=$blogiyan['seo']?>"><?=$blogiyan['adi']?></a>
											</li>
										<?php }}?>	
										</ul>
									</nav>
								</aside>
							</div>
						</div>
					</div>
				</div>
			</article>
    
    
    	<?php } else if($sayfalar['adi']!=''){?>
    
    
			<header class="pageMainHead d-flex position-relative bgCover w-100 text-white" style="background-image: url(madmin/lib/images/bannerler/<?=$banner['kurumsalresim']?>);">
				<div class="alignHolder d-flex w-100 align-items-center">
					<div class="align w-100 position-relative">
						<div class="container">
							<h1 class="text-white mb-2"><?=$sayfalar['adi']?></h1>
							<nav aria-label="breadcrumb">
								<ol class="breadcrumb breadcrWhite rounded-0 border-0 p-0 fontAlter mb-0">
									<li class="breadcrumb-item"><a href="./">Anasayfa</a></li>
									<li class="breadcrumb-item active" aria-current="page">Kurumsal</li>
								</ol>
							</nav>
						</div>
					</div>
				</div>
			</header>
    
			<article class="introAboutBlock pt-7 pb-3 pt-md-9 pb-md-6 pt-lg-15 pb-lg-10 pt-xl-10 pb-xl-10">
				<div class="container">
					<div class="row">


						<?php
						$sayfaimgcek=$db->query("select * from urun_img where urun_id='$sayfalarid' and tur='sayfalar' order by id asc limit 1",PDO::FETCH_ASSOC);
						if($sayfaimgcek->rowCount()){foreach($sayfaimgcek as $sayfaimg){
						?>  
						<div class="col-12 col-lg-12 d-flex align-items-center justify-content-center">
							<img src="madmin/lib/images/urunler/<?=$sayfaimg['img']?>" class="img-fluid mb-5" alt="<?=$sayfalar['adi']?>">
						</div>
						<?php }}?>

						<div class="col-12 col-lg-12">
                    		<?=$sayfalar['aciklama']?>				
						</div>


						<?php
						$sayfaimg2cek=$db->query("select * from urun_img where urun_id='$sayfalarid' and tur='sayfalar' order by id asc limit 1,12",PDO::FETCH_ASSOC);
						if($sayfaimg2cek->rowCount()){foreach($sayfaimg2cek as $sayfaimg2){
						?>  
						<div class="col-6 col-lg-4 d-flex align-items-center justify-content-center">
							<img src="madmin/lib/images/urunler/<?=$sayfaimg2['img']?>" class="img-fluid mb-5" alt="<?=$sayfalar['adi']?>">
						</div>
						<?php }}?>

						
					</div>
				</div>
			</article>

    
    	<?php } else if($urunler['adi']!=''){?>	
    
    
    
    	<?php }?>
    	
    	
		</main>



	<?php include("inc/footer.php");?>

    </div>


	<script src="js/jquery-3.4.1.min.js"></script>
	<script src="js/jqueryCustom.js"></script>
	<script src="js/plugins.js"></script>
	<script src="js/391f644c42.js"></script>
</body>
</html>