<?php
class eventclass_appoitment  extends eventsBase
{
	function __construct()
	{
	// fill list of events

		$this->events["BeforeAdd"]=true;


//	onscreen events

	}

//	handlers

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		

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

		$values["appoitment_booking_datetime"]=now();
$sql 		= "SELECT * FROM `service` WHERE `service_id` = ".$values["appoitment_service_service_id"];
$rs 		= CustomQuery($sql);
$data		= db_fetch_array($rs);
$period	= '+'.$data['service_period'].' minutes';
$from= strtotime($values["appoitment_datetime_from"]);
$values["appoitment_datetime_to"]= date( "Y-m-d H:i:00",  strtotime($period, $from));
//$values['appoitment_client_email'] ="P".$period." TO".$values["appoitment_datetime_to"]." FROM".$from;
// Place event code here.
// Use "Add Action" button to add code snippets.

return true;
;		
} // function BeforeAdd

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
//	onscreen events







}
?>
