<?php

/**
 * 	Dear developer!
 *	Never modify events.php file, it is autogenerated.
 *  Modify PHP/EventTemplates/events.txt instead.
 *
 */

 class eventclass_derechos_no_vigentes  extends eventsBase
{
	function __construct()
	{
	// fill list of events
		$this->events["BeforeAdd"]=true;

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



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

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

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


	}

//	handlers

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

		

require __DIR__ . '/../app/number/convert2.php';


return true;
;		
} // function BeforeAdd

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
				// Before record updated
function BeforeEdit(&$values, &$sqlValues, $where, &$oldvalues, &$keys, &$message, $inline, $pageObject)
{

		

require __DIR__ . '/../app/number/convert2.php';

return true;



;		
} // function BeforeEdit

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
				// After Import Finished
function AfterImport($count, $skipCount, $pageObject)
{

		$data = array();
$data["id_constitucion"] = $values["id_constitucion"];
$data["id_gestion"] = $values["gestion"];
$data["id_socio"] = $values["accionista"];
DB::Insert("socio_g_d", $data );

$data1 = array();
$data1["id_constitucion"] = $values["id_constitucion"];
$data1["id_dp"] = $values["id_derecho_Propietario"];
$data1["id_gestion"] = $values["gestion"];
$data1["id_socio"] = $values["accionista"];
DB::Insert("socio_dp", $data1);


$data2 = array();
$data2["derecho_propietario"] = $values["id_derecho_Propietario"];
$data2["id_gestion"] = $values["gestion"];
$data2["accionista"] = $values["accionista"];
$data2["estado"] = 65;
DB::Insert("pago_dp", $data2 );



$data3 = array();
$data3["derecho_propietario"] = $values["id_derecho_Propietario"];
$data3["id_gestion"] = $values["gestion"];
$data3["accionista"] = $values["accionista"];
$data3["estado"] = 66;
DB::Insert("entrega_dp", $data3 );

;		
} // function AfterImport

		
		
		
		
		
		
		
		
		
		

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
				// After record added
function AfterAdd(&$values, &$keys, $inline, $pageObject)
{

		
$data = array();
$data["id_constitucion"] = $values["id_constitucion"];
$data["id_gestion"] = $values["gestion"];
$data["id_dp"] = $values["id_derecho_Propietario"];
$data["id_Socio"] = $values["accionista"];

DB::Insert("socio_g_d", $data );





$data1 = array();
$data1["id_constitucion"] = $values["id_constitucion"];
$data1["id_dp"] = $values["id_derecho_Propietario"];
$data1["id_gestion"] = $values["gestion"];
$data1["id_socio"] = $values["accionista"];
$data1["tipo_accionista"] =29;

DB::Insert("socio_dp", $data1);



$data2 = array();
$data2["id_constitucion"] = $values["id_constitucion"];
$data2["derecho_Propietario"] = $values["id_derecho_Propietario"];
$data2["gestion"] = $values["gestion"];
$data2["accionista"] = $values["accionista"];
$data2["estado"] = 65;
DB::Insert("pago_dp", $data2 );




$data3 = array();
$data3["derecho_propietario"] = $values["id_derecho_Propietario"];
$data3["id_gestion"] = $values["gestion"];
$data3["accionista"] = $values["accionista"];
$data3["estado"] = 66;
DB::Insert("entrega_dp", $data3 );

;		
} // function AfterAdd

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
				// After record updated
function AfterEdit(&$values, $where, &$oldvalues, &$keys, $inline, $pageObject)
{

		$data1 = array();
$data1["id_constitucion"] = $values["id_constitucion"];
$data1["id_dp"] = $values["id_derecho_Propietario"];
$data1["id_gestion"] = $values["gestion"];
$data1["id_socio"] = $values["accionista"];
$data1["tipo_accionista"] =29;
$keyvalues["id_dp"] = $values["id_derecho_Propietario"];

DB::update("socio_dp", $data1, $keyvalues);

$data3 = array();
$data3["derecho_propietario"] = $values["id_derecho_Propietario"];
$data3["id_gestion"] = $values["gestion"];
$data3["accionista"] = $values["accionista"];
$data3["estado"] = 66;
$keyvalues2["derecho_propietario"] = $values["id_derecho_Propietario"];


DB::update("entrega_dp", $data3, $keyvalues2);

;		
} // function AfterEdit

		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		



}
?>
