<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created:	1/15/2018	ELL
// 
	include ("check_session.php");
		
	$query = "SELECT `language_folder` FROM " . BWB_TABLE_PREFIX . "plugins WHERE `name` = 'Calendar Grid v2'";
	$result = $bwb_dbh->query($query);
	$row = $result->fetch(PDO::FETCH_ASSOC);
	$language_folder = $row['language_folder'];
	
	$document_root = $_SERVER['DOCUMENT_ROOT'];
	if ((defined("BWB_LANG")) && (file_exists($document_root . "/" . $language_folder . "/" . BWB_LANG . ".php")))
		include_once ($document_root . "/" . $language_folder . "/" . BWB_LANG . ".php");
	else
		include_once ($document_root . "/" . $language_folder . "/en.php");
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Manage Links Categories | Breeze Website Builder</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../../theme/<?php echo $theme; ?>/manager.css" type="text/css">
<link rel="shortcut icon" href="../../images/favicon.ico" type="image/x-icon">

<style type="text/css">
#help_button	{	
	position:relative;
	display:block;
	top:-15px;
	left:215px;
	height:31px;
	width:31px;
	z-index:100;
}

.header_row	{
	padding-left:5px;
	padding-right:5px;
}

#update	{
	display:block;
	width:130px;
	margin-left:auto;
	margin-right:auto;
	margin-top:5px;
}

.long_txt_field	{	width:400px;	}
.med_txt_field	{	width:200px;	}

.button_heading_sub_level_1	{
	margin-left: 5%;
	margin-bottom: 3px;
}
</style>

<script src="../../js/jquery.min.js"></script>
<script src="../../js/json2.js"></script>
<script src="../../js/trim.js"></script>
<script src="../../js/escape_url.js"></script>
<script src="../../js/browser_detect.js"></script>
<script src="../../js/mouse_position.js"></script>
<script src="../../js/popup_msg.js"></script>
<script src="js/manage_event_location_categories.js"></script>

<script>
	var update_all = false;
	var unsaved_new_item = false;
	var curr_item_under_edit = "";
	var bgclr = "#eeeeee";

<?php
	echo "	var theme = '$theme';\n\n";
	
	echo "	var MANAGE_EVENT_CATEGORIES_CATEGORY = \"" . MANAGE_EVENT_CATEGORIES_CATEGORY . "\";\n";
	echo "	var MANAGE_EVENT_CATEGORIES_CATEGORY_STRING = \"" . MANAGE_EVENT_CATEGORIES_CATEGORY_STRING . "\";\n";
	echo "	var MANAGE_EVENT_CATEGORIES_ERROR_RETRIEVING_CATEGORY_ERR = \"" . MANAGE_EVENT_CATEGORIES_ERROR_RETRIEVING_CATEGORY_ERR . "\";\n";
	echo "	var MANAGE_EVENT_CATEGORIES_SAVED_MSG = \"" . MANAGE_EVENT_CATEGORIES_SAVED_MSG . "\";\n";
	echo "	var MANAGE_EVENT_CATEGORIES_ERROR_SAVING_CATEGORY_ERR = \"" . MANAGE_EVENT_CATEGORIES_ERROR_SAVING_CATEGORY_ERR . "\";\n";
	echo "	var MANAGE_EVENT_CATEGORIES_ERROR_NO_CATEGORY_ERR = \"" . MANAGE_EVENT_CATEGORIES_ERROR_NO_CATEGORY_ERR . "\";\n";
	echo "	var MANAGE_EVENT_CATEGORIES_ERROR_NO_CATEGORY_STR_ERR = \"" . MANAGE_EVENT_CATEGORIES_ERROR_NO_CATEGORY_STR_ERR . "\";\n";
	echo "	var MANAGE_EVENT_CATEGORIES_DELETE_CONFIRM_MSG_1 = \"" . MANAGE_EVENT_CATEGORIES_DELETE_CONFIRM_MSG_1 . "\";\n";
	echo "	var MANAGE_EVENT_CATEGORIES_DELETE_CONFIRM_MSG_2 = \"" . MANAGE_EVENT_CATEGORIES_DELETE_CONFIRM_MSG_2 . "\";\n";
	echo "	var YES_WORD = \"" . YES_WORD . "\";\n";
	echo "	var NO_WORD = \"" . NO_WORD . "\";\n";
	echo "	var MANAGE_EVENT_CATEGORIES_ADD_BEFORE_SAVE_NEW_MSG = \"" . MANAGE_EVENT_CATEGORIES_ADD_BEFORE_SAVE_NEW_MSG . "\";\n";
	echo "	var EDIT_MENU_ITEMS_NOT_SAVED_CONFIRM_MSG = \"" . EDIT_MENU_ITEMS_NOT_SAVED_CONFIRM_MSG . "\";\n";
	echo "	var MANAGE_EVENT_CATEGORIES_ALL_SAVED_MSG = \"" . MANAGE_EVENT_CATEGORIES_ALL_SAVED_MSG . "\";\n";
	echo "	var MANAGE_EVENT_CATEGORIES_ERROR_SAVING_CATEGORIES_ERR = \"" . MANAGE_EVENT_CATEGORIES_ERROR_SAVING_CATEGORIES_ERR . "\";\n";
	echo "	var MANAGE_EVENT_CATEGORIES_EVENT_TYPE = \"" . MANAGE_EVENT_CATEGORIES_EVENT_TYPE . "\";\n";
	echo "	var MANAGE_EVENT_CATEGORIES_LOCATION_TYPE = \"" . MANAGE_EVENT_CATEGORIES_LOCATION_TYPE . "\";\n";
	
	echo "	var http = '$http';\n";
?>
</script>

</head>

<body onLoad="RetrieveCategories();" id="workspace_body">

<div class='button_console_go_back' style="width:250px; position:absolute; right:40px; top:0px;" onClick="window.location.href='manage_events.php'"><span class='button_console_text_w_icon'><?php echo MANAGE_EVENT_CATEGORIES_BACK_BTN; ?></span></div>

	<div class="button_heading_sub_level_1" id="edit_menus_heading"><div class="button_heading_text_sub_level_1"><?php echo MANAGE_EVENT_CATEGORIES_BTN; ?></div><div class="help_button" id="help_button" onClick="OpenHelpWindow();">&nbsp;</div></div>
    
<div align="center">
   
<form name="frmCategoryAttributes" id="frmCategoryAttributes" action="save_links_categories.php" method="post" enctype="application/x-www-form-urlencoded">
	<div id="CategoriesTable" style="width:100%;">&nbsp;</div>
    <input type='hidden' name='nCount' id='nCount'>
</form>
    
    <div class='button_console_save' id="update" onClick="UpdateAll();"><span class='button_console_text_w_icon'><?php echo EDIT_MENU_ITEMS_UPDATE_ALL_BTN; ?></span></div>

</div>

<?php include("../../lib/popup_msg.html"); ?>

<script language='javascript' type='text/javascript'>
	popup_msg.HidePopupMsg();
</script>
</body>
</html>