<?
function InsertZone($zoneid,$desc)
{
	include "connect.inc.php";
	$sqlchk = "select * from fishingzone where zone='$zoneid'";
	$qrychk = mysql_query($sqlchk);
	$numchk = mysql_num_rows($qrychk);
	if($numchk == 1)
	{
	require_once("usr_function.php");
	ErrMsg("fishing area is duplicate!");
	}
	else
	{
	$sqlinsertzone = "insert fishingzone(zone,description) values('$zoneid','$desc')";
	//echo $sqlinsertzone;
	mysql_query($sqlinsertzone) or die(mysql_error());
	}
}
function EditZone($zoneid,$newzoneid,$desc)
{
	include "connect.inc.php";
	$sqlchk = "select * from fishingzone where zone!='$zoneid' and zone = '$newzoneid'";
	$qrychk = mysql_query($sqlchk) or die(mysql_error());
	$numchk = mysql_num_rows($qrychk);
	if($numchk == 1)
	{
	require_once("usr_function.php");
	ErrMsg("fishing area is duplicate!");
	}
	else
	{
	$sqleditzone = "update fishingzone set zone='$newzoneid',description='$desc' where zone='$zoneid'";
	//echo $sqleditzone;
	mysql_query($sqleditzone) or die(mysql_error());
	}
}
function DeleteZone($zoneid)
{
	include "connect.inc.php";
	$sqldeletezone = "delete from fishingzone where zone='$zoneid'";
	//echo $sqldeletezone;
	mysql_query($sqldeletezone) or die(mysql_error());
}
?>
