uitlijnen records
de huidige situatie is dit:
http://i868.photobucket.com/albums/ab245/lostprophets2/nu_zps845ba255.png
Mijn wens is dat het op deze maier wordt uitgelezen.
http://i868.photobucket.com/albums/ab245/lostprophets2/zomoethet_zps075a9f2f.png
Elke keer als ik het probeer wordt elke record appart uitgelijnt ipv in een group.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
if(isset($_GET['action']) && $_GET['action']=="add"){
$id=intval($_GET['id']);
if(isset($_SESSION['cart'][$id])){
$_SESSION['cart'][$id]['quantity']++;
}else{
$sql_s="SELECT * FROM posts
WHERE id_product={$id}";
$query_s=mysql_query($sql_s);
if(mysql_num_rows($query_s)!=0){
$row_s=mysql_fetch_array($query_s);
$_SESSION['cart'][$row_s['id_product']]=array(
"quantity" => 1,
"price" => $row_s['price']
);
}else{
$message="Het product ID is ongeldig!";
}
}
}
?>
<h1>Producten lijst Kerstbomen</h1>
<?php
if(isset($message)){
echo "<h2>$message</h2>";
}
?>
<table>
<tr>
<th>Id produkt</th>
<th>size</th>
<th>diameter</th>
<th>tips</th>
<th>nr_of_bulb</th>
<th>cu_ft</th>
<th>l</th>
<th>w</th>
<th>h</th>
<th>cbm</th>
<th>g_w</th>
<th>n_w</th>
<th>stand</th>
<th>pack</th>
<th>warehouse</th>
<th>Price</th>
<th>barcode</th>
<th>Quantity</th>
</tr>
<?php
$sql="SELECT * FROM posts ORDER BY name ASC";
$query=mysql_query($sql);
while ($row=mysql_fetch_array($query)) {
?>
</br></br></br>
<?php echo $row ['name']?>
<tr>
<td><?php echo $row['id_product'] ?></td>
<td><?php echo $row['size'] ?></td>
<td><?php echo $row['diameter'] ?></td>
<td><?php echo $row['tips'] ?></td>
<td><?php echo $row['nr_of_bulb'] ?></td>
<td><?php echo $row['cu_ft'] ?></td>
<td><?php echo $row['l'] ?></td>
<td><?php echo $row['w'] ?></td>
<td><?php echo $row['h'] ?></td>
<td><?php echo $row['cbm'] ?></td>
<td><?php echo $row['g_w'] ?></td>
<td><?php echo $row['n_w'] ?></td>
<td><?php echo $row['stand'] ?></td>
<td><?php echo $row['pack'] ?></td>
<td><?php echo $row['warehouse'] ?></td>
<td><?php echo $row['price'] ?></td>
<td><?php echo $row['barcode'] ?></td>
<td> <b></b> <input class="quantity" type="text" name="aantal" size="2" maxlength="2" value="1"</td>
<td><a href="index.php?page=products&action=add&id=<?php echo $row['id_product'] ?>">Product toevoegen</a></td>
</tr>
<?php
}
?>
</table>
if(isset($_GET['action']) && $_GET['action']=="add"){
$id=intval($_GET['id']);
if(isset($_SESSION['cart'][$id])){
$_SESSION['cart'][$id]['quantity']++;
}else{
$sql_s="SELECT * FROM posts
WHERE id_product={$id}";
$query_s=mysql_query($sql_s);
if(mysql_num_rows($query_s)!=0){
$row_s=mysql_fetch_array($query_s);
$_SESSION['cart'][$row_s['id_product']]=array(
"quantity" => 1,
"price" => $row_s['price']
);
}else{
$message="Het product ID is ongeldig!";
}
}
}
?>
<h1>Producten lijst Kerstbomen</h1>
<?php
if(isset($message)){
echo "<h2>$message</h2>";
}
?>
<table>
<tr>
<th>Id produkt</th>
<th>size</th>
<th>diameter</th>
<th>tips</th>
<th>nr_of_bulb</th>
<th>cu_ft</th>
<th>l</th>
<th>w</th>
<th>h</th>
<th>cbm</th>
<th>g_w</th>
<th>n_w</th>
<th>stand</th>
<th>pack</th>
<th>warehouse</th>
<th>Price</th>
<th>barcode</th>
<th>Quantity</th>
</tr>
<?php
$sql="SELECT * FROM posts ORDER BY name ASC";
$query=mysql_query($sql);
while ($row=mysql_fetch_array($query)) {
?>
</br></br></br>
<?php echo $row ['name']?>
<tr>
<td><?php echo $row['id_product'] ?></td>
<td><?php echo $row['size'] ?></td>
<td><?php echo $row['diameter'] ?></td>
<td><?php echo $row['tips'] ?></td>
<td><?php echo $row['nr_of_bulb'] ?></td>
<td><?php echo $row['cu_ft'] ?></td>
<td><?php echo $row['l'] ?></td>
<td><?php echo $row['w'] ?></td>
<td><?php echo $row['h'] ?></td>
<td><?php echo $row['cbm'] ?></td>
<td><?php echo $row['g_w'] ?></td>
<td><?php echo $row['n_w'] ?></td>
<td><?php echo $row['stand'] ?></td>
<td><?php echo $row['pack'] ?></td>
<td><?php echo $row['warehouse'] ?></td>
<td><?php echo $row['price'] ?></td>
<td><?php echo $row['barcode'] ?></td>
<td> <b></b> <input class="quantity" type="text" name="aantal" size="2" maxlength="2" value="1"</td>
<td><a href="index.php?page=products&action=add&id=<?php echo $row['id_product'] ?>">Product toevoegen</a></td>
</tr>
<?php
}
?>
</table>
Wie zou mij hier mee kunnen helpen?
Gewijzigd op 25/10/2013 13:40:22 door Axl vd
Wil je die tussen [code][/code] steken? Dan krijgen we alles te zien met kleurencode voor code
Gewijzigd op 25/10/2013 13:39:40 door Kris Peeters
Deze manier:
<th>zooi die er in staat
Get "naam product"
$_POST maten van dat product
ruimte tussen tables
Tweede product
<th>zooi die er in staat
Get "naam product"
$_POST maten van dat product
ruimte tussen tables
derde product
<th>zooi die er in staat
Get "naam product"
$_POST maten van dat product
dit blijven loopen dat alle info uit (mysql/table) er staat