Selasa, 15 Maret 2011

source code html tugas rumah form php modul 2. dwi sagitta tjipta 209533421964

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Login Form</title>
<style type="text/css">
#apDiv1 {
position:absolute;
width:380px;
height:330px;
z-index:1;
left: 449px;
top: 136px;
background-image: url(gambar%20presentasi/024_lopez_cover2.gif);
border: 2px solid yellow;
}
#apDiv3 {
position:absolute;
width:80px;
height:25px;
z-index:2;
left: 289px;
top: 274px;
}
.style3 {
font-size: 10px;
font-weight: bold;
}
#apDiv2 {
position:absolute;
width:412px;
height:115px;
z-index:2;
top: 0px;
left: 2px;
}
#header{
width:380px;
height:98px;
background-image: url(gambar%20presentasi/47_-_Nena_Blagojev.jpg);
}
#footer{
width:380px;
height:40px;
background-image: url(bg1.jpg);
}
body {
background-image: url(gambar%20presentasi/___Baby_O____by_turp.jpg);
}
</style>
<script type="text/javascript">
function error1()
{
alert('Masukkan User Name dan Password Terlebih Dahulu ');
}
function check()
{
if(form1.pass.value == "" || form1.user.value=="")
{
error1();
}
}
</script>

</head>
<body onLoad="document.form1.user.focus();">
<form name="form1" method="post" action="check.php">
<div id="apDiv1">
<div id="header">
</div>
<div>
<div align="center"><strong><br>User Name :</strong>
<br>
<input type="text" name="user" size="35" value="" style="background-color:#FFCC99">
<br>
<br>
<strong>Password : </strong>
<br>
<input type="password" name="pass" size="35" style="background-color:#FFCC99">
<br>
<br>
</div>
</div>
<br>
<div id="apDiv3">
<input type="submit" name="submit" value=" E N T E R " onClick="check()">
</div>
<div id="footer" align="left"><br>
</div>
</div>
</form>
</body>
</html>

simpan dalam ekstensi .html
user name : dwi
password : 1964

output :

hasil validasi :

souce code tugas rumah form Php modul 2. dwi sagitta tjipta 209533421964

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Form Administrator</title>
</head>
<body background="gambar presentasi/animalfriends_1280x960.gif">
<?php
if(($_POST['user']=='dwi') AND ($_POST['pass']=='1964')) {
echo 'Sukses, Anda Telah Masuk Halaman Administrator Dengan User Name :'.$_POST['user'];
echo '<br><br>Hallo, Mr/Mrs ' . $_POST['user'];
}
else {
echo "<br><br><br><body text='red'><strong><center>Ada Kesalahan Pada Waktu Anda Login...!<br><br><a href='cobatugaslogin.html'><h4>Kembali Ke Login</h4></a></center></strong></body>";

}
?>
</body>
</html>

simpan dalam check.php

Selasa, 08 Maret 2011

tugas no 2 generate tabel modul 6 dasar - dasar php. dwi sagitta tjipta 209533421964

script PHP :


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
$rows = 1;
$columns = 1;
$cells = 1;
?>

<?php $rows = (int) $_POST["totalBaris"]; ?>
<?php $columns = (int) $_POST["totalKolom"]; ?>
<?php $cells = (int) $_POST["totalSel"]; ?>

jumlah baris anda <?php echo $rows; ?> baris,<br />
jumlah kolom anda <?php echo $columns; ?> kolom,<br />
jumlah sel anda <?php echo $cells; ?> sel,<br />
<br /><br />
<?php
$width = $columns * 75;
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>";
?>
</body>
</html>
output : 


script html :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body background="gambar presentasi/___Baby_O____by_turp.jpg">
<form method="post" action="tabel.php">
<p><font face="Bauhaus 93" color="#336699" size="5"><strong>program bikin *****tabel***** ajaib</strong></font><br></p>
<table width="277" border="0">
<tr>
<td width="89">Baris</td>
<td width="172"><strong>: </strong><input name="totalBaris" type="text" id="totalBaris" onKeyUp="getmax();" onfocus="this.select();"></td>
</tr>
<tr>
<td><label>Kolom</label></td>
<td><strong>: </strong><input name="totalKolom" type="text" id="totalKolom" onKeyUp="getmax();" onfocus="this.select();"></td>
</tr>
<tr>
<td>Sel</td>
<td><strong>: </strong><input name="totalSel" type="text" id="totalSel" onKeyUp="getmax();" onFocus="this.select();"></td>
</tr>
<tr>
<td>Sel Maksimal</td>
<td><strong>: </strong><input name="jmlSelMax" type="text" id="jmlSelMax" readonly="true" style="background-color:#999999">
</td>
</tr>
<tr>
<td>
<div align="center">
<br />
<input type="reset" name="Reset" value="bersihkan">
</div></td>
<td>
<div align="right">
<br />
<input type="submit" name="Generate" value="bikin">
</div></td>
</tr>
</table>
</form>

<script language="JavaScript" type="text/javascript">
<!--
function getmax() {
var R = parseInt(document.getElementById('totalBaris').value);
var C = parseInt(document.getElementById('totalKolom').value);
var X = parseInt(document.getElementById('totalSel').value);
var cellmax = document.getElementById('jmlSelMax');
var total = 0;
total = R * C;
cellmax.value = new String(total);
if (X > total)
{
alert('Jumlah sel yang anda inginkan melewati batas maksimal sel =' + total);
document.getElementById('totalSel').value = new String();
}
}
//-->
</script>

</body>
</html>
output : 

tugas rumah no 1 tentang passing fungsi modul 6 dasar - dasar PHP. dwi sagitta Tjipta 209533421964

tugas praktikum
1. fungsi
fungsi adalah blok kode yang ditujukan untuk melaksanakan suatu tugas tertentu.
passing adalah melewatkan sebuah nilai atau reference ke dalam sebuah fungsi, di mana nilai atau reference tersebut digunakan sebagai input untuk fungsi. passing dibagi dua yaitu :
passing by value : di mana yang dilewatkan ke dalam fungsi adalah berdasarkan nilai dan tidak merubah nilai variabel di luar fungsi
passing by reference : di mana yang dilewatkan adalah alamat dari variabel, sehingga merubah niali dari variabel yang diinputkan, meskipun berada di luar fungsi.

contoh passing by value
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>perlewatan argumen dengan nilai</title>
</head>

<body>
<?php
function tukar($x,$y)
{
$tmp=$x;
$x=$y;
$y=$tmp;
}

$a=10;
$b=20;
print("sebelum penukaran : ");
printf("a = %d ; b = %d <br>\n",$a,$b);
tukar($a,$b);
print("sesudah penukaran : ");
printf("a = %d ; b = %d <br>\n",$a,$b);
?>

</body>
</html>
keluaran


contoh passing byarguments
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>perlewatan argumen dengan referensi</title>
</head>

<body>
<?php
function tukar(&$x,&$y)
{
$tmp=$x;
$x=$y;
$y=$tmp;
}

$a=10;
$b=20;
print("sebelum penukaran : ");
printf("a = %d ; b = %d <br>\n",$a,$b);
tukar($a,$b);
print("sesudah penukaran : ");
printf("a = %d ; b = %d <br>\n",$a,$b);
?>

</body>
</html>
keluaran

Selasa, 01 Maret 2011

style css yang digunakan di modul 5

/* CSS Document */
body{
margin:10px auto;
width:750px;
}

header,nav,section,footer{
display:block;
border:thin solid blue;
}

header{
height:100px;
background: url(bg1.jpg);
padding-top:10px;
padding-left:10px;

}

nav{
margin-left:auto;
background:url(bendera-indonesia.jpg);
height:40px;
}

section{
margin-left:auto
width:500;
height:800px;
background:url(batik.jpg)
}

footer{
clear:both;
height:40px;
padding-left:100px;
padding-right:200px;
background: url(RN-2x2-2s-Squeel_motif_8-0_0-3g.png)
}

article{
border:thick dashed blue;
width:450px;
height:750px;
margin-left:10px;
margin-right:10px;
margin-bottom:10px;
margin-top:10px;
float:left;
}

aside{
border:thick dashed red;
width:200px;
height:300px;
margin-left:10px;
margin-right:10px;
margin-bottom:10px;
margin-top:10px;
float:right;
background:#99CC00;
}

search{
float:left;
font-family:sans-serif;
font-size:16px;
font-style:oblique;
font-weight:400;
border: thin solid #CCCC00;
background-color: #CCFFCC;
padding:1px;
}

home{
font-family:Arial;
color:#FFFFFF;
border:thin solid #99CC00;
background-color: #6633FF;
float:right;
margin-left:5px;
margin-right:5px;
padding:5px;
}


