<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright EB Dynamics, Inc., Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created: 6/3/2009
// Revised: 2/7/2012	ELL
// Added table prefix handling.
	
	include ("check_session.php");
	
	$query = "SELECT head_name FROM " . BWB_TABLE_PREFIX . "head ORDER BY head_name DESC";
	$result = mysql_query($query, $bwb_link);
	$row = mysql_fetch_array($result);
	$head_name = $row["head_name"];
	
	$today = date("Y-m-d H:i:s");
	
	if ($head_name == "head")
		$query = "INSERT INTO " . BWB_TABLE_PREFIX . "head SET head_name = 'head1', revised='$today'";
	else
	{
		$index = substr($head_name, strlen("head"));
		$index = $index + 1;
		$query = "INSERT INTO " . BWB_TABLE_PREFIX . "head SET head_name = 'head" . $index . "', revised='$today'";
	}
	$result = mysql_query($query, $bwb_link);
	
	header("Location: manage_head.php");
?>