Tuesday, October 16, 2018

UTS PWeb C - Membuat E-Rapor Prestasi Siswa

Nama : Haikal Almaz Said
NRP : 05111740000068
Kelas : Pemrograman Web C


Pada postingan kali ini saya akan membagikan hasil UTS PWeb saya yaitu membuat E-Rapor untuk Prestasi Siswa, berikut Source Code dan Screenshot tampilan dari E-Rapor tersebut :


1. Source Code
  • config.php

 <?php  
 $server = "localhost";  
 $user = "root";  
 $password = "";  
 $nama_database = "prestasi_siswa";  
 $db = mysqli_connect($server, $user, $password, $nama_database);  
 if( !$db ){  
   die("Gagal terhubung dengan database: " . mysqli_connect_error());  
 }  
 ?>  

  • index.php

<!DOCTYPE html>
<html>
<head>
    <title>E-Rapor SMA Luar Biasa</title>
 <link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>
    <header>
        <h3>E-Rapor Prestasi Siswa SMA Luar Biasa</h3>
    </header>

    <h4>Menu</h4>
    <nav>
        <ul>
            <a href="form-daftar.php">Tambah Prestasi</a><br>
            <a href="list-siswa.php">List Prestasi</a>
        </ul>
    </nav>
 <?php if(isset($_GET['status'])): ?>
  <p>
        <?php
            if($_GET['status'] == 'sukses'){
                echo "Pendaftaran siswa baru berhasil!";
            } else {
                echo "Pendaftaran gagal!";
            }
        ?>
  </p>
  <?php endif; ?>
    </body>
</html>

  • form-daftar.php

<!DOCTYPE html>
<html>
<head>
    <title>Formulir Prestasi Siswa</title>
 <link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>
    <header>
        <h3>Formulir Pendaftaran Prestasi Siswa</h3>
    </header>

    <form action="proses-pendaftaran.php" method="POST">

        <fieldset>
  <p>
            <label for="kelas">Kelas: </label>
            <select name="kelas">
                <option>X IPA 1</option>
                <option>X IPA 2</option>
    <option>X IPS 1</option>
    <option>XI IPA 1</option>
                <option>XI IPA 2</option>
    <option>XI IPS 1</option>
    <option>XII IPA 1</option>
                <option>XII IPA 2</option>
    <option>XII IPS 1</option>
            </select>
        </p>
  <p>
            <label for="semester">Semester: </label>
            <select name="semester">
                <option>1</option>
                <option>2</option>
            </select>
        </p>
        <p>
            <label for="nama">Nama: </label>
            <input type="text" name="nama" placeholder="Nama Lengkap" />
        </p>
  <p>
            <label for="nis">NIS: </label>
            <input type="text" name="nis" placeholder="Masukkan NIS" />
        </p>
  <p>
            <label for="jenis_prestasi">Jenis Prestasi: </label>
            <select name="jenis_prestasi">
                <option>Akademik</option>
                <option>Kurikuler</option>
                <option>Lainnya</option>
            </select>
        </p>
        <p>
            <label for="keterangan">Keterangan: </label>
            <textarea name="keterangan" placeholder="Masukkan keterangan prestasi siswa"></textarea>
        </p>
        <p>
   <button type="cancel" onclick="window.location='index.php';return false;">Batal</button>
   <input type="submit" value="Simpan" name="daftar" />
  </p>

        </fieldset>

    </form>

    </body>
</html>

  • proses-pendaftaran.php

 <?php  
 include("config.php");  
 if(isset($_POST['daftar'])){  
   // ambil data dari formulir  
      $kelas = $_POST['kelas'];  
      $semester = $_POST['semester'];  
   $nama = $_POST['nama'];  
   $nis = $_POST['nis'];  
   $jenis_prestasi = $_POST['jenis_prestasi'];  
   $keterangan = $_POST['keterangan'];  
   // buat query  
   $sql = "INSERT INTO data_prestasi (kelas, semester, nama, nis, jenis_prestasi, keterangan) VALUE ('$kelas', '$semester', '$nama', '$nis', '$jenis_prestasi', '$keterangan')";  
   $query = mysqli_query($db, $sql);  
   // apakah query simpan berhasil?  
   if( $query ) {  
     // kalau berhasil alihkan ke halaman index.php dengan status=sukses  
     header('Location: index.php?status=sukses');  
   } else {  
     // kalau gagal alihkan ke halaman indek.php dengan status=gagal  
     header('Location: index.php?status=gagal');  
   }  
 } else {  
   die("Akses dilarang...");  
 }  
 ?>  
  • list-siswa.php

<?php include("config.php"); ?>

<!DOCTYPE html>
<html>
<head>
    <title>Daftar Prestasi</title>
 <link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>
    <header>
        <h3>Daftar Prestasi Siswa SMA Luar Biasa</h3>
    </header>

    <nav>
        <a href="form-daftar.php">[+] Tambah Baru</a>
    </nav>

    <br>

    <table border="1" align="center">
    <thead>
        <tr>
            <th>No</th>
            <th>Kelas</th>
            <th>Semester</th>
            <th>Nama</th>
            <th>NIS</th>
            <th>Jenis Prestasi</th>
            <th>Keterangan</th>
   <th>Aksi</th>
        </tr>
    </thead>
    <tbody>

        <?php
        $sql = "SELECT * FROM data_prestasi";
        $query = mysqli_query($db, $sql);

        while($siswa = mysqli_fetch_array($query)){
            echo "<tr>";

            echo "<td>".$siswa['id']."</td>";
            echo "<td>".$siswa['kelas']."</td>";
            echo "<td>".$siswa['semester']."</td>";
            echo "<td>".$siswa['nama']."</td>";
            echo "<td>".$siswa['nis']."</td>";
            echo "<td>".$siswa['jenis_prestasi']."</td>";
   echo "<td>".$siswa['keterangan']."</td>";

            echo "<td>";
            echo "<a href='form-edit.php?id=".$siswa['id']."'>Edit</a> | ";
            echo "<a href='hapus.php?id=".$siswa['id']."'>Hapus</a>";
            echo "</td>";

            echo "</tr>";
        }
        ?>

    </tbody>
    </table>

    <p align="center">Total: <?php echo mysqli_num_rows($query) ?></p>
 <p align="center"><button type="cancel" onclick="window.location='index.php';return false;">Kembali</button></p>

    </body>
</html>

  • form-edit.php

 <?php

include("config.php");

// kalau tidak ada id di query string
if( !isset($_GET['id']) ){
    header('Location: list-siswa.php');
}

//ambil id dari query string
$id = $_GET['id'];

// buat query untuk ambil data dari database
$sql = "SELECT * FROM data_prestasi WHERE id=$id";
$query = mysqli_query($db, $sql);
$siswa = mysqli_fetch_assoc($query);

// jika data yang di-edit tidak ditemukan
if( mysqli_num_rows($query) < 1 ){
    die("data tidak ditemukan...");
}

?>

