<?php if(!defined("Hacking")){die("404 Not Found"); } ?>

<div id="tour-11" class="header-content">
  <h2><i class="fa fa-personel-camera"></i>Personel Düzenle</h2>
</div>
<div class="body-content animated fadeIn">
  <?php
  error_reporting(0);

        $personel_bilgileri = $db->select('personel')
            ->where('id',$gelen)
            ->run(true);
                    if($_POST){
                            // Formdan Gelen Dizi Değeri
                            $personelBaslik = post('personelBaslik');
                            $personelResim = $_FILES["personelResim"]["name"];
                            $personelEmbed   = $_POST['personelEmbed'];
                            $personelText = $_POST['personelText'];

                            // referans Düzenleme Fonksiyonu
                            $Modul->personel_duzenle($personelBaslik,$personelResim,$personelEmbed,$personelText,$gelen);
                        }

    ?>
  <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>Personel 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($personel_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($personel_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="personelBaslik" value="<?php echo $personel_bilgileri["personelBaslik"]; ?>" 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-photo"></i>Personel Profil Resmi <b style="color:red;">(Resim Boyutu: 370x370 olmalı)*</b></h3>
           </div>
           <div class="clearfix"></div>
         </div>
         <div class="panel-body no-padding">
           <div class="form-group">
             <input class="form-control rounded" name="personelResim" id="resimboyut" style="border:0px solid #989898!important" type="file">
           </div>
           <center style="color:red;">
             Personele ait kayıtlı resim, Eğerki yeni resim yüklemeyecekseniz seçim yapmanız gerekmez! <br>
             <img src="../upload/personel/<?php echo $personel_bilgileri["personelResim"]; ?>" style="width:150px;height:150px;">
           </center>
           <br>
         </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-edit"></i>Personelin Görevi</h3>
            </div>
            <div class="clearfix"></div>
          </div>
          <div class="panel-body no-padding">
            <div class="form-group">
              <input class="form-control rounded" name="personelEmbed" value="<?php echo $personel_bilgileri["personelEmbed"]; ?>"  type="text">
            </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-edit"></i>Personel Hakkında</h3>
            </div>
            <div class="clearfix"></div>
          </div>
          <div class="panel-body no-padding">
            <div class="form-group">
              <input class="form-control rounded" name="personelText" value="<?php echo $personel_bilgileri["personelText"]; ?>"  type="text">
            </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>