home2{
font-family:Arial;
color:#FFFFFF;
border:thin solid #00CC99;
background-color: #336699;
float:right;
margin-left:5px;
margin-right:5px;
padding:5px;
}

event{
border: thin solid #003399;
background:url(184_1221_457_Hello%20Kitty%20200x200.jpg);
font-family:arial;
font-style:oblique;
font-weight:600;
width:250px;
height:430px;
float: right;
margin-right:10px;
}

script form bayar utang tugas rumah modul 5 java script. dwi sagitta tjipta 209533421964

<em><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>form bayar utang</title>
<link rel="stylesheet" href="mystyle.css" type="text/css" />
<header>
<img src="logo um copy transparant 600px.png" width="100px" height="100px" />
<img src="sensuspenduduk.png" width="333" height="100px" />

</header>
</head>
<script language="JavaScript" type="text/javascript">
function ngebond(){
var kertas = document.formulir;
var hargaBakso = 12000 * eval(kertas.Bakso.value);
var hargaSoto = 10000 * eval(kertas.Soto.value);
var hargaMie = 15000 * eval(kertas.Mie.value);
var hargaDegan = 5000 * eval(kertas.Degan.value);
var hargaCampur = 7000 * eval(kertas.Campur.value);
var TotalHarga = hargaBakso + hargaSoto + hargaMie + hargaDegan + hargaCampur;
if (TotalHarga > 50000){
kertas.Total.value = TotalHarga;
kertas.Diskon.value = 10000;
kertas.Bayar.value = TotalHarga - eval(kertas.Diskon.value);
} else {
kertas.Total.value = TotalHarga;
kertas.Diskon.value = 0;
kertas.Bayar.value = TotalHarga - eval(kertas.Diskon.value);
}
}
function resetForm(){
document.formulir.reset();
}
</script>

<body background="3C60C395125F4.JPG">

<H2>Form Pemesanan Makan dan Minum</H2>
<form name="formulir" action="#">
<table border="1px">
<tr>
<th>No</th>
<th>Makanan/Minuman</th>
<th>Harga</th>
<th>Pesan</th>
</tr>

<tr>
<td width="20" >1</td>
<td width="180">Bakso Istimewa</td>
<td width="130" > @&nbsp<input type="text" name="bakso" value="12000" size="7" readonly="readonly"/></td>
<td width="160"><input type="text" name="Bakso" value="0" onFocus="this.select()" onChange="ngebond()"/></td>
</tr>

<tr>
<td>2</td>
<td>Soto Spesial</td>
<td> @&nbsp<input type="text" name="soto" value="10000" size="7" readonly="readonly"/></td>
<td><input type="text" name="Soto" value="0" onFocus="this.select()" onChange="ngebond()"/></td>
</tr>
<tr>
<td>3</td>
<td>Mie Ayam Super</td>
<td> @&nbsp <input type="text" name="mie" value="15000" size="7" readonly="readonly"/></td>
<td><input type="text" name="Mie" value="0" onFocus="this.select()" onChange="ngebond()"/></td>
</tr>
<tr>
<td>4</td>
<td>Es Degan</td>
<td> @&nbsp <input type="text" name="degan" value="7000" size="7" readonly="readonly"/></td>
<td><input type="text" name="Degan" value="0" onFocus="this.select()" onChange="ngebond()"/></td>
</tr>
<tr>
<td>5</td>
<td>Es Campur</td>
<td> @&nbsp <input type="text" name="campur" value="7000" size="7" readonly="readonly"/></td>
<td><input type="text" name="Campur" value="0" onFocus="this.select()" onChange="ngebond()"/></td>
</tr>
<tr>
<td colspan="3" align="right">Jumlah Total</td>
<td><input type="text" name="Total" readonly="readonly" /></td>
</tr>
<tr>
<td colspan="3" align="right">Diskon</td>
<td><input type="text" name="Diskon" readonly="readonly"/></td>
</tr>
<tr>
<td colspan="3" align="right">Jumlah Dibayar</td>
<td><input type="text" name="Bayar" readonly="readonly" align="right"/></td>
</tr>
</table><br/>
<input type="button" value="CLEAR" onClick="resetForm()" />
</form>
</body>
</html></em>

screen shot tugas rumah modul 5 java script. dwi sagitta tjipta 209533421964