-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguru_insert.php
68 lines (59 loc) · 1.76 KB
/
guru_insert.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
63
64
65
66
67
68
<?php
session_start();
require "functions.php";
// function cek session dh ade lom
sec("guru");
$title = "Tambah Guru";
require "header.php";
include "css/borang.php";
include "css/button.php";
if (isset($_POST["submit"])) {
//cek berjaya di tambah ke tak
if (tambahguru($_POST) > 0) {
echo "
<script>
alert('data berjaya ditambah');
document.location.href = 'guru_senarai.php';
</script>
";
} else {
echo "
<script>
alert('data tidak berjaya ditambah');
document.location.href = 'guru_senarai.php';
</script>
";
}
}
?>
<style>
center {
margin-top: 50px;
}
</style>
<body>
<?php include "./include/menu.php" ?>
<div class="kandungan">
<center>
<h3 class="panjang">Tambah Guru</h3>
<form class="panjang" action="" method="post">
<table>
<tr>
<td><label for="IDGuru">ID Guru:</label></td>
<td><input type="text" name="IDGuru" id="IDGuru" maxlength="3" placeholder="Max Char 3"></td>
</tr>
<tr>
<td><label for="Nama_Guru">Nama Guru:</label></td>
<td><input type="text" name="Nama_Guru" id="Nama_Guru"></td>
</tr>
<tr>
<td><label for="KataLaluan">KataLaluan:</label></td>
<td><input type="password" name="KataLaluan" id="KataLaluan" maxlength="16"></td>
</tr>
</table>
<button type="submit" class="tambah" name="submit">Tambah</button>
</form>
</center>
</div>
</body>
</html>