mirror of
https://github.com/dyzulk/raisen-app.git
synced 2026-01-26 05:15:29 +07:00
first commit
This commit is contained in:
76
tambah.php
Normal file
76
tambah.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
if( !isset($_SESSION["login"]) ) {
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require 'functions.php';
|
||||
|
||||
// cek apakah tombol submit sudah ditekan atau belum
|
||||
if( isset($_POST["submit"]) ) {
|
||||
|
||||
// cek apakah data berhasil di tambahkan atau tidak
|
||||
if( tambah($_POST) > 0 ) {
|
||||
echo "
|
||||
<script>
|
||||
alert('data berhasil ditambahkan!');
|
||||
document.location.href = 'index.php';
|
||||
</script>
|
||||
";
|
||||
} else {
|
||||
echo "
|
||||
<script>
|
||||
alert('data gagal ditambahkan!');
|
||||
document.location.href = 'index.php';
|
||||
</script>
|
||||
";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Tambah data mahasiswa</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Tambah data mahasiswa</h1>
|
||||
|
||||
<form action="" method="post" enctype="multipart/form-data">
|
||||
<ul>
|
||||
<li>
|
||||
<label for="nrp">NRP : </label>
|
||||
<input type="text" name="nrp" id="nrp" required>
|
||||
</li>
|
||||
<li>
|
||||
<label for="nama">Nama : </label>
|
||||
<input type="text" name="nama" id="nama">
|
||||
</li>
|
||||
<li>
|
||||
<label for="email">Email :</label>
|
||||
<input type="text" name="email" id="email">
|
||||
</li>
|
||||
<li>
|
||||
<label for="jurusan">Jurusan :</label>
|
||||
<input type="text" name="jurusan" id="jurusan">
|
||||
</li>
|
||||
<li>
|
||||
<label for="gambar">Gambar :</label>
|
||||
<input type="file" name="gambar" id="gambar">
|
||||
</li>
|
||||
<li>
|
||||
<button type="submit" name="submit">Tambah Data!</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user