<!DOCTYPE html>
<html>
<head>
    <title>Edit Prestasi Siswa</title>
 <link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>
    <header>
        <h3>Formulir Edit Prestasi Siswa</h3>
    </header>

    <form action="proses-edit.php" method="POST">

        <fieldset>

            <input type="hidden" name="id" value="<?php echo $siswa['id'] ?>" />
  
  <p>
            <label for="kelas">Kelas: </label>
            <?php $kelas = $siswa['kelas']; ?>
            <select name="kelas">
                <option <?php echo ($kelas == 'X IPA 1') ? "selected": "" ?>>X IPA 1</option>
                <option <?php echo ($kelas == 'X IPA 2') ? "selected": "" ?>>X IPA 2</option>
                <option <?php echo ($kelas == 'X IPS 1') ? "selected": "" ?>>X IPS 1</option>
                <option <?php echo ($kelas == 'XI IPA 1') ? "selected": "" ?>>XI IPA 1</option>
                <option <?php echo ($kelas == 'XI IPA 2') ? "selected": "" ?>>XI IPA 2</option>
                <option <?php echo ($kelas == 'XI IPS 1') ? "selected": "" ?>>XI IPS 1</option>
    <option <?php echo ($kelas == 'XII IPA 1') ? "selected": "" ?>>XII IPA 1</option>
                <option <?php echo ($kelas == 'XII IPA 2') ? "selected": "" ?>>XII IPA 2</option>
                <option <?php echo ($kelas == 'XII IPS 1') ? "selected": "" ?>>XII IPS 1</option>
            </select>
        </p>
  <p>
            <label for="semester">Semester: </label>
            <?php $semester = $siswa['semester']; ?>
            <select name="semester">
                <option <?php echo ($semester == '1') ? "selected": "" ?>>1</option>
                <option <?php echo ($semester == '2') ? "selected": "" ?>>2</option>
            </select>
        </p>
        <p>
            <label for="nama">Nama: </label>
            <input type="text" name="nama" placeholder="Nama Lengkap" value="<?php echo $siswa['nama'] ?>" />
        </p>
  <p>
            <label for="nis">NIS: </label>
            <input type="text" name="nis" placeholder="Masukkan NIS" value="<?php echo $siswa['nama'] ?>" />
        </p>
  <p>
            <label for="jenis_prestasi">Jenis Prestasi: </label>
            <?php $jenis_prestasi = $siswa['jenis_prestasi']; ?>
            <select name="jenis_prestasi">
                <option <?php echo ($jenis_prestasi == 'Akademik') ? "selected": "" ?>>Akademik</option>
                <option <?php echo ($jenis_prestasi == 'Kurikuler') ? "selected": "" ?>>Kurikuler</option>
    <option <?php echo ($jenis_prestasi == 'Lainnya') ? "selected": "" ?>>Lainnya</option>
   </select>
        </p>
  <p>
            <label for="keterangan">Keterangan: </label>
            <textarea name="keterangan" placeholder="Masukkan keterangan prestasi"><?php echo $siswa['keterangan'] ?></textarea>
        </p>
        <p>
   <button type="cancel" onclick="window.location='list-siswa.php';return false;">Batal</button>
            <input type="submit" value="Simpan" name="simpan" />
        </p>

        </fieldset>


    </form>

    </body>
</html>

  • proses-edit.php

 <?php  
 include("config.php");  
 // cek apakah tombol simpan sudah diklik atau blum?  
 if(isset($_POST['simpan'])){  
   // ambil data dari formulir  
   $id = $_POST['id'];  
   $kelas = $_POST['kelas'];  
      $semester = $_POST['semester'];  
   $nama = $_POST['nama'];  
   $nis = $_POST['nis'];  
   $jenis_prestasi = $_POST['jenis_prestasi'];  
   $keterangan = $_POST['keterangan'];  
   // buat query update  
   $sql = "UPDATE data_prestasi SET kelas='$kelas', semester='$semester', nama='$nama', nis='$nis', jenis_prestasi='$jenis_prestasi', keterangan='$keterangan' WHERE id=$id";  
   $query = mysqli_query($db, $sql);  
   // apakah query update berhasil?  
   if( $query ) {  
     // kalau berhasil alihkan ke halaman list-siswa.php  
     header('Location: list-siswa.php');  
   } else {  
     // kalau gagal tampilkan pesan  
     die("Gagal menyimpan perubahan...");  
   }  
 } else {  
   die("Akses dilarang...");  
 }  
 ?>  

  • hapus.php

 <?php  
 include("config.php");  
 if( isset($_GET['id']) ){  
   // ambil id dari query string  
   $id = $_GET['id'];  
   // buat query hapus  
   $sql = "DELETE FROM data_prestasi WHERE id=$id";  
   $query = mysqli_query($db, $sql);  
   // apakah query hapus berhasil?  
   if( $query ){  
     header('Location: list-siswa.php');  
   } else {  
     die("gagal menghapus...");  
   }  
 } else {  
   die("akses dilarang...");  
 }  
 ?>  

  • style.css

 body {  
      background-color : Aquamarine;  
 }  
 h4 {  
      font-family : calibri;  
      text-align : center;  
 }  
 nav {  
      font-family : calibri;  
      text-align : center;  
 }  
 header {  
      width: 90%;  
      margin: auto;  
      height: 120px;  
      line-height: 120px;  
      background: #4169E1;  
      color: #FFFFFF;  
      font-family: calibri;  
      text-align : center;  
 }  
 p {  
      font-family : calibri;  
 }  


