<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created: 7/1/2013	ELL
	
	include ("check_session.php");

	$head_old_name = $_REQUEST['head_old_name'];
	$name_prefix = $_REQUEST['name_prefix'];
	$name_suffix = $_REQUEST['name_suffix'];
	if (is_numeric($name_suffix))
		$head_name = substr($name_prefix, 0, strlen($name_prefix)-1) . $name_suffix;
	else
		$head_name = $name_prefix . $name_suffix;
	
	$query = "UPDATE " . BWB_TABLE_PREFIX . "head SET head_name='" . $head_name . "' WHERE head_name='" . $head_old_name . "'";
	$cnt = $bwb_dbh->exec($query);
	
	$query = "UPDATE " . BWB_TABLE_PREFIX . "page_data_draft SET page_name='" . $head_name . "' WHERE page_name='" . $head_old_name . "'";
	$cnt2 = $bwb_dbh->exec($query);
	
	echo $cnt . "@@@@@" . $area_old_name  . "@@@@@" . $name_prefix . $name_suffix;
?>