function echoMenu($selectedTabID, $isLoggedIn, $isAdmin, $warenkorbCount) { echo "\n\t<nav class=\"navbar navbar-inverse navbar-fixed-top\">\n\t\t<div class=\"container>\n\t\t\t<div class=\"navbar-header\">\n\t\t\t\t<button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\" aria-controls=\"navbar\">\n\t\t\t\t</button>\n\t\t\t\t<a class=\"navbar-brand\" href=\"index.php\">Startseite</a>\n\t\t\t</div>\n\t\t\t<div id=\"navbar\" class=\"collapse navbar-collapse\">\n\t\t\t\t<ul class=\"nav navbar-nav\">"; $arrayNames = getMenuHeaderStrings(); //return an array of arrays[2]{tag,name} $length = count($arrayNames); //home is id == -1 if ($selectedTabID == -1) { echo "<li class=\"active\"><a href=\"index.php\">Home</a></li>"; } else { echo "<li><a href=\"index.php\">Home</a></li>"; } //after home add all supercategories for ($intI = 0; $intI < $length; $intI++) { if ($selectedTabID == intval($arrayNames[$intI][0])) { echo "<li class=\"active\"><a href=\"products.php?id=" . $arrayNames[$intI][0] . "\">" . $arrayNames[$intI][1] . "</a></li>"; } else { echo "<li><a href=\"products.php?id=" . $arrayNames[$intI][0] . "\">" . $arrayNames[$intI][1] . "</a></li>"; } } //after supercategories add warenkorb and myaccount //warenkorb is id == -2 if ($selectedTabID == -2) { echo "<li class=\"active\"><a href=\"cart.php\">Warenkorb({$warenkorbCount})</a></li>"; } else { echo "<li><a href=\"cart.php\">Warenkorb({$warenkorbCount})</a></li>"; } //my account / admin == -3 if ($selectedTabID == -3) { if ($isLoggedIn && $isAdmin) { echo "<li class=\"active\"><a href=\"admin.php\">Adminbereich</a></li>"; } else { if ($isLoggedIn) { echo "<li class=\"active\"><a href=\"account.php\">Mein Account</a></li>"; } else { echo "<li class=\"active\"><a href=\"anmelden.php\">Einloggen/Registrieren</a></li>"; } } } else { if ($isLoggedIn && $isAdmin) { echo "<li><a href=\"admin.php\">Adminbereich</a></li>"; } else { if ($isLoggedIn) { echo "<li><a href=\"account.php\">Mein Account</a></li>"; } else { echo "<li><a href=\"anmelden.php\">Einloggen/Registrieren</a></li>"; } } } if ($isLoggedIn) { echo "<li><a href=\"ausloggen.php\">Ausloggen</a></li>"; } echo "</ul>\n\t\t\t\t<div class=\"navbar-header\" style=\"position: right; padding-left: 400px\">\n\t\t\t\t\t<button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\" aria-controls=\"navbar\">\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</nav>\n \n\t<div class=\"container theme-showcase\" role=\"main\" name=\"placeholder-banner\">\n\t\t<br>\n\t\t<div class=\"jumbotron\">\n\t\t\t<h1>MacAPPLE</h1>\n\t\t\t<br><br><br><br>\n\t\t</div>\n\t</div>"; return 0; }
echo "<option value=\"" . $d[0] . "\">" . $d[1] . "</option>"; } echo "</select></td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table></center>\n\t\t\t\t\t\t\t<center><input type=\"submit\" name=\"delCategorySubmit\" class=\"btn btn-sm btn-default\" style=\"margin-top:10px;\" value=\"Löschen\" /></center>\n\t\t\t\t\t\t\t</form>"; } ?> </div> <div class="col-sm-4"> <?php if ($isAdmin) { echo "<form method=\"post\">\n\t\t\t\t\t\t\t<center><table>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Kategorie:</td>\n\t\t\t\t\t\t\t<td><select name=\"editCategoryItem\" data-size=5>"; $array = getCategoriesWithSuperCategories(); foreach ($array as $d) { echo "<option value=\"" . $d[0] . "\">" . $d[1] . "</option>"; } echo "</select></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Name der Kategorie:</td>\n\t\t\t\t\t\t\t<td><input type=\"text\" class=\"form-control-nosize\" style=\"width:220px\" name=\"editCategoryName\"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Übergeordnete Kategorie:</td>\n\t\t\t\t\t\t\t<td><select name=\"editCategorySupercategory\" data-size=5>\n\t\t\t\t\t\t\t<option value=\"0\">Keine übergeordnete Kategorie</option>"; $menues = getMenuHeaderStrings(); foreach ($menues as $d) { echo "<option value=\"" . $d[0] . "\">" . $d[1] . "</option>"; } echo "</select></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table></center>\n\t\t\t\t\t\t\t<center><input type=\"submit\" name=\"editCategorySubmit\" class=\"btn btn-sm btn-default\" style=\"margin-top:10px;\" value=\"Ersetzen\" /></center>\n\t\t\t\t\t\t\t</form>"; } ?> </div> </div> </div> </div> </div> <div class="row" style="margin-left:15px;margin-right:15px;"> <center> <a href="#myModal" data-toggle="modal">