2. Screenshot Tampilan





sekian postingan saya kali ini terima kasih.

Sunday, October 14, 2018

UTS PBO A - Membuat E-Parking

Membuat Sistem E-Parking

Nama : Haikal Almaz Said
NRP : 05111740000068
Kelas : PBO A

pada postingan kali ini, saya akan membagikan hasil Membuat Sistem E-Parking dalam Java, berikut Source Code dan screen shot dari Hasil tersebut :

1. Class mainTicket

 import java.util.Scanner;  
 /**  
  * ini merupakan class main  
  *  
  * @author (Haikal Almaz Said)  
  * @version (15/10/2018)  
  */  
 public class mainTicket  
 {  
   public static int main()  
    {  
      Scanner sc = new Scanner(System.in);  
      Scanner scan = new Scanner(System.in);  
      int start,cost, menu, jenis, lama, insertSald, biaya, saldo;  
      System.out.println("Selamat Datang di Sistem Parkir Elektronik \nTekan 1 untuk mulai");  
      start=scan.nextInt();  
      while(start==1)  
      {   
       lama = 0;   
       System.out.println("Pilih Menu");  
       System.out.println("1. Buat Karcis Parkir");   
       System.out.println("2. Exit");  
       menu=scan.nextInt();  
       switch(menu)  
       {  
         case 1:  
           System.out.println("Masukkan Nomor Polisi Anda");  
           String nopol = sc.next();  
           System.out.println("Pilih Jenis Kendaraan");   
           System.out.println("1. Truk");   
           System.out.println("2. Mobil");  
           System.out.println("3. Sepeda Motor");  
           System.out.println("4. Cancel");  
           jenis = scan.nextInt();  
           TicketMachine ticket = new TicketMachine(jenis);  
           ticket.getNopol(nopol);  
           cost = ticket.getPrice();  
           if(jenis==4) break;  
           else   
           {  
             System.out.println("Masukkan Lama Parkir (dalam Jam)");  
             lama = scan.nextInt();  
             biaya = ticket.getTotal(lama);  
             System.out.println("Tempelkan Kartu Anda (Masukkan Isi Saldo Kartu Anda)");  
             saldo = scan.nextInt();  
             ticket.insertMoney(saldo);  
             if(biaya>saldo) System.out.println("Maaf Saldo Anda Tidak Mencukupi");   
             else ticket.printTicket();  
           }    
           break;    
         case 2:  
           return 0;  
       }  
     }  
   return 0;  
   }  
 }    

