<?php
$nip = $_SESSION['idu'];

$sql = mysqli_query($koneksi, "SELECT * FROM guru WHERE nip='$nip'");
$rs  = mysqli_fetch_assoc($sql);
?>

<div class="row">
    <div class="col-lg-12">
        <h3 class="page-header"><strong>Edit Data Guru</strong></h3>
    </div>
</div>

<div class="row">
<div class="col-lg-12">
<div class="panel panel-primary">
<div class="panel-heading">Edit Data Guru</div>

<div class="panel-body">
<div class="row">

<form method="post" action="./module/simpan.php?act=guru_det">

<input type="hidden" name="idg" value="<?php echo $rs['idg']; ?>">

<div class="col-lg-6">

<div class="form-group">
<label>NIP</label><br>
<label><?php echo $rs['nip']; ?></label>
</div>

<div class="form-group">
<label>Nama</label>
<input type="text" class="form-control" name="nama"
       value="<?php echo $rs['nama']; ?>" required>
</div>

<div class="form-group">
<label>Jenis Kelamin</label>

<div class="radio">
<label>
<input type="radio" name="jk" value="L"
<?php if($rs['jk']=="L") echo "checked"; ?>>
Laki - Laki
</label>
</div>

<div class="radio">
<label>
<input type="radio" name="jk" value="P"
<?php if($rs['jk']=="P") echo "checked"; ?>>
Perempuan
</label>
</div>

</div>
</div>

<div class="col-lg-6">

<div class="form-group">
<label>Alamat</label>
<textarea class="form-control" name="alamat" rows="3"><?php echo $rs['alamat']; ?></textarea>
</div>

<div class="form-group">
<label>Ganti Password</label>
<input type="password" class="form-control" name="pass"
       placeholder="Kosongkan jika tidak diganti">
</div>

<br>
<button type="submit" class="btn btn-success">Simpan</button>

</div>

</form>

</div>
</div>

</div>
</div>
</div>
