<?php
	////////////////////////////////////////////////////////////////////////
	// Breeze Website Builder
	// Copyright EB Dynamics, Inc., Edward Lemmers, P.E.
	// For licensing, see license.txt.
	// Created: 11/14/2009
	
	include ("check_session.php");
	
//	include "../connect/db_connection.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Manage Menu Code | Breeze Website Builder</title>

<link rel="stylesheet" href="manager.css" type="text/css">

<script language="javascript" type="text/javascript">
function RemoveMenuCode()
{
	document.getElementById("delete_confirm").style.display = "none";
	var border_area = document.getElementById("selectBorderArea").value;
	location.href="remove_menu_code.php?border_area=" + border_area;
}

function OpenHelpWindow()
{
	window.open("http://breezewebsitebuilder.com/docs/cms/help.html#manage_menu_code", "Help", "scrollbars=1,resizable=1,status=0,toolbar=0,menubar=0,location=0,height=700,width=800");
}

function DeleteConfirm()
{
	document.getElementById("delete_confirm").style.display = "block";
	document.getElementById("delete_confirm").style.position = "absolute";
	document.getElementById("delete_confirm").style.top = "100px";
	document.getElementById("delete_confirm").style.left = "200px";
	document.getElementById("delete_confirm").style.width = "550px";
	document.getElementById("delete_confirm").style.backgroundColor = "#FFF";
	document.getElementById("delete_confirm").style.borderStyle = "solid";
	document.getElementById("delete_confirm").style.borderWidth = "2px";
	document.getElementById("delete_confirm").style.borderColor = "#000";
	document.getElementById("delete_text").innerHTML = document.getElementById("selectBorderArea").value;
}

function HideDelete()
{
	document.getElementById("delete_confirm").style.display = "none";
}
</script>

</head>

<body>
<p align="center" class="title">JavaScript Menu Code Assignment</p>
<table width="80%" border="1" align="center"><tr><td>
	<form name="frmSelectSpecialPageForMenuCode" method="post" action="add_menu_code.php">
    <p align="center">Select border area to add or remove menu code: 
        <select name="selectBorderArea" id="selectBorderArea">
    <?php
        $query = "SELECT page_name FROM page_data_special";
        $result = mysql_query($query, $link);
        $num_results = mysql_num_rows($result);
        for ($i = 0; $i < $num_results; $i++)
        {
            $row = mysql_fetch_array($result);
            $page_name = $row["page_name"];
            echo "<option value='$page_name'>$page_name</option>";
        }
    ?>
        </select>
    </p>
    <p align="center">
      <input type="submit" name="submit" id="submit" value="Add" />
      &nbsp;&nbsp;&nbsp;
      <input type="button" name="remove" id="remove" value="Remove" onClick="DeleteConfirm();" />
    </p>
    </form>
</td></tr></table>


<br />
<table width="80%" border="0" cellspacing="0" cellpadding="0">
  <tr><td align="center">
  <input type="button" name="Back" value="Back to Main Menu" onClick="window.location.href='main.php?mode=menu';">
  </td>
  <td valign="top">
  <div id="help_button" onClick="OpenHelpWindow();">
    &nbsp;
  </div>
  </td>
  </tr>
</table>

<div id="delete_confirm">
<table border="0" cellspacing="0" cellpadding="5" align="center">
  <tr>
    <td colspan="2">Are your sure you want to remove the JavaScript menu code from the <div id="delete_text">&nbsp;</div>?</td>
  </tr>
  <tr>
	<td align="center"><input type="button" name="delete" id="delete" value="Yes" onClick="RemoveMenuCode();" /></td>
	<td align="center"><input type="button" name="hide_delete" value="No" onClick="HideDelete();" />
    </td>
  </tr>
</table>
</div>

</body>
</html>