<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> 

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

input[type=text],[type=date], select, textarea, table, tr {
  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;
}

.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>
</head>
 
<body>
<div class="ana">    
<?php include 'menu.php';?>


<?php
//numara tavsiyesi için kodlanmış alan
	    $sorgu = $conn->query("SELECT * FROM ogrenci ORDER BY ogrencino DESC limit 1"); // Veritabanındaki en büyük öğrenci numarasını alıyoruz.
        while ($sonuc = $sorgu->fetch_assoc()) {
        $ogrencino = $sonuc['ogrencino'];    
        //echo substr($ogrencino,0,4);
        }
$yil= substr(date('Y') , -2);
$ay= date('m');
$numara=$yil.$ay;
//echo $numara;
if (substr($ogrencino,0,4)===$numara){$tavsiyeedilennumara=$ogrencino+1;}else{$tavsiyeedilennumara=$numara."01";}
//echo "Tavsiye edilen numara: "+$tavsiyeedilennumara;
//numara tavsiyesi için kodlanmış alan
?>  

<form method="POST" autocomplete="off" action="ogrencikayit.php">
<table border="1" align="center">
<tr>
<td colspan="2" align="center"> Öğrenci Kayıt Formu</td>
 
</tr>

<tr>
<td>Sınıf Adı</td>
<td>
            <select id="Tirtil" name="sinif">
                  <option >Lütfen Bir Sınıf Seçin</option>
                  <option value="Tirtil">Tırtıl</option>
                  <option value="Koza">Koza</option>
                  <option value="Kelebek">Kelebek</option>
            </select>
</td>
</tr>
<tr>
<td>Öğrenci Adı</td>
<td>
    
<input type="text" name="ogrenciadi">


</td>
</tr>
<tr>
<td>Öğrenci Numarası</td>
<td>
<input type="text" name="ogrencino" required placeholder="<?php echo "Tavsiye edilen numara: ".$tavsiyeedilennumara; ?>">
</td>
</tr>


<tr>
<td>Parola</td>
<td>
<input type="text" name="sifre">
</td>
</tr>


<tr>
<td>Doğum Tarihi</td>
<td>
<input type="date" name="dogumtarih">
</td>
</tr>

<tr>
<td>Cinsiyet</td>
<td>
     <select name="cinsiyet">
                  <option value="Erkek">Erkek</option>
                  <option value="Kız">Kız</option>
    </select>
</td>
</tr>


<tr>
<td>Tuvalet Eğitimi</td>
<td>
     <select name="tuvalet">
                  <option value=""></option>
                  <option value="tuvalet">Bezsiz</option>
                  <option value="bez">Bezli</option>
    </select>
</td>
</tr>

<tr>
<td>Drive Linki</td>
<td>
<input type="text" name="drive">
</td>
</tr>


<tr>
<td>Ev Adresi</td>
<td>
<textarea rows="3" cols="50" name="evadresi"></textarea>
</td>
</tr>

<tr>
<td>Anne Adı</td>
<td>
<input type="text" name="anneadi">
</td>
</tr>

<tr>
<td>Anne Doğum Tarihi</td>
<td>
<input type="date" name="annedogumtarih">
</td>
</tr>

<tr>
<td>Anne Meslek</td>
<td>
<input type="text" name="annemeslek">
</td>
</tr>

<tr>
<td>Anne İş Adres</td>
<td>
<textarea rows="3" cols="50" name="anneisadres"></textarea>
</td>
</tr>

<tr>
<td>Anne Tel</td>
<td>
<input type="text" name="annetel">
</td>
</tr>

<tr>
<td>Baba Adı</td>
<td>
<input type="text" name="babaadi">
</td>
</tr>

<tr>
<td>Baba Doğum Tarihi</td>
<td>
<input type="date" name="babadogumtarih">
</td>
</tr>

<tr>
<td>Baba Meslek</td>
<td>
<input type="text" name="babameslek">
</td>
</tr>

<tr>
<td>Baba İş Adres</td>
<td>
<textarea rows="3" cols="50" name="babaisadres"></textarea>
</td>
</tr>

<tr>
<td>Baba Tel</td>
<td>
<input type="text" name="babatel">
</td>
</tr>

<tr>
<td>Kardeş Adı</td>
<td>
<input type="text" name="kardesadi1">
</td>
</tr>

<tr>
<td>Kardeş Adı</td>
<td>
<input type="text" name="kardesadi2">
</td>
</tr>

<tr>
<td>Acil Durum Telefonu</td>
<td>
<input type="text" name="acildurumtel">
</td>
</tr>

<tr>
<td>Çocuğunuzla ilgili <br>eklemek istediğiniz<br> bilgiler</td>
<td><textarea rows="3" cols="50" name="not"></textarea>
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Kaydet"></td>
</tr>
</table>
</form>
</div>

</body>
 
 
 <p align="center" style=" padding-top:100px;">Güç İçinde!</p>

</html>