2. Class TicketMachine

 /**  
  * ini merupakan class Ticket machine  
  *  
  * @author (Haikal Almaz Said)  
  * @version (15/10/2018)  
  */  
 public class TicketMachine  
 {  
   private int price; private int balance; private int total; private String nopol;  
   private String kendara; private int lama;  
   public TicketMachine(int jenis)  
   {  
     if(jenis==1)  
     {   
      price = 5000;  
      kendara = "Truk";  
     }  
     else if(jenis==2)   
     {  
       price = 3000;  
       kendara = "Mobil";  
     }  
     else if(jenis==3)   
     {  
       price = 2000;  
       kendara = "Sepeda Motor";  
     }  
     balance = 0; total=0;  
   }  
   public void getNopol(String nopoli)  
   {  
     String nopol1=nopoli;  
     nopol=nopol1;   
   }  
   public int getPrice()  
   {  
    return price;  
   }  
   public int getTotal(int lamaPark)  
   {  
    total = price*lamaPark;  
    lama = lamaPark;  
    return total;  
   }  
   public int getBalance()  
   {  
     return balance;  
   }  
   public void insertMoney(int amount)  
   {  
     balance=balance+amount;  
   }  
   public void printTicket()  
   {  
     System.out.println("###################################");   
     System.out.println("# Ticket Parkir Meteran Surabaya");   
     System.out.println("# Kendaraan   : "+kendara);   
     System.out.println("# Nomor Plat   : "+nopol);  
     System.out.println("# Tarif     : Rp. "+total);  
     System.out.println("# Lama Parkir  : "+lama+" Jam");  
     balance = balance-total;  
     System.out.println("# Sisa Saldo   : "+balance);  
     System.out.println("###################################");   
     System.out.println();  
     balance=0;  
   }  
 }  

3. Screenshot



t

Tuesday, October 9, 2018

Tugas PWeb C - Membuat Formulir Tagihan dengan PHP

Nama : Haikal Almaz Said
NRP : 05111740000068
Kelas : Pemrograman Web C


Pada postingan saya kali ini saya akan membagikan hasil tugas membuat formulir tagihan dengan PHP. Berikut Screenshot dan source code dari gambar tersebut


1. Screenshot





