Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title></title>
- </head>
- <body>
- <?php
- echo"<table align=\"center\" border=\"1\">";
- echo"<tr bgcolor=\"iceblue\">";
- echo"<td><font face=\"calibri\" color=\"white\">";
- $conn = mysql_connect("localhost","root","dancing01")or
- die(mysql_error()."Cannot connect to server");
- $data = mysql_select_db("warung",$conn)or
- die(mysql_error()."Cannot connect to database");
- $sql = "select merk_produk from master_produk";
- $result = mysql_query($sql, $conn)or
- die(mysql_error()."An error occured in SQL query <br> Query: $sql");
- while($line = mysql_fetch_row($result)){
- $merk = $line[0];
- echo"<input type=\"checkbox\" name=\"produk\">$merk<br>";
- }
- mysql_close($conn);
- echo"</td>";
- echo"</tr>";
- echo"<tr bgcolor=\"iceblue\">";
- echo"<td>";
- echo"<input type=\"submit\" name=\"tampil\" value=\"Tampilkan Detil Pembayaran\">";
- echo"</td>";
- echo"</tr>";
- echo"</table>";
- //tabel proses pembayaran
- $cek = $_GET['tampil'];
- if(empty($cek))
- die("Input tidak sesuai");
- echo"<table align=\"center\">";
- echo"<tr bgcolor=\"iceblue\">";
- echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
- echo"No</td>";
- echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
- echo"Produk</td>";
- echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
- echo"Kategori</td>";
- echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
- echo"Harga</td>";
- echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
- echo"Stok</td>";
- echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
- echo"Qty</td>";
- echo"</tr>";
- $nomor = 0;
- $produk = $_POST['produk'];
- $query = "select merk, kategori, harga_jual, jumlah_stok from master_produk " .
- "where merk = '$produk' ";
- $hasil = mysql_query($query, $conn)or
- die(mysql_error()."An error occure in Query SQL <br> Query: $sql");
- while($line = mysql_fetch_row($hasil)){
- $nomor++;
- $merk = $line[0];
- $kategori = $line[1];
- $harga_jual = $line[2];
- $jumlah_stok = $line[3];
- echo"<tr bgcolor=\"iceblue\">";
- echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
- echo"1</td>";
- echo"<td><input type=\"text\" size=\"35%\" name=\"merk\" disabled=\"disabled\"></td>";
- echo"<td><input type=\"text\" size=\"15%\" name=\"kategori\" disabled=\"disabled\"></td>";
- echo"<td><input type=\"text\" size=\"15%\" name=\"harga\" disabled=\"disabled\"></td>";
- echo"<td><input type=\"text\" size=\"2%\" name=\"stok\" disabled=\"disabled\"></td>";
- echo"<td><input type=\"text\" size=\"2%\" name=\"qty\"></td>";
- echo"</tr>";
- echo"<tr bgcolor=\"iceblue\">";
- echo"<td colspan=\"8\" align=\"right\"><input type=\"submit\" name=\"bayar\" value=\"Bayar\"></td>";
- echo"</tr>";
- echo"</table>";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment