<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Öğrenci Bilgi Girişi</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;
}

.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>
    <?php include 'menu.php';?>
    <?php include 'baglanti.php';?>
<h1 align="center">Öğrenci Bilgi Girişi</h1>

<div class="ana">



<?php
                if($_GET["sinif"]){ 
?>
                    <div style="display:none">
<?php
                } else {
?>
                   <div>
<?php
                }
?>

    <form action=""  method="GET">

        <div class="satir">
    <?php include 'sinif.php';?>
            <br>
              <input type="submit" value="Sınıftaki Öğrencileri Getir">
              </div>
    </form>
    </div>
    
    <br><br>

<?php
                if($_GET["sinif"]){ 
?>
                            <div>
<?php
                } else {
?>
    
    <div style="display:none">
<?php
                }
?>


    <form style="align-content:center" method="POST" action="bilgikayit.php">


    <div class="satir">
        <select name="ogrenciadi" required>
          <option value="">Lütfen Öğrenci Seçin</option>

            <?php
                
                if($_GET["sinif"]){ 
                $sinif = $_GET["sinif"]; // GET değerini değişkene aktarıyoruz
                }    
    
        //kayıt sayfasına sıralı veri girişi için gerekli alan    
        $i=1;   
            
         $sorgu = $conn->query("SELECT * FROM ogrenci WHERE sinif='$sinif' "); 
        while ($sonuc = $sorgu->fetch_assoc()) { 
        $ogrenciadi = $sonuc['ogrenciadi']; 
        $id = $sonuc['id']; 
        //echo "<br>Öğrenci İsimleri: ";
        ?>
                    
                
          <option value="<?php echo $ogrenciadi; ?>"><?php echo $ogrenciadi; ?></option>


    
    <?php 
                }
    ?>
    </div>
        <div class="satir">
                <textarea rows="4" cols="50" required placeholder="Girmek istediğiniz bilgiyi yazın." name="bilgi"></textarea><br>
        </div>
        <div class="satir">
            <input type="date" value="<?php echo date('Y-m-d'); ?>" name="tarih"><br>
        </div>
        <div class="satir">
            <input type="submit" value="Kaydet">
        </div>
    </form>
    
    
</div>
    
    
        <div class="satir" style="padding-top:20px;">
            <a align="center" href="ogrencibilgi.php">Girilmiş Bilgileri Görüntüle</a>
        </div>
        <div class="satir" style="padding-top:10px;">
            <a align="center" href="toplubilgigir.php">Toplu Bilgi Gir</a>
        </div>

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

</body>
</html>
