<style type="text/css">
#menu-boards {
	width: 100%;
	display: inline-block;
	float: left;
}
.menu-board-row {
	clear: both;
}
#available-items {
	float: right;
	width: 275px;
}
#available-categories, 
#available-widgets {
	float: right;
	display: inline-block;
	margin-right:20px;
	width: 220px;
	background:#2077a1;
	border: solid 1px #cccfd2;
	  -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    border-radius: 6px;
	padding:13px 18px 8px 13px;
	margin-top:15px;
	margin-bottom:15px;
	padding-top:0px;
}
#available-categories h2,
#available-widgets h2 {
	font-family:Arial, Helvetica, sans-serif;
	font-size:1.2em; color:#fff; font-weight:bold;
	cursor: pointer;
}
.menu-board li, #available-categories li,
.menu-board li, #available-widgets li {
	margin:0;padding:0;
	width:97%;
	color:#000;
	background:#fff;
	border: solid 1px #cccfd2;
	  -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
	padding:5px;
	margin-bottom:5px;
}
.menu-board {
	float: left;
	margin-left: 15px;
	width: 43%;
	background: #2077a1;
	border: solid 1px #cccfd2;
	-webkit-border-radius: 6px;
	-moz-border-radius: 6px;
	border-radius: 6px;
	padding: 13px 13px 8px 11px;
	margin-top: 0px;
	margin-bottom: 15px;
	padding-top: 0px;
}
.menu-board h2 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 1.2em;
	color: #fff;
	font-weight: bold;
}
.dd-placeholder {
	display: inline-block;
	max-width: 100%;
	width: 100%;
}
</style>
<?php
if ($_SESSION['FirstName'] == "") {
	echo 'You are not authorized to view this page. <br><br>You may <a href="index.php">log in here.</a>';
	exit;
	}
if($_SESSION['menu_boards']>0){
echo "<h1>Manage Your Menu Boards</h1>
<center>The below boxes represent your $_SESSION[menu_boards] available digital menu boards. <br>Click on the settings gear icon for a menu board to manage the content displayed on that board.</center><br><br>";
} else {
	echo "You are not subscribed to this service.";
}

if($_GET['admin-page']>""){
$admin_page = "?admin-page=".$_GET['admin-page'];
}
if($_GET['board']>""){
	$selected_board = $_GET['board'];
	//echo "selected: $selected_board";
}
//echo"page:".$_GET['admin-page'];
//echo"page link:".$admin_page;
//if(empty($selected_board)){
	echo '<div id="menu-boards">';
	echo '<div class="menu-board-row">';
		//echo 'Action = ' . $action; (for testing)
	if(empty($selected_board)){
		//no board selected
		$board_counter = 1;
		$active_boards = $_SESSION['menu_boards'];
	} else {
		//individual board selected
		$board_counter = $selected_board;
		$active_boards = $selected_board;;
	}
	while ($board_counter <= $active_boards){
		echo '<div id="menu-board-'.$board_counter.'" class="menu-board dd" data-board-number="'.$board_counter.'">';
		echo "<h2>Menu Board $board_counter <a href='".$_SERVER['PHP_SELF']."?admin-page=8&board=$board_counter' target='_blank'><span style='float:right;'><img src='images/gear-icon.png'></span></a></h2>";
		
		echo '</div><!-- /.menu-board -->';
		$board_counter++;

	}

	echo '</div><!-- /.menu-board-row -->';
	echo '</div> <!-- /#menu-boards -->';

?>
