<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Rohan Elektronik</title>
</head>
<body>
<body bgcolor=#cc0000 text=#000000>
<form action="output.php" action="post">
<h1><center><b><font face="algerian" color=#ffffff>Rohan Elektronik</center></b></font></h1>
<h2><center><b><font face="algerian" color=#ffffff>JL.Anoa No.1 RT.10/RW.11 Kawasan Pondok Timur Indah.Bekasi 11212</center></b></font></h2>
<h3><font face="calibri" color=#ffffff>====================================================================================================================================================================================================</h3>
<hr>
<font face="times new roman" color=#000000 size=4>
<?
$koneksi=mysql_connect("localhost","root","");
if ($koneksi)
{
mysql_select_db("tugas");
if($kobar=="C01")
{
$mebar="CPU";
$harga=500000;
}
else if($kobar=="T02")
{
$mebar="TABLET";
$harga=2500000;
}
else if($kobar=="L02")
{
$mebar="LAPTOP";
$harga=4500000;
}
else
{
$mebar="PRINTER";
$harga=1000000;
}
echo"<table size=100% border=3 bgcolor=#F0F0F0>";
echo"<tr>";
echo"<td>";
echo"<pre>";
echo"<b><center>STRUK PEMBELIAN</center></b>";
echo"<br>";
echo"No.Transaksi : $notrans<br>";
echo"----------------------------------<br>";
echo"KODE : $kobar<br>";
echo"NAMA : $nabar<br>";
echo"MEREK : $mebar<br>";
echo"HARGA : $harga<br>";
echo"JUMLAH : $jumlah<br>";
echo"----------------------------------<br>";
$total=($harga*$jumlah);
echo"TOTAL HARGA : $total<br>";
echo"----------------------------------<br>";
echo"<br><b><font face=times new roman color=#cc0000 size=6><marquee>TERIMA KASIH ATAS KEDATANGANNYA</font></marquee><br>";
echo"</pre>";
echo"</td>";
echo"</tr>";
echo"</table>";
echo"<br>";
$simpan=mysql_query("insert into transaksi values('$notrans','$kobar','$nabar','$mebar','$harga','$jumlah','$total')");
if($simpan)
{
echo"<b><h2>Data Sudah Berhasil Disimpan</h2></b>";
}
else
echo"<b><h2>Tidak Berhasil</h2><b>";
$sqlstr2=mysql_query("select * from transaksi");
while($hasil=mysql_fetch_row($sqlstr2))
{
echo"<tr>";
echo"<td>$hasil[0]</td>";
echo"<td>$hasil[1]</td>";
echo"<td>$hasil[2]</td>";
echo"<td>$hasil[3]</td>";
echo"<td>$hasil[4]</td>";
echo"<td>$hasil[5]</td>";
echo"<td>$hasil[6]</td>";
echo"</tr>";
}
echo"</table>";
}
?>
<hr>
<p></font>
<center><table size=100% border=2 bgcolor=#ffff00></center>
<tr><td><a href="input.php"><b>INPUT LAGI ?</b></a></td>
</table>
</body>
</html>
Tidak ada komentar:
Posting Komentar