<?
////////////////////////////////////////////////////
// Conciliación: gestión de conciliación de activos
// Version: 1.0
//
// Copyright (C) 2014  Eustotem Multimedia, S.L.
//
// License: MIT, see LICENSE
////////////////////////////////////////////////////


include("../conf/preferences.php");
session_name(SYS_APP_SESSNAME);
session_start();
class varProcess{
	public $recordset=NULL;
	public $resId=NULL;
	
	function varProcess($res){
		$this->resId=$res;
	}
	
	function process($param){
		$prefijo=substr($param,0,2);
		switch($prefijo){
			case "{@":					
				$temp=str_replace('{@','',$param);
				$temp=str_replace('}','',$temp);
				if($temp=="parentId"){						
					$param=$_REQUEST['parentId'];
				}else if($temp=="resId"){					
					$param=$this->resId;
				}else if($temp=="uId"){						
					$param=$_SESSION[session_id()]['id'];
				}
				break;
			case "{#":					
				$temp=str_replace('{#','',$param);
				$temp=str_replace('}','',$temp);
				$param=$this->recordset[$temp];
				break;
			case "{%":					
				$temp=str_replace('{%','',$param);
				$temp=str_replace('}','',$temp);
				$param=constant($temp);
				break;
		}		
		return $param;
	}
}
?>