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

	$old_head_name = $_REQUEST['old_head_name'];
	$new_head_name = $_REQUEST['new_head_name'];
		
	$query = "SELECT * FROM " . BWB_TABLE_PREFIX . "head WHERE head_name='" . $old_head_name . "'";
	$result = $bwb_dbh->query($query);
	$row = $result->fetch(PDO::FETCH_ASSOC);
	$head_content = addslashes(stripslashes($row['head_content']));
	if (isset($row['plugins']))
		$plugins_str = "plugins='" . $row['plugins'] . "', ";
	else
		$plugins_str = "";
	$revised = $row['revised'];
	
	$query = "INSERT INTO " . BWB_TABLE_PREFIX . "head SET head_name='" . $new_head_name . "', head_content='" . $head_content . "', " . $plugins_str . " revised='" . $revised . "'";
	$cnt = $bwb_dbh->exec($query);
	
	print "1";
?>