<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created: 6/3/2009
// Rezised: 6/29/2009	ELL
// Fixed bug of assignments corrupting templates that do not have all 4: top, bottom, left and right sections.
// Revised: 10/13/2009	ELL
// Added changing of $border_area to new border areas.  $border_area is a new var used for the new PHP menu generator.
// This change will allow different menus to be assigned based on border area assignment.
// Revised: 2/7/2012	ELL
// Added reference to user files folder constant.
// Revised: 5/10/2013	ELL
// Added handling of new header and footer divs.
// Revised: 12/18/2013	ELL
// Added visual feedback for assigning border areas to pages.
// Revised: 10/2/2015	ELL
// Modified from assigning new border area by parsing page template file to updating border area names in page data table.
// Revised: 11/12/2015	ELL
// Converted from HTML/PHP POST application to AJAX application.
	
	include ("check_session.php");
	
	$page_name = $_REQUEST['page_name'];
	$right_area_name = $_REQUEST['right_area_name'];
	$left_area_name = $_REQUEST['left_area_name'];
	$top_area_name = $_REQUEST['top_area_name'];
	$bottom_area_name = $_REQUEST['bottom_area_name'];
	$header_area_name = $_REQUEST['header_area_name'];
	$footer_area_name = $_REQUEST['footer_area_name'];
	
	$query = "UPDATE " . BWB_TABLE_PREFIX . "page_data SET header_name='$header_area_name', top_name='$top_area_name', left_name='$left_area_name', right_name='$right_area_name', bottom_name='$bottom_area_name', footer_name='$footer_area_name' WHERE page_name='$page_name'";
	$cnt = $bwb_dbh->exec($query);
	
	echo $cnt . "@@@@@" . $page_name;
?>