2. Source Code

  • index.php

 <?php   
  session_start();   
  ?>   
  <!DOCTYPE html>   
      <head>   
      <link rel="stylesheet" href="style.css">   
      </head>   
      <body>   
           <div id="wrapshopcart">   
           <h1>Form Registrasi</h1>   
           <p>Mohon lengkapi data tagihan anda pada form berikut ini! (*=wajib). </p>   
           <form action="tagihan.php" method="POST">   
           <label>Nama Depan* : </label><input type="text" name="nama_depan" class="inputan" required />   
           <br>  
           <br>  
           <label>Nama Belakang : </label><input type="text" name="nama_belakang" class="inputan" />   
           <br>  
           <br>  
           <label>Email* : </label><input type="email" name="email" class="inputan" required />   
           <br>   
           <br>            
           <label>No Pelanggan* : </label><input type="number" name="no_pel" class="inputan" required pattern=".{6,}" />   
           <br>   
           <br>  
           <label>No Telp : </label><input type="text" name="no_telp" class="inputan" />   
           <br>  
           <br>  
           <label>Alamat* :</label><textarea name="alamat" class="textan" required></textarea>   
           <input type="submit" name="kirim" value="Kirim Isi Formulir!" class="submitbtn" />   
           </form>   
           </div>    
      </body>   
  </html>   


  • tagihan.php

 <?php   
  session_start();   
  $total = NULL;   
  $post = $_POST;   
  $_SESSION['cart'] = array(   
    array('productid' => 'TL01', 'product' => 'Listrik yang terpakai (Kwh)' , 'qty' => 75.23 ),   
    array('productid' => 'BA01', 'product' => 'Biaya Administrasi' , 'qty' => 1),   
    array('productid' => 'PJ01', 'product' => 'Pajak' , 'qty' => 1)   
   );   
  $_SESSION['price'] = array(   
    'TL01' => 1600,   
    'BA01' => 6500,   
    'PJ01' => 3500   
   );    
  ?>   
  <!DOCTYPE html>   
      <head>   
      <link rel="stylesheet" href="style.css">   
      </head>   
      <body>   
           <div id="wrapshopcart">   
           <h1>Invoice 637462i9</h1>   
           <p>Silahkan save halaman ini. </p>   
           <h3>Berikut adalah data lengkap Anda : </h3>   
           </label><table><tr></tr></table>   
           <label>Nama Lengkap : <?php echo $post['nama_depan'] . ' ' . $post['nama_belakang'] ;?> </label><table><tr></tr></table>   
           <label>Email : <?php echo $post['email'] ;?> </label></label><table><tr></tr></table>   
           <label>No Pelanggan: <?php echo $post['no_pel'] ;?></label></label><table><tr></tr></table>   
           <label>No Telp : <?php echo $post['no_telp'] ;?></label></label><table><tr></tr></table>   
           <label>Alamat : <?php echo $post['alamat'] ;?></label></label><table><tr></tr></table>   
           <h3>Total tagihan anda: </h3>   
           <table>   
                <tr><th width="70%">Produk</th><th width="10%">Quantity</th><th width="20%">Jumlah</th></tr>   
                <?php foreach($_SESSION['cart'] as $row):?>   
                <?php    
                     $jumlah = $_SESSION['price'][$row['productid']] * $row['qty'];    
                     $total += $jumlah;   
                ?>   
                <tr><td><?php echo $row['product'];?></td><td><?php echo $row['qty'];?></td><td><?php echo $jumlah; ?></td></tr>   
                <?php endforeach;?>   
                <tr class="total"><td></td><td >Total</td><td><?php echo $total;?></td></tr>   
           </table>    
           <h3>Silahkan Lakukan Pembayaran Ke Kantor PLN terdekat</h3>   
           </div>    
      </body>   
 </html>   


  • style.css

 body   
  {   
   background:#fff;   
   font-family:arial;   
  }   
  #wrapshopcart   
  {   
   width:70%;   
   margin:3em auto;   
   padding:30px;   
   background:#efefef;   
   box-shadow:0 0 15px #ddd;   
  }   
  h1   
  {   
   margin:0;   
   padding:0;   
   font-size:2.5em;   
   font-weight:bold;   
  }   
  p   
  {   
   font-size:1em;   
   margin:0;   
  }   
  table   
  {   
   margin:2em 0 0 0;   
   border:1px solid #eee;   
   width:100%;   
   border-collapse: separate;   
   border-spacing:0;   
  }   
  table th   
  {   
   background:#fafafa;   
   border:none;   
   padding:20px ;   
   font-weight:normal;   
   text-align:left;   
  }   
  table td   
  {   
   background:#fff;    
   border:none;   
   padding:12px 20px;    
   font-weight:normal;   
   text-align:left;    
   border-top:1px solid #eee;   
  }   
  table tr.total td   
  {   
   font-size:1.5em;   
  }   
  .btnsubmit   
  {   
   display:inline-block;   
   padding:10px;   
   border:1px solid #ddd;   
   background:#eee;   
   color:#000;   
   text-decoration:none;   
   margin:2em 0;   
  }   
  form   
  {   
   margin:2em 0 0 0;   
  }   
  label   
  {   
   display:inline-block;   
   width:12em;   
  }   
  input[type=text]   
  {   
   border:1px solid #bbb;   
   padding:10px;   
   width:30em;   
  }   
  textarea   
  {   
   border:1px solid #bbb;   
   padding:10px;   
   width:30em;   
   height:5em;   
   vertical-align:text-top;   
   margin:0.3em 0 0 0;   
  }   
  .submitbtn   
  {   
   font-size:1.5em;   
   display:inline-block;   
   padding:10px;   
   border:1px solid #ddd;   
   background:#eee;   
   color:#000;   
   text-decoration:none;   
   margin:0.5em 0 0 8em;   
  };   


Sekian postingan saya kali ini, terima kasih.

Tuesday, October 2, 2018

Tugas PWeb C - Membuat Form Validasi

Nama : Haikal Almaz Said
NRP : 05111740000068
Kelas : Pemrograman Web C

Pada postingan saya kali ini, saya akan membagikan hasil tugas saya yaitu membuat form validasi dengan HTML, CSS dan Javascript. berikut link, Screenshot dan Source code dari form tersebut. CLICK HERE

