Advertisement
Guest User

LIST CODE KALKULATOR BERLIANA PUTRI PURBAYA

a guest
Nov 22nd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.75 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>KALKULATOR</title>
  4. <style>
  5.  
  6. *{margin:0px auto}
  7. #navigasi{
  8. margin:0;
  9. padding:0;
  10. overflow:hidden;
  11. background-color:#1f1f1f;
  12. }
  13.  
  14.  
  15.  
  16. #navigasi ul li:hover ul {
  17. display:block;
  18. }
  19.  
  20. #navigasi ul ul {
  21. display:none;
  22. list-style:none;
  23. position:absolute;
  24. background-color:black;
  25. right:0px;
  26. top:60px;
  27. width:165px;
  28. }
  29.  
  30. #navigasi ul ul li a {
  31. float:none;
  32. display:block;
  33. padding-left:30px;
  34. text-align:left;
  35. width:160px;
  36. }
  37.  
  38. #navigasi ul ul li a:hover {
  39. color:#fff;
  40. }
  41.  
  42.  
  43.  
  44. .logo {
  45. display:inline-block;
  46. width:150px;
  47. padding:10px 14px;
  48. }
  49.  
  50. li{
  51. list-style-type:none;
  52. float:right;
  53. font-family:Verdana;
  54. }
  55.  
  56. li a{
  57. display:inline-block;
  58. color:white;
  59. text-align:center;
  60. padding:20px 14px;
  61. text-decoration:none;
  62. }
  63.  
  64. li a:hover{
  65. background-color:#ea3604;
  66. transition: all 0.5s ease;
  67. }
  68.  
  69. #login{
  70. margin:2% 4% 0px;
  71. padding:0;
  72. background-color:white;
  73. width:88%;
  74. height:auto;
  75. display:inline-block;
  76. }
  77.  
  78. .login{
  79. float:left;
  80. padding:2% 2%;
  81. background-color:#d9edf7;
  82. border:1px #bce8f1 solid;
  83. width:100%;
  84. height:auto;
  85. }
  86.  
  87. .login-text{
  88. float:left;
  89. width:70%;
  90. display:inline-block;
  91. color:#3a87ad;
  92. font-family:Verdana;
  93. }
  94.  
  95. .tombol-login{
  96. padding:10px 50px;
  97. font-family:Verdana;
  98. color:white;
  99. background-color:#3a87ad;
  100. text-decoration:none;
  101. float:right;
  102. }
  103.  
  104. .tombol-login:hover{
  105. background-color:#1f1f1f;
  106. transition: all 0.5s ease;
  107. }
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116. body{
  117. font-family:Verdana;
  118. color:#000;
  119. background-color:#fff;
  120. margin:0;
  121. padding:0;
  122. }
  123. input{
  124. font-size:24px;
  125. padding:6px;
  126. border: 1px solid #000;
  127. }
  128. .panel{
  129. background-color:#d9edf7;
  130. border:2px #bce8f1 solid;
  131. padding:18px;
  132. line-height:28px;
  133. margin:20px auto 2px;
  134. max-width:380px;
  135. }
  136. .tombol{
  137. color:#fff;
  138. font-size:14px;
  139. background-color:#212121;
  140. boder-bottom:2px solid #000;
  141. padding:8px;
  142. margin:2px;
  143. }
  144. .tombol:hover{
  145. background-color:#ea3604;
  146. }
  147. a{
  148. text-decoration:none;
  149. color: #F57C00;
  150. }
  151. .footer{
  152. max-width: 100%;
  153. padding: 10px;
  154. color: lime;
  155. }
  156. </style>
  157. </head>
  158. <body>
  159.  
  160.  
  161. <div id="navigasi">
  162.  
  163. <ul>
  164. <img class="logo" src="images/logo.png">
  165. <li class="text"><a href="">Aplikasi Kalkulator ></a>
  166. <ul>
  167. <li><a href="kalkulator.php">Kalkulator</a></li>
  168. <li><a href="#">List Code</a></li>
  169. </ul>
  170. </li>
  171. <li><a href="product.html">Our Product</a></li>
  172. <li><a href="tentang.html">About Us</a></li>
  173. <li><a href="index.html">Home</a></li>
  174. </ul>
  175. </div>
  176.  
  177. <div id="login">
  178. <div class="login">
  179. <div class="login-text">
  180. Silahkan Login sebagai Admin untuk dapat melanjutkan pengolahan Data Perusahaan<br>
  181. (Data Pegawai, Material, Dll).
  182. </div>
  183. <a href="login.html" class="tombol-login"><b>Login</b></a>
  184. </div>
  185. </div>
  186.  
  187.  
  188. <?php
  189. $bil1 = isset($_POST['bil1']) ? $_POST['bil1'] : NULL;
  190. $bil2 = isset($_POST['bil2']) ? $_POST['bil2'] : NULL;
  191. $hasil = isset($hasil) ? $hasil : 0;
  192. if(isset($_POST['tambah'])){
  193. $hasil = $bil1+$bil2;
  194. }
  195.  
  196. if(isset($_POST['kurang'])){
  197. $hasil = $bil1-$bil2; }
  198. if(isset($_POST['kali'])){
  199. $hasil = $bil1*$bil2;
  200. }
  201.  
  202. if(isset($_POST['bagi'])){
  203. $hasil = $bil1/$bil2;
  204. }
  205.  
  206. if(isset($_POST['clear'])){
  207. $hasil='';
  208. $bil1='';
  209. $bil2='';
  210. }
  211.  
  212. if(isset($_POST['sqrt'])){
  213. $hasil=sqrt($bil1);
  214. }
  215.  
  216. if(isset($_POST['^2'])){
  217. $hasil=($bil1*$bil1);
  218. }
  219.  
  220. if(isset($_POST['%'])){
  221. $hasil=($bil1*$bil2)/100;
  222. }
  223.  
  224. if(isset($_POST['1/x'])){
  225. $hasil=(1/$bil1);
  226. }
  227.  
  228. echo '<div class="panel">'.
  229. '<form action="" method="post">'.
  230. '<div align="center"> BERLIANA PUTRI PURBAYA </div>'.
  231. '<div align="center"></div>'.
  232. '<div align="center"></div>'.
  233. '<b>MASUKAN BILANGAN KE-1:</b><br/>'.
  234. '<input type="text" name="bil1" value="'.$bil1.'"/><br/>'.
  235. '<b>MASUKAN BILANGAN KE-2:</b><br/>'.
  236. '<input type="text" name="bil2" value="'.$bil2.'"/><br/>'.
  237. '<input class="tombol" type="submit" name="tambah" value="+"/>'.
  238. '<input class="tombol" type="submit" name="kurang" value="-"/>'.
  239. '<input class="tombol" type="submit" name="kali" value="X"/>'.
  240. '<input class="tombol" type="submit" name="bagi" value=":"/>'.
  241. '<input class="tombol" type="submit" name="sqrt" value="sqrt"/>'.
  242. '<input class="tombol" type="submit" name="^2" value="^2"/>'.
  243. '<input class="tombol" type="submit" name="%" value="%"/>'.
  244. '<input class="tombol" type="submit" name="1/x" value="1/X"/><br/>'.
  245. '<INPUT class="tombol" type="submit" name="clear" value=" BERSIHKAN FORM "/>'.
  246.  
  247. '</form>'.
  248. '<b>HASIL:</b><br/>'.
  249. '<input type="text" value="'.$hasil.'" readonly/><br/>'.
  250. '</div>';
  251. ?><br/><br/><br/><br/><br/>
  252. <div class="footer">
  253.  
  254. </div>
  255. </body>
  256. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement