
<?php 

?>
            
 <style type="text/css">
#menu-boards {
	width: 100%;
	display: inline-block;
	float: left;
	margin-bottom:22px;
}
.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%;
}
.add-new-slide{
	background: #48a3db none repeat scroll 0 0;
    border: 1px solid #777777;
    border-radius: 4px;
    color: #fff;
    display: inline-block;
    float: right;
    margin-left: 8px;
    padding: 3px 12px 3px 0;
    text-align: center;
    width: auto;
    cursor: pointer;
}
.add-new-slide:hover{
background-color: #45CD35;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
	$('.add-new-slide').click(function(){
		
		$.ajax({
			type: 'post',
			url: 'save_menu_board_settings.php',
			data: { action: 'add-new-slide' },
			dataType: 'json'
		}).done(function(response) {
			console.log(response);
			window.location = 'http://www.tastedev.com/cmsadmin/index.php?admin-page=8&slide='+response+'';
		});
	});
});

</script>
<?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 Slides for Your Menu Board</h1><div class='preview-menu-board'><a href='?admin-page=5' type='button'><p>Manage Monitors</p></a></div>
<center>A slide is basically a digital picture of whatever you want displayed on a monitor. <br>You can add, edit or remove slides on this page. <br>Once you have your slides created, click Manage Monitors to add slides to a monitor.</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">';

if($_SESSION['adminkey']=="security"){
	$query2="Select * from menu_boards where add_on_slide='1' order by board_number";	
    $rs2=mysql_query($query2);
    echo'<center><table width=70% cellpadding=5 cellspacing=5><tr><td colspan="2"><strong>Slide Name</strong>
    <button class="add-new-slide">Add new slide</button>
    </td></tr>
	<tr><td colspan="4"><hr /></td></tr>';
    while($nt2=mysql_fetch_array($rs2)){
          echo'<tr><td>Slide '.$nt2['board_number'].'('.$nt2['board_name'].')<a href="?admin-page=8&slide='.$nt2['board_number'].'"><img src="images/gear-icon.png"></a></td></tr>';
    }

    
    mysql_close;
    echo'</table>';

} else {
	echo '<font color="red"><div align="center">You are not authorized to view this page. <br>Please <a href="index.php"><font color="blue">login here</font></a>.</div></font>';
}

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