<?php 
class eventclass_senuc_certificados_voluntario  extends eventsBase
{ 
	function eventclass_senuc_certificados_voluntario()
	{
	// fill list of events
		$this->events["BeforeAdd"]=true;


//	onscreen events


	}
// Captchas functions	

//	handlers

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

		
$value['operador']=$_SESSION["operador"];

 
function codigo($length=10)
{
 $salt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 $len = strlen($salt);
 $pass = '';
 mt_srand(10000000*(double)microtime());
 for ($i = 0; $i < $length; $i++)
 {
   $pass .= $salt[mt_rand(0,$len - 1)];
 }
 return $pass;
} 
$values['codigo']=codigo(12);



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

return true;
;		
} // function BeforeAdd

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
//	onscreen events

} 
?>
