-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproses_guru.php
53 lines (47 loc) · 2.21 KB
/
proses_guru.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
<?php
include "koneksi.php";
if (isset($_POST['bsimpan'])){
$simpan = mysqli_query($connection,"INSERT INTO siswa(nis, nama, tempat_lahir, tgl_lahir,jenis_kelamin, agama, alamat)
VALUES ('$_POST[nis]',
'$_POST[nama]',
'$_POST[tempat_lahir]',
'$_POST[tgl_lahir]',
'$_POST[jenis_kelamin]',
'$_POST[agama]',
'$_POST[alamat]') ");
if($simpan){
echo "<script>
alert('Simpan data berhasil!');
document.location='dashboard_guru.php';
</script>";
} else{
echo "<script>
alert('Simpan data gagal!');
document.location='dashboard_guru.php';
</script>";
}
}
if (isset($_POST['bedit'])){
$edit = mysqli_query($connection,"UPDATE siswa SET
nis = '$_POST[nis]',
nama = '$_POST[nama]',
tempat_lahir = '$_POST[tempat_lahir]',
tgl_lahir = '$_POST[tgl_lahir]',
jenis_kelamin = '$_POST[jenis_kelamin]',
agama = '$_POST[agama]',
alamat = '$_POST[alamat]'
WHERE id_siswa = '$_POST[id_siswa]'
");
if($edit){
echo "<script>
alert('Edit data berhasil!');
document.location='dashboard_guru.php';
</script>";
} else{
echo "<script>
alert('Edit data gagal!');
document.location='dashboard_guru.php';
</script>";
}
}
?>