<?php 
# check for duplicate record entry
if ($_SESSION['IS_USER_CLIENT'] && $_POST['formaction'] == 'add')
{
	$errorMsg = "Sorry, you do not have access to create new address book!";
}
else
{
	if (isset($_POST['formaction']) && ($_POST['formaction'] == 'add' || $_POST['formaction'] == 'edit'))
	{
		$ID					= isset($_POST['ID'])?$_POST['ID']:'';
		$NAME				= trim($funcObj->AppendSlashes($_POST['txtname']));
		$DESC 				= trim($funcObj->AppendSlashes($_POST['txtdescription']));
		
		$error = "";
		
		if (empty($NAME))
		{
			$error .= "Address book name is required.<br />";
		}
		
		if (strlen($error))
		{
			$errorMsg = "<strong>Please correct the following error(s):</strong> <br />
			$error";
		}
	}
}
?>