View difference between Paste ID: kDHfphMm and 3iMn5GFY
SHOW: | | - or go back to the newest paste.
1
<html>
2
<style>
3
	#wrapper{
4
		margin: 150px 0px 50px 0px;
5
	}
6
	table{border-collapse:collapse; margin: 0 auto;}
7
	td, th{
8
		border-right:1px solid black;
9
		border-top:1px solid black;
10
		border-bottom:1px solid black;
11
12
		text-align:center;
13
	}
14
	
15
	.content{font-family:verdana; font-size:12px; color: #2E506E;}
16
	.content:hover{background-color: #9DC7ED;}
17
	
18
	td{padding: 5px 10px 5px 10px;}
19
	a{color: #2E506E;text-decoration:none;}
20
21
	#topleft{
22
		-moz-border-radius-topleft:10px;
23
		-webkit-border-radius-topleft:10px;
24
		-khtml-border-radius-topleft:10px;
25
		border-radius-topleft:10px;
26
27
		border-top: none;
28
		border-left:none;
29
		background-color: #37556E;
30
		color: white;
31
		font-family:verdana;
32
		font-weight:bold;
33
		font-size:13px;
34
	}
35
	#topright{
36
		-moz-border-radius-topright:10px;
37
		-webkit-border-radius-topright:10px;
38
		-khtml-border-radius-topright:10px;
39
		border-radius-topright:10px;
40
41
		border-top: none;
42
		border-right:none;
43
		background-color: #37556E;
44
		color: white;
45
		font-family:verdana;
46
		font-weight:bold;
47
		font-size:13px;
48
	}
49
	.top{
50
		border-top:none;
51
		background-color: #37556E;
52
		color: white;
53
		font-family:verdana;
54
		font-weight:bold;
55
		font-size:13px;
56
	}
57
	.mid_left_content{
58
		border-left:none;
59
		font-weight:bold;
60
	}
61
	.mid_right_content{
62
		border-right:none;
63
	}
64
	.foot_content{
65
		border-left:none;
66
		border-right:none;
67
		font-size:12px;
68
		text-align:right;
69
		font-family:verdana;
70
		color: white;
71
		font-weight:bold;
72
	}
73
	.foot_content a{
74
		color: #2E506E;
75
		text-decoration:none;
76
	}
77
	#footer_tr{
78
		background-color: #024A68;
79
		height:30px;
80
81
		-moz-border-radius-bottomright:10px;
82
		-webkit-border-radius-bottomright:10px;
83
		-khtml-border-radius-bottomright:10px;
84
		border-radius-bottomright:10px;
85
86
		-moz-border-radius-bottomleft:10px;
87
		-webkit-border-radius-bottomleft:10px;
88
		-khtml-border-radius-bottomleft:10px;
89
		border-radius-bottomleft:10px;
90
	}
91
92
	#id_handphone{width:120px;text-align:center;padding: 2.5px 5px;}
93
	#kategori{width:65px;text-align:center;padding: 2.5px 5px;}
94
	#merk{width:95px;text-align:center;padding: 2.5px 5px;}
95
	#tipe{width:100px;text-align:center;padding: 2.5px 5px;}
96
	#hargabeli{width:75px;text-align:center;padding: 2.5px 5px;}
97
	#hargajual{width:80px;text-align:center;padding: 2.5px 5px;}
98
	#stok{width:35px;text-align:center;padding: 2.5px 5px;}
99
100
	#td_footer{
101
		background-color: #d5d5d5;
102
		border-right:none;
103
	}
104
105
	#footer{
106
		height:30px;
107
	}
108
109
#mss{
110
	border: red 1px solid;background-color:gray;color: white;font-family: verdana;
111
	padding: 10px 10px 10px 10px;margin: 0 auto;width:600px;height:40px;text-align:center;
112
}
113
114
</style>
115
<body>
116
	<div id='wrapper'>
117
		<form action='../interface/editstok/do_edit_stok_acc.php' method='post'>
118
		<table>
119
			<tr>
120
				<td id='topleft'>Id Accecoriss</td>
121
				<td class='top'>Nama Barang</td>
122
				<td class='top'>Kategori</td>
123
				<td class='top'>Harga Beli</td>
124
				<td class='top'>Harga Jual</td>
125
				<td id='topright'>Stok</td>
126
			</tr>
127
<?php
128
129
include ('../../connect.php');
130
error_reporting(0);
131
132
	$id = $_GET['select'];
133
134
	if (empty($id)) {
135
		die("<div id='mss'>Silahkan pilih barang terlebih dahulu</div>");
136
	}
137
138
foreach ($_GET['select'] as $key => $id) {
139
140
		date_default_timezone_set('UTC');
141
		date_default_timezone_set('Asia/Jakarta');
142
143
		$date = date("Y-m-d H:i:s");
144
		
145
		$sql = mysql_query("SELECT id_acc, nama_barang, kategori, harga_beli, harga_jual, stok from db_accecoriss where id_acc = '$id' ");
146
147
			while ($line = mysql_fetch_row($sql)){
148
				
149
				$id = $line[0];
150
				$merk = $line[1];
151
				$kategori = $line[2];
152
				$hargabeli= $line[3];
153
				$hargajual= $line[4];
154
				$stok = $line[5];
155
156
			echo "
157
				
158
				<input type='hidden' name='date[]' value='$date' />
159
				<input type='hidden' name='id[]' value='$id' />
160
161
				<tr bgcolor='#d5d5d5' class='content'>
162
		  			<td class='mid_left_content'>$id</td>
163
					<td><input id='merk' width='95px' type='text' name='merk[]' value='$merk'></td>
164
					<td><input id='kategori' width='55px' type='text' name='kategori[]' value='$kategori'></td>
165
					<td><input id='hargabeli' width='75px' type='text' name='hargabeli[]' value='$hargabeli'></td>
166
					<td><input id='hargajual' width='80px' type='text' name='hargajual[]' value='$hargajual'></td>
167
					<td class='mid_right_content'><input id='stok' type='text' name='stok[]' value='$stok'></td>
168
				</tr>"; 	
169
			}
170
		}
171
?>
172
			<tr>
173
				<td class ='footer_content' colspan='7' id='td_footer'><input type='submit' value='Edit'></td>
174
			</tr>
175
			<tr bgcolor='#d5d5d5' id='footer_tr'><td colspan='9' class='foot_content'><?php echo " $date"; ?></td></tr>
176
		</table>
177
	</form>
178
	</div>
179
<!--
180
132	$id = $_GET['select']; lebih baik dimanfaatkan dengan benar.. jadi script foreach berikutnya pake $id bukan $_GET[select]
181
182
136 dijelaskan kl tidak ada isi keluar pemberitahuan tetapi kl ada harusnya lanjut khan.. seharusnya km menulis
183
if(is_empty()) 
184
{ 
185
	pesan 
186
}else{
187
	perintah dibawahnya
188
}
189
jadi bila error akibat kosong.. tidak akan menjalankan tablenya
190
191
173 usahakan submit kasi nama
192
193
all: dan usahakan agar pemakaian id untuk 1 saja id='td_footer' (contoh) tidak boleh lebih
194
class yg boleh banyak .. id itu cuma 1.. 
195
-->	
196
</body>
197
</html>