Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>KALKULATOR</title>
- <style>
- *{margin:0px auto}
- #navigasi{
- margin:0;
- padding:0;
- overflow:hidden;
- background-color:#1f1f1f;
- }
- #navigasi ul li:hover ul {
- display:block;
- }
- #navigasi ul ul {
- display:none;
- list-style:none;
- position:absolute;
- background-color:black;
- right:0px;
- top:60px;
- width:165px;
- }
- #navigasi ul ul li a {
- float:none;
- display:block;
- padding-left:30px;
- text-align:left;
- width:160px;
- }
- #navigasi ul ul li a:hover {
- color:#fff;
- }
- .logo {
- display:inline-block;
- width:150px;
- padding:10px 14px;
- }
- li{
- list-style-type:none;
- float:right;
- font-family:Verdana;
- }
- li a{
- display:inline-block;
- color:white;
- text-align:center;
- padding:20px 14px;
- text-decoration:none;
- }
- li a:hover{
- background-color:#ea3604;
- transition: all 0.5s ease;
- }
- #login{
- margin:2% 4% 0px;
- padding:0;
- background-color:white;
- width:88%;
- height:auto;
- display:inline-block;
- }
- .login{
- float:left;
- padding:2% 2%;
- background-color:#d9edf7;
- border:1px #bce8f1 solid;
- width:100%;
- height:auto;
- }
- .login-text{
- float:left;
- width:70%;
- display:inline-block;
- color:#3a87ad;
- font-family:Verdana;
- }
- .tombol-login{
- padding:10px 50px;
- font-family:Verdana;
- color:white;
- background-color:#3a87ad;
- text-decoration:none;
- float:right;
- }
- .tombol-login:hover{
- background-color:#1f1f1f;
- transition: all 0.5s ease;
- }
- body{
- font-family:Verdana;
- color:#000;
- background-color:#fff;
- margin:0;
- padding:0;
- }
- input{
- font-size:24px;
- padding:6px;
- border: 1px solid #000;
- }
- .panel{
- background-color:#d9edf7;
- border:2px #bce8f1 solid;
- padding:18px;
- line-height:28px;
- margin:20px auto 2px;
- max-width:380px;
- }
- .tombol{
- color:#fff;
- font-size:14px;
- background-color:#212121;
- boder-bottom:2px solid #000;
- padding:8px;
- margin:2px;
- }
- .tombol:hover{
- background-color:#ea3604;
- }
- a{
- text-decoration:none;
- color: #F57C00;
- }
- .footer{
- max-width: 100%;
- padding: 10px;
- color: lime;
- }
- </style>
- </head>
- <body>
- <div id="navigasi">
- <ul>
- <img class="logo" src="images/logo.png">
- <li class="text"><a href="">Aplikasi Kalkulator ></a>
- <ul>
- <li><a href="kalkulator.php">Kalkulator</a></li>
- <li><a href="#">List Code</a></li>
- </ul>
- </li>
- <li><a href="product.html">Our Product</a></li>
- <li><a href="tentang.html">About Us</a></li>
- <li><a href="index.html">Home</a></li>
- </ul>
- </div>
- <div id="login">
- <div class="login">
- <div class="login-text">
- Silahkan Login sebagai Admin untuk dapat melanjutkan pengolahan Data Perusahaan<br>
- (Data Pegawai, Material, Dll).
- </div>
- <a href="login.html" class="tombol-login"><b>Login</b></a>
- </div>
- </div>
- <?php
- $bil1 = isset($_POST['bil1']) ? $_POST['bil1'] : NULL;
- $bil2 = isset($_POST['bil2']) ? $_POST['bil2'] : NULL;
- $hasil = isset($hasil) ? $hasil : 0;
- if(isset($_POST['tambah'])){
- $hasil = $bil1+$bil2;
- }
- if(isset($_POST['kurang'])){
- $hasil = $bil1-$bil2; }
- if(isset($_POST['kali'])){
- $hasil = $bil1*$bil2;
- }
- if(isset($_POST['bagi'])){
- $hasil = $bil1/$bil2;
- }
- if(isset($_POST['clear'])){
- $hasil='';
- $bil1='';
- $bil2='';
- }
- if(isset($_POST['sqrt'])){
- $hasil=sqrt($bil1);
- }
- if(isset($_POST['^2'])){
- $hasil=($bil1*$bil1);
- }
- if(isset($_POST['%'])){
- $hasil=($bil1*$bil2)/100;
- }
- if(isset($_POST['1/x'])){
- $hasil=(1/$bil1);
- }
- echo '<div class="panel">'.
- '<form action="" method="post">'.
- '<div align="center"> BERLIANA PUTRI PURBAYA </div>'.
- '<div align="center"></div>'.
- '<div align="center"></div>'.
- '<b>MASUKAN BILANGAN KE-1:</b><br/>'.
- '<input type="text" name="bil1" value="'.$bil1.'"/><br/>'.
- '<b>MASUKAN BILANGAN KE-2:</b><br/>'.
- '<input type="text" name="bil2" value="'.$bil2.'"/><br/>'.
- '<input class="tombol" type="submit" name="tambah" value="+"/>'.
- '<input class="tombol" type="submit" name="kurang" value="-"/>'.
- '<input class="tombol" type="submit" name="kali" value="X"/>'.
- '<input class="tombol" type="submit" name="bagi" value=":"/>'.
- '<input class="tombol" type="submit" name="sqrt" value="sqrt"/>'.
- '<input class="tombol" type="submit" name="^2" value="^2"/>'.
- '<input class="tombol" type="submit" name="%" value="%"/>'.
- '<input class="tombol" type="submit" name="1/x" value="1/X"/><br/>'.
- '<INPUT class="tombol" type="submit" name="clear" value=" BERSIHKAN FORM "/>'.
- '</form>'.
- '<b>HASIL:</b><br/>'.
- '<input type="text" value="'.$hasil.'" readonly/><br/>'.
- '</div>';
- ?><br/><br/><br/><br/><br/>
- <div class="footer">
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement