Breadcrumbs menu
Quote:
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
if (isset($cat)) {
if (isset($_GET['showprod']) && $cat > 0) {
$q = "SELECT COUNT(*) AS totaal FROM produkten WHERE subcat = ".$subcat." AND vis = 1";
$rs = mysql_query($q);
$aantalprod = (mysql_num_rows($rs) > 0 ? mysql_fetch_object($rs)->totaal : 0);
// Selectievelden
echo '<form action="?page=assortiment" method="get">';
echo '<fieldset>';
echo '<input type="hidden" name="page" value="assortiment" />';
echo '<input type="hidden" name="cat" value="'.$cat.'" />';
echo '<input type="hidden" name="subcat" value="'.$subcat.'" />';
echo '<input type="hidden" name="showprod" value="'.$showprod.'" />';
echo 'Weergave per pagina : toon ';
echo '<select name="maxperpage" onchange="this.form.submit();">';
for ($i = 20; $i <= 100; $i += 20)
{
echo '<option value="'.$i.'"';
echo ($i == $maxperpage ? ' selected="selected"' : '');
echo '>'.$i.'</option>'."\n";
}
echo '</select>';
echo ' produkten<br />';
echo 'Aantal gevonden producten: '.$aantalprod;
echo '</fieldset>';
echo '</form><br />';
// Pagina's
$numpages = $aantalprod / $maxperpage;
echo '<div>';
if ($numpages > 0)
{
echo 'Pagina: ';
}
for ($x = 0; $x < $numpages; $x++)
{
$y = $x + 1;
$z = $x * $maxperpage;
echo '<a href="?page=assortiment&showprod=1&cat='.$cat.'&subcat='.$subcat.'&offset='.$z.'" style="text-decoration:none;">'.$y.'</a> ';
}
echo '</div><br />';
// Icoon output
$offset = (isset($_GET['offset']) ? $_GET['offset'] : 0);
$q = "SELECT * FROM produkten WHERE subcat=".$subcat." AND vis=1 ORDER BY volgorde ASC LIMIT ".$maxperpage." OFFSET ".$offset;
$rs = mysql_query($q);
$float_clear = array();
$counter = 1;
for ($i = 5; $i <= 100; $i += 5)
{
$float_clear[] = $i;
}
while ($row = mysql_fetch_object($rs))
{
$pafbeelding = ($row->afbeelding != '' ? $row->afbeelding : $root.'/buttons/noimg100.jpg');
echo '<div class="prodList">';
echo showthumb($pafbeelding);
echo $row->naam.'';
echo '</div>';
if (in_array($counter, $float_clear))
{
echo '<div class="floatClear">';
echo '<!-- Valid Filler -->';
echo '</div>';
}
$counter++;
}
$restu = 'showprod=1&cat='.$cat.'&subcat='.$subcat;
if ($numpages > 0)
{
echo 'Pagina: ';
}
for ($x = 0; $x < $numpages; $x++)
{
$y = $x + 1;
$z = $x * $maxperpage;
echo '<a href="?page=assortiment&showprod=1&cat='.$cat.'&subcat='.$subcat.'&offset='.$z.'" style="text-decoration:none;">'.$y.'</a> ';
}
echo '</div><br />';
}
else if (isset($cat) && $cat > 0) {
$q = "SELECT categorie.*, catdesc.* FROM categorie LEFT JOIN catdesc ON catdesc.id=categorie.child WHERE categorie.parent=".$cat." AND categorie.tonen = 1 ORDER BY categorie.volgorde";
$rs = mysql_query($q);
while ($row = mysql_fetch_object($rs)) {
$button = ($row->button != '' ? $row->button : '/buttons/noimg75.jpg');
echo '<div class="categorieList">';
echo '<a href="?page=assortiment&showprod=1&cat='.$cat.'&subcat='.$row->child.'">';
echo '<img src="'.$root.'/'.$button.'" alt="Categorie Knop" /><br />';
echo $row->descr;
echo '</a>';
echo '</div>';
}
}
else {
echo '<div class="categorieList">';
echo 'Er is een fout opgetreden, de ingevoerde categorie bestaat niet (meer).';
echo '</div>';
}
}
else {
$q = "SELECT categorie.*, catdesc.* FROM categorie LEFT JOIN catdesc ON catdesc.id=categorie.child WHERE categorie.parent=0 AND categorie.tonen = 1 ORDER BY categorie.volgorde";
$rs = mysql_query($q);
while ($row = mysql_fetch_object($rs)) {
$button = ($row->button != '' ? $row->button : '/buttons/noimg75.jpg');
echo '<div class="categorieList">';
echo '<a href="?page=assortiment&cat='.$row->child.'">';
echo '<img src="'.$root.'/'.$button.'" alt="Categorie Knop" /><br />';
echo $row->descr;
echo '</a>';
echo '</div>';
}
}
?>
if (isset($cat)) {
if (isset($_GET['showprod']) && $cat > 0) {
$q = "SELECT COUNT(*) AS totaal FROM produkten WHERE subcat = ".$subcat." AND vis = 1";
$rs = mysql_query($q);
$aantalprod = (mysql_num_rows($rs) > 0 ? mysql_fetch_object($rs)->totaal : 0);
// Selectievelden
echo '<form action="?page=assortiment" method="get">';
echo '<fieldset>';
echo '<input type="hidden" name="page" value="assortiment" />';
echo '<input type="hidden" name="cat" value="'.$cat.'" />';
echo '<input type="hidden" name="subcat" value="'.$subcat.'" />';
echo '<input type="hidden" name="showprod" value="'.$showprod.'" />';
echo 'Weergave per pagina : toon ';
echo '<select name="maxperpage" onchange="this.form.submit();">';
for ($i = 20; $i <= 100; $i += 20)
{
echo '<option value="'.$i.'"';
echo ($i == $maxperpage ? ' selected="selected"' : '');
echo '>'.$i.'</option>'."\n";
}
echo '</select>';
echo ' produkten<br />';
echo 'Aantal gevonden producten: '.$aantalprod;
echo '</fieldset>';
echo '</form><br />';
// Pagina's
$numpages = $aantalprod / $maxperpage;
echo '<div>';
if ($numpages > 0)
{
echo 'Pagina: ';
}
for ($x = 0; $x < $numpages; $x++)
{
$y = $x + 1;
$z = $x * $maxperpage;
echo '<a href="?page=assortiment&showprod=1&cat='.$cat.'&subcat='.$subcat.'&offset='.$z.'" style="text-decoration:none;">'.$y.'</a> ';
}
echo '</div><br />';
// Icoon output
$offset = (isset($_GET['offset']) ? $_GET['offset'] : 0);
$q = "SELECT * FROM produkten WHERE subcat=".$subcat." AND vis=1 ORDER BY volgorde ASC LIMIT ".$maxperpage." OFFSET ".$offset;
$rs = mysql_query($q);
$float_clear = array();
$counter = 1;
for ($i = 5; $i <= 100; $i += 5)
{
$float_clear[] = $i;
}
while ($row = mysql_fetch_object($rs))
{
$pafbeelding = ($row->afbeelding != '' ? $row->afbeelding : $root.'/buttons/noimg100.jpg');
echo '<div class="prodList">';
echo showthumb($pafbeelding);
echo $row->naam.'';
echo '</div>';
if (in_array($counter, $float_clear))
{
echo '<div class="floatClear">';
echo '<!-- Valid Filler -->';
echo '</div>';
}
$counter++;
}
$restu = 'showprod=1&cat='.$cat.'&subcat='.$subcat;
if ($numpages > 0)
{
echo 'Pagina: ';
}
for ($x = 0; $x < $numpages; $x++)
{
$y = $x + 1;
$z = $x * $maxperpage;
echo '<a href="?page=assortiment&showprod=1&cat='.$cat.'&subcat='.$subcat.'&offset='.$z.'" style="text-decoration:none;">'.$y.'</a> ';
}
echo '</div><br />';
}
else if (isset($cat) && $cat > 0) {
$q = "SELECT categorie.*, catdesc.* FROM categorie LEFT JOIN catdesc ON catdesc.id=categorie.child WHERE categorie.parent=".$cat." AND categorie.tonen = 1 ORDER BY categorie.volgorde";
$rs = mysql_query($q);
while ($row = mysql_fetch_object($rs)) {
$button = ($row->button != '' ? $row->button : '/buttons/noimg75.jpg');
echo '<div class="categorieList">';
echo '<a href="?page=assortiment&showprod=1&cat='.$cat.'&subcat='.$row->child.'">';
echo '<img src="'.$root.'/'.$button.'" alt="Categorie Knop" /><br />';
echo $row->descr;
echo '</a>';
echo '</div>';
}
}
else {
echo '<div class="categorieList">';
echo 'Er is een fout opgetreden, de ingevoerde categorie bestaat niet (meer).';
echo '</div>';
}
}
else {
$q = "SELECT categorie.*, catdesc.* FROM categorie LEFT JOIN catdesc ON catdesc.id=categorie.child WHERE categorie.parent=0 AND categorie.tonen = 1 ORDER BY categorie.volgorde";
$rs = mysql_query($q);
while ($row = mysql_fetch_object($rs)) {
$button = ($row->button != '' ? $row->button : '/buttons/noimg75.jpg');
echo '<div class="categorieList">';
echo '<a href="?page=assortiment&cat='.$row->child.'">';
echo '<img src="'.$root.'/'.$button.'" alt="Categorie Knop" /><br />';
echo $row->descr;
echo '</a>';
echo '</div>';
}
}
?>
Dit resulteert in de pagina www.prohoreca.nl/assortiment.
Maar hoe realiseer ik nu dat breadcrumbs-menu? Ik heb al iets geprobeerd met $cat en $subcat, maar daarmee krijg ik alleen nummers...
vervolgens kun je dan met "array_pop" laatste segment van de array pakken ( dit is dan de aktieve page waar je op zit ) en alle segmenten die je overhoud kun je doorheen loopen als voorlopers van je breadcrumbs
dus: tafelaankleding -> servetten