<link href="<?= SITE ?>css/contact.css" rel="stylesheet">
<main class="bg_gray">

	<div class="container margin_30">
		<div class="page_header">
			<div class="breadcrumbs">
				<ul>
					<li><a href="<?=SITE?>">Anasayfa</a></li> 
					<li>İletişim</li>
				</ul>
			</div> 
		</div>

		<div class="container margin_60">
			<div class="main_title">
				<h2>İletişim Bilgileri</h2>
				<p>Hizmetlerimiz hakkında daha detaylı bilgi almak için bize ulaşın.</p>
			</div>
			<div class="row justify-content-center">
				<div class="col-lg-4">
					<div class="box_contacts">
						<i class="ti-support"></i>
						<h2>İletişim</h2>
						<a><?=$sitetelefon?></a> - <a><?=$sitemail?></a>
						<small>Pazartesi - Cuma 09:00 - 18:00</small>
					</div>
				</div>
				<div class="col-lg-4">
					<div class="box_contacts">
						<i class="ti-map-alt"></i>
						<h2>Adres</h2>
						<div><?=$siteadres?></div> 
					</div>
				</div>
				<div class="col-lg-4">
					<div class="box_contacts">
						<i class="ti-package"></i>
						<h2>Siparişler</h2>
						<a><?=$sitefax?></a> - <a><?=$sitemail?></a>
						<small>Pazartesi - Cuma 09:00 - 18:00</small>
					</div>
				</div>
			</div>
			<!-- /row -->
		</div>
		<!-- /container -->
		<div class="bg_white">
			<div class="container margin_60_35">
				<h4 class="pb-3">İletişim Formu</h4>
				<div class="row">

					<div class="col-lg-4 col-md-6 add_bottom_25">
						<?php
						if ($_POST) {
							if (!empty($_POST["adsoyad"]) && !empty($_POST["mail"])  && !empty($_POST["konu"]) && !empty($_POST["mesaj"]) && !empty($_POST["telefon"])) 
							{   
								include_once(SINIF."class.phpmailer.php");
								include_once(SINIF."class.smtp.php");

								$adsoyad = $VT->filter($_POST["adsoyad"]);
								$mail = $VT->filter($_POST["mail"]);
								$konu = $VT->filter($_POST["konu"]);
								$mesaj = $VT->filter($_POST["mesaj"]);
								$telefon = $VT->filter($_POST["telefon"]);
								$metin="Ad Soyad : ".$adsoyad.' Mail Adresi : '.$mail." Telefon : ".$telefon." Mesaj : ".$mesaj;
								$maililet=$VT->MailGonder($sitemail,$konu,$mesaj); 
								$maililet=$VT->SorguCalistir("INSERT INTO contact","SET adsoyad=?, mail=?, konu=?, mesaj=?, telefon=?, tarih=?",
									array($adsoyad,$mail,$konu,$mesaj,$telefon,date("Y-m-d"))); 
								if($maililet!=false) 
								{
									$success = 'Mesajınız bize ulaştı.';
								} else {
									$error = 'Bir hata oluştu.';
								}

							} 
							else
							{
								echo '<div class="alert alert-danger">Boş Alanları Doldurunuz!</div>';
							} 
						} 
						?> 
						<form action="" method="post" enctype="multipart/form-data">
							<div class="form-group">
								<input class="form-control" type="text" name="adsoyad" placeholder="Ad Soyad *">
							</div>
							<div class="form-group">
								<input class="form-control" type="email" name="mail" placeholder="Email *">
							</div>
							<div class="form-group">
								<input class="form-control" type="text" name="telefon" placeholder="Telefon *">
							</div>
							<div class="form-group">
								<input class="form-control" type="text" name="konu" placeholder="Konu? *">
							</div>
							<div class="form-group">
								<textarea class="form-control" style="height: 100px;" name="mesaj" placeholder="Mesajınızı yazınız... *"></textarea>
							</div>
							<div class="form-group">
								<input class="btn_1 full-width" type="submit" name="maililet" value="Gönder">
							</div>
						</form>
					</div>
					<div class="col-lg-8 col-md-6 add_bottom_25">
						<iframe class="map_contact" src="<?=$sitemaps?>" style="border: 0" allowfullscreen></iframe>
					</div>
				</div>
				<!-- /row -->
			</div>
			<!-- /container -->
		</div>
	</div>
	<!-- /bg_white -->

	<?php include_once(SAYFA."alt.php"); ?>
	<script src="<?=SITE?>js/sweetalert.min.js"></script>
	<?php if (isset($success)) { ?>
		<script type="text/javascript">
			swal("Tebrikler.", "<?= $success ?>", "success").then(function() {window.location.href = 'iletisim';});
		</script>
	<?php } ?>
	<?php if (isset($error)) { ?>
		<script type="text/javascript">
			swal("Hata.", "<?= $error ?>", "error").then(function() {window.location.href = 'iletisim';});
		</script>
	<?php } ?>
</main>
<!--/main-->
