<?php if(!defined("Hacking")){die("404 Not Found"); } ?>
<?php
error_reporting(0);
    $gelen = @get('duzenle');
?>
<div id="tour-11" class="header-content">
  <h2><i class="fa fa-camera"></i>Slider Düzenle</h2>
</div>
<div class="body-content animated fadeIn">
  <?php
    $slider_bilgileri = $db->select('slider')
            ->where('id',$gelen)
            ->run(true);
    if($_POST){
                    // Formdan Gelen Dizi Değeri
                    $sliderbaslik = post('sliderBaslik');
					          $sliderResim = $_FILES["sliderResim"]["name"];
                    $sliderbaslik_goster = post("baslik_goster");
                    $sliderresim_goster = post("resim_goster");
                    $tarih_ayari      = $_POST["tarih_ayari"];
                    $saat_ayari      = $_POST["saat_ayari"];
                    // slider Düzenleme Fonksiyonu
                    $Modul->slider_duzenle($sliderbaslik,$sliderResim,$sliderbaslik_goster,$sliderresim_goster,$tarih_ayari,$saat_ayari,$gelen);
                }
    ?>



  <form action="" method="post" name="" enctype="multipart/form-data">
    <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>Slider Adı</h3>
            </div>
            <div align="right">
              <button type="button" class="btn btn-success"><y style="color:black;"><b>Oluşturma: </b><?=date("d/m/Y", strtotime($slider_bilgileri["olusturma_tarihi"]));?></y></button>
              <button type="button" class="btn btn-warning"><y style="color:black;"><b>Düzenleme:</b> <?=date("d/m/Y", strtotime($slider_bilgileri["duzenleme_tarihi"]));?></y></button>
          </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="sliderBaslik" value="<?php echo $m->baslik; ?>" placeholder="slider Adı Girinyedek" type="text"> !-->
                <input class="form-control" name="sliderBaslik" value="<?php echo $slider_bilgileri["sliderBaslik"]; ?>" placeholder="Marka Adı Girin" type="text">
              </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-picture-o"></i>Slider Resmi </h3>
            </div>
            <div class="clearfix"></div>
          </div>
          <div class="panel-body no-padding">
            <div class="form-group">
              <input class="form-control rounded" name="sliderResim" style="border:0px solid #989898!important" type="file">
            </div>
            <center style="color:red;">
              Kayıtlı resim, Eğerki yeni resim yüklemeyecekseniz seçim yapmanız gerekmez! <br>
              <img src="../upload/slider/<?php echo $slider_bilgileri["sliderResim"]; ?>" style="width:600px;height:300px;">
            </center>
            <br>
          </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">
                  <li class="fa fa-question-circle"></li>
                  &nbsp;Resim Sliderda Gösterilsin mi?</h3>
              </div>
              <div class="clearfix"></div>
            </div>
            <div class="panel-body no-padding">
              <div class="form-body">
                <div class="form-group">
                  <div class="checkbox">
                    <label>
                  &nbsp;    <input type="checkbox" name="resim_goster" value="1"  <?php  if($slider_bilgileri["resim_goster"]=='1') echo 'checked';?>>
                      Evet Göster </label>
                  </div>
                </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">
                  <li class="fa fa-question-circle"></li>
                  &nbsp;Başlık Sliderda Gösterilsin mi?</h3>
              </div>
              <div class="clearfix"></div>
            </div>
            <div class="panel-body no-padding">
              <div class="form-body">
                <div class="form-group">
                  <div class="checkbox">
                    <label>
                  &nbsp;    <input type="checkbox" name="baslik_goster" value="1"  <?php  if($slider_bilgileri["baslik_goster"]=='1') echo 'checked';?>>
                      Evet Göster </label>
                  </div>
                </div>
              </div>
            </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="<?=$slider_bilgileri["tarih_zamanlama"];?>">
              <input class="form-control rounded col-md-4" name="saat_ayari" style="border:1px solid #989898!important"  type="time" value="<?=$slider_bilgileri["saat_zamanlama"];?>"><br>
            </div>
          </div>
        </div>
      </div>
    </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>
        </form>
      </div>
