Postingan lainnya
Buku Ini Koding!
Baru!
Buku ini akan jadi teman perjalanan kamu belajar sampai dapat kerjaan di dunia programming!
Kelas Premium!
Belajar bikin website dari nol sekarang
Gunakan kupon "lebihcepat" untuk diskon 25%!
Gan, Tentang POPUP di PHP
gan saya kan mau bikin tugas, jadi saya mau munculin popup jika bil2 kurang dari 30% dari bil1,
saya sudah coba2 tapii gagal :'(Â bisa minta tolong, saya pakai php & html & css
<!DOCTYPE html>
<html>
<head>
<title>Simulasi Kredit | UD.Abadi Motor Semarang</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<?php
if(isset($_POST['hitung'])){
$bil1 = $_POST['bil1'];
$bil2 = $_POST['bil2'];
$operasi = $_POST['operasi'];
switch ($operasi) {
case '12bulan':
$hasil = $bil1-$bil2;
$hasil1 = $hasil*0.03;
$hasil2 = $hasil1+$hasil;
$hasil3 = $hasil2/12;
break;
case '24bulan':
$hasil = $bil1-$bil2;
$hasil1 = $hasil*0.06;
$hasil2 = $hasil1+$hasil;
$hasil3 = $hasil2/24;
break;
case '36bulan':
$hasil = $bil1-$bil2;
$hasil1 = $hasil*0.09;
$hasil2 = $hasil1+$hasil;
$hasil3 = $hasil2/36;
break;
#case 'minimal':
# $bil_lanjut = $bil1*30/100;
#break;
}
}
#else($bil2 < $bil_lanjut) {
# echo"<script>alert('DP anda Kurang dari 30%');history.go(-1);</script>";
#}
?>
<div class="kalkulator">
<h2 class="judul">SIMULASI KREDIT</h2>
<form method="post" action="index.php">
<input type="text" name="bil1" class="bil" autocomplete="off" placeholder="Harga OTR">
<input type="text" name="bil2" class="bil" autocomplete="off" placeholder="DP - Minimal 30%">
<select class="opt" name="operasi" placeholder="Tenor">
<option value="12bulan">12 Bulan</option>
<option value="24bulan">24 Bulan</option>
<option value="36bulan">36 Bulan</option>
</select>
<input type="submit" name="hitung" value="Hitung" class="tombol">
</form>
<?php if(isset($_POST['hitung'])){ ?>
<input type="text" value="<?php echo $hasil3; ?>" class="bil" placeholder="Hasil" disable>
<?php }else{ ?>
<input type="text" value="0" class="bil">
<?php } ?>
</div>
</body>
</html>
2 Jawaban:
<div>mungkin kaya gini ya?<br><br> <?php <br> $bil1 = $_POST['bil1'];<br> $bil2 = $_POST['bil2'];<br> $bil_lanjut = $bil130/100;<br><br> if(isset($_POST['hitung'])){<br> $operasi = $_POST['operasi'];<br> switch ($operasi) {<br> case '12bulan':<br> $hasil = $bil1-$bil2;<br> $hasil1 = $hasil0.03;<br> $hasil2 = $hasil1+$hasil;<br> $hasil3 = $hasil2/12;<br> break;<br> case '24bulan':<br> $hasil = $bil1-$bil2;<br> $hasil1 = $hasil0.06;<br> $hasil2 = $hasil1+$hasil;<br> $hasil3 = $hasil2/24;<br> break;<br> case '36bulan':<br> $hasil = $bil1-$bil2;<br> $hasil1 = $hasil0.09;<br> $hasil2 = $hasil1+$hasil;<br> $hasil3 = $hasil2/36;<br> break; <br> }<br> }<br><br> if($bil2 < $bil_lanjut) {<br> echo '<script type="text/javascript">alert("DP anda Kurang dari 30%");history.go(-1);</script>';<br> }</div><div> ?></div><div><br><br></div>
<div><br>My dream residence could be very one of a kind from the usual house. i would love to introduce it to you if you are interested in it. <br>the shape of my dream residence like a strawberry; the roof if inexperienced, and walls are crimson. <br>let’s enter my dream house and look around: it consists of a dwelling-room, a observe-room, a bed room, and a bathroom. the wall of the bedroom is covered with mink, so that i'm able to sleep with a candy dream and sense extra at ease. there are lots of factors in my house ----which includes computers,televisions, telephones, tables, beds, and so on. of path, the cost of my dream residence may be very huge, too. <br>how can make my dream come real? we can understand it most effective by our hard operatingn。<br><a href="https://www.businessmenuguide.com/searchengine">bing image search</a></div>