<?php require admin_view('include/header'); ?>
<!-- Content Wrapper. Contains page content -->
<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>Yönetici Panel</h1>
        </div>
        <div class="col-sm-6">
          <ol class="breadcrumb float-sm-right">
            <li class="breadcrumb-item"><a href="index">Genel Ayarlar</a></li>
            <li class="breadcrumb-item active">Yönetici Panel</li>
          </ol>
        </div>
      </div>
    </div><!-- /.container-fluid -->
  </section>

  <!-- Main content -->
  <section class="content">
    <div class="container-fluid">
      <div class="row">
        <div class="col-md-3">

          <!-- Profile Image -->
          <div class="card card-primary card-outline">
            <div class="card-body box-profile">
              <div class="text-center">
                <img class="profile-user-img img-fluid img-circle"
                src="<?= admin_public_url(); ?>dist/img/user2-160x160.jpg"
                alt="User profile picture">
              </div>

              <h3 class="profile-username text-center"><?= $rowowner['name']. " ". $rowowner['surname']; ?></h3>

              <p class="text-muted text-center"><?= $rowowner['username']; ?></p> 
            </div>
            <!-- /.card-body -->
          </div>
          <!-- /.card -->

        </div>
        <!-- /.col -->
        <div class="col-md-9">
          <div class="card">
            <div class="card-header p-2">
              <ul class="nav nav-pills">
                <li class="nav-item"><a class="nav-link active" href="#hesap" data-toggle="tab">Hesap İşlemleri</a></li>

                <li class="nav-item"><a class="nav-link" href="#password" data-toggle="tab">Şifre İşlemleri</a></li>
              </ul>
            </div><!-- /.card-header -->
            <div class="card-body">
              <div class="tab-content">
                <div class="active tab-pane" id="hesap"> 
                 <form action="" method="POST">
                  <div class="form-group row">
                    <label for="inputName" class="col-sm-2 col-form-label">isim</label>
                    <div class="col-sm-10">
                      <input type="text" class="form-control" name="name" value="<?= $row['name'] ?>" required="">
                    </div>
                  </div>
                  <div class="form-group row">
                    <label for="inputEmail" class="col-sm-2 col-form-label">Soyad</label>
                    <div class="col-sm-10">
                     <input type="text" class="form-control" name="surname" value="<?= $row['surname'] ?>" required="">
                   </div>
                 </div>
                 <div class="form-group row">
                  <label for="inputName2" class="col-sm-2 col-form-label">Kullanıcı Adı</label>
                  <div class="col-sm-10">
                   <input type="text" class="form-control" name="username" value="<?= $row['username'] ?>" required="">
                 </div>
               </div>

               <div class="form-group row">
                <label for="inputEmail" class="col-sm-2 col-form-label">Email</label>
                <div class="col-sm-10"> 
                 <input type="email" class="form-control" name="email" value="<?= $row['email'] ?>">
               </div>
             </div> 

             <div class="card-footer">
              <button type="submit" name="editaccount" class="btn btn-info"><i class="fas fa-save"></i> Güncelle</button> 
            </div>
            <div class="col-xs-6">
              <p>Bilgilerinizi en son <?= tarih('j F Y - H:i:s',$row['edit_account']); ?> tarihinde güncellediniz.</p>
            </div>
          </form>
        </div> 

        <div class="tab-pane" id="password">
          <form action="" method="POST"> 
           <div class="form-group row">
            <label for="inputName" class="col-sm-2 col-form-label">Eski Şifreniz</label>
            <div class="col-sm-10">
              <input type="password" class="form-control" name="old" required="">
            </div>
          </div>  
          <div class="form-group row">
            <label for="inputName" class="col-sm-2 col-form-label">Yeni Şifreniz</label>
            <div class="col-sm-10"> 
             <input type="password" class="form-control" name="one" required="">
           </div>
         </div> 
         <div class="form-group row">
          <label for="inputName" class="col-sm-2 col-form-label">Yeni Şifreniz (Tekrar)</label>
          <div class="col-sm-10">
           <input type="password" class="form-control" name="two" required="">
         </div>
       </div> 

       <div class="card-footer">
        <button type="submit" name="editpassword" class="btn btn-info"><i class="fas fa-save"></i> Güncelle</button> 
      </div>
      <div class="col-xs-6">
        <p>Şifrenizi en son <?= tarih('j F Y - H:i:s',$row['edit_password']); ?> tarihinde güncellediniz.</p>
      </div>
    </form>
  </div>
  <!-- /.tab-pane -->
</div>
<!-- /.tab-content -->
</div><!-- /.card-body -->
</div>
<!-- /.nav-tabs-custom -->
</div>
<!-- /.col -->
</div>
<!-- /.row -->
</div>
<!-- /.container-fluid -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->

<?php require admin_view('include/footer'); ?>