You are on page 1of 4

<html> <head> <link rel="stylesheet" type="text/css" href="style.

css"> </head> <body> <div class="head"> <a class="white" href="home.html">PROFILE</a> &nbsp &nbsp <a class="white" href="register.html">REGISTER</a> &nbsp &nbsp <a class="white" href="contact us.html">CONTACT US</a></white> </div> <br/> <br/> <br/> <div class="body"> <table> <tr> <td class = "right"> Username :</td> <td> <input value="" type="text" name=nama size=25> </td> </tr> <tr> <td class = "right"> Password :</td> <td> <input value="" type="password" name=nama size=15> </td> </tr> <tr> <td class = "right"> Gender : </td> <td> <input type=radio name=gender value="Male" checked> Male <input type=radio name=gender value="Female" > Female </td> </tr> <tr> <td class = "right"> Most Favorite Taylor Swift Album : </td> <td> <select> <option selected>Taylor Swift</option> <option>Fearless</option> <option>Speak Now</option> </select> </td> </tr> <tr> <td class = "right"> Top 3 Taylor Swift Songs : </td> <td> <select name="1" size="4" multiple> <optgroup label="Taylor Swift"> <option value="Our Song" selected="selected">Our Song</option> <option value="Tim McGraw">Tim McGraw</option> <option value="Picture To Burn">Picture To Burn</option> </optgroup> </select></td> </td> </tr> <tr> <td colspan = 2> <div align="center"><input type=button value="Submit"></div> </td> </tr> </table> </div> </body> </html>

