
	
	
	<div class="content-wrapper">
  <!-- Content Header (Page header) -->
  <section class="content-header">
    <div class="container-fluid">
      <div class="row mb-2">
        <div class="col-sm-6">
          <h1>Genel Ayarları 
          </h1>
        </div>
        <div class="col-sm-6">
          <ol class="breadcrumb float-sm-right">
            <li class="breadcrumb-item"><a href="<?=SITE?>">Anasayfa</a></li>
            <li class="breadcrumb-item active">Genel Ayarları</li>
          </ol>
        </div>
      </div>
    </div><!-- /.container-fluid -->
  </section>
  <!-- Main content -->
  <section class="content">
    <div class="container-fluid">
     <div class="row">
      <!-- left column -->
      <div class="col-md-12">
       <?php
       if($_POST)
       {
         if(!empty($_POST["baslik"]) && !empty($_POST["anahtar"]) && !empty($_POST["description"]))
         {
           $baslik=$VT->filter($_POST["baslik"]);
           $anahtar=$VT->filter($_POST["anahtar"]);
           $description=$VT->filter($_POST["description"]);
           $url=$VT->filter($_POST["url"]);

           if(!empty($_FILES["favicon"]["name"]))  
           {
            $favicon=$VT->upload("favicon","../images/favicon/");
            if($favicon!=false)
            {
             $ekle=$VT->SorguCalistir("UPDATE ayarlar","SET baslik=?, anahtar=?, aciklama=?, url=?, favicon=? WHERE ID=?",
              array($baslik,$anahtar,$description,$url,$favicon,1),1);
           }
           else
           {
             $ekle=false;
             ?>
             <div class="alert alert-info">Favicon yükleme işleminiz başarısız.</div>
             <meta http-equiv="refresh" content="2;url=<?=SITE?>genel-ayarlar"/>
             <?php
           } 
         } 

         if(!empty($_FILES["resim"]["name"]))  
         {
          $yukle=$VT->upload("resim","../images/ayarlar/");
          if($yukle!=false)
          {
           $ekle=$VT->SorguCalistir("UPDATE ayarlar","SET baslik=?, anahtar=?, aciklama=?, url=?, resim=? WHERE ID=?",
            array($baslik,$anahtar,$description,$url,$yukle,1),1);
         }
         else
         {
           $ekle=false;
           ?>
           <div class="alert alert-info">Logo yükleme işleminiz başarısız.</div>
           <meta http-equiv="refresh" content="2;url=<?=SITE?>genel-ayarlar"/>
           <?php
         } 
       }
       else
       {
        $ekle=$VT->SorguCalistir("UPDATE ayarlar","SET baslik=?, anahtar=?, aciklama=?, url=? WHERE ID=?",
          array($baslik,$anahtar,$description,$url,1),1);
      }

      if($ekle!=false)
      {
        ?>
        <div class="alert alert-success">İşleminiz başarıyla kaydedildi.</div>
        <meta http-equiv="refresh" content="2;url=<?=SITE?>genel-ayarlar"/>
        <?php
      }
      else
      {
        ?>
        <div class="alert alert-danger">İşleminiz sırasında bir sorunla karşılaşıldı.</div>
        <meta http-equiv="refresh" content="2;url=<?=SITE?>genel-ayarlar"/>
        <?php
      }
    }
    else
    {
      ?>
      <div class="alert alert-danger">Boş bıraktığınız alanları doldurunuz.</div>
      <meta http-equiv="refresh" content="2;url=<?=SITE?>genel-ayarlar"/>
      <?php
    }
  }
  ?>
  <!-- Horizontal Form -->
  <div class="card card-info">
    <div class="card-header">
      <h3 class="card-title">Site Genel Ayarları</h3>
    </div>
    <!-- /.card-header -->

    <form action="#" method="post" enctype="multipart/form-data">
      <div class="card-body">

        <div class="form-group row">
          <label class="col-sm-2 col-form-label">Sita Başlık</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" name="baslik" value="<?=$sitebaslik?>">
          </div>
        </div> 

        <div class="form-group row">
          <label class="col-sm-2 col-form-label">keywords</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" placeholder="Seo kelimeler" name="anahtar" value="<?=$siteanahtar?>">
          </div>
        </div> 

        <div class="form-group row">
          <label class="col-sm-2 col-form-label">Description</label>
          <div class="col-sm-8">
            <input type="text" class="form-control"  placeholder="Açıklama" name="description" value="<?=$siteaciklama?>">
          </div>
        </div>  

        <div class="form-group row">
          <label class="col-sm-2 col-form-label">Site URL</label>
          <div class="col-sm-8">
            <input type="text" class="form-control" placeholder="Site Url" name="url" value="<?=$siteURL?>">
          </div>
        </div>  

        <div class="form-group row">
          <label class="col-sm-2 col-form-label">Logo</label>
          <div class="col-sm-8"> 
            <input type="file" class="form-control" placeholder="Resim Seçiniz ..." name="resim">
          </div>
        </div>

        <div class="form-group row">
          <label class="col-sm-2 col-form-label">favicon</label>
          <div class="col-sm-8"> 
            <input type="file" class="form-control" placeholder="favicon Seçiniz ..." name="favicon">
          </div>
        </div> 
      </div>
      <!-- /.card-body -->
      <div class="card-footer">
       <button type="submit" name="ekle" class="btn btn-info">GÜNCELLE</button>
       <!-- /.card-footer -->
     </form>
   </div>
 </div>
</div> 
</section>
<!-- /.content -->
</div>
