<!DOCTYPE html>
<html>
<head>
<title>Input data siswa</title>
</head>
<body style="padding:15px;background:#ddd">
<h4> Form edit Data Warga:</h4>
<?php
include 'koneksi.php';
$nomor_surat = @$_GET['nomor_surat']; // ambil data ID dari URL
$data = mysqli_query($koneksi,"select * from pengantar where nomor_surat = '$nomor_surat'");
$d = mysqli_fetch_array($data);?>

<form action="update_data.php?nomor_surat=<?php echo $nomor_surat ?>" method="post"> ID: <?php echo $d['nomor_surat']; ?><br><hr>
<input style="margin-bottom:10px;" type="text" name="nik" value="<?php echo $d['nik']; ?>"><br>
<input style="margin-bottom:10px;" type="text" name="no_kk" value="<?php echo $d['no_kk']; ?>"><br>
<input style="margin-bottom:10px;" type="text" name="nama" value="<?php echo $d['nama']; ?>"><br>
<input style="margin-bottom:10px;" type="text" name="alamat" value="<?php echo $d['alamat']; ?>"><br>
<input style="margin-bottom:10px;" type="text" name="jenis_kelamin" value="<?php echo $d['jenis_kelamin']; ?>"><br>
<input style="margin-bottom:10px;" type="text" name="kewarganegaraan" value="<?php echo $d['kewarganegaraan']; ?>"><br>
<input style="margin-bottom:10px;" type="text" name="agama" value="<?php echo $d['agama']; ?>"><br>
<input style="margin-bottom:10px;" type="text" name="pekerjaan" value="<?php echo $d['pekerjaan']; ?>"><br>
<input style="margin-bottom:10px;" type="text" name="keperluan" value="<?php echo $d['keperluan']; ?>"><br>
<input style="margin-bottom:10px;" type="text" name="keterangan" value="<?php echo $d['keterangan']; ?>"><br>
<input style="margin-bottom:10px;" type="date" name="berlaku_mulai" value="<?php echo $d['berlaku_mulai']; ?>"><br>
<button  type="submit">Update</button>
</form>
</body>
</html>