-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchange_data.php
62 lines (62 loc) · 2.45 KB
/
change_data.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<title></title>
</head>
<body class="m-5">
<?php
include "connect.php";
$qry_get_siswa=mysqli_query($conn,"select * from siswa where
id_siswa = '".$_GET['id_siswa']."'");
$dt_siswa=mysqli_fetch_array($qry_get_siswa);
?>
<h3 class="font-bold">Change Student Data</h3>
<form action="how_change_data.php" method="post">
<input type="hidden" name="id_siswa" value=
"<?=$dt_siswa['id_siswa']?>">
Student Name :
<input type="text" name="nama_siswa" value= "<?=$dt_siswa['nama_siswa']?>" class="form-control">
Born Date :
<input type="date" name="tanggal_lahir" value="<?=$dt_siswa['tanggal_lahir']?>" class="form-control">
Gender :
<?php
$arr_gender=array('L'=>'Boy','P'=>'Girl');
?>
<select name="gender" class="form-control">
<option></option>
<?php foreach ($arr_gender as $key_gender => $val_gender):
if($key_gender==$dt_siswa['gender']){
$selek="selected";
} else {
$selek="";
}
?>
<option value="<?=$key_gender?>" <?=$selek?>><?=$val_gender?></option>
<?php endforeach ?>
</select>
Address :
<textarea name="alamat" class="form-control" rows="4"><?=$dt_siswa['alamat']?></textarea>
Class :
<select name="id_kelas" class="form-control">
<option></option>
<?php
include "connect.php";
$qry_kelas=mysqli_query($conn,"select * from kelas");
while($data_kelas=mysqli_fetch_array($qry_kelas)){
if($data_kelas['id_kelas']==$dt_siswa['id_kelas']){
$selek="selected";
} else {
$selek="";
}
echo '<option value="'.$data_kelas['id_kelas'].'" '.$selek.'>'.$data_kelas['nama_kelas'].'</option>';
}
?>
</select>
Username :
<input type="text" name="username" value="<?=$dt_siswa['username']?>" class="form-control">
Password :
<input type="password" name="password" value="" class="form-control">
<input type="submit" name="simpan" value="Change Data" class="btn btn-primary">
</form>
</html>