} //the first time login does not have groupName in table $answer = array(1, $res['name'], $res['surname']); echo json_encode($answer); } else { $answer[0] = 0; echo json_encode($answer); } $connection->close(); } } //setup step: adding first group if (isset($_POST['addingFirstGroupName'])) { include_once 'db.php'; include_once '../function/funcs.php'; if (checkFirstSetup()) { $connection = new mysqli(HOST, USER, PSW, DB); if ($connection->error) { echoResponse('no', $connection->error); } $addingField = 'ALTER TABLE board ADD firstSetup SMALLINT UNSIGNED'; $added = $connection->query($addingField); if (!$added) { echoResponse('no', $added->error); } else { //echoResponse('yes','Field Added!'); $settingFirstSetup = "UPDATE board SET firstSetup='1' WHERE boardName='" . getBoardName() . "'"; $settedFirstSetup = $connection->query($settingFirstSetup); if (!$settedFirstSetup) { echoResponse('no', $settedFirstSetup->error); } else {
<nav class="navbar navbar-default" role="navigation"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#"><?php echo getBoardName(); ?> </a> </div> <?php if (!checkFirstSetup()) { echo "\n <!-- Collect the nav links, forms, and other content for toggling -->\n <div class='collapse navbar-collapse navbar-ex1-collapse'>\n <ul class='nav navbar-nav'>\n <li class='dropdown'>\n <a href='#' class='dropdown-toggle' data-toggle='dropdown'>New..<b class='caret'></b></a>\n <ul class='dropdown-menu'>\n <li><a href='#' id='tktNew'>Ticket</a></li>\n "; if ($user->getPosition() == 'admin' || $user->getPosition() == 'superuser') { echo "\n <li><a href='#' id='customerNew'>Customer</a></li>\n <li><a href='#' id='assetNew'>Asset</a></li>"; } echo " \n </ul>\n </li>\n <li class='dropdown'>\n <a href='#' class='dropdown-toggle' data-toggle='dropdown'>List Custom<b class='caret'></b></a>\n <ul class='dropdown-menu'>\n <li><a href='#'>list</a></li>\n <li><a href='#'>something</a></li>\n <li><a href='#'>custom</a></li>\n <li><a href='#'>TO DO</a></li>\n </ul>\n </li>\n </ul>\n <form class='navbar-form navbar-left' role='search'>\n <div class='form-group'>\n <input type='text' class='form-control' data-toggle='tooltip' data-placement='bottom' title='You can use any parameter to search a ticket' id='ticketField' placeholder='Search Ticket'>\n </div>\n <button type='submit' id='searchTicket' class='btn btn-default'>Go</button>\n </form>\n <form class='navbar-form navbar-left' role='search'>\n <div class='form-group'>\n <input type='text' class='form-control' data-toggle='tooltip' data-placement='bottom' title='You can use any parameter to search a customer' id='customerField' placeholder='Search Customer'>\n </div>\n <button type='submit' id='searchCustomer' class='btn btn-default'>Go</button>\n </form>\n <form class='navbar-form navbar-left' role='search'>\n <div class='form-group'>\n <input type='text' class='form-control'data-toggle='tooltip' data-placement='bottom' title='You can use any parameter to search an asset' id='assetField' placeholder='Search Asset'>\n </div>\n <button type='submit' id='searchAsset' class='btn btn-default'>Go</button>\n </form>\n "; } else { doAlert('An admin must complete the first setup procedure.\\nUse the control panel on the right!'); } ?> <ul class='nav navbar-nav navbar-right'> <?php if ($user->getPosition() == 'admin' || $user->getPosition() == 'superuser') { echo " \n <li><a href='#cpanel' id='cpanelButton'>Control Panel</a></li>"; } ?>