Screenshot







Source Code

  1. HTML

 <!DOCTYPE html>   
  <html>   
  <head>   
   <title>Sign Up</title>   
   <link rel="stylesheet" type="text/css" href="formst.css">   
      <script type="text/javascript" src="formjs.js"></script>        
  </head>   
  <body>   
    <center><h2>REGISTER</h2></center>   
    <div class="login">   
       <form action="#" method="POST" onSubmit="validasi()">   
         <div>   
            <label>Nama Lengkap:</label>   
            <input type="text" name="name" placeholder="Enter Your Name" id="name" maxlength="50" required />   
         </div>   
         <div>   
            <label>Alamat:</label>   
            <textarea cols="40" rows="5" name="alamat" placeholder="Enter Your Address" id="alamat" required ></textarea>   
         </div>   
         <div>   
            <label>Email:</label>   
            <input type="email" name="email" placeholder="Enter Your E-mail"id="email" required />   
         </div>  
                     <div>   
            <label>Password:</label>   
            <input type="password" name="pass1" placeholder="Enter Your Password"id="pass1" required />   
         </div>  
         <div>   
            <label>No. HP:</label>   
            <input type="phone" name="phone" placeholder="Enter Your Phone Number" id="phone" min="11" max="13" required/>   
         </div>   
         <div>   
            <label>Jenis Kelamin: </label> <br/>   
            <input type="radio" name="gender" value="male" /> Pria  
            <input type="radio" name="gender" value="female" /> Wanita <br/>   
         </div>   
         <div>   
                          <label>Tanggal Lahir:</label>   
                          <input type="date" id="birthday" name="birthday" id="birthday" min="01-01-1900" max="31-12-2018" required />   
                     </div>   
                     <div>   
            <label>Rubrik Favorit:</label>   
            <input type="text" name="fav" placeholder="Enter Your Personal Insterest" required />     
         </div>   
         <div>   
            <center><input type="submit" value="Submit" class="tombol"><center>   
         </div>   
       </form>   
    </div>   
  </body>    
  </html>   

  2. CSS

 body {   
  background: #00008B;   
  font-family: calibri;   
  }   
  h2 {   
  color: #fff;   
  }  
  .login {   
  padding: 1em;   
  margin: 2em auto;   
  width: 17em;   
  background: #fff;   
  border-radius: 3px;   
  }  
  label {   
  font-size: 10pt;   
  color: #555;   
  }  
  input[type="text"],   
  input[type="email"],   
  input[type="phone"],   
  input[type="date"],  
  input[type="password"],  
  textarea {   
  padding: 8px;   
  width: 95%;   
  background: #efefef;   
  border: 0;   
  font-family: calibri;   
  font-size: 10pt;   
  margin: 6px 0px;   
  }  
  .tombol {   
  background: #4682B4;   
  color: #fff;   
  border: 0;   
  padding: 5px 8px;   
  }   

  3. Javascript

 function validasi() {   
   var nama = document.getElementById("nama").value;   
   var alamat = document.getElementById("alamat").value;   
   var email = document.getElementById("email").value;   
   var phone = document.getElementById("phone").value;   
   var gender = document.getElementById("gender").value;   
   var birthday = document.getElementById("birthday").value;   
   var fav = document.getElementById("fav").value;   
   var maxhuruf = 50;   
   pola_email=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;   
      if (!pola_email.test(form.email.value)){   
           alert ('Penulisan Email tidak benar');   
           form.email.focus();   
           return false;   
      }   
   if (form.nama.value.length > maxhuruf){   
           alert("Batas Maksimal adalah 50 Karakter");   
           form.nama.focus();   
           return (false);   
   }   
   if (nama = "" || email="" || alamat ="" || phone ="" || gender ="" || birthday ="" || fav ="") {   
     alert('Anda harus mengisi data dengan lengkap !');   
     return (false);}   
      }   
 }   

Sekian postingan dari saya kali ini.