<?php
include("madmin/include/baglan.php");
include("madmin/include/fonksiyonlar.php");
?>
<!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>Teklif Al - <?=$ayar['site_title']?></title>
    <meta name="keywords" content="<?=$ayar['site_meta']?>" />
    <meta name="description" content="<?=$ayar['site_description']?>">
    <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">
</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>
			<header class="pageMainHead d-flex position-relative bgCover w-100 text-white" style="background-image: url(madmin/lib/images/bannerler/<?=$banner['teklifal']?>);">
				<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">Teklif Al</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">Teklif Al</li>
								</ol>
							</nav>
						</div>
					</div>
				</div>
			</header>
			<div class="contactSectionWrap pt-7 pb-2 pt-md-10 pb-md-1 pt-lg-16 pb-lg-10 pt-xl-10 pb-xl-10">
				<div class="container">
					<div class="row">
						<div class="col-12 col-md-12 col-xl-12">
							<div class="widget bg-white shadow contactFormWidget ml-xl-n5 mb-7 mb-md-5">
								<div class="pt-8 pb-10 px-4 px-md-6 px-xl-8">
									<h2 class="fwSemiBold h3Medium mb-4">Teklif almak için formu doldurunuz</h2>
									
                                    <?php
                        			if(isset($_POST['adi']) && isset($_POST['telefon']) && isset($_POST['email']) && isset($_POST['konu']) && 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['konu']) || 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 = "Teklif Al Form";
                        						$mail->MsgHTML('İsim:'.' '.$_POST["adi"].'<br/>
                        										Telefon:'.' '.$_POST["telefon"].'<br/>
                        										E-mail:'.' '.$_POST["email"].'<br/>
                        										Konu:'.' '.$_POST["konu"].'<br/>
                        										Mesaj:'.' '.$_POST["mesaj"].'');
                        			if($mail->Send()) 
                        			
                        			{
                        				$bilgi ='
                        				<p style="color:#00C853">Teklif 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önderirken 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-6 col-md-12 col-lg-6 px-2">
												<div class="form-group">
													<input type="text" class="form-control d-block w-100" name="adi" placeholder="Adınız Soyadınız">
												</div>
											</div>
											<div class="col-12 col-sm-6 col-md-12 col-lg-6 px-2">
												<div class="form-group">
													<input type="email" class="form-control d-block w-100" name="email" placeholder="Email">
												</div>
											</div>
											<div class="col-12 col-sm-6 col-md-12 col-lg-6 px-2">
												<div class="form-group">
													<input type="text" class="form-control d-block w-100" name="telefon" placeholder="Telefon">
												</div>
											</div>
											<div class="col-12 col-sm-6 col-md-12 col-lg-6 px-2">
												<div class="form-group">
													<input type="text" class="form-control d-block w-100" name="konu" placeholder="Konu">
												</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-2 btnWidthSmall" data-hover="Gönder">
											<span class="d-block btnText">Gönder</span>
										</button>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>

		</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>