<?php
require_once 'ayar/Config.php';
include "header.php";
?>
  <?php if ($Site->site_ayarlari('iletisim-title') != ''){ // Meta Title ?>
  <title>
    <?php echo $Site->site_ayarlari('iletisim-title'); ?>
  </title>
  <?php } else { ?>
  <title>İletişim</title>
  <?php } ?>
  <?php if ($Site->site_ayarlari('iletisim-keywords') != ''){ // Meta Keywords ?>
  <meta name="keywords" content="<?php echo $Site->site_ayarlari('iletisim-keywords'); ?>">
  <?php } else { ?>

  <?php } ?>
  <?php if ($Site->site_ayarlari('iletisim-description') != ''){  // Meta Description ?>
  <meta name="description" content="<?php echo $Site->site_ayarlari('iletisim-description'); ?>">
  <?php } else { ?>
  <?php } ?>
  <!--===== Başlık =====-->
  <section class="padding bg_light" style="background-image: url(images/iletisim.jpg);">

    <div class="container">
      <div class="row">
        <div class="col-md-12 bottom20"><br>
          <br>
          <br>
          <br>
          <h2 class="text-uppercase"><span class="color_red" style="font-size:60px;"> İLETİŞİM </span></h2>
          <br>
          <span style="font-size:12px; color:#000000;"><a href="anasayfa">ANA SAYFA</a> / <a href="iletisim">İLETİŞİM</a></span> </div>
      </div>
  </section>

  <!--===== CONTACT US =====-->
  <section id="contact-us">
    <div class="container">
      <div class="row padding">
        <div class="col-md-8">
          <div class="bottom40">
            <h2 class="text-uppercase">Bize<span class="color_red"> Yazın</span></h2>
            <div class="line_1"></div>
            <div class="line_2"></div>
            <div class="line_3"></div>
          </div>
          <div class="agent-p-form p-t-30">
            <div class="row">
              <?php
			error_reporting(0);

					if($_POST){
						// Formdan Gelen Bilgiler
						$iletisim_adsoyad = post('iletisim_adsoyad');
						$iletisim_email   = post('iletisim_email');
						$iletisim_konu    = post('iletisim_konu');
						$iletisim_text    = post('iletisim_text');
						// İletişime Geç
						$Site->iletisim($iletisim_adsoyad,$iletisim_email,$iletisim_konu,$iletisim_text);

            if($Site->site_ayarlari('mailgonderilsinmi')==1){
            //mail
            $mailicerik  = $iletisim_adsoyad."<br>";
            $mailicerik .= $iletisim_email."<br>";
            $mailicerik .= $iletisim_konu."<br>";
            $mailicerik .= $iletisim_text."<br>";

              $smtp_server = $Site->site_ayarlari('smtp_server');
              $smtp_port = $Site->site_ayarlari('smtp_port');
              $smtp_protokol =   $Site->site_ayarlari('smtp_protokol');
              $e_posta =   $Site->site_ayarlari('e_posta');
              $e_posta_sifre =   $Site->site_ayarlari('e_posta_sifre');
              $gonderici_bilgi = $Site->site_ayarlari('gonderici_bilgi');
              $gidecek_e_posta = $Site->site_ayarlari('gidecek_e_posta');

            include "ayar/class.phpmailer.php";
            $mail = new PHPMailer();
            $mail->IsSMTP();
            $mail->SMTPDebug = 1;
            $mail->SMTPAuth = true;
            $mail->SMTPSecure = $smtp_protokol ;
            $mail->Host = $smtp_server;
            $mail->Port = $smtp_port;
            $mail->IsHTML(true);
            $mail->Username = $e_posta;
            $mail->Password = $e_posta_sifre;
            $mail->SetFrom($mail->Username, $iletisim_adsoyad);

            $mail->CharSet = 'UTF-8';
            $mail->Subject = $iletisim_konu;
            $content = $mailicerik;
            $mail->MsgHTML($content);
            $mail->AddAddress($gidecek_e_posta, $gonderici_bilgi);
            if($mail->Send()) {
            } else {

                echo $mail->ErrorInfo;
            }
					}
        }
				?>
                <form action="" method="post" class="findus">
                  <div class="col-md-12">
                    <div class="single-query">
                      <input type="text" placeholder="Adınız" class="keyword-input" required name="iletisim_adsoyad">
                    </div>
                  </div>
                  <div class="col-md-12">
                    <div class="single-query">
                      <input type="email" placeholder="E-Posta" class="keyword-input" required name="iletisim_email">
                    </div>
                  </div>
                  <div class="col-md-12">
                    <div class="single-query">
                      <input type="text" placeholder="Konu" class="keyword-input" required name="iletisim_konu">
                    </div>
                  </div>
                  <div class="col-md-12">
                    <div class="single-query">
                      <textarea required name="iletisim_text" placeholder="Mesajınız"></textarea>
                    </div>
                  </div>
                  <div class="col-md-2 col-sm-2 col-xs-12 text-right">
                    <div class="query-submit-button">
                      <input type="submit" value="Mesajı Gönder" class="btn_fill">
                    </div>
                  </div>
                </form>
            </div>
          </div>
        </div>
        <div class="col-md-4">
          <div class="bottom40">
            <h2 class="text-uppercase">BİZE<span class="color_red"> ULAŞIN</span></h2>
            <div class="line_1"></div>
            <div class="line_2"></div>
            <div class="line_3"></div>
          </div>
          <div class="agent-p-contact p-t-30">
            <div class="agetn-contact-2">
              <p><b><i class="icon-telephone114"></i> <a style="font-size:23px;" href="tel:<?php echo $Site->site_ayarlari('site-telefon1'); ?>"><?php echo $Site->site_ayarlari('site-telefon1'); ?></a></b></p>
  <p><b><i class="icon-telephone114"></i> <a style="font-size:23px;" href="tel:<?php echo $Site->site_ayarlari('site-telefon2'); ?>"><?php echo $Site->site_ayarlari('site-telefon2'); ?></a></b></p>
              <p><b><a style="font-size:18px;" href="mailto:<?php echo $Site->site_ayarlari('site-eposta'); ?>"><i class=" icon-icons142"></i> <?php echo $Site->site_ayarlari('site-eposta'); ?></a></b></p>
              <p><b><i class="icon-icons74"></i> <a style="font-size:18px;" href="<?php echo $Site->site_ayarlari('site-googlemaps'); ?>" target="_blank" title="Google Maps"><?php echo $Site->site_ayarlari('site-adres'); ?></a></b></p>
            </div>
            <ul class="socials">
              <?php if ($Site->site_ayarlari('site-facebook') != "") {  ?>
              <li><a href="<?php echo $Site->site_ayarlari('site-facebook'); ?>" target="_blank"><i class="fa fa-facebook"></i></a></li>
              <?php } ?>
              <?php if ($Site->site_ayarlari('site-twitter') != "") {  ?>
              <li><a href="<?php echo $Site->site_ayarlari('site-twitter'); ?>" target="_blank"><i class="fa fa-twitter"></i></a></li>
              <?php } ?>
              <?php if ($Site->site_ayarlari('site-instagram') != "") {  ?>
              <li><a href="<?php echo $Site->site_ayarlari('site-instagram'); ?>" target="_blank"><i class="fa fa-instagram"></i></a></li>
              <?php } ?>
              <?php if ($Site->site_ayarlari('site-googleplus') != "") {  ?>
              <li><a href="<?php echo $Site->site_ayarlari('site-googleplus'); ?>" target="_blank"><i class="fa fa-google-plus"></i></a></li>
              <?php } ?>
              <li><a href="sitemap.xml" target="_blank" title="Site Haritası"><i class="fa fa-sitemap"></i></a></li>
            </ul>
          </div>
        </div>
      </div>
    </div>
<?php if ($Site->modul_ayarlari('krokigoster') == "aktif") { ?>
    <?php if ($Site->site_ayarlari('site-googlemaps') != "") {  ?>
    <div class="contact">
      <div id="map">
        <iframe src="<?php echo $Site->site_ayarlari('site-googlemaps'); ?>" width="100%" height="400" frameborder="0" style="border:0" allowfullscreen></iframe>
      </div>
    </div>
  <?php }
} ?>
  </section>
  <!--===== #/CONTACT US =====-->

  <?php include "footer.php"; ?>
