Created
March 21, 2021 08:08
-
-
Save firdaushqq/85191486224f58263a0856a43eec913f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Firdaus Haqiqi XI RPL 3</title> | |
<link rel="stylesheet" type="text/css" href="assets/style.css"> | |
</head> | |
<body> | |
<form method="POST" action=" | |
<?php | |
$action = '$tambah.php'; | |
if (!empty($siswa)) $action = 'edit.php' | |
?>" | |
enctype="multipart/form-data" | |
> | |
<div> | |
<td> | |
<label for="">Foto</label> | |
<?php if (!empty($siswa['file'])) { ?> | |
<img width="90" height="90" src="<?php echo base_url() ?>/assets/image/<?php echo $siswa['file'] ?>"> | |
<?php } else { ?> | |
<img width="90" height="90" src="assets/img/ava1.png"> | |
<?php } ?> | |
<input type="file" name="foto" class="border" autocomplete="off" onchange="loadFile(event)"> | |
</td> | |
</div> | |
<div> | |
<div > | |
<span>NIS</span> | |
</div> | |
<input type="text" placeholder="Masukkan Nomor induk siswa" name="nis" value="<?= @$siswa['nis'] ?>" required> | |
</div> | |
<div> | |
<div> | |
<span>Nama Lengkap</span> | |
</div> | |
<input type="text" name="nama_lengkap" value="<?= @$siswa['nama_lengkap'] ?>" required> | |
</div> | |
<div> | |
<label> | |
<h5>Jenis Kelamin :</h5> | |
<input type="radio" name="jenis_kelamin" value="L" <?= @$siswa['jenis_kelamin'] == 'L' ? 'checked' : '' ?> required> Laki-laki | |
</label> | |
<label> | |
<input type="radio" name="jenis_kelamin" value="P" <?= @$siswa['jenis_kelamin'] == 'P' ? 'checked' : '' ?>> Perempuan | |
</label> | |
</div> | |
<div> | |
<div> | |
<label>Kelas</label> | |
</div> | |
<select name="id_kelas" id="select1"> | |
<option value="">[ Pilih Kelas ]</option> | |
<?php while ($murid = @$dataKelas->fetch_array()) { ?> | |
<option value="<?php echo $murid['id_kelas'] ?>" <?php echo @$siswa['id_kelas'] == $murid['id_kelas'] ? 'selected' : '' ?>> | |
<?php echo $murid['nama_kelas'] ?> | |
</option> | |
<?php } ?> | |
</select> | |
</div> | |
<div> | |
<div> | |
<span>Jurusan</span> | |
</div> | |
<input type="text" placeholder="Masukkan Jurusan anda" name="jurusan" value="<?= @$siswa['jurusan']; ?>" required> | |
</div> | |
<div> | |
<div> | |
<span>Alamat</span> | |
</div> | |
<input type="text" placeholder="Masukkan Alamat Rumah" name="alamat" value="<?= @$siswa['alamat'] ?>" required> | |
</div> | |
<div> | |
<div> | |
<label>Golongan Darah</label> | |
</div> | |
<select name="gol_darah" required> | |
<option value="A" <?= @$siswa['gol_darah'] == 'A' ? 'selected' : '' ?>>A</option> | |
<option value="B" <?= @$siswa['gol_darah'] == 'B' ? 'selected' : '' ?>>B</option> | |
<option value="AB" <?= @$siswa['gol_darah'] == 'AB' ? 'selected' : '' ?>>AB</option> | |
<option value="O" <?= @$siswa['gol_darah'] == 'O' ? 'selected' : '' ?>>O</option> | |
</select> | |
</div> | |
<div> | |
<div> | |
<span>Nama Ibu kandung</span> | |
</div> | |
<input type="text" placeholder="Masukkan Nama Ibu Kandung anda" name="nama_ibu_kandung" value="<?= @$siswa['nama_ibu_kandung']; ?>" required> | |
</div> | |
<button type="submit" value="Simpan">Simpan</button> | |
</form> | |
<a href="index.php">Kembali ke data</a> | |
<script> | |
const del = document.querySelector(".del"); | |
const overwrite = document.createElement("input"); | |
const inp = document.querySelector(".inp"); | |
if (del.value != '') { | |
del.setAttribute("type", "hidden"); | |
overwrite.setAttribute("type", "text"); | |
overwrite.setAttribute("class", "form-control"); | |
overwrite.setAttribute("value", "<?= $siswa["nis"]; ?>"); | |
overwrite.setAttribute("disabled", ""); | |
inp.appendChild(overwrite); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment