You are on page 1of 85

MODUL PRAKTIKUM

PEMROGRAMAN INTERNET



















D
I
S
U
S
U
N

O
L
E
H







Ahmad Sanmorino, S.Kom




Modul Praktikum Pemrograman Internet
2

DAFTAR ISI

Chapter 1 : HTML, PHP & MySQL
@ Membuat Aps. Buku Tamu (Guestbook)
@ Membuat Aps. Jajak Pendapat (Polling)
@ Membuat Aps. Search Engine
@ Membuat Aps. File Upload
Chapter 2 : CSS (Cascading Style Sheet)
@ Pengenalan CSS, Grouping & Inheritance
@ Pembuatan List (Daftar)
@ Cara Penggunaan Huruf (Warna, Ukuran dll)
Chapter 3 : JavaScript
@ Pengenalan JS dan Pembuatan Kalender
@ Menonaktifkan Klik Kanan pada Mouse
@ Operasi Matematika pada JavaScript
@ Pembuatan Scroll Vertical
Chapter 4 : Case Study
@ Program Aplikasi Persewaan Mobil
@ Program Aplikasi Online Store (e-Commerce)






























Modul Praktikum Pemrograman Internet
3
Chapter 1
## Membuat Buku Tamu ##

Buku Tamu yang dibuat terdiri dari 3 file yaitu :
File index.html
File simpan_guestbook.php
File tampil_guestbook.php

Menyiapkan Database
Langkah awal yang harus dipersiapkan sebelum membuat program adalah membuat
database-nya terlebih dahulu. Database yang akan digunakan diberi nama latihan dengan
mengetikan perintah :

create database latihan;

Selanjutnya buatlah tabel guestbook dalam database latihan tersebut. Namun sebelumnya
masuklah terlebih dahulu ke dalam database latihan dengan mengetikan perintah :

use latihan;

Kemudian buatlah table guestbook dengan mengetikan perintah MySQL sebagai berikut :





















Modul Praktikum Pemrograman Internet
4
Membuat file index.html

















Modul Praktikum Pemrograman Internet
5
Membuat file simpan_guestbook.php
































Modul Praktikum Pemrograman Internet
6
Membuat file tampil_guestbook.php










Modul Praktikum Pemrograman Internet
7





















LATIHAN !

Buatlah program yang menerima input berupa nim, nama, alamat, no telp, email, hobby.
Kemudian buat output yang menampilkan seluruh data yang telah diinputkan. Gunakan
database latihan, buat tabel baru dengan nama mahasiswa, jadikan nim sebagai primary
key-nya. Selamat bekerja !
























Modul Praktikum Pemrograman Internet
8
Chapter 2
## Membuat Jajak Pendapat ##

Program jajak pendapat terdiri dari 3 file yaitu :
1. index.html
2. proses.php
3. output.php

Mempersiapkan Database
Database yang akan digunakan adalah database latihan, buat tabel baru dengan nama
polling. Adapun perintah MySQL yang digunakan untuk membuat tabel polling adalah
sebagai berikut :



Selanjutnya isikan terlebih dahulu ke dalam tabel tersebut data-data sebagai berikut ini :

INSERT INTO polling VALUES ('redhat', 5);
INSERT INTO polling VALUES ('mandrake', 3);
INSERT INTO polling VALUES ('suse', 1);
INSERT INTO polling VALUES ('slackware', 0);
INSERT INTO polling VALUES ('debian', 0);

Membuat file index.html








Modul Praktikum Pemrograman Internet
9
















Membuat file proses.php


Membuat file output.php



Modul Praktikum Pemrograman Internet
10



















LATIHAN !

Buatlah polling/jajak pendapat yang meminta masukan pengguna mengenai penilaian
suatu website. Terdiri dari 4 kategori penilaian yaitu buruk, cukup, baik dan sangat baik.




















Modul Praktikum Pemrograman Internet
11
Chapter 3
## Membuat Mesin Pencari ##

Program mesin pencari sederhana terdiri dari 2 file :
1. index.html
2. proses.php

Mempersiapkan Database
Gunakan database latihan buat tabel baru dengan nama cari_pegawai dengan perintah
MySQL sebagai berikut :






















Modul Praktikum Pemrograman Internet
12
Membuat file index.html



















Membuat file proses.php




Modul Praktikum Pemrograman Internet
13


LATIHAN !

Buatlah mesin pencari (search engine) mahasiswa yang menerima input berupa nama
mahasiswa dan menampilkan output berupa informasi nim, nama dan alamat mahasiswa
yang bersangkutan.






























Modul Praktikum Pemrograman Internet
14
Chapter 4
## Membuat File Upload ##

Program File Upload terdiri dari 3 file yaitu :
1. index.html
2. upload_proses.php
3. upload_data.php
Kemudian juga dibuat satu folder bernama folder file untuk menampung file yang telah
diupload.

Persiapan Database
Gunakan database latihan dengan membuat tabel baru yaitu tabel upload dengan perintah
MySQL sebagai berikut :





Membuat file index.html




Modul Praktikum Pemrograman Internet
15





















Membuat file upload_proses.php



Modul Praktikum Pemrograman Internet
16






















Membuat file upload_data.php



Modul Praktikum Pemrograman Internet
17


}

}

?>













































Modul Praktikum Pemrograman Internet
18
Chapter 1
## Pengenalan CSS ##

I. Cara penulisan CSS
Cara penulisan CSS terdiri dari 3 macam yaitu :

1. Inline Style Sheet

Penulisan sintaks CSS di dalam elemen HTML. Misalkan hendak memberikan warna
hijau pada tag <p>, maka cara penulisannya sebagai berikut :

<p style=”color: green”>

2. Embedded Style Sheet

Penulisan sintaks CSS di dalam dokumen HTML dengan metode Embedded Style Sheet
menggunakan tag <style> dan </style>, contoh :

<style type=”text/css”>
h1 {color: red}
</style>

3. Linked Style Sheet

Penulisan sintaks CSS di halaman yang berbeda atau terpisah dari HTML. Untuk metode
yang satu ini, menggunakan tag <link rel> yang ditempatkan pada bagian tag <HEAD>.

<link rel=”stylesheet” type=”text/css” href=”htp://www.webqoe.com/global.css”>


2. Aturan Penulisan CSS
CSS memiliki aturan dalam penulisannya, yang terdiri atas :

1. Selector : yang terdiri dari tag class, ids dan pseudo yang digunakan sebagai
pemisah antar elemen.
2. Declaration : untuk mendeskripsikan property dan value yang akan digunakan
pada selector atau pemisah.

Contoh penggunaan aturan :


h1 {
color: #0000FF;
}


Keterangan :
Selektor : h1
Properti : color
Value : #0000FF

Modul Praktikum Pemrograman Internet
19
3. Grouping dan Inheritance
Grouping : pengelompokkan beberapa tag HTML dengan property dan value yang sama.
Jadi dapat dilakukan pendefinisian beberapa tag sekaligus. Sintaks yang digunakan :

Selector1, selector2, selector3 {
Property: value;
}

Jika dimasukkan ke dalam tag HTML maka strukturnya menjadi :


<html>
<head>
<title>…</title>
<style type=”text/css”>
selector1, selector2, selector3, … {
property: value;
property: value;

}
</style>
</head>
<body>
<tag html>…</tag html> /* sesuaikan dengan tag yang digunakan pada selector */
</body>
</html>


Inheritance : sifat pengaturan property, dimana jika ia ditetapkan pada sebuah <tag>,
maka tag-tag yang lain yang berada di antara tag dalam susunan (hierarki) tersebut akan
memiliki sifat yang sama pula. Contoh :








Modul Praktikum Pemrograman Internet
20














LATIHAN !

Dari pembahasan tentang grouping, buatlah contoh penggunaan CSS pada tag HTML
dengan criteria sebagai berikut : judul dengan h1, subjudul dengan h2, subsubjudul
dengan h3, dan isi dengan h4, menggunakan pengaturan jenis font arial dan warna biru.
































Modul Praktikum Pemrograman Internet
21
Chapter 2
## Pembuatan List (Daftar) ##

Pada CSS properti “list-style-type”, menerima nilai “disc”, “circle”, “square”, “decimal”,
“lower-roman”, “upper-roman”, “lower-alpha”, “upper-alpha” atau “none”. Contoh :





















LATIHAN !

Buatlah daftar menu makan siang pada sebuah restoran dengan menggunakan fungsi
list(daftar) yang terdapat pada CSS.


Modul Praktikum Pemrograman Internet
22
Chapter 3
## Penggunaan CSS ##

Pada bagian ini akan dibahas mengenai penggunaan CSS diluar tag <head> serta fungsi
perataan (horizontal & vertikal) yang sering digunakan.
Perataan horizontal berlangsung melalui property “text-align”, yang menerima harga
“left”, ”right”, “center” dan “justify”, sedangkan perataan vertical terjadi melalui property
“vertical-align”, yang dapat membawa harga “baseline”, “text-top”, “text-bottom”,
“middle”, “sub”, “super”, “top”, dan “bottom”.




















Modul Praktikum Pemrograman Internet
23



Property “text-transform” juga mengijinkan anda untuk mengganti besar huruf, maaf,
maksudnya Kapitalisasi dari seluruh teks. Pilih antara “uppercase”, “lowercase”,
“capitalize”, dan “none”.

LATIHAN !

Dengan menggunakan property “text-transform”, konsep yang sama dapat diterapkan
pada pengaturan huruf besar atau huruf kecil. Coba gunakan sintaks “uppercase”,
“lowercase”, “capitalize”, dan “none” dalam pembuatan program CSS.





















Modul Praktikum Pemrograman Internet
24
Chapter 1
## Pengenalan JavaScript & Pembuatan Kalender ##

Skrip dari JavaScript terletak di dalam dokumen HTML. Kode tersebut tidak akan terlihat
dari dalam jendela navigator, karena diantara tag (kalau anda mengerti HTML pasti tahu
dengan istilah ini) tertentu yang memerintahkan navigator untuk memperlakukan bahwa
skrip tersebut adalah skrip dari JavaScript. Contoh dari skrip yang menunjukkan bahwa
skrip tersebut adalah skrip dari JavaScript adalah sebagai berikut :


·SCFÌPT language=¨JavascrIpt¨·
letakkan scrIpt anda dIsInI
·/SCFÌPT·


Contoh Script JavaScript dalam tag HTML :



Jika diuji coba pada browser maka akan ditampilkan :


















Modul Praktikum Pemrograman Internet
25




Modul Praktikum Pemrograman Internet
26
document.write("<table border=2 bgcolor=white ");
document.write("bordercolor=black><font color=black>");
document.write("<tr><td colspan=7><center><strong>"
+ monthnames[thismonth] + " " + thisyear
+ "</strong></center></font></td></tr>");
document.write("<tr>");
document.write("<td align=center>M</td>");
document.write("<td align=center>S</td>");
document.write("<td align=center>Se</td>");
document.write("<td align=center>R</td>");
document.write("<td align=center>K</td>");
document.write("<td align=center>J</td>");
document.write("<td align=center>Sa</td>");
document.write("</tr>");
document.write("<tr>");
for (s=0;s<startspaces;s++) {
document.write("<td> </td>");
}
count=1;
while (count <= monthdays[thismonth]) {
for (b = startspaces;b<7;b++) {
linktrue=false;
document.write("<td>");
for (c=0;c<linkdays.length;c++) {
if (linkdays[c] != null) {
if ((linkdays[c][0]==thismonth + 1) && (linkdays[c][1]==count)) {
document.write("<a href=\"" + linkdays[c][2] + "\">");
linktrue=true;
}
}
}
if (count==thisdate) {
document.write("<font color='FF0000'><strong>");
}
if (count <= monthdays[thismonth]) {
document.write(count);
}
else {
document.write(" ");
}
if (count==thisdate) {
document.write("</strong></font>");
}
if (linktrue)
document.write("</a>");
document.write("</td>");
count++;
}
document.write("</tr>");
document.write("<tr>");
startspaces=0;
}
document.write("</table></p>");
// End -->
</script>
<!-- Script Size: 2.98 KB -->

</body>
</html>



Modul Praktikum Pemrograman Internet
27
Jika script kalender diatas diuji coba pada browser, maka akan ditampilkan




















Perlu diketahui bahwa script javascript berjalan pada sisi client (client side) sehingga
sangat mudah untuk dimanipulasi dan direkayasa.


LATIHAN !

Buatlah program sederhana menggunakan JavaScript yang dapat menampilkan message
alert “maaf, anda tidak berhak mengakses halaman ini !” ketika ditampilkan di browser.






















Modul Praktikum Pemrograman Internet
28
Chapter 2
## Menonaktifkan Klik Kanan Pada Mouse ##

Terkadang seorang developer menginginkan halaman web yang buatnya tidak bisa
dengan mudah dilihat source html atau propertiesnya, salah satu cara sederhana adalah
dengan menonaktifkan right click (klik kanan) pada mouse. Berikut source programnya :











Modul Praktikum Pemrograman Internet
29
Chapter 3
## Operasi Matematis pada JavaScript ##

JavaScript dapat digunakan dalam proses perhitungan matematis sederhana, seperti pada
contoh berikut ini :


·html·
·SCFÌPT language=¨JavascrIpt¨·
·!··
var a = 12;
var b = 4;
functIon PerkalIan0engan2(b) [
var a = b * 2;
return a;
]
document.wrIte(¨0ua kalI darI ¨,b,¨ adalah ¨,PerkalIan0engan2(b), "¦");
document.wrIte(¨NIlaI darI a adalah¨,a);
// ···
·/SCFÌPT·
<html>














Chapter 4
## Pembuatan scroll vertical menggunakan JavaScript ##


<html>

<head>
<title>Check it out</title>
<script LANGUAGE="JavaScript">

<!-- Begin
function scrollit() {
for (I=1; I<=750; I++){
parent.scroll(1,I)
}
}
// End -->
</script>
</head>


Modul Praktikum Pemrograman Internet
30
<body>

<form>
<p><input type="button" value="Scroll Page" onClick="scrollit()"></p>
</form>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>Check it out</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>Check it out</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>Scroll Here </p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>Scroll Here</p>
</body>
</html>



Modul Praktikum Pemrograman Internet
31
Case Study : Program Aplikasi Persewaan Mobil

Program aplikasi ini memiliki 4 menu utama yaitu :

1. Daftar Mobil
Pada bagian ini akan ditampilkan semua data-data mobil yang dimiliki perusahaan
mulai dari jenis, merek, warna, tahun, dan plat nomor.

2. Mobil Baru
Bagian ini berfungsi untuk memasukkan data-data mobil baru guna untuk
persewaan

3. Transaksi Sewa
Bagian ini berfungsi untuk menampilkan informasi mengenai transaksi sewa
mobil

4. Laporan
Bagian ini digunakan sebagai form untuk mengetahui laporan mengenai transaksi
sewa mobil.

Menyiapkan Folder Gambar
Folder gambar digunakan untuk menyimpan gambar secara default.

Menyiapkan Database
Buat database baru dengan nama rentalmobil dengan mengetikkan perintah :

create database rentalmobil;
use rentalmobil;

Selanjutnya buat 2 tabel dalam database tersebut yaitu :

1. Tabel daftarmobil


CREATE TABLE daftarmobil (
id int(3) NOT NULL auto_increment,
jenis varchar(25) NOT NULL default '',
merk varchar(25) NOT NULL default '',
warna varchar(25) NOT NULL default '',
tahun varchar(25) NOT NULL default '',
platnomor varchar(25) NOT NULL default '',
PRIMARY KEY (id)
) TYPE=MyISAM;

INSERT INTO daftarmobil VALUES (1, 'mobil keluarga', 'Toyota Avanza', 'Silver',
'2004', 'W3388KA');
INSERT INTO daftarmobil VALUES (2, 'mobil keluarga', 'Kijang Innova', 'Silver',
'2004', 'L2345NA');



Modul Praktikum Pemrograman Internet
32
2. Tabel laporan_sewa


CREATE TABLE laporan_sewa (
id int(3) NOT NULL default '0',
penyewa varchar(25) NOT NULL default '',
lamasewa varchar(25) NOT NULL default '',
biaya varchar(25) NOT NULL default '',
tglpinjam varchar(25) NOT NULL default '',
tglkembali varchar(25) NOT NULL default '',
identitas varchar(25) NOT NULL default ''
) TYPE=MyISAM;

