View difference between Paste ID: NbZxz7BG and Qfvc8Kmb
SHOW: | | - or go back to the newest paste.
1
<?php
2
/*
3
ini cuma tes.. tolong dienya di hapus
4
5
echo "get<pre>";print_r($_GET);echo "</pre>";
6
echo "POST<pre>";print_r($_POST);echo "</pre>";
7
die();
8
*/
9
//kl udah dapet variabel2nya.. comment 2 perintah di atas
10
error_reporting(1); //kl 0 bener2 gk kelihatan.. kl mo liat error secara full 2047
11
?><html>
12
13
<head>
14
  <title>View Data</title>
15
</head>
16
17
<body>
18
19
<?php
20
//if($_POST['id']){ << pake yang ini ga bisa mulu walau di ganti GET juga tetep ga  bisa
21-
		echo"<table align=\"center\">";
21+
22-
		echo"<tr bgcolor=\"iceblue\">";
22+
		echo "<table align='center'>";
23-
	echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
23+
		echo "<tr bgcolor='iceblue'>";
24-
	echo"No</td>";
24+
	echo "<td align='center'><font face='calibri' color='white'>";
25-
	echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
25+
	echo "No</td>";
26-
	echo"Id Produk</td>";
26+
	echo "<td align='center'><font face='calibri' color='white'>";
27-
	echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
27+
	echo "Id Produk</td>";
28-
	echo"Id Kategori</td>";
28+
	echo "<td align='center'><font face='calibri' color='white'>";
29-
	echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
29+
	echo "Id Kategori</td>";
30-
	echo"Merk Produk</td>";
30+
	echo "<td align='center'><font face='calibri' color='white'>";
31-
	echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
31+
	echo "Merk Produk</td>";
32-
	echo"Harga Beli</td>";
32+
	echo "<td align='center'><font face='calibri' color='white'>";
33-
	echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
33+
	echo "Harga Beli</td>";
34-
	echo"Harga Jual Satuan</td>";
34+
	echo "<td align='center'><font face='calibri' color='white'>";
35-
		echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
35+
	echo "Harga Jual Satuan</td>";
36-
		echo"Harga Jual Setengah Bungkus</td>";
36+
		echo "<td align='center'><font face='calibri' color='white'>";
37-
	    		echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
37+
		echo "Harga Jual Setengah Bungkus</td>";
38-
		echo"Harga Jual Satu Bungkus</td>";
38+
	    		echo "<td align='center'><font face='calibri' color='white'>";
39-
		echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
39+
		echo "Harga Jual Satu Bungkus</td>";
40-
		echo"Jumlah Stok</td>";
40+
		echo "<td align='center'><font face='calibri' color='white'>";
41-
		echo"<td align=\"center\"><font face=\"calibri\" color=\"white\">";
41+
		echo "Jumlah Stok</td>";
42-
		echo"Choise</td>";
42+
		echo "<td align='center'><font face='calibri' color='white'>";
43-
		echo"</tr>";			
43+
		echo "Choise</td>";
44
		echo "</tr>";			
45
46
47
	$nomor = 0;
48
49
	$conn = mysql_connect("localhost","root","dancing01")or
50
		die(mysql_error()."Cannot connect to server");
51
52
		$data = mysql_select_db("warung", $conn)or
53
			die(mysql_error()."Cannot connect to database");
54
55
			$sql = "select * from master_produk ORDER BY id_kategori ASC";
56
			$result = mysql_query($sql, $conn)or
57
				die(mysql_error()."An error occure in SQL query <br> Query: $sql");
58
59
		while($line = mysql_fetch_row($result)){
60
61
			$nomor++;
62
63
			$id_produk = $line[0];
64
			$id_kategori = $line[1];
65
			$merk_produk = $line[2];
66
				$harga_beli = $line[3];
67
				$harga_jual_satuan = $line[4];
68
				$harga_jual_setengah_bks = $line[5];
69
				$harga_jual_satu_bks = $line[6];
70
				$jumlah_stok = $line[7];
71-
				echo"<tr bgcolor=\"white\">";
71+
72-
					echo"<td align=\"center\"> <font face=\"calibri\" color=\"gray\">";
72+
				echo "<tr bgcolor='white'>";
73-
					echo"$nomor</td>";
73+
					echo "<td align='center'> <font face='calibri' color='gray'>";
74-
				    echo"<td align=\"center\"> <font face=\"calibri\" color=\"gray\">";
74+
					echo "$nomor</td>";
75-
					echo"$id_produk</td>";
75+
				    echo "<td align='center'> <font face='calibri' color='gray'>";
76-
					echo"<td align=\"center\"> <font face=\"calibri\" color=\"gray\">";
76+
					echo "$id_produk</td>";
77-
					echo"$id_kategori</td>";
77+
					echo "<td align='center'> <font face='calibri' color='gray'>";
78-
					echo"<td align=\"center\"> <font face=\"calibri\" color=\"gray\">";
78+
					echo "$id_kategori</td>";
79-
					echo"$merk_produk</td>";
79+
					echo "<td align='center'> <font face='calibri' color='gray'>";
80-
					echo"<td align=\"center\"> <font face=\"calibri\" color=\"gray\">";
80+
					echo "$merk_produk</td>";
81-
					echo"$harga_beli</td>";
81+
					echo "<td align='center'> <font face='calibri' color='gray'>";
82-
					echo"<td align=\"center\"> <font face=\"calibri\" color=\"gray\">";
82+
					echo "$harga_beli</td>";
83-
					echo"$harga_jual_satuan</td>";
83+
					echo "<td align='center'> <font face='calibri' color='gray'>";
84-
					echo"<td align=\"center\"> <font face=\"calibri\" color=\"gray\">";
84+
					echo "$harga_jual_satuan</td>";
85-
					echo"$harga_jual_setengah_bks</td>";
85+
					echo "<td align='center'> <font face='calibri' color='gray'>";
86-
					echo"<td align=\"center\"> <font face=\"calibri\" color=\"gray\">";
86+
					echo "$harga_jual_setengah_bks</td>";
87-
					echo"$harga_jual_satu_bks</td>";
87+
					echo "<td align='center'> <font face='calibri' color='gray'>";
88-
					echo"<td align=\"center\"> <font face=\"calibri\" color=\"gray\">";
88+
					echo "$harga_jual_satu_bks</td>";
89-
					echo"$jumlah_stok</td>";
89+
					echo "<td align='center'> <font face='calibri' color='gray'>";
90-
					echo"<td align=\"center\"> <a href=\"editData.php\"><font face=\"calibri\" color=\"gray\">";
90+
					echo "$jumlah_stok</td>";
91-
					echo"Edit</td>";
91+
					echo "<td align='center'> 
92-
				echo"</tr>";
92+
					<a href='editData.php?id=$id_produk'><font face='calibri' color='gray'>";
93
					echo "Edit</a></td>";
94
				echo "</tr>";
95-
				echo"</tr>";
95+
96-
				echo"</table>";
96+
97
				echo "</tr>";
98
				echo "</table>";
99
	}
100
?>
101
102
</body>
103
104
</html>