<?php if(!defined("Hacking")){die("404 Not Found"); } ?>
<?php
    // Gelen İd Değeri
    $gelen = @get('duzenle');
    if($_POST){
        // Formdan gelen bilgileri
        $blog_baslik          = post('blog_baslik');
        $blog_seo_etiket      = post('blog_seo_etiket');
        $blog_seo_aciklama    = post('blog_seo_aciklama');
        $tarih_ayari      = $_POST["tarih_ayari"];
        $saat_ayari      = $_POST["saat_ayari"];
        $blog_text            = $_POST['blog_text'];
        $anasayfa_resim        = $_FILES["anasayfa_resim"]["name"];
        // Ürün Düzenleme
        $blog->blog_duzenle($blog_baslik,$blog_seo_etiket,$blog_seo_aciklama,$blog_text,$anasayfa_resim,$tarih_ayari,$saat_ayari,$gelen);
    }
    ?>

<div id="tour-11" class="header-content">
  <h2><i class="fa fa-newspaper-o"></i>Blog Düzenle<span> <?php echo $blog->blog_tekil($gelen,'blog_baslik'); ?> Blogunu düzenleme paneli.</span>
    <div align="right">
      <a target="_blank" href="../blog/<?php echo $blog->blog_tekil($gelen,'blog_seflink'); ?>">
        <buttontype="button" class="btn btn-default"><y style="color:black;">Arayüzde Görüntüle</y></button></a>
        <button type="button" class="btn btn-success"><y style="color:black;"><b>Oluşturma: </b><?=date("d/m/Y", strtotime($blog->blog_tekil($gelen,'olusturma_tarihi')));?></y></button>
        <button type="button" class="btn btn-warning"><y style="color:black;"><b>Düzenleme:</b> <?=date("d/m/Y", strtotime($blog->blog_tekil($gelen,'duzenleme_tarihi')));?></y></button>
      </div>
    </h2>
</div>
<div class="body-content animated fadeIn">
  <form action="" method="post" name="" enctype="multipart/form-data" onsubmit="return boyutkontrol(4194304)">
    <div class="row">
      <div class="col-md-12">
        <div class="panel rounded shadow">
          <div class="panel-heading">
            <div class="pull-left">
              <h3 class="panel-title"><i class="fa fa-edit"></i>Blog Adı</h3>
            </div>
            <div class="clearfix"></div>
          </div>
          <div class="panel-body no-padding">
            <div class="form-body">
              <div class="form-group">
                <input class="form-control" name="blog_baslik" value="<?php echo $blog->blog_tekil($gelen,'blog_baslik'); ?>" type="text">
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-md-6">
        <div class="panel rounded shadow">
          <div class="panel-heading">
            <div class="pull-left">
              <h3 class="panel-title"><i class="fa fa-cog"></i>Blog SEO Ayarları</h3>
            </div>
            <div class="clearfix"></div>
          </div>
          <div class="panel-body no-padding">
            <div class="form-body">
              <div class="form-group">
                <label class="control-label"><i class="fa fa-edit"></i>&nbsp;Blog Kelimeleri (Keywords)</label>
                <input class="form-control rounded" id="tags_2" placeholder="(Her Kelimeyi Virgülle Ayırın),php,pdo,mysql,html,css,jquery,show yazılım vs.." value="<?php echo $blog->blog_tekil($gelen,'blog_seo_etiket'); ?>" name="blog_seo_etiket" type="text">
              </div>
              <div class="form-group">
                <label class="control-label"><i class="fa fa-edit"></i>&nbsp;Blog Açıklaması (Description)</label>
                <input class="form-control rounded" name="blog_seo_aciklama" placeholder="Blog Başlığının aynısını ya da Blogla ilgili kısa yazı yazabilirsiniz." value="<?php echo $blog->blog_tekil($gelen,'blog_seo_aciklama'); ?>" type="text">
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="col-md-6">
        <div class="panel rounded shadow">
          <div class="panel-heading">
            <div class="pull-left">
              <h3 class="panel-title"><i class="fa fa-picture-o"></i>Blog Resmi</h3>
            </div>
            <div class="clearfix"></div>
          </div>
          <div class="panel-body no-padding">
            <div class="form-body">
              <div class="form-group"> <img style="width:83px;" src="../upload/blog/<?php echo $blog->blog_tekil($gelen,'anasayfa_resim'); ?>" alt=""/><br>
                <br>
                <input class="form-control rounded" name="anasayfa_resim" id="resimboyut" style="border:1px solid #989898!important"  type="file">
              </div>
            </div>
          </div>
        </div>
        <div class="panel rounded shadow">
          <div class="panel-heading">
            <div class="pull-left">
              <h3 class="panel-title"><i class="fa fa-clock-o"></i>Yayınlanma Zaman Ayarı</h3>
            </div>
            <div class="clearfix"></div>
          </div>
          <div class="panel-body no-padding">
            <div class="form-body">
              <div class="form-group">
                <input class="form-control rounded col-md-8" name="tarih_ayari" style="border:1px solid #989898!important"  type="date" value="<?=$blog->blog_tekil($gelen,'tarih_zamanlama');?>">
                <input class="form-control rounded col-md-4" name="saat_ayari" style="border:1px solid #989898!important"  type="time" value="<?=$blog->blog_tekil($gelen,'saat_zamanlama');?>"><br>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="row">
      <div class="col-md-12">
        <div class="panel rounded shadow">
          <div class="panel-heading">
            <div class="pull-left">
              <h3 class="panel-title"><i class="fa fa-cog"></i>Açıklama</h3>
            </div>
            <div class="clearfix"></div>
          </div>
          <div class="panel-body no-padding">
            <div class="form-body">
              <div class="form-group">
                <textarea class="ckeditor" cols="80" id="editor1" name="blog_text" rows="10"><?php echo $blog->blog_tekil($gelen,'blog_text'); ?></textarea>
              </div>
            </div>
            <div class="form-footer">
              <div class="pull-left">
                <button class="btn btn-primary mr-5" type="submit">
                <li class="fa fa-floppy-o"></li>
                &nbsp;&nbsp;Düzenlemeyi Kaydet</button>
              </div>
              <div class="clearfix"></div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </form>
</div>