INSERT INTO laporan_sewa VALUES (2, 'Amin', '2 Hari', '500000', '12 April 2005', '14
April 2005', '17799989');
INSERT INTO laporan_sewa VALUES (4, 'Dedi G', '2 Bulan', '3000000', '1 Juni 2005', '1
Juli 2005', '2203120982');


1. Membuat file index.html




Modul Praktikum Pemrograman Internet
33

2. Membuat file daftarmobil.php


<HTML><HEAD><TITLE>Untitled-2</TITLE>
</HEAD>
<BODY bgColor=#860901 leftMargin=0 topMargin=0><P>&nbsp;</P>
<P>&nbsp;</P>
<CENTER>
<TABLE cellSpacing=0 cellPadding=0 width=640 border=0>
<TBODY>
<TR>
<TD colSpan=2><IMG height=49 src="gambar/index_01.jpg"
width=100></TD>
<TD><a href="daftarmobil.php"><IMG height=49
src="gambar/index_02.jpg" border=0 width=109></a></TD>
<TD><a href="mobilbaru.html"><IMG height=49
src="gambar/index_03.jpg" border=0 width=104></a></TD>
<TD><a href="transaksisewa.php"><IMG height=49
src="gambar/index_04.jpg" border=0 width=129></a></TD>
<TD><a href="laporan.php"><IMG height=49 src="gambar/index_05.jpg"
width=97 border=0></a></TD>
<TD colSpan=2><IMG height=49 src="gambar/index_06.jpg"
width=101></TD></TR>
<TR>
<TD><IMG height=288 src="gambar/index_07.jpg"
width=58></TD>
<TD background=gambar/mburi.jpg colSpan=6 valign="top">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%"
height="62">
<tr>
<td width="100%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="100%" height="11">
<div align="center">
<center>
<table border="0" width="100%" height="31" cellspacing="3">
<tr>
<td width="17%" height="31" bgcolor="#460200"
align="center"><b>
<font color="#FFFFFF" face="Verdana" size="2">No
Polisi</font></b></td>
<td width="24%" height="31" bgcolor="#460200"
align="center"><b>
<font face="Verdana" size="2"

Modul Praktikum Pemrograman Internet
34
color="#FFFFFF">Jenis</font></b></td>
<td width="26%" height="31" bgcolor="#460200"
align="center"><b>
<font face="Verdana" size="2"
color="#FFFFFF">Merk</font></b></td>
<td width="15%" height="31" bgcolor="#460200"
align="center"><b>
<font face="Verdana" size="2"
color="#FFFFFF">Tahun</font></b></td>
<td width="18%" height="31" bgcolor="#460200"
align="center"><b>
<font face="Verdana" size="2"
color="#FFFFFF">Warna</font></b></td>
</tr>
<?
$dbh = mysql_connect("localhost","root","");
mysql_select_db("rentalmobil",$dbh);
$query = "SELECT * FROM daftarmobil";
$result=mysql_query($query) or die("Wah error nih!");

if ($result) {
while ($r = mysql_fetch_array($result)) {
extract ($r);
echo "

<tr>
<td width=17% height=31 align=center><font face=Verdana
size=2 color=#FFFFFF>$platnomor</td>
<td width=24% height=31 align=center><font face=Verdana
size=2 color=#FFFFFF>$jenis</td>
<td width=26% height=31 align=center><font face=Verdana
size=2 color=#FFFFFF>$merk</td>
<td width=15% height=31 align=center><font face=Verdana
size=2 color=#FFFFFF>$tahun</td>
<td width=18% height=31 align=center><font face=Verdana
size=2 color=#FFFFFF>$warna</td>
</tr>
";

}
}

MYSQL_CLOSE();
?>

</table>
</center>
</div>
</td>
</tr>
</table>
</center>
</div>
</TD>
<TD><IMG height=288 src="gambar/index_09.jpg"
width=54></TD></TR>
<TR>
<TD colSpan=8><IMG height=44 src="gambar/index_10.jpg"
width=640></TD></TR>
<TR>
<TD><IMG height=1 src="gambar/spacer.gif" width=58></TD>

Modul Praktikum Pemrograman Internet
35



3. Membuat file mobilbaru.html


<HTML><HEAD><TITLE>Untitled-2</TITLE>
</HEAD>
<BODY bgColor=#860901 leftMargin=0 topMargin=0><P>&nbsp;</P>
<P>&nbsp;</P>
<CENTER>
<TABLE cellSpacing=0 cellPadding=0 width=640 border=0>
<TBODY>
<TR>
<TD colSpan=2><IMG height=49 src="gambar/index_01.jpg"
width=100></TD>
<TD><a href="daftarmobil.php"><IMG height=49
src="gambar/index_02.jpg" border=0 width=109></a></TD>
<TD><a href="mobilbaru.html"><IMG height=49
src="gambar/index_03.jpg" border=0 width=104></a></TD>
<TD><a href="transaksisewa.php"><IMG height=49
src="gambar/index_04.jpg" border=0 width=129></a></TD>
<TD><a href="laporan.php"><IMG height=49 src="gambar/index_05.jpg"
width=97 border=0></a></TD>
<TD colSpan=2><IMG height=49 src="gambar/index_06.jpg"
width=101></TD></TR>
<TR>
<TD><IMG height=288 src="gambar/index_07.jpg"
width=58></TD>
<TD background=gambar/mburi.jpg colSpan=6 valign="top">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%"
height="62">
<tr>
<td width="100%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="100%" height="11">
<div align="center">
<center>

<table border="0" style="border-collapse: collapse"
bordercolor="#111111" width="80%" id="AutoNumber1" cellspacing="0"
height="166">
<form method=post action=mobilbaru_proses.php>
<tr>
<td width="100%" colspan="2" height="28">
&nbsp;</td>
</tr>
<tr>
<td width="100%" colspan="2" height="28"

Modul Praktikum Pemrograman Internet
36
bgcolor="#460200">
<p align="center"><b>
<font face="Verdana" size="2" color="#FFFFFF">Masukkan
Mobil
Baru</font></b></td>
</tr>
<tr>
<td width="63%" align="right" height="10"
colspan="2"></td>
</tr>
<tr>
<td width="22%" align="right" height="25">
<b><font face="Verdana" size="2" color="#FFFFFF">Jenis
:</font></b></td>
<td width="41%" align="left" height="25">
<font face="Verdana" color="#FFFFFF"><b><font
size="2">&nbsp;
</font>
<input type="text" name="jenis" size="25"
style="border: 1px solid #460200; padding-left: 4; padding-right: 4;
padding-top: 1; padding-bottom: 1; background-color:
#860901"></b></font></td>
</tr>
<tr>
<td width="22%" align="right" height="25">
<b><font face="Verdana" size="2" color="#FFFFFF">Merk
:</font></b></td>
<td width="41%" align="left" height="25">
<font face="Verdana" color="#FFFFFF"><b><font
size="2">&nbsp;
</font>
<input type="text" name="merk" size="25"
style="border: 1px solid #460200; padding-left: 4; padding-right: 4;
padding-top: 1; padding-bottom: 1; background-color:
#860901"></b></font></td>
</tr>
<tr>
<td width="22%" align="right" height="25">
<b><font face="Verdana" size="2" color="#FFFFFF">Warna
:</font></b></td>
<td width="41%" align="left" height="25">
<font face="Verdana" color="#FFFFFF"><b><font
size="2">&nbsp;
</font>
<input type="text" name="warna" size="25"
style="border: 1px solid #460200; padding-left: 4; padding-right: 4;
padding-top: 1; padding-bottom: 1; background-color:
#860901"></b></font></td>
</tr>
<tr>
<td width="22%" align="right" height="25">
<b><font face="Verdana" size="2" color="#FFFFFF">Tahun
:</font></b></td>
<td width="41%" align="left" height="25">
<font face="Verdana" color="#FFFFFF"><b><font
size="2">&nbsp;
</font>
<input type="text" name="tahun" size="25"
style="border: 1px solid #460200; padding-left: 4; padding-right: 4;
padding-top: 1; padding-bottom: 1; background-color:
#860901"></b></font></td>

Modul Praktikum Pemrograman Internet
37
</tr>
<tr>
<td width="22%" align="right" height="25">
<b><font face="Verdana" size="2" color="#FFFFFF">No
Polisi :</font></b></td>
<td width="41%" align="left" height="25">
<font face="Verdana" color="#FFFFFF"><b><font
size="2">&nbsp;
</font>
<input type="text" name="platnomor" size="25"
style="border: 1px solid #460200; padding-left: 4; padding-right: 4;
padding-top: 1; padding-bottom: 1; background-color:
#860901"></b></font></td>
</tr>

<tr>
<td width="22%" align="right" height="11"></td>
<td width="41%" align="left" height="11">
<font color="#FFFFFF"><b><font face="Verdana"
size="2">&nbsp;
</font></b>
<input type="submit" value="Proses" style="font-
family: Verdana; color: #FFFFFF; font-weight: bold; font-size: 10pt;
border: 1px solid #860901; padding-left: 4; padding-right: 4; padding-
top: 1; padding-bottom: 1; background-color: #460200"><b><font
face="Verdana" size="2">&nbsp;
</font></b>
<input type="reset" value="Hapus" style="font-family:
Verdana; color: #FFFFFF; font-weight: bold; font-size: 10pt; border: 1px
solid #860901; padding-left: 4; padding-right: 4; padding-top: 1;
padding-bottom: 1; background-color: #460200"></font></td>
</tr>
</form>
</table>

</center>
</div>
</td>
</tr>
</table>
</center>
</div>
</TD>
<TD><IMG height=288 src="gambar/index_09.jpg"
width=54></TD></TR>
<TR>
<TD colSpan=8><IMG height=44 src="gambar/index_10.jpg"
width=640></TD></TR>
<TR>
<TD><IMG height=1 src="gambar/spacer.gif" width=58></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=42></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=109></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=104></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=129></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=97></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=47></TD>
<TD><IMG height=1 src="gambar/spacer.gif"
width=54></TD></TR></TBODY></TABLE></CENTER></BODY></HTML>



Modul Praktikum Pemrograman Internet
38
4. Membuat file mobilbaru_proses.php


<?php
$dbh = mysql_connect("localhost","root","");
mysql_select_db("rentalmobil",$dbh);

mysql_query("INSERT INTO daftarmobil VALUES
('0','$jenis','$merk','$warna','$tahun','$platnomor')");
header ("Location: daftarmobil.php");
mysql_close($dbh);
exit;
?>


5. Membuat file transaksisewa.php


<HTML><HEAD><TITLE>Untitled-2</TITLE>
</HEAD>
<BODY bgColor=#860901 leftMargin=0 topMargin=0><P>&nbsp;</P>
<P>&nbsp;</P>
<CENTER>
<TABLE cellSpacing=0 cellPadding=0 width=640 border=0>
<TBODY>
<TR>
<TD colSpan=2><IMG height=49 src="gambar/index_01.jpg"
width=100></TD>
<TD><a href="daftarmobil.php"><IMG height=49
src="gambar/index_02.jpg" border=0 width=109></a></TD>
<TD><a href="mobilbaru.html"><IMG height=49
src="gambar/index_03.jpg" border=0 width=104></a></TD>
<TD><a href="transaksisewa.php"><IMG height=49
src="gambar/index_04.jpg" border=0 width=129></a></TD>
<TD><a href="laporan.php"><IMG height=49 src="gambar/index_05.jpg"
width=97 border=0></a></TD>
<TD colSpan=2><IMG height=49 src="gambar/index_06.jpg"
width=101></TD></TR>
<TR>
<TD><IMG height=288 src="gambar/index_07.jpg"
width=58></TD>
<TD background=gambar/mburi.jpg colSpan=6 valign="top">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%"
height="62">
<tr>
<td width="100%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="100%" height="11">
<div align="center">
<center>

<table border="0" style="border-collapse: collapse"
bordercolor="#111111" width="456" id="AutoNumber1" cellspacing="0"
height="125">
<tr>
<td width="454" colspan="2" height="1">

Modul Praktikum Pemrograman Internet
39
<p align="center"><b>
<font face="Verdana" size="2" color="#648267">
&nbsp;</font></b></td>
</tr>

<tr>
<td width="452" align="right" bgcolor="#460200"
height="16" colspan="2">
<p align="center"><b>
<font face="Verdana" size="2" color="#FFFFFF">++
Transaksi Peminjaman Mobil ++</font></b></td>
</tr>
<form method=post action=transaksisewa_proses.php>
<tr>
<td width="164" align="right" height="21">
<b><font face="Verdana" size="2" color="#FFFFFF">Nama
Penyewa :</font></b></td>
<td width="288" align="left" height="21">
<font color="#FFFFFF">&nbsp;
<input type="text" name="penyewa" size="28"
style="border: 1px solid #460200; padding-left: 4; padding-right: 4;
padding-top: 1; padding-bottom: 1; background-color: #860901;
color:#FFFFFF; font-family:Verdana; font-size:10pt"></font></td>
</tr>
<tr>
<td width="164" align="right" height="21">
<b><font face="Verdana" size="2"
color="#FFFFFF">Identitas (KTP) :</font></b></td>
<td width="288" align="left" height="21">
<font color="#FFFFFF">&nbsp;
<input type="text" name="identitas" size="28"
style="border: 1px solid #460200; padding-left: 4; padding-right: 4;
padding-top: 1; padding-bottom: 1; background-color: #860901;
color:#FFFFFF; font-family:Verdana; font-size:10pt"></font></td>

</td>

<tr>
<td width="164" align="right" height="21">
<b><font face="Verdana" size="2" color="#FFFFFF">Mobil
Yang Disewa:</font></b></td>

<td width="288" align="left" height="21">
<font color="#FFFFFF">&nbsp;
<select size="1" name="mobil"
style="border:1px solid #460200; background-color: #860901; font-
family:Verdana; color:#FFFFFF; ">


<?
$dbh = mysql_connect("localhost","root","");
mysql_select_db("rentalmobil",$dbh);
$query = "SELECT * FROM daftarmobil";
$result=mysql_query($query) or die("Wah error nih!");

if ($result) {
while ($r = mysql_fetch_array($result)) {
extract ($r);

echo "<option value=$id>$merk [$platnomor]</option>";
}

Modul Praktikum Pemrograman Internet
40
echo "</select>";
echo "</td></tr>";

}

MYSQL_CLOSE();
?>


</font>


</td></tr>

<tr>
<td width="164" align="right" height="21">
<b><font face="Verdana" size="2" color="#FFFFFF">Lama
Sewa:</font></b></td>
<td width="288" align="left" height="21">
<font color="#FFFFFF">&nbsp;
<input type="text" name="tanggal1" size="1"
style="border: 1px solid #460200; padding-left: 4; padding-right: 4;
padding-top: 1; padding-bottom: 1; background-color: #860901;
color:#FFFFFF; font-family:Verdana; font-size:10pt">

<select size="1" name="waktu1" style="padding:0;
background-color: #860901; font-family:Verdana; color:#FFFFFF; ">
<option>Jam</option>
<option>Hari</option>
<option>Minggu</option>
<option>Bulan</option>

</select> </font>
</td>
</tr>
<tr>
<td width="164" align="right" height="21">
<b><font face="Verdana" size="2"
color="#FFFFFF">Tanggal Pinjam :</font></b></td>
<td width="288" align="left" height="21">
<font color="#FFFFFF">&nbsp;
<input type="text" name="tanggal2" size="1"
style="border: 1px solid #460200; padding-left: 4; padding-right: 4;
padding-top: 1; padding-bottom: 1; background-color: #860901;
color:#FFFFFF; font-family:Verdana; font-size:10pt">

<select size="1" name="bulan2" style="padding:0;
background-color: #860901; font-family:Verdana; color:#FFFFFF; ">
<option>Januari</option>
<option>Februari</option>
<option>Maret</option>
<option>April</option>
<option>Mei</option>
<option>Juni</option>
<option>Juli</option>
<option>Agustus</option>
<option>September</option>
<option>Oktober</option>
<option>November</option>
<option>Desember</option>
</select><select size="1" name="tahun2"

Modul Praktikum Pemrograman Internet
41
style="border:1px solid #460200; background-color: #860901; font-
family:Verdana; color:#FFFFFF; padding-left:4; padding-right:4; padding-
top:1; padding-bottom:1">
<option>2005</option>
<option>2006</option>
<option>2007</option>
<option>2008</option>
<option>2009</option>
<option>2010</option>
</select></font></td>
</tr>
<tr>
<td width="164" align="right" height="21">
<b><font face="Verdana" size="2"
color="#FFFFFF">Tanggal
Kembali :</font></b></td>
<td width="288" align="left" height="21">
<font color="#FFFFFF">&nbsp;
<input type="text" name="tanggal3" size="1"
style="border: 1px solid #460200; padding-left: 4; padding-right: 4;
padding-top: 1; padding-bottom: 1; background-color: #860901;
color:#FFFFFF; font-family:Verdana; font-size:10pt">

<select size="1" name="bulan3" style="padding:0;
background-color: #860901; font-family:Verdana; color:#FFFFFF; ">
<option>Januari</option>
<option>Februari</option>
<option>Maret</option>
<option>April</option>
<option>Mei</option>
<option>Juni</option>
<option>Juli</option>
<option>Agustus</option>
<option>September</option>
<option>Oktober</option>
<option>November</option>
<option>Desember</option>
</select><select size="1" name="tahun3"
style="border:1px solid #460200; background-color: #860901; font-
family:Verdana; color:#FFFFFF; padding-left:4; padding-right:4; padding-
top:1; padding-bottom:1">
<option>2005</option>
<option>2006</option>
<option>2007</option>
<option>2008</option>
<option>2009</option>
<option>2010</option>
</select></font></td>
</tr>


<tr>
<td width="164" align="right" height="11">
<b><font face="Verdana" size="2" color="#FFFFFF">Biaya
Sewa
</font></b><font color="#FFFFFF"><b>
<font size="2" face="Verdana">(Rp)
</font></b></font><b>
<font face="Verdana" size="2"
color="#FFFFFF">:</font></b></td>
<td width="288" align="left" height="11">

Modul Praktikum Pemrograman Internet
42
<font color="#FFFFFF"><b><font size="2"
face="Verdana">&nbsp;</font></b>
<input type="text" name="biaya" size="28"
style="border: 1px solid #460200; padding-left: 4; padding-right: 4;
padding-top: 1; padding-bottom: 1; background-color: #860901;
color:#FFFFFF; font-family:Verdana; font-size:10pt"></font></td>
</tr>


<tr>
<td width="22%" align="right" height="11"></td>
<td width="41%" align="left" height="11">
<font color="#FFFFFF"><b><font face="Verdana"
size="2">&nbsp;
</font></b>
<input type="submit" value="Proses" style="font-
family: Verdana; color: #FFFFFF; font-weight: bold; font-size: 10pt;
border: 1px solid #860901; padding-left: 4; padding-right: 4; padding-
top: 1; padding-bottom: 1; background-color: #460200"><b><font
face="Verdana" size="2">&nbsp;
</font></b>
<input type="reset" value="Hapus" style="font-family:
Verdana; color: #FFFFFF; font-weight: bold; font-size: 10pt; border: 1px
solid #860901; padding-left: 4; padding-right: 4; padding-top: 1;
padding-bottom: 1; background-color: #460200"></font></td>
</tr>
</form>
</table>

</center>
</div>
</td>
</tr>
</table>
</center>
</div>
</TD>
<TD><IMG height=288 src="gambar/index_09.jpg"
width=54></TD></TR>
<TR>
<TD colSpan=8><IMG height=44 src="gambar/index_10.jpg"
width=640></TD></TR>
<TR>
<TD><IMG height=1 src="gambar/spacer.gif" width=58></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=42></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=109></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=104></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=129></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=97></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=47></TD>
<TD><IMG height=1 src="gambar/spacer.gif"
width=54></TD></TR></TBODY></TABLE></CENTER></BODY></HTML>








Modul Praktikum Pemrograman Internet
43
6. Membuat file transaksisewa_proses.php


<?php

$dbh = mysql_connect("localhost","root","");
mysql_select_db("rentalmobil",$dbh);

$lamasewa="$tanggal1 $waktu1";
$tglpinjam="$tanggal2 $bulan2 $tahun2";
$tglkembali="$tanggal3 $bulan3 $tahun3";

mysql_query("INSERT into laporan_sewa values
('$mobil','$penyewa','$lamasewa','$biaya','$tglpinjam','$tglkembali','$identitas')");
header ("Location: laporan.php");

?>


7. Membuat file laporan.php


<HTML><HEAD><TITLE>Untitled-2</TITLE>
</HEAD>
<BODY bgColor=#860901 leftMargin=0 topMargin=0><P>&nbsp;</P>
<P>&nbsp;</P>
<CENTER>
<TABLE cellSpacing=0 cellPadding=0 width=640 border=0>
<TBODY>
<TR>
<TR>
<TD colSpan=2><IMG height=49 src="gambar/index_01.jpg"
width=100></TD>
<TD><a href="daftarmobil.php"><IMG height=49
src="gambar/index_02.jpg" border=0 width=109></a></TD>
<TD><a href="mobilbaru.html"><IMG height=49
src="gambar/index_03.jpg" border=0 width=104></a></TD>
<TD><a href="transaksisewa.php"><IMG height=49
src="gambar/index_04.jpg" border=0 width=129></a></TD>
<TD><a href="laporan.php"><IMG height=49 src="gambar/index_05.jpg"
width=97 border=0></a></TD>
<TD colSpan=2><IMG height=49 src="gambar/index_06.jpg"
width=101></TD></TR>
<TR>
<TD><IMG height=288 src="gambar/index_07.jpg"
width=58></TD>
<TD background=gambar/mburi.jpg colSpan=6 valign="top">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" width="100%"
height="62">
<tr>
<td width="100%" height="19">&nbsp;</td>
</tr>
<tr>
<td width="100%" height="11">
<div align="center">
<center>
<table border="0" width="100%" height="31" cellspacing="3">

Modul Praktikum Pemrograman Internet
44
<tr>
<td width="17%" height="31" bgcolor="#460200"
align="center"><b>
<font color="#FFFFFF" face="Verdana"
size="2">Penyewa</font></b></td>
<td width="17%" height="31" bgcolor="#460200"
align="center"><b>
<font face="Verdana" size="2" color="#FFFFFF">No
KTP</font></b></td>
<td width="15%" height="31" bgcolor="#460200"
align="center"><b>
<font face="Verdana" size="2" color="#FFFFFF">Lama
Sewa</font></b></td>
<td width="20%" height="31" bgcolor="#460200"
align="center"><b>
<font face="Verdana" size="2" color="#FFFFFF">Tanggal
Pinjam</font></b></td>
<td width="20%" height="31" bgcolor="#460200"
align="center"><b>
<font face="Verdana" size="2" color="#FFFFFF">Tanggal
Kembali</font></b></td>
<td width="18%" height="31" bgcolor="#460200"
align="center"><b>
<font face="Verdana" size="2"
color="#FFFFFF">Biaya(Rp)</font></b></td>
</tr>
<?
$dbh = mysql_connect("localhost","root","");
mysql_select_db("rentalmobil",$dbh);
$query = "SELECT * FROM laporan_sewa";
$result=mysql_query($query) or die("Wah error nih!");

if ($result) {
while ($r = mysql_fetch_array($result)) {
extract ($r);
echo "

<tr>
<td width=17% height=31 align=center><font face=Verdana
size=2 color=#FFFFFF>$penyewa</td>
<td width=17% height=31 align=center><font face=Verdana
size=2 color=#FFFFFF>$identitas</td>
<td width=15% height=31 align=center><font face=Verdana
size=2 color=#FFFFFF>$lamasewa</td>
<td width=20% height=31 align=center><font face=Verdana
size=2 color=#FFFFFF>$tglpinjam</td>
<td width=20% height=31 align=center><font face=Verdana
size=2 color=#FFFFFF>$tglkembali</td>
<td width=18% height=31 align=center><font face=Verdana
size=2 color=#FFFFFF>$biaya</td>
</tr>
";

}
}

MYSQL_CLOSE();
?>

</table>
</center>

Modul Praktikum Pemrograman Internet
45
</div>
</td>
</tr>
</table>
</center>
</div>
</TD>
<TD><IMG height=288 src="gambar/index_09.jpg"
width=54></TD></TR>
<TR>
<TD colSpan=8><IMG height=44 src="gambar/index_10.jpg"
width=640></TD></TR>
<TR>
<TD><IMG height=1 src="gambar/spacer.gif" width=58></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=42></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=109></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=104></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=129></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=97></TD>
<TD><IMG height=1 src="gambar/spacer.gif" width=47></TD>
<TD><IMG height=1 src="gambar/spacer.gif"
width=54></TD></TR></TBODY></TABLE></CENTER></BODY></HTML>






























Untuk memperoleh file gambar silakan kirim email ke : yatamafeb2005@yahoo.co.id


Modul Praktikum Pemrograman Internet
46
Case Study : Program Aplikasi Online Store

Program aplikasi online store terdiri dari 2 bagian penting yaitu,
1. Bagian pengguna
- file index.php
- file took.php
- file hapus.php
- file kantongbelanja.php
- file kosongkan.php
- file kwitansi.php
- file masukkankantongbelanja.php
- file pesanan_proses.php
- file produk.php
- file tambah.php

2. Bagian Admin
- file categori.php
- file categori_delete.php
- file categori_insert.php
- file categori_update.php
- file index.php
- file isipesanan.php
- file ngisiproduk.php
- file order.php
- file order_search.php
- file pesanan.php
- file product.php
- file product_delete.php
- file product_edit.php
- file product_insert.php
- file produk.php
- file took.php

dan memilki 3 folder yang terdiri dari :
1. Folder admin (untuk menyimpan file-file admin)
2. Folder gambar (untuk menyimpan file-file gambar)
3. Folder inc (untuk menimpan file-file inc)

File inc dibuat tersendiri digunakan untuk keperluan pengaksesan data ke database
MySQL.

Persiapan Database
Buatlah database baru dengan nama tokoku.

create database tokoku ;
use tokoku ;

Selanjutnya buatlah tabel-tabel yang dibutuhkan untuk aplikasi online store berikut ini :



Modul Praktikum Pemrograman Internet
47

CREATE TABLE dollar (
barangID bigint(20) NOT NULL default '0',
harga$ decimal(12,2) NOT NULL default '0.00'
) TYPE=MyISAM;

#
# Dumping data for table `dollar`
#

INSERT INTO dollar VALUES (0, '200.00');
INSERT INTO dollar VALUES (0, '5000.00');
INSERT INTO dollar VALUES (0, '4000.00');
INSERT INTO dollar VALUES (0, '7000.00');
INSERT INTO dollar VALUES (0, '588.00');
INSERT INTO dollar VALUES (0, '5600.00');
INSERT INTO dollar VALUES (0, '678.00');
INSERT INTO dollar VALUES (0, '50.00');
INSERT INTO dollar VALUES (0, '34.00');
INSERT INTO dollar VALUES (0, '453.00');
INSERT INTO dollar VALUES (0, '434.00');
INSERT INTO dollar VALUES (0, '234.00');
INSERT INTO dollar VALUES (0, '5545.00');
INSERT INTO dollar VALUES (0, '656.00');
INSERT INTO dollar VALUES (0, '5654.00');
INSERT INTO dollar VALUES (0, '234.00');
INSERT INTO dollar VALUES (0, '545.00');
INSERT INTO dollar VALUES (0, '333.00');
INSERT INTO dollar VALUES (0, '333.00');
INSERT INTO dollar VALUES (0, '333.00');
INSERT INTO dollar VALUES (0, '333.00');
INSERT INTO dollar VALUES (0, '333.00');
INSERT INTO dollar VALUES (0, '333.00');
INSERT INTO dollar VALUES (0, '333.00');
INSERT INTO dollar VALUES (0, '444.00');
INSERT INTO dollar VALUES (0, '111.00');
INSERT INTO dollar VALUES (0, '149.99');
# --------------------------------------------------------

#
# Table structure for table `items`
#

CREATE TABLE items (
ItemSKU varchar(25) NOT NULL default '',
namabarang varchar(100) NOT NULL default '',
deskripsibarang mediumtext NOT NULL,
hargabarang decimal(12,2) NOT NULL default '0.00',
kategori bigint(20) NOT NULL default '0',
gambar varchar(50) NOT NULL default '',

Modul Praktikum Pemrograman Internet
48
barangID bigint(20) NOT NULL auto_increment,
PRIMARY KEY (barangID)
) TYPE=MyISAM;

#
# Dumping data for table `items`
#

INSERT INTO items VALUES ('N05', 'Pavilion ze5279 P4/2.4 512MB/40GB Combo
15', 'HP', '245.00', 2, 'hp5', 1);
INSERT INTO items VALUES ('02', 'Athlon 64 3200+, 1600MHz Bus, Socket 754
Processor', 'AMD', '943.00', 5, 'amd1.gif', 2);
INSERT INTO items VALUES ('03', 'Pentium 4, 2.80cGHz, 800MHz Bus, Socket 478
Processor with Hyper-Threading', 'Intel', '813.00', 5, 'intel1.gif', 3);
INSERT INTO items VALUES ('05', 'Celeron, 2.60GHz, 400MHz Bus, Socket 478
Processor', 'Intel', '363.00', 5, 'intel2', 5);
INSERT INTO items VALUES ('07', 'Bundle Sony VAIO RZ46G Minitower Intel
Pentium 4 Processor', 'Sony', '953.00', 1, 'sony1', 7);
INSERT INTO items VALUES ('', 'Athlon 64 3200 , 1600MHz Bus, Socket 754
Processor', 'AMD', '334.00', 0, '', 32);
INSERT INTO items VALUES ('10', 'Evo XW4100 P4/2.4 256Mb/40Gb CD-ROM XPP
NVIDIA', 'HP', '233.00', 1, 'hp2', 10);
INSERT INTO items VALUES ('11', 'PAVILION 735n AXP2600+ 512MB/80GB
DVD+RW/+R 48XCD PS/2', 'HP', '555.00', 1, 'hp3', 11);
INSERT INTO items VALUES ('N03', 'PORTEGE 3500 PIII M/1.33 256MB/40GB
12TFT 100BT TABLET PC XP', 'Toshiba', '567.00', 2, 'toshiba1', 14);
INSERT INTO items VALUES ('N04', 'Tablet PC TC1000 CRUSOE/1GHz
256Mb/30Gb 10.4', 'HP', '658.00', 2, 'hp4', 15);
INSERT INTO items VALUES ('s02', 'Evo Thin Client T30 300MHz 32MB Flash/
64MB Win CE', 'HP', '564.00', 3, 'hp7', 18);
INSERT INTO items VALUES ('s07', 'HP T5700 1GHz 192Mb IDE Flash / 256Mb ATI
Win XPe', 'HP', '759.00', 3, 'hp8', 23);
INSERT INTO items VALUES ('a01', 'POWERMAC G4/1.25GHz 256/80GB COMBO
R9000P GIGE 56K OS10.2/9', 'Apple', '263.00', 4, 'apple1', 24);
INSERT INTO items VALUES ('', 'Athlon 64 3200 , 1600MHz Bus, Socket 754
Processor', 'AMD', '444.00', 0, '', 33);
INSERT INTO items VALUES ('HD1', 'Barracuda 160GB, 7200RPM, Internal ATA/100
Hard Drive', 'Seagate', '189.99', 8, 'seagate1', 27);
INSERT INTO items VALUES ('HD2', '250GB, 7200RPM, Internal ATA/133 Hard
Drive', 'Maxtor', '264.99', 8, 'maxtor1', 28);
INSERT INTO items VALUES ('DH4', 'Caviar 20GB, 7200RPM, Internal ATA/100
Hard Drive', 'Western Digital', '59.20', 8, '7add7ab1-fadc-11d5-a0fa-00805fbbb715.gif',
30);
INSERT INTO items VALUES ('', 'Athlon 64 3200 , 1600MHz Bus, Socket 754
Processor', 'AMD', '444.00', 0, '', 34);
INSERT INTO items VALUES ('', 'POWERMAC G4/1.25GHz 256/80GB COMBO
R9000P GIGE 56K OS10.2/9', 'Apple', '444.00', 0, '', 35);
INSERT INTO items VALUES ('', 'HP T5700 1GHz 192Mb IDE Flash / 256Mb ATI
Win XPe', 'HP', '333.00', 0, '', 36);
# --------------------------------------------------------

Modul Praktikum Pemrograman Internet
49

#
# Table structure for table `kantongbelanja`
#

CREATE TABLE kantongbelanja (
UserID varchar(100) NOT NULL default '',
barangID varchar(25) NOT NULL default '',
jumlahbarang int(4) NOT NULL default '0',
tanggal varchar(100) NOT NULL default '',
kantongbelanjaID bigint(20) NOT NULL auto_increment,
PRIMARY KEY (kantongbelanjaID)
) TYPE=MyISAM;

#
# Dumping data for table `kantongbelanja`
#

INSERT INTO kantongbelanja VALUES ('20031206020121127.0.0.1', '22', 1,
'2003:339:2003-12-06', 42);
INSERT INTO kantongbelanja VALUES ('20031206020121127.0.0.1', '24', 43,
'2003:339:2003-12-06', 39);
INSERT INTO kantongbelanja VALUES ('20031206011426127.0.0.1', '31', 1,
'2003:339:2003-12-06', 38);
INSERT INTO kantongbelanja VALUES ('20031206011426127.0.0.1', '7', 1,
'2003:339:2003-12-06', 37);
INSERT INTO kantongbelanja VALUES ('20050418050454127.0.0.1', '7', 1,
'2005:107:2005-04-18', 61);
INSERT INTO kantongbelanja VALUES ('20050416174055127.0.0.1', '27', 1,
'2005:105:2005-04-16', 60);
INSERT INTO kantongbelanja VALUES ('20050416174055127.0.0.1', '7', 1,
'2005:105:2005-04-16', 59);
INSERT INTO kantongbelanja VALUES ('20050414053656127.0.0.1', '24', 1,
'2005:103:2005-04-14', 58);
INSERT INTO kantongbelanja VALUES ('20050412131620127.0.0.1', '3', 1,
'2005:101:2005-04-12', 54);
INSERT INTO kantongbelanja VALUES ('20050412131620127.0.0.1', '28', 1,
'2005:101:2005-04-12', 53);
INSERT INTO kantongbelanja VALUES ('20031211155842127.0.0.1', '2', 1,
'2003:344:2003-12-11', 52);
INSERT INTO kantongbelanja VALUES ('20031207045003127.0.0.1', '10', 1,
'2003:340:2003-12-07', 51);
INSERT INTO kantongbelanja VALUES ('20031206011026127.0.0.1', '24', 1,
'2003:339:2003-12-06', 32);
INSERT INTO kantongbelanja VALUES ('20031206011026127.0.0.1', '3', 2,
'2003:339:2003-12-06', 33);
INSERT INTO kantongbelanja VALUES ('20031206011026127.0.0.1', '27', 1,
'2003:339:2003-12-06', 34);
INSERT INTO kantongbelanja VALUES ('20031206011026127.0.0.1', '14', 1,
'2003:339:2003-12-06', 35);

Modul Praktikum Pemrograman Internet
50
INSERT INTO kantongbelanja VALUES ('20031206011026127.0.0.1', '10', 1,
'2003:339:2003-12-06', 36);
# --------------------------------------------------------

#
# Table structure for table `kategori`
#

CREATE TABLE kategori (
kategori varchar(100) NOT NULL default '',
kategoriID bigint(20) NOT NULL auto_increment,
PRIMARY KEY (kategoriID)
) TYPE=MyISAM;

#
# Dumping data for table `kategori`
#

INSERT INTO kategori VALUES ('Desktop PC', 1);
INSERT INTO kategori VALUES ('Notebook', 2);
INSERT INTO kategori VALUES ('Server', 3);
INSERT INTO kategori VALUES ('Apple Mac', 4);
INSERT INTO kategori VALUES ('Processor', 5);
INSERT INTO kategori VALUES ('Motherboard', 6);
INSERT INTO kategori VALUES ('CDROM', 20);
INSERT INTO kategori VALUES ('Drive & Storage', 8);
INSERT INTO kategori VALUES ('Graphic Adapter', 9);
INSERT INTO kategori VALUES ('Casing', 11);
INSERT INTO kategori VALUES ('Printer', 12);
INSERT INTO kategori VALUES ('Scanner', 13);
INSERT INTO kategori VALUES ('Monitor', 14);
INSERT INTO kategori VALUES ('Handhelds/PDA', 15);
INSERT INTO kategori VALUES ('Accessoris', 16);
INSERT INTO kategori VALUES ('Networking', 17);
# --------------------------------------------------------

#
# Table structure for table `kurs`
#

CREATE TABLE kurs (
kurs decimal(12,2) NOT NULL default '0.00'
) TYPE=MyISAM;

#
# Dumping data for table `kurs`
#

# --------------------------------------------------------


Modul Praktikum Pemrograman Internet
51
#
# Table structure for table `orders`
#

CREATE TABLE orders (
BuyerID bigint(20) NOT NULL default '0',
UserID varchar(100) NOT NULL default '',
date varchar(100) NOT NULL default '',
OrderTotal decimal(12,2) NOT NULL default '0.00',
OrderNumber bigint(20) NOT NULL auto_increment,
PRIMARY KEY (OrderNumber)
) TYPE=MyISAM;

#
# Dumping data for table `orders`
#

INSERT INTO orders VALUES (1, '20031203035008127.0.0.1', '', '0.00', 1);
INSERT INTO orders VALUES (2, '20031205035127127.0.0.1', '', '0.00', 2);
INSERT INTO orders VALUES (3, '20031205042817127.0.0.1', '', '0.00', 3);
INSERT INTO orders VALUES (4, '20031205042926127.0.0.1', '', '0.00', 4);
INSERT INTO orders VALUES (5, '20031205043150127.0.0.1', '', '0.00', 5);
INSERT INTO orders VALUES (6, '20031205043617127.0.0.1', '', '0.00', 6);
INSERT INTO orders VALUES (7, '20031206042345127.0.0.1', '', '0.00', 7);
INSERT INTO orders VALUES (8, '20050412133952127.0.0.1', '', '0.00', 8);
# --------------------------------------------------------

#
# Table structure for table `pembeli`
#

CREATE TABLE pembeli (
nama varchar(100) NOT NULL default '',
alamat1 varchar(100) NOT NULL default '',
kota varchar(100) NOT NULL default '',
propinsi varchar(100) NOT NULL default '',
negara varchar(20) NOT NULL default '',
kodepos varchar(20) NOT NULL default '',
email varchar(100) NOT NULL default '',
telpkantor varchar(100) NOT NULL default '',
telprumah varchar(100) NOT NULL default '',
kontak int(1) NOT NULL default '0',
carabayar varchar(100) NOT NULL default '',
totalorder decimal(12,2) NOT NULL default '0.00',
tanggal varchar(100) NOT NULL default '',
nomororder bigint(20) NOT NULL default '0',
UserID varchar(100) NOT NULL default '',
pembeliID bigint(20) NOT NULL auto_increment,
PRIMARY KEY (pembeliID)
) TYPE=MyISAM;

Modul Praktikum Pemrograman Internet
52

#
# Dumping data for table `pembeli`
#

INSERT INTO pembeli VALUES ('x', 'x', 'x', '', '', '', 'x', '', 'x', 0, '', '0.00', '2003:336:2003-
12-03', 1, '20031203035008127.0.0.1', 1);
INSERT INTO pembeli VALUES ('Dedi Gunawan', 'Puri Perdana K-1 No 8
Banyumanik', 'Semarang', '', '', '', 'aldedi@yahoo.com', '', '08164245942', 0, '', '4329.00',
'2003:338:2003-12-05', 2, '20031205035127127.0.0.1', 2);
INSERT INTO pembeli VALUES ('a', 'a', 'a', '', '', '', 'a', '', 'a', 0, '', '0.00', '2003:338:2003-
12-05', 3, '20031205042817127.0.0.1', 3);
INSERT INTO pembeli VALUES ('s', 's', 's', '', '', '', 's', '', 's', 0, '', '333.00', '2003:338:2003-
12-05', 4, '20031205042926127.0.0.1', 4);
INSERT INTO pembeli VALUES ('c', 'c', 'c', '', '', '', 'c', '', 'c', 0, '', '333.00',
'2003:338:2003-12-05', 5, '20031205043150127.0.0.1', 5);
INSERT INTO pembeli VALUES ('t', 't', 't', '', '', '', 't', '', 't', 0, '', '333.00', '2003:338:2003-
12-05', 6, '20031205043617127.0.0.1', 6);
INSERT INTO pembeli VALUES ('PT. IndoTech Media Network', 'Jl. Telkom Pahlawan
Semarang', 'Semarang', '', '', '', 'marketing@indotech.com', '', '08164245942', 0, '', '333.00',
'2003:339:2003-12-06', 7, '20031206042345127.0.0.1', 7);
INSERT INTO pembeli VALUES ('Dedi Gunawan', 'Puri Perdana K1/08 Banyumanik',
'Semarang', '', '', '', 'aldedi@yahoo.com', '', '024-70151469', 0, '', '2645.00',
'2005:101:2005-04-12', 8, '20050412133952127.0.0.1', 8);
# --------------------------------------------------------

#
# Table structure for table `tandaterima`
#

CREATE TABLE tandaterima (
pembeliID bigint(20) NOT NULL default '0',
UserID varchar(100) NOT NULL default '',
nomororder bigint(20) NOT NULL default '0',
tanggal varchar(100) NOT NULL default '',
barangID bigint(20) NOT NULL default '0',
ItemSKU varchar(25) NOT NULL default '',
namabarang varchar(100) NOT NULL default '',
hargabarang decimal(12,2) NOT NULL default '0.00',
ongkoskirim decimal(12,2) NOT NULL default '0.00',
jumlahbarang int(11) NOT NULL default '0',
Total decimal(12,2) NOT NULL default '0.00'
) TYPE=MyISAM;

#
# Dumping data for table `tandaterima`
#

INSERT INTO tandaterima VALUES (1, '20031203035008127.0.0.1', 1, '2003:336:2003-
12-03', 1, 'n12', 'Toshiba Satelite', '0.00', '1000.00', 1, '0.00');

Modul Praktikum Pemrograman Internet
53
INSERT INTO tandaterima VALUES (2, '20031205035127127.0.0.1', 2, '2003:338:2003-
12-05', 21, 's05', 'IBM eServer x235 Xeon/2.4 256MB/0GB 48XCD Tower', '0.00', '0.00',
1, '0.00');
INSERT INTO tandaterima VALUES (2, '20031205035127127.0.0.1', 2, '2003:338:2003-
12-05', 24, 'a01', 'POWERMAC G4/1.25GHz 256/80GB COMBO R9000P GIGE 56K
OS10.2/9', '333.00', '0.00', 3, '999.00');
INSERT INTO tandaterima VALUES (2, '20031205035127127.0.0.1', 2, '2003:338:2003-
12-05', 3, '03', 'Pentium 4, 2.80cGHz, 800MHz Bus, Socket 478 Processor with Hyper-
Threading', '333.00', '0.00', 10, '3330.00');
INSERT INTO tandaterima VALUES (3, '20031205042817127.0.0.1', 3, '2003:338:2003-
12-05', 13, 'N02', 'ACER AS2002LCI CENT/1.5MHZ 512MB/40GB COMBO
15.4"WIDE XPH', '0.00', '0.00', 1, '0.00');
INSERT INTO tandaterima VALUES (4, '20031205042926127.0.0.1', 4, '2003:338:2003-
12-05', 23, 's07', 'HP T5700 1GHz 192Mb IDE Flash / 256Mb ATI Win XPe', '333.00',
'0.00', 1, '333.00');
INSERT INTO tandaterima VALUES (5, '20031205043150127.0.0.1', 5, '2003:338:2003-
12-05', 24, 'a01', 'POWERMAC G4/1.25GHz 256/80GB COMBO R9000P GIGE 56K
OS10.2/9', '333.00', '0.00', 1, '333.00');
INSERT INTO tandaterima VALUES (6, '20031205043617127.0.0.1', 6, '2003:338:2003-
12-05', 8, '08', 'IBM Thinkcentre A50P P4/2.4 256M/40GB CDRW XPH TWR', '333.00',
'0.00', 1, '333.00');
INSERT INTO tandaterima VALUES (7, '20031206042345127.0.0.1', 7, '2003:339:2003-
12-06', 13, 'N02', 'ACER AS2002LCI CENT/1.5MHZ 512MB/40GB COMBO
15.4"WIDE XPH', '0.00', '0.00', 1, '0.00');
INSERT INTO tandaterima VALUES (7, '20031206042345127.0.0.1', 7, '2003:339:2003-
12-06', 7, '07', 'Bundle Sony VAIO RZ46G Minitower Intel Pentium 4 Processor',
'333.00', '0.00', 1, '333.00');
INSERT INTO tandaterima VALUES (8, '20050412133952127.0.0.1', 8, '2005:101:2005-
04-12', 2, '02', 'Athlon 64 3200+, 1600MHz Bus, Socket 754 Processor', '943.00', '0.00', 2,
'1886.00');
INSERT INTO tandaterima VALUES (8, '20050412133952127.0.0.1', 8, '2005:101:2005-
04-12', 23, 's07', 'HP T5700 1GHz 192Mb IDE Flash / 256Mb ATI Win XPe', '759.00',
'0.00', 1, '759.00');
# --------------------------------------------------------

#
# Table structure for table `users`
#

CREATE TABLE users (
User varchar(100) NOT NULL default '',
tanggal int(4) NOT NULL default '0'
) TYPE=MyISAM;

#
# Dumping data for table `users`
#

INSERT INTO users VALUES ('20031206074817127.0.0.1', 339);
INSERT INTO users VALUES ('20031206074815127.0.0.1', 339);

Modul Praktikum Pemrograman Internet
54
INSERT INTO users VALUES ('20031206074812127.0.0.1', 339);
INSERT INTO users VALUES ('20031206074801127.0.0.1', 339);
INSERT INTO users VALUES ('20031206074638127.0.0.1', 339);
INSERT INTO users VALUES ('20031206074618127.0.0.1', 339);
INSERT INTO users VALUES ('20031206074617127.0.0.1', 339);
INSERT INTO users VALUES ('20031206074539127.0.0.1', 339);
INSERT INTO users VALUES ('20031206074518127.0.0.1', 339);
INSERT INTO users VALUES ('20031206074516127.0.0.1', 339);
INSERT INTO users VALUES ('20031206074434127.0.0.1', 339);
INSERT INTO users VALUES ('20031206074401127.0.0.1', 339);
INSERT INTO users VALUES ('20031206053338127.0.0.1', 339);
INSERT INTO users VALUES ('20031206053330127.0.0.1', 339);
INSERT INTO users VALUES ('20031206051358127.0.0.1', 339);
INSERT INTO users VALUES ('20031206050823127.0.0.1', 339);
INSERT INTO users VALUES ('20031206050817127.0.0.1', 339);
INSERT INTO users VALUES ('20031206020512127.0.0.1', 339);
INSERT INTO users VALUES ('20031206020512127.0.0.1', 339);
INSERT INTO users VALUES ('20031206020121127.0.0.1', 339);
INSERT INTO users VALUES ('20031206011426127.0.0.1', 339);
INSERT INTO users VALUES ('20050607122216127.0.0.1', 157);
INSERT INTO users VALUES ('20050510071856127.0.0.1', 129);
INSERT INTO users VALUES ('20050510071640127.0.0.1', 129);
INSERT INTO users VALUES ('20050510071456127.0.0.1', 129);
INSERT INTO users VALUES ('20050510071451127.0.0.1', 129);
INSERT INTO users VALUES ('20050509070121127.0.0.1', 128);
INSERT INTO users VALUES ('20050509065601127.0.0.1', 128);
INSERT INTO users VALUES ('20050509064730127.0.0.1', 128);
INSERT INTO users VALUES ('20050509064727127.0.0.1', 128);
INSERT INTO users VALUES ('20050509064145127.0.0.1', 128);
INSERT INTO users VALUES ('20050418050454127.0.0.1', 107);
INSERT INTO users VALUES ('20050417145253127.0.0.1', 106);
INSERT INTO users VALUES ('20050417145251127.0.0.1', 106);
INSERT INTO users VALUES ('20050417145248127.0.0.1', 106);
INSERT INTO users VALUES ('20050416174055127.0.0.1', 105);
INSERT INTO users VALUES ('20050416174037127.0.0.1', 105);
INSERT INTO users VALUES ('20050416174007127.0.0.1', 105);
INSERT INTO users VALUES ('20050416173946127.0.0.1', 105);
INSERT INTO users VALUES ('20050416173121127.0.0.1', 105);
INSERT INTO users VALUES ('20050416173038127.0.0.1', 105);
INSERT INTO users VALUES ('20050416172851127.0.0.1', 105);
INSERT INTO users VALUES ('20050416172756127.0.0.1', 105);
INSERT INTO users VALUES ('20050416172719127.0.0.1', 105);
INSERT INTO users VALUES ('20050416172639127.0.0.1', 105);
INSERT INTO users VALUES ('20050416172349127.0.0.1', 105);
INSERT INTO users VALUES ('20050416172328127.0.0.1', 105);
INSERT INTO users VALUES ('20050416172249127.0.0.1', 105);
INSERT INTO users VALUES ('20050416171338127.0.0.1', 105);
INSERT INTO users VALUES ('20050416171324127.0.0.1', 105);
INSERT INTO users VALUES ('20050416153328127.0.0.1', 105);
INSERT INTO users VALUES ('20050416153225127.0.0.1', 105);

Modul Praktikum Pemrograman Internet
55
INSERT INTO users VALUES ('20050416153214127.0.0.1', 105);
INSERT INTO users VALUES ('20050416153203127.0.0.1', 105);
INSERT INTO users VALUES ('20050416153148127.0.0.1', 105);
INSERT INTO users VALUES ('20050416152610127.0.0.1', 105);
INSERT INTO users VALUES ('20050416152534127.0.0.1', 105);
INSERT INTO users VALUES ('20050416140248127.0.0.1', 105);
INSERT INTO users VALUES ('20050416140234127.0.0.1', 105);
INSERT INTO users VALUES ('20050416140225127.0.0.1', 105);
INSERT INTO users VALUES ('20050416140215127.0.0.1', 105);
INSERT INTO users VALUES ('20050416140206127.0.0.1', 105);
INSERT INTO users VALUES ('20050416140143127.0.0.1', 105);
INSERT INTO users VALUES ('20050416140122127.0.0.1', 105);
INSERT INTO users VALUES ('20050416140057127.0.0.1', 105);
INSERT INTO users VALUES ('20050416140013127.0.0.1', 105);
INSERT INTO users VALUES ('20050416135828127.0.0.1', 105);
INSERT INTO users VALUES ('20050416135818127.0.0.1', 105);
INSERT INTO users VALUES ('20050416135803127.0.0.1', 105);
INSERT INTO users VALUES ('20050416135731127.0.0.1', 105);
INSERT INTO users VALUES ('20050416135707127.0.0.1', 105);
INSERT INTO users VALUES ('20050416135656127.0.0.1', 105);
INSERT INTO users VALUES ('20050416135458127.0.0.1', 105);
INSERT INTO users VALUES ('20050416135412127.0.0.1', 105);
INSERT INTO users VALUES ('20050416135345127.0.0.1', 105);
INSERT INTO users VALUES ('20050416135311127.0.0.1', 105);
INSERT INTO users VALUES ('20050416135242127.0.0.1', 105);
INSERT INTO users VALUES ('20050416135231127.0.0.1', 105);
INSERT INTO users VALUES ('20050416135221127.0.0.1', 105);
INSERT INTO users VALUES ('20050416135212127.0.0.1', 105);
INSERT INTO users VALUES ('20050416135106127.0.0.1', 105);
INSERT INTO users VALUES ('20050416135012127.0.0.1', 105);
INSERT INTO users VALUES ('20050416134924127.0.0.1', 105);
INSERT INTO users VALUES ('20050416134819127.0.0.1', 105);
INSERT INTO users VALUES ('20050414053656127.0.0.1', 103);
INSERT INTO users VALUES ('20050412182614127.0.0.1', 101);
INSERT INTO users VALUES ('20050412182613127.0.0.1', 101);
INSERT INTO users VALUES ('20050412182612127.0.0.1', 101);
INSERT INTO users VALUES ('20050412181342127.0.0.1', 101);
INSERT INTO users VALUES ('20050412181340127.0.0.1', 101);
INSERT INTO users VALUES ('20050412181338127.0.0.1', 101);
INSERT INTO users VALUES ('20050412162212127.0.0.1', 101);
INSERT INTO users VALUES ('20050412162149127.0.0.1', 101);
INSERT INTO users VALUES ('20050412162007127.0.0.1', 101);
INSERT INTO users VALUES ('20050412161901127.0.0.1', 101);
INSERT INTO users VALUES ('20050412161619127.0.0.1', 101);
INSERT INTO users VALUES ('20050412161516127.0.0.1', 101);
INSERT INTO users VALUES ('20050412161359127.0.0.1', 101);
INSERT INTO users VALUES ('20050412161338127.0.0.1', 101);
INSERT INTO users VALUES ('20050412161251127.0.0.1', 101);
INSERT INTO users VALUES ('20050412161249127.0.0.1', 101);
INSERT INTO users VALUES ('20050412161241127.0.0.1', 101);

Modul Praktikum Pemrograman Internet
56
INSERT INTO users VALUES ('20050412161235127.0.0.1', 101);
INSERT INTO users VALUES ('20050412161225127.0.0.1', 101);
INSERT INTO users VALUES ('20050412161223127.0.0.1', 101);
INSERT INTO users VALUES ('20050412161204127.0.0.1', 101);
INSERT INTO users VALUES ('20050412153300127.0.0.1', 101);
INSERT INTO users VALUES ('20050412140435127.0.0.1', 101);
INSERT INTO users VALUES ('20050412140300127.0.0.1', 101);
INSERT INTO users VALUES ('20050412140252127.0.0.1', 101);
INSERT INTO users VALUES ('20050412140250127.0.0.1', 101);
INSERT INTO users VALUES ('20050412140239127.0.0.1', 101);
INSERT INTO users VALUES ('20050412140231127.0.0.1', 101);
INSERT INTO users VALUES ('20050412140227127.0.0.1', 101);
INSERT INTO users VALUES ('20050412140223127.0.0.1', 101);
INSERT INTO users VALUES ('20050412140219127.0.0.1', 101);
INSERT INTO users VALUES ('20050412140217127.0.0.1', 101);
INSERT INTO users VALUES ('20050412140151127.0.0.1', 101);
INSERT INTO users VALUES ('20050412140104127.0.0.1', 101);
INSERT INTO users VALUES ('20050412140039127.0.0.1', 101);
INSERT INTO users VALUES ('20050412140023127.0.0.1', 101);
INSERT INTO users VALUES ('20050412140020127.0.0.1', 101);
INSERT INTO users VALUES ('20050412140007127.0.0.1', 101);
INSERT INTO users VALUES ('20050412131620127.0.0.1', 101);
INSERT INTO users VALUES ('20050412130255127.0.0.1', 101);
INSERT INTO users VALUES ('20050412130204127.0.0.1', 101);
INSERT INTO users VALUES ('20050412130002127.0.0.1', 101);
INSERT INTO users VALUES ('20050412125627127.0.0.1', 101);
INSERT INTO users VALUES ('20031211161015127.0.0.1', 344);
INSERT INTO users VALUES ('20031211155842127.0.0.1', 344);
INSERT INTO users VALUES ('20031207173413127.0.0.1', 340);
INSERT INTO users VALUES ('20031207065621127.0.0.1', 340);
INSERT INTO users VALUES ('20031207052839127.0.0.1', 340);
INSERT INTO users VALUES ('20031207052628127.0.0.1', 340);
INSERT INTO users VALUES ('20031207052620127.0.0.1', 340);
INSERT INTO users VALUES ('20031207052557127.0.0.1', 340);
INSERT INTO users VALUES ('20031207052527127.0.0.1', 340);
INSERT INTO users VALUES ('20031207052512127.0.0.1', 340);
INSERT INTO users VALUES ('20031207052441127.0.0.1', 340);
INSERT INTO users VALUES ('20031207052428127.0.0.1', 340);
INSERT INTO users VALUES ('20031207052408127.0.0.1', 340);
INSERT INTO users VALUES ('20031207052323127.0.0.1', 340);
INSERT INTO users VALUES ('20031207052200127.0.0.1', 340);
INSERT INTO users VALUES ('20031207052132127.0.0.1', 340);
INSERT INTO users VALUES ('20031207052049127.0.0.1', 340);
INSERT INTO users VALUES ('20031207052039127.0.0.1', 340);
INSERT INTO users VALUES ('20031207052003127.0.0.1', 340);
INSERT INTO users VALUES ('20031207051948127.0.0.1', 340);
INSERT INTO users VALUES ('20031207051932127.0.0.1', 340);
INSERT INTO users VALUES ('20031207051902127.0.0.1', 340);
INSERT INTO users VALUES ('20031207051752127.0.0.1', 340);
INSERT INTO users VALUES ('20031207051714127.0.0.1', 340);

Modul Praktikum Pemrograman Internet
57
INSERT INTO users VALUES ('20031207051649127.0.0.1', 340);
INSERT INTO users VALUES ('20031207051612127.0.0.1', 340);
INSERT INTO users VALUES ('20031207051536127.0.0.1', 340);
INSERT INTO users VALUES ('20031207051511127.0.0.1', 340);
INSERT INTO users VALUES ('20031207051338127.0.0.1', 340);
INSERT INTO users VALUES ('20031207051001127.0.0.1', 340);
INSERT INTO users VALUES ('20031207050946127.0.0.1', 340);
INSERT INTO users VALUES ('20031207050856127.0.0.1', 340);
INSERT INTO users VALUES ('20031207050724127.0.0.1', 340);
INSERT INTO users VALUES ('20031207050534127.0.0.1', 340);
INSERT INTO users VALUES ('20031207050301127.0.0.1', 340);
INSERT INTO users VALUES ('20031207045124127.0.0.1', 340);
INSERT INTO users VALUES ('20031207045120127.0.0.1', 340);
INSERT INTO users VALUES ('20031207045118127.0.0.1', 340);
INSERT INTO users VALUES ('20031207045111127.0.0.1', 340);
INSERT INTO users VALUES ('20031207045003127.0.0.1', 340);
INSERT INTO users VALUES ('20031207000736127.0.0.1', 340);
INSERT INTO users VALUES ('20031206010234127.0.0.1', 339);
INSERT INTO users VALUES ('20031206010243127.0.0.1', 339);
INSERT INTO users VALUES ('20031206010246127.0.0.1', 339);
INSERT INTO users VALUES ('20031206010247127.0.0.1', 339);
INSERT INTO users VALUES ('20031206010318127.0.0.1', 339);
INSERT INTO users VALUES ('20031206010507127.0.0.1', 339);
INSERT INTO users VALUES ('20031206010641127.0.0.1', 339);
INSERT INTO users VALUES ('20031206011026127.0.0.1', 339);
INSERT INTO users VALUES ('20031206011042127.0.0.1', 339);
INSERT INTO users VALUES ('20031206011046127.0.0.1', 339);
INSERT INTO users VALUES ('20031206011048127.0.0.1', 339);
INSERT INTO users VALUES ('20031206011425127.0.0.1', 339);
INSERT INTO users VALUES ('20031206074839127.0.0.1', 339);
INSERT INTO users VALUES ('20031206075023127.0.0.1', 339);
INSERT INTO users VALUES ('20031206080900127.0.0.1', 339);
INSERT INTO users VALUES ('20031206081050127.0.0.1', 339);
INSERT INTO users VALUES ('20031206081726127.0.0.1', 339);
INSERT INTO users VALUES ('20031206082101127.0.0.1', 339);
INSERT INTO users VALUES ('20031206082106127.0.0.1', 339);
INSERT INTO users VALUES ('20031206082203127.0.0.1', 339);
INSERT INTO users VALUES ('20031206082243127.0.0.1', 339);
INSERT INTO users VALUES ('20031206082415127.0.0.1', 339);
INSERT INTO users VALUES ('20031206082420127.0.0.1', 339);
INSERT INTO users VALUES ('20031206082717127.0.0.1', 339);
INSERT INTO users VALUES ('20031206082727127.0.0.1', 339);
INSERT INTO users VALUES ('20031206082815127.0.0.1', 339);
INSERT INTO users VALUES ('20031206082848127.0.0.1', 339);
INSERT INTO users VALUES ('20031206082935127.0.0.1', 339);
INSERT INTO users VALUES ('20031206082940127.0.0.1', 339);
INSERT INTO users VALUES ('20031206082952127.0.0.1', 339);
INSERT INTO users VALUES ('20031206083153127.0.0.1', 339);
INSERT INTO users VALUES ('20031206083157127.0.0.1', 339);
INSERT INTO users VALUES ('20031206083328127.0.0.1', 339);

Modul Praktikum Pemrograman Internet
58
INSERT INTO users VALUES ('20031206083351127.0.0.1', 339);
INSERT INTO users VALUES ('20031206083355127.0.0.1', 339);
INSERT INTO users VALUES ('20031206084759127.0.0.1', 339);
INSERT INTO users VALUES ('20031206084801127.0.0.1', 339);
INSERT INTO users VALUES ('20031206084820127.0.0.1', 339);
INSERT INTO users VALUES ('20031206084821127.0.0.1', 339);
INSERT INTO users VALUES ('20031206084856127.0.0.1', 339);
INSERT INTO users VALUES ('20031206084858127.0.0.1', 339);
INSERT INTO users VALUES ('20031206084904127.0.0.1', 339);
INSERT INTO users VALUES ('20031206084944127.0.0.1', 339);
INSERT INTO users VALUES ('20031206085045127.0.0.1', 339);
INSERT INTO users VALUES ('20031206085047127.0.0.1', 339);
INSERT INTO users VALUES ('20031206085108127.0.0.1', 339);
INSERT INTO users VALUES ('20031206085308127.0.0.1', 339);
INSERT INTO users VALUES ('20031206085431127.0.0.1', 339);
INSERT INTO users VALUES ('20031206085439127.0.0.1', 339);
INSERT INTO users VALUES ('20031206085456127.0.0.1', 339);
INSERT INTO users VALUES ('20031206085501127.0.0.1', 339);
INSERT INTO users VALUES ('20031206085512127.0.0.1', 339);
INSERT INTO users VALUES ('20031206085519127.0.0.1', 339);
INSERT INTO users VALUES ('20031206085753127.0.0.1', 339);
INSERT INTO users VALUES ('20031206085820127.0.0.1', 339);
INSERT INTO users VALUES ('20031206085846127.0.0.1', 339);
INSERT INTO users VALUES ('20031206085859127.0.0.1', 339);
INSERT INTO users VALUES ('20031206085952127.0.0.1', 339);
INSERT INTO users VALUES ('20031206085959127.0.0.1', 339);
INSERT INTO users VALUES ('20031206090120127.0.0.1', 339);
INSERT INTO users VALUES ('20031206090200127.0.0.1', 339);
INSERT INTO users VALUES ('20031206090201127.0.0.1', 339);
INSERT INTO users VALUES ('20031206090215127.0.0.1', 339);
INSERT INTO users VALUES ('20031206090317127.0.0.1', 339);
INSERT INTO users VALUES ('20031206090345127.0.0.1', 339);
INSERT INTO users VALUES ('20031206090352127.0.0.1', 339);
INSERT INTO users VALUES ('20031206090430127.0.0.1', 339);
INSERT INTO users VALUES ('20031206090732127.0.0.1', 339);
INSERT INTO users VALUES ('20031206090826127.0.0.1', 339);
INSERT INTO users VALUES ('20031206090915127.0.0.1', 339);
INSERT INTO users VALUES ('20031206091226127.0.0.1', 339);
INSERT INTO users VALUES ('20031206091231127.0.0.1', 339);
INSERT INTO users VALUES ('20031206091245127.0.0.1', 339);
INSERT INTO users VALUES ('20031206091412127.0.0.1', 339);
INSERT INTO users VALUES ('20031206091418127.0.0.1', 339);
INSERT INTO users VALUES ('20031206091430127.0.0.1', 339);
INSERT INTO users VALUES ('20031206163807127.0.0.1', 339);
INSERT INTO users VALUES ('20031206163817127.0.0.1', 339);
INSERT INTO users VALUES ('20031206163857127.0.0.1', 339);
INSERT INTO users VALUES ('20031206163859127.0.0.1', 339);
INSERT INTO users VALUES ('20031206165300127.0.0.1', 339);
INSERT INTO users VALUES ('20031206165601127.0.0.1', 339);
INSERT INTO users VALUES ('20031206165748127.0.0.1', 339);

Modul Praktikum Pemrograman Internet
59
INSERT INTO users VALUES ('20031206165804127.0.0.1', 339);
INSERT INTO users VALUES ('20031206170525127.0.0.1', 339);
INSERT INTO users VALUES ('20031206170623127.0.0.1', 339);
INSERT INTO users VALUES ('20031206170635127.0.0.1', 339);
INSERT INTO users VALUES ('20031206170645127.0.0.1', 339);
INSERT INTO users VALUES ('20031206170857127.0.0.1', 339);
INSERT INTO users VALUES ('20031206171033127.0.0.1', 339);
INSERT INTO users VALUES ('20031206171108127.0.0.1', 339);
INSERT INTO users VALUES ('20031206171449127.0.0.1', 339);
INSERT INTO users VALUES ('20031206171718127.0.0.1', 339);
INSERT INTO users VALUES ('20031206171850127.0.0.1', 339);
INSERT INTO users VALUES ('20031206171933127.0.0.1', 339);
INSERT INTO users VALUES ('20031206172027127.0.0.1', 339);
INSERT INTO users VALUES ('20031206172032127.0.0.1', 339);
INSERT INTO users VALUES ('20031206172247127.0.0.1', 339);
INSERT INTO users VALUES ('20031206172250127.0.0.1', 339);
INSERT INTO users VALUES ('20031206172251127.0.0.1', 339);
INSERT INTO users VALUES ('20031206172312127.0.0.1', 339);
INSERT INTO users VALUES ('20031206172333127.0.0.1', 339);
INSERT INTO users VALUES ('20031206172654127.0.0.1', 339);
INSERT INTO users VALUES ('20031206172729127.0.0.1', 339);
INSERT INTO users VALUES ('20031206173414127.0.0.1', 339);
INSERT INTO users VALUES ('20031206173527127.0.0.1', 339);
INSERT INTO users VALUES ('20031206174049127.0.0.1', 339);
INSERT INTO users VALUES ('20031206180532127.0.0.1', 339);
INSERT INTO users VALUES ('20031206180648127.0.0.1', 339);
INSERT INTO users VALUES ('20031206180840127.0.0.1', 339);
INSERT INTO users VALUES ('20031206181330127.0.0.1', 339);
INSERT INTO users VALUES ('20031206181338127.0.0.1', 339);
INSERT INTO users VALUES ('20031206181651127.0.0.1', 339);
INSERT INTO users VALUES ('20031206181755127.0.0.1', 339);
INSERT INTO users VALUES ('20031206181840127.0.0.1', 339);
INSERT INTO users VALUES ('20031206181848127.0.0.1', 339);
INSERT INTO users VALUES ('20031206181906127.0.0.1', 339);
INSERT INTO users VALUES ('20031206182228127.0.0.1', 339);
INSERT INTO users VALUES ('20031206183949127.0.0.1', 339);
INSERT INTO users VALUES ('20031206183950127.0.0.1', 339);
INSERT INTO users VALUES ('20031206183954127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184107127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184108127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184115127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184116127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184146127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184147127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184148127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184217127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184229127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184231127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184247127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184311127.0.0.1', 339);

Modul Praktikum Pemrograman Internet
60
INSERT INTO users VALUES ('20031206184415127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184429127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184436127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184456127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184510127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184523127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184536127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184552127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184617127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184629127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184639127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184659127.0.0.1', 339);
INSERT INTO users VALUES ('20031206184725127.0.0.1', 339);
INSERT INTO users VALUES ('20031206185331127.0.0.1', 339);
INSERT INTO users VALUES ('20031206185337127.0.0.1', 339);
INSERT INTO users VALUES ('20031206185342127.0.0.1', 339);
INSERT INTO users VALUES ('20031207000733127.0.0.1', 340);


Membuat file bagian pengguna

1. file index.php




Modul Praktikum Pemrograman Internet
61
<td height="55">
<img border="0"src="gambar/unguii_02.gif" height="47"></td>
<td height="55">
<img border="0" src="gambar/unguii_03.gif" height="47" ></td>
<td height="55">
<img border="0" src="gambar/unguii_04.gif" height="47" ></td>
<td height="55">
<img border="0" src="gambar/unguii_05.gif" height="47"></td>

<td width="9" height="55">
<img border="0" src="gambar/search13.gif" height="63"></td>
</tr>
</table>

</TD>
</TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="656" border=0 height="340">
<TBODY>
<TR>
<TD vAlign=top width=195 height="340">
<TABLE cellSpacing=0 cellPadding=0 width=162 border=0 height="47">
<TBODY>
<TR>
<TD width=185 height="14" colspan="6"><font color="#009900"
size="1">
<IMG height=10 alt=""
src="gambar/pixel.gif"
width=7></font></TD>
</TR>
<TR>
<TD width=29 height="19">
<p align="center">
&nbsp;</TD>
<TD width=10 height="19">
<p align="center">
<img border="0" src="gambar/bunderan2ungu.gif" width="15"
height="15"></TD>
<TD width=133 height="19"><b>
<font face="Verdana" size="2" color="#7762DD"><span lang="en-
us">Our
Products</span></font></b></TD>
<TD width=1 height="19"></TD>
<TD width=6 height="19"
background="gambar/dotted_margin_white.gif">&nbsp;</TD>
<TD width=7 height="19">&nbsp;</TD></TR>
<TR>
<TD width=1 height="312"></TD>
<TD vAlign=top width="239" height="312" colspan="3"><B>
<?php
echo "<table width=100%><tr><td width=10%></td><td width=90%>";
$result=mysql("$DBName","SELECT * FROM kategori ORDER BY kategoriID");
while ($row = mysql_fetch_row($result)) {
$Cat=$row[0];
$CatID=$row[1];
echo "<font face=Verdana size=1 color=#7762DD><a
href='produk.php?CA=$CatID&UID=$UID'>$Cat</a></font>";
echo "<br>";
}
echo "</td></tr>";
?>
<TABLE cellSpacing=0 cellPadding=0 border=0 height="6"

Modul Praktikum Pemrograman Internet
62
width="122">
<TBODY>

<TR>
</FONT>

</TR>
</FONT><FONT style="FONT-SIZE: 9pt" face="Arial,
Helvetica"
POINT-SIZE="9">
<FONT style="FONT-SIZE: 9pt" face="Arial, Helvetica"
POINT-SIZE="9">
</FONT></FONT>

</FONT>
</FONT>

</TBODY></TABLE></FONT></FONT></B></TD>
<TD width=13
background="gambar/dotted_margin_white.gif" height="312"
colspan="2">&nbsp;</TD></TR>
<TR>
<TD width=240 height="19" colspan="4">
&nbsp;</TD>
<TD width=13
background="gambar/dotted_margin_white.gif" height="19"
colspan="2">&nbsp;</TD></TR></TBODY></TABLE>
<p>
<IMG height=1 alt=""
src="gambar/pixel.gif"
width=185></TD>
<TD height="340" width="574">
<TABLE cellSpacing=0 cellPadding=0 width="574" border=0>
<TBODY>
<TR>
<TD align=middle width="515">
<TABLE cellSpacing=0 cellPadding=2 width="573" border=0
height="1">
<TBODY>
<tr>
<TD width=563 height=15 colspan="3">
</TD>
</tr>
<tr><td align=center><b>
<font face="Verdana" size="2" color="#7762DD">bagian ini
sengaja dibuat kosong</font></b>
</td></tr>
</TBODY></TABLE></TD>
</TR>
</TBODY></TABLE>
</TD></TR></TBODY></TABLE>
<table border="0" cellpadding="0" cellspacing="0" width="758"
height="1">
<tr>
<td width="758" colspan="3" height="19">
<hr color="#907EE3" size="1" width="95%" noshade></td>
</tr>
<tr>
<td width="4" height="30">
<p align="center">&nbsp;</td>
<td width="750" height="30">

Modul Praktikum Pemrograman Internet
63




2. file katongbelanja.php

<?
include("inc/produk.inc")
?>
<html>

<HTML><HEAD><TITLE>welcome@DigitalThink --- 2003^OnlineStore</TITLE>
<META http-equiv=Content-Language content=fr-ca>
<META http-equiv=Content-Type content=text/html;charset=ISO-8859-1>
<META
content="Compusmart Online offers computer hardware and software for
shipment within Canada."
name=description>
<META
content="compusmart online,canada,canadian,computer hardware,computer
software,business software,video
games,desktops,notebooks,laptops,cd,cdr,digital cameras,geek toys,online
shopping,shipping,alberta,british
columbia,ontario,quebec,manitoba,saskatchewan,new brunswick,nova
scotia,newfoundland,prince edward island,northwest
territories,english,anglais,français,french"
name=keywords>

<STYLE>BODY {
BACKGROUND-COLOR: white
}

Modul Praktikum Pemrograman Internet
64
.regular {
FONT-SIZE: 11px; COLOR: #838383; FONT-FAMILY: verdana
}
H2 {
FONT-SIZE: 11px; COLOR: #838383; FONT-FAMILY: verdana
}
H4 {
FONT-SIZE: 11px; COLOR: #838383; FONT-FAMILY: verdana
}
.formlabel {
FONT-SIZE: 11px; COLOR: #333333; FONT-FAMILY: verdana
}
.footer {
FONT-SIZE: 10px; COLOR: #838383; FONT-FAMILY: verdana
}
.portlet {
FONT-SIZE: 9px; COLOR: #838383; FONT-FAMILY: verdana
}
.bodyheader {
FONT-SIZE: 12px; COLOR: #4f7298; FONT-FAMILY: verdana
}
.headline {
FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #000000; FONT-FAMILY:
helvetica
}
H1 {
FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #000000; FONT-FAMILY:
helvetica
}
.headlinewhite {
FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #ffffff; FONT-FAMILY:
helvetica
}
.headlineyellow {
FONT-SIZE: 12px; COLOR: #ffffcc; FONT-FAMILY: helvetica
}
.tabs {
FONT-WEIGHT: bold; FONT-SIZE: 11px; COLOR: #838383; FONT-FAMILY:
verdana
}
.date {
FONT-WEIGHT: bold; FONT-SIZE: 10px; COLOR: #ffffff; FONT-FAMILY:
verdana
}
.InputText {
FONT-WEIGHT: normal; FONT-SIZE: 12pt; WIDTH: 140px; FONT-FAMILY:
verdana, helvetica, sans-serif; TEXT-DECORATION: none
}
.InputTextF {
FONT-WEIGHT: normal; FONT-SIZE: 10pt; WIDTH: 250px; FONT-FAMILY:
verdana, helvetica, sans-serif; TEXT-DECORATION: none
}
.formtext {
FONT-SIZE: 8pt; FONT-FAMILY: verdana
}
.InputTextFnoWidth {
FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-FAMILY: verdana,
helvetica, sans-serif; TEXT-DECORATION: none
}
A:link {
TEXT-DECORATION: none

Modul Praktikum Pemrograman Internet
65
}
A:visited {
TEXT-DECORATION: none
}
A:active {
TEXT-DECORATION: none
}
A:hover {
COLOR: #7762DD; FONT-WEIGHT: bold; TEXT-DECORATION: underline
}
</STYLE>
<SCRIPT language=Javascript
src="master.js"
type=text/javascript></SCRIPT>

<META content="Microsoft FrontPage 5.0" name=GENERATOR></HEAD>
<BODY vLink=#7762DD aLink=#7762DD link=#7762DD bgColor=#ffffff
leftMargin=0
topMargin=0 rightMargin=0 marginheight="0" marginwidth="0" FONTBASE="3">
<TABLE height=40 cellSpacing=0 cellPadding=0 width="760"
border=0 style="border-collapse: collapse" bordercolor="#111111">
<TBODY>
<TR>
<TD width=741>
<table border="0" cellpadding="0" cellspacing="0" style="border-
collapse: collapse" bordercolor="#111111" width="763" id="AutoNumber1"
height="55">
<tr>
<td width="529" height="55">
<a href="index.php"

onmouseover="MM_swapImage('Image1','','gambar/menuabu_01.gif',1)"
onmouseout=MM_swapImgRestore() >
<img alt="Welcome Home" border="0" src="gambar/unguii_01.gif"

width="111" height="47" name=Image1></a><a
href="profile.php"

onmouseover="MM_swapImage('Image2','','gambar/menuabu_02.gif',1)"
onmouseout=MM_swapImgRestore() ><img border="0" name=Image2
src="gambar/unguii_02.gif" width="100" height="47"></a><a
href="delivery.php"

onmouseover="MM_swapImage('Image3','','gambar/menuabu_03.gif',1)"
onmouseout=MM_swapImgRestore() ><img border="0"
src="gambar/unguii_03.gif" width="100" height="47" name=Image3></a><a
href="faq.php"

onmouseover="MM_swapImage('Image4','','gambar/menuabu_04.gif',1)"
onmouseout=MM_swapImgRestore() ><img border="0"
src="gambar/unguii_04.gif" width="101" height="47" name=Image4></a><a
href="contacts.php"

onmouseover="MM_swapImage('Image5','','gambar/menuabu_05.gif',1)"
onmouseout=MM_swapImgRestore() ><img border="0"
src="gambar/unguii_05.gif" width="113" height="47" name=Image5></a>
</a>
</td>




Modul Praktikum Pemrograman Internet
66
<td width="9" height="55">
<img border="0" src="gambar/search13.gif" width="225"
height="63"></td>
</tr>
</table>

</TD>
</TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="656" border=0 height="340">
<TBODY>
<TR>
<TD vAlign=top width=195 height="340">
<TABLE cellSpacing=0 cellPadding=0 width=162 border=0 height="47">
<TBODY>
<TR>
<TD width=185 height="14" colspan="6"><font color="#009900"
size="1">
<IMG height=10 alt=""
src="gambar/pixel.gif"
width=7></font></TD>
</TR>
<TR>
<TD width=29 height="19">
<p align="center">
&nbsp;</TD>
<TD width=10 height="19">
<p align="center">
<img border="0" src="gambar/bunderan2ungu.gif" width="15"
height="15"></TD>
<TD width=133 height="19"><b>
<font face="Verdana" size="2" color="#7762DD"><span lang="en-
us">Our
Products</span></font></b></TD>
<TD width=1 height="19"></TD>
<TD width=6 height="19"
background="gambar/dotted_margin_white.gif">&nbsp;</TD>
<TD width=7 height="19">&nbsp;</TD></TR>
<TR>
<TD width=1 height="312"></TD>
<TD vAlign=top width="239" height="312" colspan="3"><B>
<?php
echo "<table width=100%><tr><td width=10%></td><td width=90%>";
$result=mysql("$DBName","SELECT * FROM kategori ORDER BY kategoriID");
while ($row = mysql_fetch_row($result)) {
$Cat=$row[0];
$CatID=$row[1];
echo "<font face=Verdana size=1 color=#7762DD><a
href='produk.php?CA=$CatID&UID=$UID'>$Cat</a></font>";
echo "<br>";
}
echo "</td></tr>";
?>
<TABLE cellSpacing=0 cellPadding=0 border=0 height="246"
width="122">
<TBODY>
<TR>
<TD height="15" width="1"></TD>
<TD height="15" width="178">
</TD></TR>
<TR>
</FONT>

Modul Praktikum Pemrograman Internet
67

</TR>
</FONT><FONT style="FONT-SIZE: 9pt" face="Arial,
Helvetica"
POINT-SIZE="9">
<FONT style="FONT-SIZE: 9pt" face="Arial, Helvetica"
POINT-SIZE="9">
</FONT></FONT>

</FONT>
</FONT>
</TBODY></TABLE></FONT></FONT></B></TD>
<TD width=13
background="gambar/dotted_margin_white.gif" height="312"
colspan="2">&nbsp;</TD></TR>
<TR>
<TD width=240 height="19" colspan="4">
&nbsp;</TD>
<TD width=13
background="gambar/dotted_margin_white.gif" height="19"
colspan="2">&nbsp;</TD></TR></TBODY></TABLE>
<p>
<IMG height=1 alt=""
src="gambar/pixel.gif"
width=185></TD>
<TD vAlign=top height="340" width="574">
<TABLE cellSpacing=0 cellPadding=0 width="574" border=0>
<TBODY>
<TR>
<TD vAlign=top align=middle width="515">
<TABLE cellSpacing=0 cellPadding=2 width="573" border=0
height="1">
<TBODY>
<tr>
<TD width=563 height=15 colspan="3">
</TD>
</tr>
<tr><td>
<table width=100% align=center border="0">

<TR>
<TD colspan=6>
<table>
<tr>
<td valign=top><img border="0"
src="gambar/bunderan2ungu.gif"></td>
<td><FONT face="Verdana" size="2" color="#7762DD"><b>Your
Shopping Cart</b><br><BR></TD>
</tr>
</table>

<TR>
<TD colspan=2 width=70% align=center><B><font size="1" color=gray
face="Verdana">Product</font></B></TD>
<TD align=center><B><font size="1" color=gray
face="Verdana">Qty</font></B></TD>
<TD width=25% align=center><B><font size="1" color=gray
face="Verdana">Total</font></B></TD>
<TD colspan=2 align=center><B><font size="1"
face="Verdana"></font></B></TD>


Modul Praktikum Pemrograman Internet
68
</TR>
<?
$i=0;
$j=0;

$result=mysql("$DBName","SELECT * FROM kantongbelanja WHERE
UserID='$UID'");
$num=mysql_num_rows($result);
if ($num == "0") {

echo "<center>";
blueFont("Arial","Maaf, sepertinya Anda belum berbelanja<br><br>");

} else {

$result=mysql("$DBName","SELECT * FROM kantongbelanja WHERE
UserID='$UID'");

while ($row = mysql_fetch_row($result)) {
$CUI=$row[0];
$CII=$row[1];
$CIQ=$row[2];
$CDa=$row[3];
$CCI=$row[4];

$result2=mysql("$DBName","SELECT * FROM Items WHERE
barangID='$CII'");
while ($row2=mysql_fetch_row($result2)) {
$noitem=$row2[0];
$nama=$row2[1];
$deskripsi=$row2[2];
$harga=$row2[3];
$kategori=$row2[4];
$gambar=$row2[5];
$idbarang=$row2[6];

$To[$i]=(($CIQ * $harga));
$To2[$i]=(($CIQ*$do1));
$color = ($coloralternator++ %2 ? "D7D0F4" : "CBC2EF");

echo "<tr><TD colspan=6 height=1 bgcolor=#cccccc></TD></tr>";

echo "<TR>";
echo "<TD align=center><img src=gambar/$gambar></TD>";
echo "<TD ><font size=\"1\" color=#907EE3
face=\"Verdana\">$nama<br>Brand : $deskripsi";
echo "<br><font size=\"1\" color=#7766DD
face=\"Verdana\"><b>US$$harga </font></td>";

echo "<FORM ACTION=\"tambah.php\" METHOD=\"POST\">";
echo "<TD align=center><input type=text name=tambah value=$CIQ
size=2></TD>";

$Tot=$CIQ*$harga;
$Tot2=$CIQ*$do1;
echo "<td align=center><font size=\"1\" color=#7766DD
face=\"Verdana\"><b>US$ $Tot </font></td>";
echo "<td width=5% align=center width=10%>";
echo "<input type=\"hidden\" name=\"kantongbelanjaID\" value=\"$CCI\"
>";
echo "<input type=\"hidden\" name=\"namabarang\" value=\"$IIN\" >";

Modul Praktikum Pemrograman Internet
69
echo "<input type=\"hidden\" name=\"UID\" value=\"$UID\" >";
echo "<input type=\"submit\" name=\"submit\" value=\"Update\"
></td></form>";

echo "<td width=5% align=center>";
echo "<FORM ACTION=\"hapus.php\" METHOD=\"POST\">";
echo "<input type=\"hidden\" name=\"kantongbelanjaID\" value=\"$CCI\"
>";
echo "<input type=\"hidden\" name=\"UID\" value=\"$UID\" >";
echo "<input type=\"SUBMIT\" NAME=\"SUBMIT\" value=\"Delete\" >";
echo "</center></td></tr>";
echo "</form>";


$i++;
}
}

while ($j < $i) {
$total=$total+$To[$j];
$total2=$total2+$To2[$j];
$j++;
}

echo "<tr><TD colspan=6 height=1 bgcolor=#cccccc></TD></tr>";

echo "<tr><Td colspan=6 height=5></TD></tr>";
echo "<tr>";
echo "<td colspan='6' align=right >";
echo "<font size=\"1\" color=#7766DD face=\"Verdana\"><b>Total Cost : ";
$total=$total;
$total2=$total2;
if ($ES == "1") {
echo "US$ $total";
} elseif ($ES != "1") {
echo "US$$total &nbsp;&nbsp; </td></tr> ";
}

echo "<tr><td colspan=\"6\" align=center><FORM ACTION=\"kosongkan.php\"
METHOD=\"POST\">";
echo "<input type=\"hidden\" NAME=\"UID\" value=\"$UID\" >";
echo "<input type=\"SUBMIT\" NAME=\"SUBMIT\" value=\"Empty Cart\" >";
echo "</center></td></tr></table>";
echo "</form>";



echo "<form action=\"pesanan_proses.php\" method=\"post\">
<br><br>";
echo "<table width=70% align=center><tr><td colspan=2 align=right>";
echo "<font align=center face=verdana size=1 color=#907EE3><b>Untuk
Menyelesaikan Pesanan Silahkan Mengisi Form Berikut<br><br></b></font>";

echo "<tr><td width=40% ></td>";
echo "<td align=center> <IMG border=0 height=37 src=gambar/pelanggan.gif
width=178></td>";

echo "<tr><td width=40% align=right><font face=verdana size=1
color=#907EE3><b>Customer Name : </b></font></td>";
echo "<td width=60%> <input type=\"text\" name=\"nama\"
size=\"40\"></td>";

Modul Praktikum Pemrograman Internet
70

echo "<tr><td width=40% align=right><font face=verdana size=1
color=#907EE3><b>Address : </b></font></td>";
echo "<td><input type=\"text\" name=\"alamat1\" size=\"40\"></td>";

echo "<tr><td width=40% align=right><font face=verdana size=1
color=#907EE3><b>City : </b></font></td>";
echo "<td><input type=\"text\" name=\"kota\" size=\"40\"></td>";

echo "<tr><td width=40% align=right><font face=verdana size=1
color=#907EE3><b>e-Mail : </b></font></td>";
echo "<td><input type=\"text\" name=\"email\" size=\"40\"><br>";

echo "<tr><td width=40% align=right><font face=verdana size=1
color=#907EE3><b>Phone : </b></font></td>";
echo "<td><input type=\"text\" name=\"telprumah\" size=\"40\"></td>";

echo "<tr><td></td><td align=center>";
$tanggal=date("Y:z:Y-m-d");
$total=ereg_replace(",","",$total);
echo "<input type=\"hidden\" name=\"totalorder\" value=\"$total\" >
<input type=\"hidden\" name=\"tanggal\" value=\"$tanggal\" >
<input type=\"hidden\" name=\"UserID\" value=\"$UID\" >
<input type=\"hidden\" name=\"pembeliID\" value=\"\" >
<input type=\"hidden\" name=\"hapuskantong\" value=\"\" >
<input type=\"hidden\" name=\"nomororder\" value=\"\" >
<input type=\"submit\" value=\"Check Out\" ></form></td></tr></table>";


}


?>

</td></tr></table>
</tr>

</table> </td></tr>
</TBODY></TABLE></TD>
</TR>
</TBODY></TABLE>
</TD></TR></TBODY></TABLE>
<table border="0" cellpadding="0" cellspacing="0" style="border-
collapse: collapse" bordercolor="#111111" width="758" id="AutoNumber2"
height="1">
<tr>
<td width="758" colspan="3" height="19">
<hr color="#907EE3" size="1" width="95%" noshade></td>
</tr>
<tr>
<td width="4" height="30">
<p align="center">&nbsp;</td>
<td width="750" height="30">
<p align="center">
<img border="0" src="gambar/power.gif" width="404" height="30"></td>
<td width="4" height="30">&nbsp;</td>
</tr>
<tr>
<td width="4" height="18"></td>
<td width="750" height="18"></td>
<td width="4" height="18"></td>

Modul Praktikum Pemrograman Internet
71
</tr>
<tr>
<td width="4" height="19">&nbsp;</td>
<td width="750" height="19">
<p align="center"><font face="Verdana" size="1"
color="#907EE3">©<span lang="en-us">DigitalThink | 2003 OnlineStore |
aldedi@yahoo.com</span></font><br>
<font face="Verdana" size="1" color="#907EE3">Mobile : +62 0816 4245
942</font></span></td>
<td width="4" height="19">&nbsp;</td>
</tr>
<tr>
<td width="4" height="1"></td>
<td width="750" height="1">
</td>
<td width="4" height="1"></td>
</tr>
</table>
</BODY></HTML>


3. file kosongkan.php


<?
require("toko.php");
DBinfo();
Root();
mysql_connect("$DBHost","$DBUser","$DBPass");
mysql("$DBName","DELETE FROM kantongbelanja WHERE UserID='$UID'");
Header("Location: index.php?UID=$UID");
?>


4. file kwitansi.php

<?php
require("toko.php");

DBinfo();
Brand();
Root();
mysql_connect("$DBHost","$DBUser","$DBPass");

echo "<BR><BR><BR><BR><table border='0' width='100%'><tr>";
echo "<td align='center'>";
echo "<font face=Verdana size=5 color=#907EE3>Y o u r &nbsp; O n l i n e
S t o r e &nbsp; C o m p a n y </font></td></tr>";
echo "<tr><td align=center><font face=Verdana size=1 color=#907EE3>P u r
i &nbsp; P e r d a n a &nbsp; K - 1 &nbsp; N o &nbsp; 8 &nbsp; B a
n y u m a n i k &nbsp;S e m a r a n g &nbsp; 5 0 2 6 7 &nbsp;I n d o
n e s i a<br> M o b i l e &nbsp; : &nbsp; + 6 2 &nbsp; 8 1 6 &nbsp;
4 2 4 5 &nbsp; 9 4 2 <br>";
echo "<font face=Verdana size=2 color=#907EE3><b>w w w . o n l i n e s t
o r e . c o m </td></tr>";

$result=mysql("$DBName","SELECT Date FROM Orders WHERE
OrderNumber='$ON'");
while ($row=mysql_fetch_row($result)) {

Modul Praktikum Pemrograman Internet
72
$ODa=$row[0]; }

$pieces=explode(":",$ODa);

echo "</td></tr><tr><td valign='top' align='left'>";
$result=mysql("$DBName","SELECT * FROM Pembeli WHERE pembeliID='$BI'");
while ($row=mysql_fetch_row($result)) {
$BNa=$row[0];
$BA1=$row[1];
$BA2=$row[2];
$BCi=$row[3];
$BSt=$row[4];
$BZi=$row[5];
$BEm=$row[6];
$BDP=$row[7];
$BEP=$row[8];
$BCo=$row[9];
$BPM=$row[10];
$BOT=$row[11];
$BDa=$row[12];
$BON=$row[13];
$BUI=$row[14];
$BBI=$row[15];
}
echo "</td></tr>";

echo "<tr><TD height=1 bgcolor=#cccccc></TD></tr></table>";
echo "<br>";
echo "<center><font face=verdana size=1 color=#400080>Terima Kasih telah
mempercayakan kebutuhan Anda kepada kami</center>";
echo "<table align=center cellpadding=2 cellspacing=1 border=0>
<TR BGCOLOR=#7762DD>
<TD ><B><font size=1 color=white face=Verdana>Kode </font></B></TD>
<TD ><B><font size=1 color=white face=Verdana>Produk </font></B></TD>
<TD><B><font size=1 color=white face=Verdana>Qty</font></B></TD>
<TD ><B><font size=1 color=white face=Verdana>Harga </font></B></TD>
<TD ><B><font size=1 color=white face=Verdana>Total</font></B></TD>
</TR>";

$result=mysql("$DBName","SELECT * FROM tandaterima WHERE pembeliID='$BI'
AND nomororder='$ON'");
while ($row=mysql_fetch_row($result)) {
$RBI=$row[0];
$RUI=$row[1];
$RON=$row[2];
$RDa=$row[3];
$RII=$row[4];
$RIS=$row[5];
$RIN=$row[6];
$RIC=$row[7];
$RSC=$row[8];
$RIQ=$row[9];
$RTC=$row[10];
$dol=mysql("$DBName","SELECT * FROM dollar where barangID=$RII ORDER BY
barangID");
$dollar=mysql_fetch_row($dol);
$do0=$dollar[0];
$do1=$dollar[1];
$total=$total+$RTC;
$color = ($coloralternator++ %2 ? "C5C5F3" : "D7D7F7");
echo "<TR BGCOLOR=\"#$color\">";

Modul Praktikum Pemrograman Internet
73
echo "<TD><font size=\"1\" face=\"Verdana\"
color=#400080>$RIS</FONT></TD>";
echo "<TD><font size=\"1\" face=\"Verdana\"
color=#400080>$RIN</FONT></TD>";
echo "<TD><font size=\"1\" face=\"Verdana\"
color=#400080>$RIQ</FONT></TD>";
echo "<TD><font size=\"1\" face=\"Verdana\"
color=#400080>$RIC</FONT></TD>";
echo "<TD><font size=\"1\" face=\"Verdana\"
color=#400080>$RTC</FONT></TD>";


}

$Tot=number_format($total);
echo "<tr><td colspan=\"3\"></td><td>";
echo "<font color=red size=\"1\" face=\"Verdana\">Total:";
echo "</td><td>";
if ($ES == "1") {
echo "<font color=red size=\"1\" face=\"Verdana\"><b>US$ $Tot</b>";
fontSize("-1","blue","Arial","");
} else {
echo "<font color=red size=\"1\" face=\"Verdana\"><b>US$ $Tot</b>"; }
echo "</td></tr>";

echo "<tr><TD colspan=6 height=1 bgcolor=#cccccc></TD></tr>";

echo "<tr><td></td><td>";
echo "<font face=verdana size=1>";
echo "Nomor order : $ON<br>";
echo "<b>Nama : </b>$BNa<br>";
echo "<b>Alamat : </b> $BA1<br>";
echo "<b>Telpon rumah : </b>$BEP<br>";
echo "<b>E-mail : </b>$BEm<br>";
echo "</font>";


?>

</td>
</tr>
</table> </td></tr>
</TBODY></TABLE></TD>
</TR>
</TBODY></TABLE>
</TD></TR></TBODY></TABLE>
<table align="center" border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="758"
id="AutoNumber2" height="1">
<tr>
<td width="758" colspan="3" height="19">
<hr color="#907EE3" size="1" width="95%" noshade></td>
</tr>
<tr>
<td width="4" height="19">&nbsp;</td>
<td width="750" height="19">
<p align="center"><font face="Verdana" size="1"
color="#907EE3">©<span lang="en-us">DigitalThink | 2003 OnlineStore |
aldedi@yahoo.com</span></font><br>
<font face="Verdana" size="1" color="#907EE3">Mobile : +62 0816 4245
942</font></span></td>

Modul Praktikum Pemrograman Internet
74
<td width="4" height="19">&nbsp;</td>
</tr>
<tr>
<td width="4" height="1"></td>
<td width="750" height="1">
</td>
<td width="4" height="1"></td>
</tr>
</table>
</BODY></HTML>


5. file masukkankantongbelanja.php


<?
require("toko.php");
DBinfo();
Root();
mysql_connect("$DBHost","$DBUser","$DBPass");
mysql("$DBName","INSERT INTO kantongbelanja VALUES
('$UID','$barangID','$jumlahbarang','$tanggal','')");

Header("Location: kantongbelanja.php?UID=$UID");
?>


6. file pesanan_proses.php


<?
require("toko.php");
DBInfo();
Root();
Brand();
mysql_connect("$DBHost","$DBUser","$DBPass");

if ($nama == "") {
Brand();

echo "<center>";
echo "<br>";
echo "<br>";
echo "<font face=verdana size=1 color=#907EE3><b>Maaf! Anda belum mengisikan
NAMA anda pada form.";
echo "<hr>";
echo "<p align=center><input type='submit' value='Back To Cart'
onclick='history.go(-1)'></p>";
exit;
}

if ($alamat1 == "") {
Brand();

echo "<center>";
echo "<br>";
echo "<br>";
echo "<font face=verdana size=1 color=#907EE3><b>Maaf! Anda belum mengisikan
ALAMAT anda pada form.";

Modul Praktikum Pemrograman Internet
75
echo "<hr>";
echo "<p align=center><input type='submit' value='Back To Cart'
onclick='history.go(-1)'></p>";
exit;
}

if ($email == "") {
Brand();
echo "<center>";
echo "<br>";
echo "<br>";
echo "<font face=verdana size=1 color=#907EE3><b>Maaf! Anda belum mengisikan
EMAIL anda pada form.";
echo "<hr>";
echo "<p align=center><input type='submit' value='Back To Cart'
onclick='history.go(-1)'></p>";
exit;
}

if ($telpkantor == "" AND $telprumah == "") {
Brand();
echo "<center>";
echo "<br>";
echo "<br>";
echo "<font face=verdana size=1 color=#907EE3><b>Maaf! Anda belum mengisikan
TELEPON anda pada form.";
echo "<hr>";
echo "<p align=center><input type='submit' value='Back To Cart'
onclick='history.go(-1)'></p>";
exit;
}
if ($hapuskantong == "" ) {
Brand();
mysql("DBName","delete from kantongbelanja where UserID=$UID");
}
mysql("$DBName","INSERT INTO Pembeli VALUES (
'$nama','$alamat1','$kota',
'$propinsi','$negara','$kodepos',
'$email','$telpkantor','$telprumah',
'$kontak','$carabayar','$totalorder',
'$tanggal','$nomororder','$UserID',
'$pembeliID')");

$result=mysql("$DBName","SELECT pembeliID FROM Pembeli WHERE UserID='$UserID'
AND tanggal='$tanggal' AND nama='$nama'");
while ($row=mysql_fetch_row($result)) {
$BID=$row[0];
}

mysql("$DBName","INSERT INTO Orders VALUES (
'$BID','$UserID','$Date',
'$OrderTotal','$OrderNumber')");

$result=mysql("$DBName","SELECT OrderNumber FROM Orders WHERE UserID='$UserID'
AND Date='$Date' AND BuyerID='$BID'");
while ($row=mysql_fetch_row($result)) {
$ONu=$row[0];
}

mysql("$DBName","UPDATE Pembeli SET nomororder='$ONu' WHERE
pembeliID='$BID'");

Modul Praktikum Pemrograman Internet
76

$result=mysql( "$DBName", "SELECT * FROM kantongbelanja WHERE
UserID='$UserID'");
while ($row = mysql_fetch_row($result)) {
$CUI=$row[0];
$CII=$row[1];
$CIQ=$row[2];
$CDa=$row[3];
$CCI=$row[4];
$result2=mysql( "$DBName", "SELECT * FROM Items WHERE barangID='$CII'");
while ($row2=mysql_fetch_row($result2)) {
$IIS=$row2[0];
$IIN=$row2[1];
$IID=$row2[2];
$IIC=$row2[3];
$ICa=$row2[4];
$ISC=$row2[5];
$III=$row2[6];

$To[$i]=($CIQ * $IIC);
mysql("$DBName","INSERT INTO tandaterima VALUES (
'$BID','$UserID','$ONu',
'$tanggal','$III','$IIS',
'$IIN','$IIC','$ISC',
'$CIQ','$To[$i]')");

$i++;
}
}

mysql("$DBName","DELETE FROM kantongbelanja WHERE UserID='$UserID'");
mysql("$DBName","DELETE FROM Users WHERE User='$UserID'");

$result=mysql( "$DBName", "SELECT * FROM Pembeli WHERE pembeliID='$BID'");
while ($row=mysql_fetch_row($result)) {
$BNa=$row[0];
$BA1=$row[1];
$BA2=$row[2];
$BCi=$row[3];
$BSt=$row[4];
$BZi=$row[5];
$BEm=$row[6];
$BDP=$row[7];
$BEP=$row[8];
$BCo=$row[9];
$BPM=$row[10];
$BOT=$row[11];
$BDa=$row[12];
$BON=$row[13];
$BUI=$row[14];
$BBI=$row[15];
}

if ($BCo == "1") {
$BCo="Ya";
} else {
$BCo="Tidak"; }

$pieces=explode(":",$BDa);

$part1="Nama: $BNa\nAlamat: $BA1\nKota:$BA2\n$BCi,$BSt $BZi\nE-mail:

Modul Praktikum Pemrograman Internet
77
$BEm\n\nTelpon kantor: $BDP\nTelpon rumah: $BEP\n\nKontak terlebih dahulu?
$BCo\n\nBayar pakai: $BPM\n\ntanggal: $pieces[2]\n\n";

$result=mysql( "$DBName","SELECT * FROM tandaterima WHERE pembeliID='$BID' AND
nomororder='$ONu'");
while ($row=mysql_fetch_row($result)) {
$RBI=$row[0];
$RUI=$row[1];
$RON=$row[2];
$RDa=$row[3];
$RII=$row[4];
$RIS=$row[5];
$RIN=$row[6];
$RIC=$row[7];
$RSC=$row[8];
$RIQ=$row[9];
$RTC=$row[10];

$total=$total+$RTC;

$part2=$part2."SKU: $RIS\nNama barang: $RIN\nHarga: Rp $RIC\n: Rp
$RSC\nBanyaknya: $RIQ\nTotal: Rp $RTC\n\n"; }

if ($ES == "1") {
$part3="TOTAL: Rp $total \n\n";
} else { $part3="TOTAL: Rp $total\n\n"; }


Header("Location:
kwitansi.php?BI=$BID&ON=$ONu&PM=$carabayar&CT=$tipecc&Co=$kontak&UID=$UserID");

?>


7. file produk.php


<?
include("inc/produk.inc")
?>
<html>

<HTML><HEAD><TITLE>welcome@DigitalThink --- 2003^OnlineStore</TITLE>
<META http-equiv=Content-Language content=fr-ca>
<META http-equiv=Content-Type content=text/html;charset=ISO-8859-1>
<META
content="Compusmart Online offers computer hardware and software for
shipment within Canada."
name=description>
<META
content="compusmart online,canada,canadian,computer hardware,computer
software,business software,video
games,desktops,notebooks,laptops,cd,cdr,digital cameras,geek toys,online
shopping,shipping,alberta,british
columbia,ontario,quebec,manitoba,saskatchewan,new brunswick,nova
scotia,newfoundland,prince edward island,northwest
territories,english,anglais,français,french"
name=keywords>

<STYLE>BODY {

Modul Praktikum Pemrograman Internet
78
BACKGROUND-COLOR: white
}
.regular {
FONT-SIZE: 11px; COLOR: #838383; FONT-FAMILY: verdana
}
H2 {
FONT-SIZE: 11px; COLOR: #838383; FONT-FAMILY: verdana
}
H4 {
FONT-SIZE: 11px; COLOR: #838383; FONT-FAMILY: verdana
}
.formlabel {
FONT-SIZE: 11px; COLOR: #333333; FONT-FAMILY: verdana
}
.footer {
FONT-SIZE: 10px; COLOR: #838383; FONT-FAMILY: verdana
}
.portlet {
FONT-SIZE: 9px; COLOR: #838383; FONT-FAMILY: verdana
}
.bodyheader {
FONT-SIZE: 12px; COLOR: #4f7298; FONT-FAMILY: verdana
}
.headline {
FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #000000; FONT-FAMILY:
helvetica
}
H1 {
FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #000000; FONT-FAMILY:
helvetica
}
.headlinewhite {
FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #ffffff; FONT-FAMILY:
helvetica
}
.headlineyellow {
FONT-SIZE: 12px; COLOR: #ffffcc; FONT-FAMILY: helvetica
}
.tabs {
FONT-WEIGHT: bold; FONT-SIZE: 11px; COLOR: #838383; FONT-FAMILY:
verdana
}
.date {
FONT-WEIGHT: bold; FONT-SIZE: 10px; COLOR: #ffffff; FONT-FAMILY:
verdana
}
.InputText {
FONT-WEIGHT: normal; FONT-SIZE: 12pt; WIDTH: 140px; FONT-FAMILY:
verdana, helvetica, sans-serif; TEXT-DECORATION: none
}
.InputTextF {
FONT-WEIGHT: normal; FONT-SIZE: 10pt; WIDTH: 250px; FONT-FAMILY:
verdana, helvetica, sans-serif; TEXT-DECORATION: none
}
.formtext {
FONT-SIZE: 8pt; FONT-FAMILY: verdana
}
.InputTextFnoWidth {
FONT-WEIGHT: normal; FONT-SIZE: 10pt; FONT-FAMILY: verdana,
helvetica, sans-serif; TEXT-DECORATION: none
}

Modul Praktikum Pemrograman Internet
79
A:link {
TEXT-DECORATION: none
}
A:visited {
TEXT-DECORATION: none
}
A:active {
TEXT-DECORATION: none
}
A:hover {
COLOR: #7762DD; FONT-WEIGHT: bold; TEXT-DECORATION: underline
}
</STYLE>
<SCRIPT language=Javascript
src="master.js"
type=text/javascript></SCRIPT>

<META content="Microsoft FrontPage 5.0" name=GENERATOR></HEAD>
<BODY vLink=#7762DD aLink=#7762DD link=#7762DD bgColor=#ffffff
leftMargin=0
topMargin=0 rightMargin=0 marginheight="0" marginwidth="0" FONTBASE="3">
<TABLE height=40 cellSpacing=0 cellPadding=0 width="760"
border=0 style="border-collapse: collapse" bordercolor="#111111">
<TBODY>
<TR>
<TD width=741>
<table border="0" cellpadding="0" cellspacing="0" style="border-
collapse: collapse" bordercolor="#111111" width="763" id="AutoNumber1"
height="55">
<tr>
<td width="529" height="55">
<a href="index.php"

onmouseover="MM_swapImage('Image1','','gambar/menuabu_01.gif',1)"
onmouseout=MM_swapImgRestore() >
<img alt="Welcome Home" border="0" src="gambar/unguii_01.gif"

width="111" height="47" name=Image1></a><a
href="profile.php"

onmouseover="MM_swapImage('Image2','','gambar/menuabu_02.gif',1)"
onmouseout=MM_swapImgRestore() ><img border="0" name=Image2
src="gambar/unguii_02.gif" width="100" height="47"></a><a
href="delivery.php"

onmouseover="MM_swapImage('Image3','','gambar/menuabu_03.gif',1)"
onmouseout=MM_swapImgRestore() ><img border="0"
src="gambar/unguii_03.gif" width="100" height="47" name=Image3></a><a
href="faq.php"

onmouseover="MM_swapImage('Image4','','gambar/menuabu_04.gif',1)"
onmouseout=MM_swapImgRestore() ><img border="0"
src="gambar/unguii_04.gif" width="101" height="47" name=Image4></a><a
href="contacts.php"

onmouseover="MM_swapImage('Image5','','gambar/menuabu_05.gif',1)"
onmouseout=MM_swapImgRestore() ><img border="0"
src="gambar/unguii_05.gif" width="113" height="47" name=Image5></a>
</a>
</td>


Modul Praktikum Pemrograman Internet
80


<td width="9" height="55">
<img border="0" src="gambar/search13.gif" width="225"
height="63"></td>
</tr>
</table>

</TD>
</TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="656" border=0 height="340">
<TBODY>
<TR>
<TD vAlign=top width=195 height="340">
<TABLE cellSpacing=0 cellPadding=0 width=162 border=0
height="340">
<TBODY>
<TR>
<TD width=185 height="14" colspan="6"><font color="#009900"
size="1">
<IMG height=10 alt=""
src="gambar/pixel.gif"
width=7></font></TD>
</TR>
<TR>
<TD width=29 height="19">
<p align="center">
&nbsp;</TD>
<TD width=10 height="19">
<p align="center">
<img border="0" src="gambar/bunderan2ungu.gif" width="15"
height="15"></TD>
<TD width=133 height="19"><b>
<font face="Verdana" size="2" color="#7762DD"><span lang="en-
us">Our
Products</span></font></b></TD>
<TD width=1 height="19"></TD>
<TD width=6 height="19"
background="gambar/dotted_margin_white.gif">&nbsp;</TD>
<TD width=7 height="19">&nbsp;</TD></TR>
<TR>
<TD width=1 height="312"></TD>
<TD vAlign=top width="239" height="312" colspan="3"><B>
<?php
echo "<table width=100%><tr><td width=10%></td><td width=90%>";
$result=mysql("$DBName","SELECT * FROM kategori ORDER BY kategoriID");
while ($row = mysql_fetch_row($result)) {
$Cat=$row[0];
$CatID=$row[1];
echo "<font face=Verdana size=1 color=#7762DD><a
href='produk.php?CA=$CatID&UID=$UID'>$Cat</a></font>";
echo "<br>";
}
echo "</td></tr>";
?>
<TABLE cellSpacing=0 cellPadding=0 border=0 height="14"
width="122">
<TBODY>
<TR>
<TD height="39" width="1"></TD>
<TD height="39" width="178">

Modul Praktikum Pemrograman Internet
81
</TD></TR>
<TR>
<TD height="17" width="1">
<img border="0" src="gambar/bunderan2ungu.gif" width="15"
height="15"></TD>
</FONT>

<TD height="17" width="178">
<span lang="en-us"><FONT face="Verdana"
size="2" color="#7762DD"><b>Shopping
Cart</b></span></TD></TR>
</FONT><FONT style="FONT-SIZE: 9pt" face="Arial,
Helvetica"
POINT-SIZE="9">
<FONT style="FONT-SIZE: 9pt" face="Arial, Helvetica"
POINT-SIZE="9">
<TR>
<TD width="1" height="12"></TD>
</FONT></FONT>

<TD width="178" height="12"><span lang="en-us">
<font face="Tahoma" size="1" color="#907EE3">View
Cart</font></span></TD></TR>
</FONT>
<TR>
<TD width="1" height="12"></TD>

<TD width="178" height="12"><span lang="en-us">
<font face="Tahoma" size="1" color="#907EE3">Total
Product : </font></span></TD></TR>
</FONT>
<TR>
<TD width="1" height="12"></TD>
<TD width="178" height="12">
<span lang="en-us"><font face="Tahoma" size="1"
color="#907EE3">Total Cost : </span></TD></TR>
<TR>
<TD width="1" height="1"></TD>
<TD width="178" height="1">
<font face="Tahoma" size="1" color="#907EE3">
<span lang="en-us">Check Out</span></TD></TR>
<TR>
<TD height="1" width="1"></TD>
<TD height="1" width="178">
</TD></TR>

</TBODY></TABLE></FONT></FONT></B></TD>
<TD width=13
background="gambar/dotted_margin_white.gif" height="312"
colspan="2">&nbsp;</TD></TR>
</TBODY></TABLE>
<p>
<IMG height=1 alt=""
src="gambar/pixel.gif"
width=185></TD>
<TD vAlign=top height="340" width="574">
<TABLE cellSpacing=0 cellPadding=0 width="574" border=0>
<TBODY>
<TR>
<TD vAlign=top align=middle width="515">
<TABLE cellSpacing=0 cellPadding=2 width="573" border=0

Modul Praktikum Pemrograman Internet
82
height="1">
<TBODY>
<tr>
<TD width=563 height=15 colspan="3">
</TD>
</tr>
<tr><td>
<table align=center cellpadding="2" cellspacing="1" border="0">
<?
$i=0;
$j=0;
$result=mysql("$DBName","SELECT * FROM Items WHERE kategori='$CA' ORDER
BY namabarang");

if ($num == "0") {
echo "<center>";
blueFont("Arial","Maaf Tidak Ada Barang<br><br>");
echo "<br><br><br>";
echo "<center>";
echo "<a href=%22index.php/%22><font size=\"7\"
color=\"red\">HOME</font></a>";

} else {


$result2=mysql("$DBName","SELECT * FROM Items WHERE kategori='$CA' ORDER
BY namabarang");
while ($row2=mysql_fetch_row($result2)) {
$noitem=$row2[0];
$nama=$row2[1];
$deskripsi=$row2[2];
$harga=$row2[3];
$kategori=$row2[4];
$gambar=$row2[5];
$idbarang=$row2[6];


echo "<form action=masukkankantongbelanja.php method=post >";
$tanggal=date("Y:z:Y-m-d");

echo "<INPUT TYPE=\"hidden\" NAME=\"kategori\" VALUE=\"$kategori\"
>";
echo "<INPUT TYPE=\"hidden\" NAME=\"barangID\" VALUE=\"$idbarang\"
>";
echo "<INPUT TYPE=\"hidden\" NAME=\"UID\" VALUE=\"$UID\" >";
echo "<input type=\"hidden\" name=\"tanggal\" value=\"$tanggal\"
>";
echo "<input type=\"hidden\" name=\"kantongbelanjaID\" value=\"\"
>";

echo "<table width=100%><TR>";
echo "<TD width=20% align=center><img src=gambar/$gambar></TD>";
echo "<TD width=70% ><font size=\"1\" color=#907EE3
face=\"Verdana\">$nama<br>Brand : $deskripsi<br><b>Harga : US$$harga";
echo "<TD width=30% align=center>
<INPUT TYPE=value NAME=jumlahbarang VALUE=1 SIZE=2 >
<INPUT TYPE=SUBMIT VALUE=Buy!></FONT></TD>";

echo "<tr><TD colspan=3 height=1 bgcolor=#cccccc></TD></tr>";

echo "</tr></FORM>";

Modul Praktikum Pemrograman Internet
83
$i++;
}
}
?></td>
</tr>
</table> </td></tr>
</TBODY></TABLE></TD>
</TR>
</TBODY></TABLE>
</TD></TR></TBODY></TABLE>
<table border="0" cellpadding="0" cellspacing="0" style="border-
collapse: collapse" bordercolor="#111111" width="758" id="AutoNumber2"
height="1">
<tr>
<td width="758" colspan="3" height="19">
<hr color="#907EE3" size="1" width="95%" noshade></td>
</tr>
<tr>
<td width="4" height="30">
<p align="center">&nbsp;</td>
<td width="750" height="30">
<p align="center">
<img border="0" src="gambar/power.gif" width="404" height="30"></td>
<td width="4" height="30">&nbsp;</td>
</tr>
<tr>
<td width="4" height="18"></td>
<td width="750" height="18"></td>
<td width="4" height="18"></td>
</tr>
<tr>
<td width="4" height="19">&nbsp;</td>
<td width="750" height="19">
<p align="center"><font face="Verdana" size="1"
color="#907EE3">©<span lang="en-us">DigitalThink | 2003 OnlineStore |
aldedi@yahoo.com</span></font><br>
<font face="Verdana" size="1" color="#907EE3">Mobile : +62 0816 4245
942</font></span></td>
<td width="4" height="19">&nbsp;</td>
</tr>
<tr>
<td width="4" height="1"></td>
<td width="750" height="1">
</td>
<td width="4" height="1"></td>
</tr>
</table>
</BODY></HTML>


8. file tambah.php


<?
require("toko.php");
DBinfo();
Root();
mysql_connect("$DBHost","$DBUser","$DBPass");
$result=mysql("$DBName","SELECT jumlahbarang FROM kantongbelanja WHERE
kantongbelanjaID='$kantongbelanjaID'");

Modul Praktikum Pemrograman Internet
84

mysql("$DBName","UPDATE kantongbelanja
set jumlahbarang='$tambah'
WHERE kantongbelanjaID='$kantongbelanjaID'");
Header("Location: kantongbelanja.php?UID=$UID");
?>


9. file toko.php


<?
/* info perusahan */
$perusahan ="Mahesa Computer";
$alamatI="JL Singosari 65";
$di ="Semarang";
$prop="Jawa Tengah";
$tel ="(024)23034";
$Web ="www.mahesa.net";

function Brand() {
global
$Perusahan,$alamat1,$alamat2,$kota,$propinsi,$kodepos,$telp,$Web,$Email,$NoPengiriman;
}

/* database server */
$DBHost="localhost";
$DBUser="root";
$DBPass="";
$DBName="tokoku";
function DBInfo() {
global $DBHost,$DBUser,$DBPass,$DBName;
}

/* toko scripts */
$WebRoot="/htdocs/coba2";
$Relative="/IntelShop";
$WebHost="localhost/coba2";
function Root() {
global $WebRoot,$Relative,$WebHost;
}

function redFont($font,$text) {
echo "<FONT FACE=\"$font\" COLOR=\"red\">$text</FONT>";
}

function blueFont($font,$text) {
echo "<FONT FACE=\"$font\" COLOR=\"blue\">$text</FONT>";
}

function colorFont($color,$font,$text) {
echo "<FONT FACE=\"$font\" COLOR=\"$color\">$text</FONT>";
}

function fontFace($font,$text) {
echo "<FONT FACE=\"$font\">$text</FONT>";
}

function fontSize($size,$color,$font,$text) {
echo "<FONT FACE=\"$font\" COLOR=\"$color\" SIZE=\"$size\">$text</FONT>";

Modul Praktikum Pemrograman Internet
85
}

function commonHeader($perusahan,$title) {
echo "<HTML><TITLE>kantong belanja $perusahan - $title</TITLE><BODY
BGCOLOR=\"#ffffFF\">";
}


function receiptHeader($perusahan,$title) {
echo "<HTML><TITLE>tanda terima $perusahan - $title</TITLE><BODY
BGCOLOR=\"#FFFFFF\">";
}

function commonpojok($Relative,$UID) {
echo "<align=\"right\">";
echo "<b><a href=\"$Relative/periksa.php?UID=$UID\"><img
src=\"images/trans.jpg\"></a></b><br><br>";
echo "</align>";
}



function adminFooter($Relative) {
echo "<center><br><br><hr width=\"70%\"><br>";
fontFace("Arial"," | <a href=\"$Relative\">HOME</a>");
fontFace("Arial"," | <a href=\"$Relative/penguasa/\">Admin</a>");
echo "<br><br></center></BODY></HTML>";
}

function receiptFooter($perusahan) {
echo "<br><br><center>";
fontFace("Arial","Terimakasih telah berbelanja di <b>$perusahan</b>");
echo "</center><br><br>";
}


?>


Untuk memperoleh file bagian admin (pada folder admin), file inc, & file gambar yang
digunakan silakan hubungi via email : yatamafeb2005@yahoo.co.id. Terima kasih.


TUGAS AKHIR !

Buatlah sebuah toko online (online store) dengan tema : toko buku, bunga, motor, mobil,
handphone, computer/notebook, sepatu, dll (jika ada yang lain). Mahasiswa diwajibkan
memilih salah satu dari tema tersebut.



GOOD LUCK