<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created:	2/4/2016	ELL
// 

	include ("check_session.php");
	
	$last_style_sheet_edited = $_SESSION['last_style_sheet_edited'];
	$last_class_edited = $_SESSION['last_class_edited'];
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Delete Custom CSS Classes | Breeze Website Builder</title>
<link rel="stylesheet" href="theme/<?php echo $theme; ?>/manager.css" type="text/css">

<script src="js/mouse_position.js"></script>
<script src="js/popup_msg.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/delete_custom_classes_select.js"></script>

<script>
<?php
	echo "	var CLEAR_CUSTOM_CSS_CLASSES_WARNING_MSG = \"" . CLEAR_CUSTOM_CSS_CLASSES_WARNING_MSG . "\";\n";
	echo "	var CLEAR_CUSTOM_CSS_CLASSES_WARNING_2_MSG = \"" . CLEAR_CUSTOM_CSS_CLASSES_WARNING_2_MSG . "\";\n";
	echo "	var YES_WORD = \"" . YES_WORD . "\";\n";
	echo "	var NO_WORD = \"" . NO_WORD . "\";\n";
	echo "	var CLEAR_CUSTOM_CSS_CLASSES_START_MSG = \"" . CLEAR_CUSTOM_CSS_CLASSES_START_MSG . "\";\n";
	echo "	var CLEAR_CUSTOM_CSS_CLASSES_COMPLETE_MSG = \"" . CLEAR_CUSTOM_CSS_CLASSES_COMPLETE_MSG . "\";\n";
	echo "	var CLEAR_CUSTOM_CSS_CLASSES_COMPLETE_ERR = \"" . CLEAR_CUSTOM_CSS_CLASSES_COMPLETE_ERR . "\";\n";
	
	echo "	var http = '$http';\n";
?>
</script>
</head>

<body>
<div id="sub_level_1_buttons">
        
          <div class="button_heading_sub_level_1"><div class="button_heading_text_sub_level_1"><?php echo CLEAR_CUSTOM_CSS_CLASSES_HEADING; ?></div><div class="button_heading_help" onClick="OpenHelpWindow('delete_custom_classes');">&nbsp;</div></div>
		    <?php
			$query = "SELECT * FROM " . BWB_TABLE_PREFIX . "style_sheets ORDER BY sort_order";
			$result = $bwb_dbh->query($query);
			while($row = $result->fetch(PDO::FETCH_ASSOC))
			{
				$name = $row["name"];
				$description = $row["description"];
				if ((strpos($name, "menu", 0) !== false) && (strpos($name, "item", 4) === false))
				{
					$query2 = "SELECT * FROM " . BWB_TABLE_PREFIX . "menus WHERE menu_name = '$name'";
					$result2 = $bwb_dbh->query($query2);
					$row2 = $result2->fetch(PDO::FETCH_ASSOC);
					$description = $row2['description'] . " Styles";
				}
				
				if ($name == $last_style_sheet_edited)
					$selected = " down_sub";
				else
					$selected = "";

				echo "<div class='button_sub_level_1$selected' onClick=\"DeleteCustomClassesConfirm('$name');\"><span class='button_text_sub_level_1'>$description</span></div>\n";
			}
		?>
        <div class='button_sub_level_1' onClick="DeleteCustomClassesConfirm('-all-');"><span class='button_text_sub_level_1'>- <?php echo CLEAR_CUSTOM_CSS_CLASSES_ALL_STYLE_SHEETS; ?> -</span></div>
</div>

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

<script language="javascript" type="text/javascript">
	popup_msg.HidePopupMsg();
</script>

</body>
</html>