# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Kategorienliste # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # sub topcat { $sektionstitel = "Verwaltung der Shopmenütopkategorien"; &Headerout; print &tparser("$cgipfad/templates/user/header.html"); print &tparser("$cgipfad/templates/user/contentkopf.html"); print qq~
Neue Topkategorie eintragen
Hinweise hierzu:
Die hier anzulegenden Topkategorien trennen die einzelnen Artikelbereiche voneinander ab. Haben Sie z.B. einen Shop für Haushaltwaren so könnten die Topkategorien z.B. "Geschirr, Besteck, Töpfe, Elektrogeräte usw." lauten. Zu diesen Topkategorien können Sie dann die entspechenden Unterkategorien erstellen.
Kategorientitel

~; # mid, shopid, mtitel, tid, rf, aktiv my $shopmenues = $prefix . "shopmenues"; my $shopmenuessub = $prefix . "shopmenues"; $menutopquery = "SELECT a.mid, a.shopid, a.mtitel, a.tid, a.rf, a.aktiv, COUNT(b.tid) AS total FROM $shopmenues a LEFT JOIN $shopmenuessub b ON 'a.mid' = b.tid WHERE a.shopid = '$usersid' AND a.tid = '0' GROUP BY a.mid ORDER BY a.rf ASC"; my $sth = $dbh->prepare($menutopquery); my $success = $sth->execute or die DBI->errstr; $summe = $success eq "0E0" ? 0 : $success; $stcount = 0; while (my @inhalt = $sth->fetchrow_array()){ if ($stcount != 0) { $linkoutup = "\"Eins"; } else { $linkoutup = "\"\""; } if ($stcount != ($summe-1)) { $linkoutdown = "\"Eins"; } else { $linkoutdown = "\"\""; } $cssclass = $cssclass eq "innenh" ? "innenh2" : "innenh"; $aktiv_or_not = $inhalt[5] == 0 ? "" : ""; $trout .=qq~ $linkoutup $linkoutdown Eintrag bearbeiten $aktiv_or_not $inhalt[2] [$inhalt[6]] Neue Subkategorie erstellen Kategorie $inhalt[2] mit allen Daten löschen Kategorie $inhalt[2] Content anlegen ~; $stcount++; } $trout = getcategories(0, 0); print qq~
Kategorien: Symbol Eintrag bearbeiten klicken um Kategorien zu bearbeiten.
» Topkategorien neu zählen « Nur nötig wenn sich die Topkategorien nicht ordnen lassen, z.B. nach Löschaktionen
Legende: • Kategorie deaktiviert • Kategorie aktiv - [n] = Anzahl Artikel
~; print $trout; print &tparser("$cgipfad/templates/user/contentfuss.html"); # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # Kategorien mit angegebener ParentKategorie ausgeben (Rekursiv) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # sub getcategories { my $shopmenues = $prefix . "shopmenues"; my $shopmenuessub = $prefix . "shopmenues"; $menutopquery = "SELECT a.mid, a.shopid, a.mtitel, a.tid, a.rf, a.aktiv AS total FROM $shopmenues a WHERE a.shopid = '$usersid' AND a.tid = '".@_[0]."' ORDER BY a.rf ASC"; my $sth = $dbh->prepare($menutopquery); my $success = $sth->execute or die DBI->errstr; my $count = 0; my $tree = ""; if (@_[1] == 0) { $tree .= ""; } while (my @inhalt = $sth->fetchrow_array()) { my $artnrsql = "SELECT COUNT(*) AS number FROM ".$prefix."artikel WHERE subkat='$inhalt[0]'"; my $artnrsth = $dbh->prepare($artnrsql); $artnrsth->execute or die DBI->errstr; my @artcount = $artnrsth->fetchrow_array(); $aktiv_or_not = $inhalt[5] == 0 ? "" : ""; if (@_[1] == 0) { if ($count % 2 == 0) { $tree .= ""; } $count++; } if (@_[1] == 0) { $tree .= "
"; } else { $tree .= "
"; } #$tree .= "
"; } elsif (@_[1] == 1) { #$tree .= "
"; } else { #$tree .= "
"; } $tree .= ''; $tree .= "\"Nach \"Nach "; $tree .= "\"Kategorie"; $tree .= "\"Kategorie"; $tree .= "\"Artikelliste\""; $tree .= "\"Einen"; $tree .= ''; for ($i = 0; $i < @_[1]; $i++) { $tree .= "  "; } if ($inhalt[6] > 0) { $tree .= ""; } else { $tree .= " " } $tree .= $aktiv_or_not; $tree .= "  "; $tree .= "[".$artcount[0]."] "; $tree .= $inhalt[2]; #$tree .= "
"; $tree .= '
'; $tree .= '
'; $tree .= getcategories($inhalt[0], @_[1]+1); if (@_[1] == 0) { $tree .= "
"; } return $tree; }