// Connects to database
function db_connect() {
return new mysqli("localhost", "sienasel_sbxuser", "OMITTED FOR SECURITY", "sienasel_sandbox");
}
/* ------------------------- Document Structure Functions ---------------------------- */
// Print html header with bootstrap css and page title
function print_html_header($title) {
if ($title != "Login")
$menu = make_menu_bs($title);
echo '
'.$title.'
'.$menu.'
';
if ($title != "Login")
echo '
'.$title.'
';
}
// Print html footer with bootstrap js
function print_html_footer() {
echo '
';
}
/* ------------------------- Main Menu Functions ---------------------------- */
// Get main menu items
function get_menu_items($title) {
$items['home.php'] = "Home";
$items['play_trivia.php'] = "Play Trivia";
$items['view_leaders.php'] = "View Leader Board";
$items['rank_question.php'] = "Rank Questions";
$items['insert_question.php'] = "Insert Question";
if ($_SESSION['admin']) {
$items['insert_user.php'] = "Delete User";
$items['delete_question.php'] = "Delete Question";
}
$items['logout.php'] = "Logout";
foreach ($items as $key=>$value) {
$active = '';
if ($value==$title) $active = "active";
$menu_items .= '