<?php
class eventclass_system_users  extends TableEventsBase {
	
	function init() {
		$this->events = array(
	'BeforeAdd' => true,
	'BeforeEdit' => true 
);
		$this->fieldValues = array(
	'filterLimit' => array(
		 
	),
	'mapIcon' => array(
		 
	),
	'viewCustom' => array(
		 
	),
	'lookupWhere' => array(
		 
	),
	'viewFileText' => array(
		 
	),
	'defaultValue' => array(
		 
	),
	'autoUpdateValue' => array(
		 
	),
	'uploadFolder' => array(
		 
	),
	'viewPluginInit' => array(
		 
	),
	'editPluginInit' => array(
		 
	) 
);
			}
		function BeforeAdd( &$values, &$sqlValues, &$message, $inline, $pageObject ) {
		if (isset($_SESSION["admin_user_id"])) {
    $values["created_by_admin_id"] = (int)$_SESSION["admin_user_id"];
    $values["updated_by_admin_id"] = (int)$_SESSION["admin_user_id"];
}

if (isset($values["createdAt"])) {
    $values["createdAt"] = date("Y-m-d H:i:s");
}

if (isset($values["updatedAt"])) {
    $values["updatedAt"] = date("Y-m-d H:i:s");
}
		;
		return true;
	}

	function BeforeEdit( &$values, &$sqlValues, $where, &$oldvalues, &$keys, &$message, $inline, $pageObject ) {
		if (isset($_SESSION["admin_user_id"])) {
    $values["updated_by_admin_id"] = (int)$_SESSION["admin_user_id"];
}

if (isset($values["updatedAt"])) {
    $values["updatedAt"] = date("Y-m-d H:i:s");
}
		;
		return true;
	}
		

}


?>