<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
    <?php include 'baglanti.php';?>
<title>Öğrenci Bilgileri Düzenleme</title>

<style>
* {
  box-sizing: border-box;
}

input[type=text],[type=date], select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
}

label {
  padding: 12px 12px 12px 0;
  display: inline-block;
}

input[type=submit] {
  background-color: #4CAF50;
  color: white;
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  float: right;
  margin-top:5px;

}

input[type=submit]:hover {
  background-color: #45a049;
}

.ana {
  border-radius: 5px;
  background-color: #f2f2f2;
  padding: 20px;
}
    #tumsayfa {
    width: 80%;
    position: relative;
    margin: auto;
    margin-top: 6px;
    display:block;
    }

.col-25 {
  float: left;
  width: 25%;
  margin-top: 6px;
}

.col-75 {
  float: left;
  width: 75%;
  margin-top: 6px;
}

/* Clear floats after the columns */
.satir:after {
  content: "";
  display: table;
  clear: both;
}

/* Responsive layout - when the screen is less than 600px wide, make the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 600px) {
  .col-25, .col-75, input[type=submit] {
    width: 100%;
    margin-top: 5px;
  }
}
</style>
    <?php include 'menu.php';?>
</head>
<body>
    <div id="tumsayfa">
    

    
    <h3 align="center">Öğrenci Bilgi Düzenleme</h3>
 <?php 


if ($_GET) 
{


//veritabanı bağlantı bitiş


// id'si seçilen veriyi silme sorgumuzu yazıyoru
    $sorgu = $conn->query("SELECT * FROM ogrenci WHERE id =".(int)$_GET['id']); 
    while ($sonuc = $sorgu->fetch_assoc()) { 

        $sube = $sonuc['sube'];
        $durum = $sonuc['Durum'];
        $sinif = $sonuc['sinif'];
        $ogrenciadi = $sonuc['ogrenciadi'];
        $ogrencino = $sonuc['ogrencino'];
        $dogumtarih = $sonuc['dogumtarih'];
        $cinsiyet = $sonuc['cinsiyet'];
        $evadresi = $sonuc['evadresi'];
        $anneadi = $sonuc['anneadi'];
        $annedogumtarih = $sonuc['annedogumtarih'];
        $annemeslek = $sonuc['annemeslek'];
        $anneisadres = $sonuc['anneisadres'];
        $annetel = $sonuc['annetel'];
        $babaadi = $sonuc['babaadi'];
        $babadogumtarih = $sonuc['babadogumtarih'];
        $babameslek = $sonuc['babameslek'];
        $babaisadres = $sonuc['babaisadres'];
        $babatel = $sonuc['babatel'];
        $kardesadi1 = $sonuc['kardesadi1'];
        $kardesadi2 = $sonuc['kardesadi2'];
        $acildurumtel = $sonuc['acildurumtel'];
        $not1 = $sonuc['not1'];
        $id = $sonuc['id'];
        // While döngüsü ile verileri sıralayacağız. Burada PHP tagını kapatarak tırnaklarla uğraşmadan tekrarlatabiliriz. 

}
}

?>



<form method="POST" autocomplete="off" action="ogrenciduzenlekayit.php">
  <div class="satir" style="display:none;">Kayıt Numarası <input type="text" name="id" value="<?php echo $id; ?>"></div>
<table border="1" align="center">
<tr>
<td>Şube</td>
<td>

          <select name="sube">
          <option value="<?php echo $sube; ?>"><?php echo $sube; ?></option>
          <option value="Gelisim">Gelişim</option>
          <option value="Tirtil">Tırtıl</option>
        </select>
</td>
</tr>
<div id="gizli" style="display:none;">
<tr>
<td>Durum</td>
<td>

          <select name="durum">
          <option value="<?php echo $durum; ?>"><?php echo $durum; ?></option>
          <option value="Aktif">Aktif</option>
          <option value="Pasif">Pasif</option>
          <option value="Beklemede">Beklemede</option>
        </select>
</td>
</tr>
<div id="gizli" style="display:none;">
<tr>
<td>Sınıf Adı</td>
<td>
    
             <select name="sinif">
                  <option value="<?php echo $sinif; ?>"><?php echo $sinif; ?></option>
                  <option value="Ayrıldı">Ayrıldı</option>
                  <option value="Tirtil">Tırtıl</option>
                  <option value="Koza">Koza</option>
                  <option value="Kelebek">Kelebek</option>
                  <option value="Anasınıfı">Anasınıfı</option>
            </select>


</td>
</tr>
</div>
<tr>
<td>Öğrenci Adı</td>
<td>
    
<input type="text" value="<?php echo $ogrenciadi; ?>" name="ogrenciadi">


</td>
</tr>
<tr>
<td>Öğrenci Numarası</td>
<td>
<input type="text" value="<?php echo $ogrencino; ?>" name="ogrencino">
</td>
</tr>

<tr>
<td>Doğum Tarihi</td>
<td>
<input type="date" value="<?php echo $dogumtarih; ?>" name="dogumtarih">
</td>
</tr>

<tr>
<td>Cinsiyet</td>
<td>
     <select name="cinsiyet">
                  <option value="<?php echo $cinsiyet; ?>"><?php echo $cinsiyet; ?></option>
                  <option value="Erkek">Erkek</option>
                  <option value="Kız">Kız</option>
    </select>
</td>
</tr>

<tr>
<td>Ev Adresi</td>
<td>
<textarea rows="3" cols="50" name="evadresi"><?php echo $evadresi; ?></textarea>
</td>
</tr>

<tr>
<td>Anne Adı</td>
<td>
<input type="text" value="<?php echo $anneadi; ?>" name="anneadi">
</td>
</tr>

<tr>
<td>Anne Doğum Tarihi</td>
<td>
<input type="date" value="<?php echo $annedogumtarih; ?>" name="annedogumtarih">
</td>
</tr>

<tr>
<td>Anne Meslek</td>
<td>
<input type="text" value="<?php echo $annemeslek; ?>" name="annemeslek">
</td>
</tr>

<tr>
<td>Anne İş Adres</td>
<td>
<textarea rows="3" cols="50" name="anneisadres"><?php echo $anneisadres; ?></textarea>
</td>
</tr>

<tr>
<td>Anne Tel</td>
<td>
<input type="text" value="<?php echo $annetel; ?>" name="annetel">
</td>
</tr>

<tr>
<td>Baba Adı</td>
<td>
<input type="text" value="<?php echo $babaadi; ?>" name="babaadi">
</td>
</tr>

<tr>
<td>Baba Doğum Tarihi</td>
<td>
<input type="date" value="<?php echo $babadogumtarih; ?>" name="babadogumtarih">
</td>
</tr>

<tr>
<td>Baba Meslek</td>
<td>
<input type="text" value="<?php echo $babameslek; ?>" name="babameslek">
</td>
</tr>

<tr>
<td>Baba İş Adres</td>
<td>
<textarea rows="3" cols="50" name="babaisadres"><?php echo $babaisadres; ?></textarea>
</td>
</tr>

<tr>
<td>Baba Tel</td>
<td>
<input type="text" value="<?php echo $babatel; ?>" name="babatel">
</td>
</tr>

<tr>
<td>Kardeş Adı</td>
<td>
<input type="text" value="<?php echo $kardesadi1; ?>" name="kardesadi1">
</td>
</tr>

<tr>
<td>Kardeş Adı</td>
<td>
<input type="text" value="<?php echo $kardesadi2; ?>" name="kardesadi2">
</td>
</tr>

<tr>
<td>Acil Durum Telefonu</td>
<td>
<input type="text" value="<?php echo $acildurumtel; ?>" name="acildurumtel">
</td>
</tr>

<tr>
<td>Not</td>
<td><textarea rows="3" cols="50"  name="not"><?php echo $not1; ?></textarea>
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Kaydet"></td>
</tr>
</table>
</form>


</div>
</body>
</html>