<?php

/**
 * 	Dear developer!
 *	Never modify events.php file, it is autogenerated.
 *  Modify PHP/EventTemplates/events.txt instead.
 *
 */
 
 class eventclass_LiveApplicationNew  extends eventsBase
{
	function __construct()
	{
	// fill list of events
		$this->events["BeforeAdd"]=true;


	}

//	handlers

		
		
		
		
		
		
		
		
		
		
		
		
		
				// Before record added
function BeforeAdd(&$values, &$message, $inline, &$pageObject)
{

		

//**********  Check if specific record exists  ************
global $conn;
$strSQLExists = "select * from applicform where FirstName='FirstName' and Surname='Surname'";
$rsExists = db_query($strSQLExists,$conn);
$data=db_fetch_array($rsExists);
if($data)
{
	// if record exists do something

//**********  Display a message on the Web page  ************
echo "WARNING! Data exists already on the database";

}
else
{
	// if dont exist do something else

//**********  Insert a record into another table  ************

$sql = "INSERT INTO Applicform (FirstName, Surname) values (Firstname, Surname)";
CustomQuery($sql);



}




// Place event code here.
// Use "Add Action" button to add code snippets.

return true;
;		
} // function BeforeAdd

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		



}
?>
