
	
	<?php
if(!empty($_GET["ID"]))
{
  $ID=$VT->filter($_GET["ID"]);
  $veri=$VT->VeriGetir("kullanicilar","WHERE ID=?",array($ID),"ORDER BY ID ASC",1);
  if($veri!=false)
  {
    ?>
    <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>Müşteri Hesap Düzenle</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"><a href="<?=SITE?>uyeler">Müşteri Liste</a></li>
                <li class="breadcrumb-item active">Müşteri Düzenle</li>
              </ol>
            </div>
          </div>
        </div><!-- /.container-fluid -->
      </section>
      <!-- Main content -->
      <section class="content">
        <div class="container-fluid">
         <div class="row">
          <div class="col-md-8">
            <?php
            if($_POST)
            {
              if(!empty($_POST["adsoyad"]) && !empty($_POST["mail"]))
              {
                $adsoyad=$VT->filter($_POST["adsoyad"]); 
                $sifre=md5($VT->filter($_POST["sifre"]));
                $mail=$VT->filter($_POST["mail"]);

                $guncelle=$VT->SorguCalistir("UPDATE kullanicilar","SET adsoyad=?, sifre=?, mail=?, tarih=?",
                  array($adsoyad,$sifre,$mail,date("Y-m-d")));
                if($guncelle!=false)
                {
                  ?>
                  <div class="alert alert-success">Müşteri bilgileriniz başarıyla güncellendi.</div>
                  <?php
             
                }

                else
                {
                 ?>
                 <div class="alert alert-danger">Boş bıraktığınız alanları doldurunuz.</div>
                 <?php
               }
             } 
           }
        ?>
      </div>
      <!-- left column -->
      <div class="col-md-12">
        <!-- Horizontal Form -->
        <div class="card card-info">
          <div class="card-header">
            <h3 class="card-title">Yönetici Hesap Düzenle</h3>
          </div>
          <!-- /.card-header -->

          <form action="#" method="post">
            <div class="card-body">

              <div class="form-group row">
                <label for="inputPassword3" class="col-sm-2 col-form-label">Kullanıcı Adı</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" name="adsoyad" value="<?=$veri[0]["adsoyad"]?>">
                </div>
              </div> 
              <div class="form-group row">
                <label for="inputPassword3" class="col-sm-2 col-form-label">Kullanıcı Yetkisi</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" value="<?=$veri[0]["kullanici"]?>"disabled>
                </div>
              </div> 
              <div class="form-group row">
                <label for="inputPassword3" class="col-sm-2 col-form-label">E-posta Adresi</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" name="mail" value="<?=$veri[0]["mail"]?>">
                </div>
              </div>  
              <div class="form-group row">
                <label for="inputPassword3" class="col-sm-2 col-form-label">Şifre</label>
                <div class="col-sm-8">
                  <input type="Password" class="form-control" name="sifre">
                </div>
              </div> 

            </div>
            <!-- /.card-body -->
            <div class="card-footer">
              <button type="submit" name="ekle" class="btn btn-info">Kaydet</button> 
              <!-- /.card-footer -->
            </form>
          </div>
        </div>
      </div> 
    </section>
    <!-- /.content -->
  </div>
  <?php
}
}
?>