CSS STYLING body {background-image: url('tay.jpg'); font-family : verdana;} table {font-family: arial; font-size: medium; color: #00CCFF; width: 100%;} judul {font-weight : bolder; font-size: x-large; color: #00FFFF;} td{padding:5px;} .right {text-align: right} td.pict {colspan: 2; height:"107"; width:"295"} div.head {width: 100%; background-image: url('blackTransparent.png')} div.body {width: 50%; color: #00CCFF; font-size: small; background-image: url('blackTransparent.png'); align:"center"; float: left; margin-top: 15; marginbottom: 15; padding: 10;} {color: #00FFFF ; text-decoration: none;} a.white {color: white ; text-decoration: none; font-weight : bold;} div.pict { float: left; margin-top: 15; margin-bottom: 15; padding: 10; background-image: url('blackTransparent.png');}

u. if(isset($_COOKIE["cart"][$id])) //kalau udah pernah pilih (buku ada dalam cart) buka yang sama.hpel_id AND d. while ($row = mysql_fetch_array($result)) { echo "<tr>". $subtotal = $j * $harga. } mysql_close($link). if(isset($_COOKIE["cart"])) //kalau cart ada { echo "<a href=shoppingcart.time()+86400). increment jumlahnya { $jum = $_COOKIE["cart"][$id] + 1."hpembelian h. dengan index $id. $con).men_harga FROM ".PHP if (isset($_GET["q"])) { //insert if ($_GET["q"] == "insert") { $id = $_GET["id"]. $hasil = mysql_query($query. echo $row[$i-1].0.$j.$i++) { echo "<td>". } else //barang yang dipilih belom ada di cart { setcookie("cart[$id]". ".pel_username = u.hpel_id. } else { echo "Tidak ada data ditemukan. //supaya expired else setcookie("cart[$i]". m. include "includes/header. } } </script> <form name="register" onsubmit="return validateForm().pel_username ASC". } Else echo "<H1> Cart is Empty </H1>" HEADER LAPORAN TRANSAKSI $link = $db->open_connection(). echo "<input type=hidden name='q' value='update'> <input type=submit value=Update>". echo "<table border='1'>". echo "<form action=shoppingcart. echo "</tr>".pel_username AND h. echo "<tr> <td>Kode Buku</td> <td>Judul Buku</td> <td>Harga Satuan</td> <td>Jumlah</td> <td>Subtotal</td> </td>"." method="post"> SHOPPINGCART.value. if ($jumlah >= 1) { $kolom = mysql_num_fields($result).lastIndexOf(". for ($i=1. $harga = $brs["PRICE"]. isi index masuk ke j { $query = "SELECT * FROM book WHERE ID='$i'". //UNTUK PROSES echo "<table border=1 cellpadding=10>". $jumlah = mysql_num_rows($result).time()-86400). } echo "</table>". } echo "</tr>".$basdat['prefix'].VALIDASI EMAIL <script type="text/javascript"> function validateForm() { var x=document.hpel_id = d.dpel_jmlh.$jum. h.pel_username.php method=get>".".men_nama. m."dpembelian d. $brs = mysql_fetch_array($hasil).men_id = m. foreach($_COOKIE["cart"] as $i=>$j) //index masuk ke i.men_harga. var atpos=x. setcookie("cart[$id]". echo "</td>".php". d.1. }}} //empty cart if ($_GET["q"] == "empty") { foreach($_COOKIE["cart"] as $i=>$j) { setcookie("cart[$i]".$basdat['prefix']. return false. if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.php?q=empty>Empty Cart</a>". d.").$basdat['prefix']. //cart adalah nama cookie(array).PHP session_start(). diisi default jumlah 1 }} //update if ($_GET["q"] == "update") { foreach($_GET as $i=>$j) { if($i!="q") { if($j==0) setcookie("cart[$i]".time()+86400). u.hpel_id ASC. echo "<td>$judul</td> <td>$ $harga</td> <td><input type=text size=10 value=$j name=$i></td> <td>$ $subtotal</td>". include "includes/connect.time()-86400). //supaya expired }}} header("location:viewcart.length) { alert("Not a valid e-mail address"). echo "</form>"."menu m. var dotpos=x. include "includes/functions.$basdat['prefix']. ". .time()+86400). } echo "</table>".php".php"). VIEWCART. echo "<tr class=header><td>ID Transaksi</td><td>Tanggal Transaksi</td><td>Username</td><td>Menu</td><td>Jumlah</td><td>Harga Satuan</td><td>Total</td></tr>".indexOf("@"). $query = "SELECT h.0.php".$i<=$kolom.hpel_tgl. echo "<tr> <td>$i</td>". ".forms["register"]["email"]." "."user_admin u WHERE h.dpel_jmlh*m. $judul = $brs["TITLE"]. $result = mysql_query($query) or die (mysql_error()).men_id ORDER BY h.

if(empty($_POST['username'])) { $e[] = 'You must have a username'."'. } header("location:katalog. unset($_SESSION["password"]). while ($brs = mysql_fetch_array($hasil)) { book_simple($i+$page_start. include "includes/footer. $i = 0.php". include "includes/header. } for($j=1. if($q == "") header("location:katalog. else $page = 1.php". if (isset($_POST['submit'])) { $e = array(). . $query = "SELECT * FROM user WHERE username='$username' AND password='$password'".php") //$result = mysql_query($sql) or die(mysql_error()). //tambah combobox echo "<form action=search. echo "Halaman $page <br/><br/>". header("location:katalog. //BELOM SEMPURNA for($j=1.$j<=$page_count.2)".php").PROSESLOGIN. $email = mysql_real_escape_string($_POST['email']). $hasil = mysql_query($query. } else if(strlen($_POST['pass'])<3) { $e[] = 'Passwords are minimal 3 characters long'. unset($_SESSION["username"]). } echo"<input type=hidden name=q value=$q>". $_SESSION["username"]=$username.'". if($res = mysql_query($sql)) { header("location:katalog."'. echo "<a href=search. } PROSESLOGOUT.$con).php"). } end_table(). } else { $e[] = "Username unavailable.'".php?q=$q&page=$j>$j</a> ". $page_end = $page_start+$page_size-1. }} PROSESSEARCH. $prev . $i++. PROSESREGISTER. $page_size = 20. $hasil = mysql_query($query. $pass = mysql_real_escape_string($_POST['pass']). $page_start = ($page-1)*$page_size. echo "<a href=search. ">Next</a> ".$j++) { if($j == $page) echo "$j ". ">Prev</a> ". $_SESSION["level"]=$isi["level"]. level) VALUES('". //combobox sampe sini if($page>1) { $prev = $page-1.php") } else header("location:katalog. foreach($e as $err) { echo "<div class=error>$err</div>". if(mysql_num_rows($hasil) == 1) { $isi = mysql_fetch_array($hasil).php?q=$q&page=1>First</a> ".$j<=$page_count. if(isset($_GET["page"])) $page = $_GET["page"]. //mengambil banyaknya jumlah data dalam tabel $kuerihitung = "SELECT COUNT(*) FROM book WHERE TITLE LIKE '%$q%'". $page_size". $query = "SELECT * FROM book WHERE TITLE LIKE '%$q%' limit $page_start. $page_count = ceil($jmlhdata/$page_size). unset($_SESSION["level"]).php"). Please choose another username. } echo "<br/><br />".php?q=$q&page=". } if($page<$page_count) { $next = $page+1."'. include "includes/connect.$j++) { echo "<option value=$j>$j</option>". //print_r($p). $password = $_POST["password"].php"). $hasil = mysql_fetch_array($hasilhitung).$con). $jmlhdata = $hasil[0]. $hasilhitung = mysql_query($kuerihitung.php?q=$q&page=$page_count>Last</a> ". echo "<a href=search. email. $con). if (isset($_GET["q"])) { $q=$_GET["q"].$email. if(isset($_POST["username"]) && isset($_POST["password"])) { $username = $_POST["username"].$pass.PHP session_start().php".$username. echo "</select><input type=submit></form><br />". } else if($_POST['pass'] !== $_POST['cpass']) { $e[] = 'Passwords did not match'. else echo "<a href=search. start_table(). $brs). include "includes/connect. password. $next .php".PHP session_start().php".PHP include "includes/connect. }} //header("location:katalog.php". include "includes/functions. $sql = "INSERT INTO USER(username.php method=get> <select name=page>".".php?q=$q&page=". echo "<a href=search.PHP session_start(). } else { $username = mysql_real_escape_string($_POST['username']).

$sinopsis = $_POST["sinopsis"]. $query = "UPDATE book SET TITLE='$title'. include "includes/connect.php"). start_table(). $query = "DELETE FROM book WHERE ID='$id'". $year = $_POST["year"]."'> </td></tr>". DB_UserName. header("location:detail. $hasil = mysql_query($query. end_table().php".php session_start(). $author = $_POST["author"]. $con). $baris = mysql_fetch_array($hasil).php $con = mysql_connect(DB_ServerName. session_start().php'><input type=submit value=Back></form>". include "includes/header."></form>". REVIEW='$sinopsis' WHERE ID='$id'". include "includes/footer. $r = mysql_select_db(DB_DatabaseName.php <?php define("DB_ServerName".$baris['REVIEW']. echo "<br/><br/>". if(isset($_SESSION["level"]) and $_SESSION["level"]==0) { $title = $_POST["title"].php").php"). mysql_query($query. include "includes/footer.php"). $price = $_POST["price"].php?id=$id"). echo "<input type=hidden name=id value=". echo "<br/><br/>". PRICE=$price. include "includes/footer. include "includes/functions. Prosesedit. echo "<tr>". PUBLISHER='$publisher'.'> Sinopsis : </span><br/><textarea name=sinopsis cols='50' rows='10'>".". include "includes/connect. include "includes/functions. include "includes/functions.php". mysql_query($query.php". $hasil = mysql_query($query. include "includes/header. detail_simple($baris). } FORMEDIT. detail_input($baris)."></td></tr>"."'></td></tr>".$con). echo "<br/><br/>".$baris['AUTHOR']. end_table().php". echo "<form action='prosesdelete.php". if (isset($_GET["id"])) { $id=$_GET["id"].php"). if (!$r) die("Error selecting database").php' method=post><input type=hidden name=id value=$id>Are you sure? <input type=submit value='Yes. } Else header("location:katalog.$baris['ID'].php". } . formdelete.php".php". header("location:katalog. include "includes/connect. detail_inputkosong().php session_start(). $id = $_POST["id"]. start_table(). include "includes/connect. if($id == "") header("location:katalog.php session_start(). $baris = mysql_fetch_array($hasil)."'></td></tr>". Constant.php". echo "<tr><td class=price>Price : $<input type=text name=price value =".$baris['TITLE']. echo "<tr><td> Published on <input type=text name=year value ='". include "includes/connect. include "includes/header. echo "</td>".php". end_table(). } else header("location:katalog. $query = "SELECT * FROM book where ID='$id'". if (!$con) die("Error koneksi"). AUTHOR='$author'.php".php".include "includes/constant.$con). echo "<tr><td class=author> Author : <input type=text name=author value ='". //connect."'></td></tr>".php". $publisher = $_POST["publisher"]. DB_Password).$con). echo "<td class=title>Title : <input type=text name=title value ='".$baris['PUBLISHER'].$baris['PRICE']. delete this book'></form>".php forminsert.$baris['ID'].$baris['YEAR']. ?> Functions. "localhost"). echo "<tr><td> Publisher : <input type=text name=publisher value ='"."</textarea><br> <input type=submit value=Save> </td></tr>".jpg' border=0>".PHP session_start(). if($id == "") header("location:katalog. echo "<img src='img/". start_table(). echo "<form action='katalog. $query = "SELECT * FROM book where ID='$id'".php prosesdelete.$con). YEAR=$year. echo "<tr><td> <span style='font-weight:bold.php". color:darkblue.php". if (isset($_GET["id"])) { $id=$_GET["id"].php method=post>". echo "<td rowspan=6 align=center>". } function detail_input($baris) { echo "<form action=prosesedit. if(isset($_SESSION["level"]) and $_SESSION["level"]==0) { $id = $_POST["id"].