STUDY KASUS 2 - MOD 6

ini merupakan syntax yang harus dsimpan dg .php


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<html>

<head>
<title>Hasil Study Kasus</title>
</head>

<body>

<div align="center">
<?php
$rows = 2;
$columns = 2;
$cells = 2;
?>

  <?php $rows = (int) $_POST["JumlahRow"]; ?>
  <?php $columns = (int) $_POST["JumlahColum"]; ?>
  <?php $cells = (int) $_POST["JumlahCell"]; ?>

  <strong>Anda Memilih</strong> <?php echo $rows; ?> <em>baris,</em><br />
  <strong>Anda Memilih</strong> <?php echo $columns; ?> <em>kolom,</em><br />
  <strong>Dan Anda Membutuhkan</strong> <?php echo $cells; ?> <em>sel,</em><br />
  <br />
  <br />
  <?php
    $width = $columns * 100;
    echo "<table width=".$width." border=1>";
    $rw = 0;
    $cel = 1;
    while ($rw < $rows && $cel <= $cells)
    {
        echo "<tr>";
        $cl = 0;
        while ($cl < $columns)
        {
            if ($cel <= $cells)
            {
                echo "<td><div align=center>".$cel."</div></td>";
                $cel++;
            }
            $cl++;
        }
        echo "</tr>";
        $rw++;
    }
    echo "</table>";
?>
</div>

</body>
</html>

ini merupakan HTML

body {
margin: 10px auto;
width: 750px;
}

header{
border:1px solid green;
height: 80px;
}

nav {
border:1px solid blue;
height:20px;
}

section{
padding:15px;
border:1px solid red;
height:370px;
}

article{
float:left;
border:2px dashed red;
height:340px;
width:550px;}

aside{
float:right;
border:2px dashed black;
height:340px;
width:150px;
}

footer{
border:1px solid green;
height:20px;
}

HASILnya..


Jika dKLIK GENERATE, maka ..





Floodie
*dposting dg terpaksa untuk memenuhi syarat UTS besug. -.-"
ampun mas asdos :D


Free Template Blogger collection template Hot Deals SEO

MODUL 5 - WARUNG GITA

Syntax untuk membuat penghitungan warung :


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<blink><title>Warung GITA</title> </blink>
</head>
<body bgcolor = "pink">
<body>
<script language="JavaScript" type="text/javascript">
function hitungPesan(){
var nota = document.form2;
var hargaBakso = 12000 * eval(nota.Bakso.value);
var hargaSoto = 10000 * eval(nota.Soto.value);
var hargaMie = 15000 * eval(nota.Mie.value);
var hargaDegan = 5000 * eval(nota.Degan.value);
var hargaCampur = 7000 * eval(nota.Campur.value);
var jumlahTotal = hargaBakso + hargaSoto + hargaMie + hargaDegan + hargaCampur;
if (jumlahTotal > 50000){
nota.Total.value = jumlahTotal;
nota.Diskon.value = 10000;
nota.Bayar.value = jumlahTotal - eval(nota.Diskon.value);
} else {
nota.Total.value = jumlahTotal;
nota.Diskon.value = 0;
nota.Bayar.value = jumlahTotal - eval(nota.Diskon.value);
}
}
function resetForm(){
document.form2.reset();
}

</script><h3>Form Pemesanan WARUNG GITA</h3>
<form name="form2" action="#">
<table border="1px">
<tr>
<th>No</th>
<th>Makanan/Minuman</th>
<th>Harga</th>
<th>Pesan</th>
</tr>
<tr>
<td width="15">1</td>
<td width="200">Bakso Istimewa</td>
<td width="90">@ <input id="n123" type="text" name="bakso" value="12000" size="6" disabled="true"/></td>
<td width="110"><input type="text" name="Bakso" size="14" value="0" onChange="hitungPesan()"/></td>
</tr>
<tr>
<td>2</td>
<td>Soto Spesial</td>
<td>@ <input type="text" name="soto" value="10000" size="6" disabled="true"/></td>
<td><input type="text" name="Soto" size="14" value="0" onChange="hitungPesan()"/></td>
</tr>
<tr>
<td>3</td>
<td>Mie Ayam Super</td>
<td>@ <input type="text" name="mie" value="15000" size="6" disabled="true"/></td>
<td><input type="text" name="Mie" size="14" value="0" onChange="hitungPesan()"/></td>
</tr>
<tr>
<td>4</td>
<td>Es Degan</td>
<td>@ <input type="text" name="degan" value="5000" size="6" disabled="true"/></td>
<td><input type="text" name="Degan" size="14" value="0" onChange="hitungPesan()"/></td>
</tr>
<tr>
<td>5</td>
<td>Es Campur</td>
<td>@ <input type="text" name="campur" value="7000" size="6" disabled="true"/></td>
<td><input type="text" name="Campur" size="14" value="0" onChange="hitungPesan()"/></td>
</tr>
<tr>
<td colspan="3" align="right">Jumlah Total</td>
<td>Rp.<input type="text" name="Total" size="10" disabled="true" /></td>
</tr>
<tr>
<td colspan="3" align="right">Diskon</td>
<td>Rp.<input type="text" name="Diskon" size="10" disabled="true" /></td>
</tr>
<tr>
<td colspan="3" align="right">Jumlah Dibayar</td>
<td>Rp.<input type="text" name="Bayar" disabled="true" size="10" align="right"/></td>
</tr>
</table><br/>
<input type="button" value="BATAL" onClick="resetForm()" />
</form>
</body>
</html>

TAMPILAN :


FLoodi_thxdd



Free Template Blogger collection template Hot Deals SEO

MODUL 5 - KALKULATOR SEDERHANA

Syntax untuk membuat kalkulaator sederhana :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>gitagitagitagitagita</title>
</head>
<body>
<CENTER>
<font size="7" color="red"><blink>Kalkulator Sederhana 2011</font></blink>
<hr size="5" color="black">
<script language="JavaScript" type="text/javascript">
<!--
function hitung(){
var myForm = document.form1;
var x=eval(myForm.x.value);
var y=eval(myForm.y.value);
var pil= myForm.opt.value;
if (pil == "tambah") {
    var z = x + y;
 }else if (pil == "kurang") {
    var z = x - y;
 } else if (pil == "kali") {
    var z = x * y;
 } else if (pil == "bagi") {
    var z = x / y;
 }
 myForm.hasil.value = z;
}
function resetForm(){
document.form1.reset();
}
//-->
</script>
<form name="form1" action="#">
<input type="text" name="x" />
<select name="opt">
 <option value="tambah"> + </option>
 <option value="kurang"> - </option>
 <option value="kali"> * </option>
 <option value="bagi"> / </option>
</select>
<input type="text" name="y" />
<input type="button" value="=" onClick="hitung()" />
<input type="text" name="hasil" disabled="true" /><br/>
<input type="button" value="CLEAR" onClick="resetForm()" />
</form>
</center>
</body>
</html>

HASIL :


Free Template Blogger collection template Hot Deals SEO