Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require'function.php';
- if (isset($_POST['submit'])) {
- if (tambah($_POST,$_FILES['foto']) > 0) {
- $nama = $_POST['nama'];
- echo "<script>alert('Print ini sebagai bukti'), window.location='hasilpdf.php?nama=$nama'</script>";
- }
- else{
- echo mysqli_error($conn);
- }
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
- <style>
- body {
- font-family: Arial, Helvetica, sans-serif;
- background-color: red;
- }
- * {
- box-sizing: border-box;
- }
- /* Add padding to containers */
- .container {
- width: 470px;
- margin:100px auto;
- padding: 16px;
- background-color: white;
- }
- /* Full-width input fields */
- input[type=text], input[type=textarea] {
- width: 100%;
- padding: 15px;
- margin: 5px 0 22px 0;
- display: inline-block;
- border: none;
- background: #f1f1f1;
- }
- input[type=text]:focus, input[type=textarea]:focus {
- background-color: #ddd;
- outline: none;
- }
- input[type=number], input[type=date] {
- width: 100%;
- padding: 15px;
- margin: 5px 0 22px 0;
- display: inline-block;
- border: none;
- background: #f1f1f1;
- }
- input[type=number]:focus, input[type=date]:focus {
- background-color: #ddd;
- outline: none;
- }
- /* Overwrite default styles of hr */
- hr {
- border: 1px solid #f1f1f1;
- margin-bottom: 25px;
- }
- /* Set a style for the submit button */
- .registerbtn {
- background-color: #4CAF50;
- color: white;
- padding: 16px 20px;
- margin: 8px 0;
- border: none;
- cursor: pointer;
- width: 100%;
- opacity: 0.9;
- }
- .registerbtn:hover {
- opacity: 1;
- }
- /* Add a blue text color to links */
- a {
- color: dodgerblue;
- }
- /* Set a grey background color and center the text of the "sign in" section */
- .signin {
- background-color: #f1f1f1;
- text-align: center;
- }
- @media screen and (max-width:1366px){
- #maincontent{
- width: auto;
- float: none;
- }
- #sidebar{
- width: auto;
- float: none;
- }
- }
- </style>
- </head>
- <body>
- <div class="container">
- <center><h1>Pendaftaran</h1></center>
- <center><p>Isi Sesuai Data diri anda.</p></center>
- <form method="post" enctype="multipart/form-data" >
- <hr>
- <label for="nama"><b>Nama</b></label>
- <input type="text" placeholder="Enter Name" name="nama" required>
- <label for="noktp"><b>No KTP</b></label>
- <input type="number" placeholder="Enter No KTP" name="noktp" required>
- <label for="tanggal"><b>Tanggal Pemasangan</b></label>
- <input type="date" placeholder="Enter Tanggal" name="tanggal" required>
- <label for="nohp"><b>No Handphone</b></label>
- <input type="number" placeholder="Enter No Handphone" name="nohp" required>
- <fieldset class="form-group">
- <div class="row">
- <legend class="col-form-label col-sm-2 pt-0"><b>Paket Layanan</b></legend>
- <div class="col-sm-10">
- <div class="form-check">
- <input class="form-check-input" type="radio" name="paket" id="paket1" value="INTERNET" checked>
- <label class="form-check-label" for="paket1">
- INTERNET
- </label>
- </div>
- <div class="form-check">
- <input class="form-check-input" type="radio" name="paket" id="paket2" value="INTERNET + TV">
- <label class="form-check-label" for="paket2">
- INTERNET + TV
- </label>
- </div>
- <div class="form-check">
- <input class="form-check-input" type="radio" name="paket" id="paket3" value="INTERNET + TV + TELEPHONE">
- <label class="form-check-label" for="paket3">
- INTERNET + TV + TELEPHONE
- </label>
- </div>
- </div>
- </fieldset>
- <label for="foto"><b>Kirim Foto KTP anda</b></label>
- <img id="image-preview" / style="height: 80px;">
- <input type="file" id="image-source" name="foto" onchange="previewImage();"/><br><br>
- <label for="alamat"><b>Alamat</b></label><br>
- <input type="textarea" name="alamat" style="height: 100px; width: 400px;" required>
- <hr>
- <button type="submit" name="submit" class="registerbtn">Daftar</button>
- </div>
- <script>
- function previewImage() {
- document.getElementById("image-preview").style.display = "block";
- var oFReader = new FileReader();
- oFReader.readAsDataURL(document.getElementById("image-source").files[0]);
- oFReader.onload = function(oFREvent) {
- document.getElementById("image-preview").src = oFREvent.target.result;
- };
- };
- </script>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement