Assalamualaikum temen temen...
Hello semuanya, gimana nihh kabarnya sehat kan.. oke gengs kali ini mimin akan membahas tentang fungsi di dalam PHP, berikut contohnya:
Dan ini Cssnya:
Dan ini dia hasilnya
Nah mungkin kali ini mimin gak akan ngejelasin dulu soalnya mimin udah ngantuk banget, mungkin jika ada waktu mimin akan mengupdatenya ya guys see you
<!DOCTYPE html>
<html>
<head>
<title>Money chgr</title>
<link rel="stylesheet" href="cssyo.css">
</head>
<body>
<center>
<div class="transparan">
<form method="post">
<h1>Money Changer</h1>
<table border="1" class="tabel">
<tr>
<th>Mata Uang Asing</th>
<th>Mata Uang Indonesia</th>
</tr>
<tr>
<td>Dollar Amerika</td>
<td>15000</td>
</tr>
<tr>
<td>Dollar Singapura</td>
<td>11000</td>
</tr>
<tr>
<td>Yen</td>
<td>136</td>
</tr>
<tr>
<td>Won</td>
<td>13</td>
</tr>
</table>
</div>
<br>
<div class="box">
<h1>Transaksi</h1>
Masukan uang dalam rupiah Rp. <br>
<input type="text" name="uang"><br>
<select id="list" name="list">
<option id="list" name="list" value="amerika">Dolar Amerika</option>
<option id="list" name="list" value="singapura">Dolar Singapura</option>
<option id="list" name="list" value="yen">Yen</option>
<option id="list" name="list" value="won">Won</option>
</select>
<button type="Submit">Hitung</button>
</center>
</form>
</div>
</body>
<?php
error_reporting(0);
$uang = $_POST['uang'];
function konversi ($total){
$hasil = $_POST['list'];
if ($hasil == 'amerika') {
$hasil2 = $total/15000;
return $hasil2;
} elseif ($hasil == 'Singapura') {
$hasil2 = $total/11000;
return $hasil2;
} elseif ($hasil == 'Yen') {
$hasil2 = $total/136;
return $hasil2;
} else {
$hasil2 = $total/13;
return $hasil2;
}
}
echo'<center>'. konversi($uang);
?>
</html>
<html>
<head>
<title>Money chgr</title>
<link rel="stylesheet" href="cssyo.css">
</head>
<body>
<center>
<div class="transparan">
<form method="post">
<h1>Money Changer</h1>
<table border="1" class="tabel">
<tr>
<th>Mata Uang Asing</th>
<th>Mata Uang Indonesia</th>
</tr>
<tr>
<td>Dollar Amerika</td>
<td>15000</td>
</tr>
<tr>
<td>Dollar Singapura</td>
<td>11000</td>
</tr>
<tr>
<td>Yen</td>
<td>136</td>
</tr>
<tr>
<td>Won</td>
<td>13</td>
</tr>
</table>
</div>
<br>
<div class="box">
<h1>Transaksi</h1>
Masukan uang dalam rupiah Rp. <br>
<input type="text" name="uang"><br>
<select id="list" name="list">
<option id="list" name="list" value="amerika">Dolar Amerika</option>
<option id="list" name="list" value="singapura">Dolar Singapura</option>
<option id="list" name="list" value="yen">Yen</option>
<option id="list" name="list" value="won">Won</option>
</select>
<button type="Submit">Hitung</button>
</center>
</form>
</div>
</body>
<?php
error_reporting(0);
$uang = $_POST['uang'];
function konversi ($total){
$hasil = $_POST['list'];
if ($hasil == 'amerika') {
$hasil2 = $total/15000;
return $hasil2;
} elseif ($hasil == 'Singapura') {
$hasil2 = $total/11000;
return $hasil2;
} elseif ($hasil == 'Yen') {
$hasil2 = $total/136;
return $hasil2;
} else {
$hasil2 = $total/13;
return $hasil2;
}
}
echo'<center>'. konversi($uang);
?>
</html>
Dan ini Cssnya:
body{
background-color: #1a2c2e;
font-family: Tw Cen MT;
font-size: 30px;
color :white;
}
.transparan, .box{
background:rgba(2, 2, 2, 0.5);
width: 50%;
height:500px;
padding:10px;
margin:0px auto;
}
* {
box-sizing: border-box;
}
h3{
color: white;
}
.tabel{
border-collapse: collapse;
width: auto;
border: 1px solid white;
}
.tabel tr th{
background: #35A9DB;
font-weight: normal;
}
.tabel, th, td {
padding: 8px 20px;
text-align: center;
}
input[type=text]{
background:none;
color:white;
font-family: tw cen mt;
font-size: 20px;
width: 40%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
text-align: center;
border :2px solid white;
}
#list{
background:none;
color:white;
font-family: tw cen mt;
font-size: 20px;
width: 29%;
height: auto;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
text-align: center;
border :2px solid white;
}
button[type=submit]{
color:white;
background-color: green;
border: none;
width: 11%;
height: 45px;
border-radius:5px;
font-size: 18px;
}
button[type=submit]:hover{
opacity: 0.6;
zoom:105%;
zoom: 1;
}
background-color: #1a2c2e;
font-family: Tw Cen MT;
font-size: 30px;
color :white;
}
.transparan, .box{
background:rgba(2, 2, 2, 0.5);
width: 50%;
height:500px;
padding:10px;
margin:0px auto;
}
* {
box-sizing: border-box;
}
h3{
color: white;
}
.tabel{
border-collapse: collapse;
width: auto;
border: 1px solid white;
}
.tabel tr th{
background: #35A9DB;
font-weight: normal;
}
.tabel, th, td {
padding: 8px 20px;
text-align: center;
}
input[type=text]{
background:none;
color:white;
font-family: tw cen mt;
font-size: 20px;
width: 40%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
text-align: center;
border :2px solid white;
}
#list{
background:none;
color:white;
font-family: tw cen mt;
font-size: 20px;
width: 29%;
height: auto;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
text-align: center;
border :2px solid white;
}
button[type=submit]{
color:white;
background-color: green;
border: none;
width: 11%;
height: 45px;
border-radius:5px;
font-size: 18px;
}
button[type=submit]:hover{
opacity: 0.6;
zoom:105%;
zoom: 1;
}
Dan ini dia hasilnya
Nah mungkin kali ini mimin gak akan ngejelasin dulu soalnya mimin udah ngantuk banget, mungkin jika ada waktu mimin akan mengupdatenya ya guys see you
1 Komentar
THANKYOUU !
BalasHapus