Commit 4cc64c7e by Oppir hutapea

Initial commit

parents
ITDEL.jpg

9.04 KB

/*
SQLyog Community v12.5.1 (64 bit)
MySQL - 10.1.30-MariaDB : Database - formulir
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`formulir` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `formulir`;
/*Table structure for table `mahasiswa_baru` */
DROP TABLE IF EXISTS `mahasiswa_baru`;
CREATE TABLE `mahasiswa_baru` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nama` varchar(255) DEFAULT NULL,
`tempat_lahir` varchar(200) DEFAULT NULL,
`tanggal_lahir` date DEFAULT NULL,
`asal` varchar(200) DEFAULT NULL,
`nisn` int(50) DEFAULT NULL,
`npsm` int(50) DEFAULT NULL,
`no_peserta` int(50) DEFAULT NULL,
`tanggal_pelaksanaan` date DEFAULT NULL,
`no_handphone` int(20) DEFAULT NULL,
`sertifikat` varchar(200) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=67 DEFAULT CHARSET=latin1;
/*Data for the table `mahasiswa_baru` */
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
<?php
// function connect_database(){
// $conn = new mysqli ('127.0.0.1' , 'root' , '', 'formulir');
// return $conn;
// }
$host = 'localhost';
$user = 'root';
$pass = '';
$db = 'formulir';
$conn = mysqli_connect($host, $user, $pass, $db) or die ("Koneksi ke database GAGAL!!!");
?>
\ No newline at end of file
.container{
width: 450px;
}
}
.submit{
padding-top: 3px;
}
.tile{
}
body{
background-color:rgb(176, 230, 197);
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>Form Upload</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script language="JavaScript" type="text/javascript">
function checkData() {
if (window.confirm('Apakah Anda yakin Data Anda sudah Benar?'))
return ('http://www.del.ac.id/');
}
</script>
<style>
body {
background-color: #555;
}
img {
border-radius: 10px;
}
input[type=text]:focus {
border: 3px solid #555;
border-radius: 4px;
background-color: #3CBC8D;
}
input[type=date]:focus {
border: 2px solid #555;
border-radius: 4px;
background-color: #3CBC8D;
}
input[type=file]:focus {
border: 2px solid #555;
border-radius: 4px;
background-color: #3CBC8D;
}
.title {
font-weight: bold;
}
.row {
max-width: 1000px;
margin: auto;
background: white;
padding: 10px;
}
</style>
</head>
<body>
<div class="row">
<div class="container">
<div class="row">
<br>
<br>
<div class="col-md-10">
<div class="panel panel-default">
<div class="panel-body">
<form action="upload_proses.php" method="POST" class="form" enctype="multipart/form-data">
<img src="ITDEL.jpg" alt="IT Del">
<label for="title">
<h1>Pendaftaran USM Seleksi UTBK</h1>
</label>
<div class="form-group">
<label class="title">Nama</label>
<input type="text" name="nama" class="form-control" placeholder="Nama" required="">
</div>
<div class="form-group">
<label class="title">Tempat Lahir</label>
<input type="text" name="tempat_lahir" class="form-control" placeholder="Tempat Lahir" required="">
</div>
<div class="form-group">
<label class="title">Tanggal Lahir</label>
<input type="date" name="tanggal_lahir" class="form-control" placeholder="Tanggal Lahir" required="">
</div>
<div class="form-group">
<label class="title">Asal Sekolah</label>
<input type="text" name="asal" class="form-control" placeholder="Asal" required="">
</div>
<div class="form-group">
<label class="title">NISN</label>
<input type="text" name="nisn" class="form-control" placeholder="NISN" required="">
</div>
<div class="form-group">
<label class="title">NPSM</label>
<input type="text" name="npsm" class="form-control" placeholder="NPSM" required="">
</div>
<div class="form-group">
<label class="title">Nomor Peserta UTBK</label>
<input type="text" name="no_peserta" class="form-control" placeholder="Nomor Peserta UTBK" required="">
</div>
<div class="form-group">
<label class="title">Tanggal Pelaksanaan UTBK</label>
<input type="date" name="tanggal_pelaksanaan" class="form-control" placeholder="Tanggal Lahir" required="">
</div>
<div class="form-group">
<label class="title">No Handphone</label>
<input type="text" name="no_handphone" class="form-control" placeholder="No Handphone" required="">
</div>
</div>
<div class="form-group">
<label class="title">Sertifikat</label>
<input type="file" name="sertifikat" class="form-control" placeholder="NISN" required="">
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary" onclick="return checkData()">
<i class="glyphicon glyphicon-plus"></i> Tambah
</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<?php
// include_once('function.php');
// $db = connect_database();
include 'function.php';
$nama =$_POST['nama'];
$tempat_lahir = $_POST['tempat_lahir'];
$tanggal_lahir = $_POST['tanggal_lahir'];
$asal = $_POST['asal'];
$nisn = $_POST['nisn'];
$npsm = $_POST['npsm'];
$no_peserta = $_POST['no_peserta'];
$tanggal_pelaksanaan = $_POST['tanggal_pelaksanaan'];
$no_handphone = $_POST['no_handphone'];
$sertifikat = $_FILES['sertifikat']['name'];
move_uploaded_file($_FILES['sertifikat']['tmp_name'], "file/" .$sertifikat);
$input=mysqli_query($conn, "INSERT INTO mahasiswa_baru (nama,tempat_lahir,tanggal_lahir,asal,nisn,npsm,no_peserta,tanggal_pelaksanaan,no_handphone,sertifikat) VALUES ('$nama','$tempat_lahir','$tanggal_lahir','$asal','$nisn','$npsm','$no_peserta','$tanggal_pelaksanaan','$no_handphone','$sertifikat')");
if($input){
// echo "<script>alert('Data Berhasil Ditambah');document.location.href='upload.php'</script>";
echo "<script>alert('Data Berhasil Ditambah');document.location.href='http://spmb.del.ac.id/'</script>";
}else{
echo "<script>alert('Data Gagal Ditambah');document.location.href='upload.php'</script>";
}
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment