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

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

<style>
#copy_to_mobile_note	{
	display:block;
	position:absolute;
	top:50px;
	left:350px;
	width:50%;
}
</style>

<script src="js/jquery.min.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/copy_css_to_mobile_select.js"></script>

<script>
<?php
	echo "	var COPY_STYLE_TO_MOBILE_CONFIRM_1_MSG = \"" . COPY_STYLE_TO_MOBILE_CONFIRM_1_MSG . "\";\n";
	echo "	var COPY_STYLE_TO_MOBILE_CONFIRM_2_MSG = \"" . COPY_STYLE_TO_MOBILE_CONFIRM_2_MSG . "\";\n";
	echo "	var COPY_STYLE_TO_MOBILE_CONFIRM_3_MSG = \"" . COPY_STYLE_TO_MOBILE_CONFIRM_3_MSG . "\";\n";	
	echo "	var COPY_STYLE_TO_MOBILE_COMPLETE_MSG = \"" . COPY_STYLE_TO_MOBILE_COMPLETE_MSG . "\";\n";
	echo "	var COPY_STYLE_TO_MOBILE_COMPLETE_ERR = \"" . COPY_STYLE_TO_MOBILE_COMPLETE_ERR . "\";\n";
	echo "	var YES_WORD = \"" . YES_WORD . "\";\n";
	echo "	var NO_WORD = \"" . NO_WORD . "\";\n";
	echo "	var TO_WORD = \"" . TO_WORD . "\";\n";
?>
</script>
</head>

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

<div id="sub_level_1_buttons">
        
          <div class="button_heading_sub_level_1"><div class="button_heading_text_sub_level_1"><?php echo EDIT_CSS_SELECT_COPY_STYLES_TO_MOBILE_BTN; ?></div><div class="button_heading_help" onClick="OpenHelpWindow();" style="left:210px;">&nbsp;</div></div>
		    <?php
			$query = "SELECT * FROM " . BWB_TABLE_PREFIX . "style_sheets WHERE (`name` NOT LIKE '%_mobile%') AND (`name` NOT LIKE '%_item%') ORDER BY sort_order";
			$result = $bwb_dbh->query($query);
			while($row = $result->fetch(PDO::FETCH_ASSOC))
			{
				$name = $row["name"];
				$description = $row["description"];
				
				if ($name == $last_style_sheet_edited)
					$selected = " down_sub";
				else
					$selected = "";

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

<div id="copy_to_mobile_note"><?php echo COPY_STYLE_TO_MOBILE_NOTE; ?></div>

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

<script>
	HidePopupMsg();
</script>

</body>
</html>