<?php 

class apr_clase {

	var $io_sql_origen;
	var $io_sql_destino;
	var $io_mensajes;
	var $io_funciones;
	var $io_validacion;
	var $lo_archivo;
	var $ls_database_source;
	var $ls_dabatase_target;
		
	function apr_clase()
	{
		require_once("../shared/class_folder/sigesp_include_covensol.php");
		require_once("../shared/class_folder/class_funciones.php");
		require_once("../shared/class_folder/class_mensajes.php");
		require_once("../shared/class_folder/class_datastore.php");
		require_once("../shared/class_folder/class_sql_covensol.php");
		
		require_once("class_folder/class_validacion.php");
		$this->ls_database_source = $_SESSION["ls_database"];
		$this->ls_database_target = $_SESSION["ls_data_des"];
		$this->io_mensajes        = new class_mensajes();		
		$this->io_funciones       = new class_funciones();
		$this->io_validacion      = new class_validacion();
		$io_conect	              = new sigesp_include_covensol();
		$io_conexion_origen       = $io_conect->uf_conectar();
		$io_conexion_destino  = $io_conect->uf_conectar_otra_bd ($_SESSION["ls_hostname"],$_SESSION["ls_login"],$_SESSION["ls_password"],$this->ls_database_target,$_SESSION["ls_gestor"]); 
		$this->io_sql_origen      = new class_sql_covensol($io_conexion_origen);
		$this->io_sql_destino 	  = new class_sql_covensol($io_conexion_destino);
		
		global $ruta;		
		if($ruta==''){$ruta="../";}	
		require_once($ruta."shared/class_folder/sigesp_conexiones.php");
		$this->io_conexiones=new conexiones();
		if($_SESSION["ls_gestor"] == 'POSTGRES'){$this->postgres_ilike = 'I';}
		$this->borrar_tabla = 0;
		$this->msjejec = "";
		$this->msjresultado = "";
		
	}


	function liberar_apertura($prop=array()){
		
		 $this->io_sql_destino->begin_transaction();

		 $ls_sql=" DELETE FROM sigesp_config WHERE seccion LIKE'%APERT%' ";
		 $li_row = $this->io_sql_destino->execute($ls_sql);
		 if ($li_row===false){	
			$this->io_sql_destino->rollback();					
			$this->io_mensajes->message("CLASE->".get_class($this)." MÉTODO->liberar_apertura ERROR->".$this->io_sql_destino->message);
			return false;						
		 }
					
		 $this->io_sql_destino->commit();
		 return true;
		
	}// end liberar_apertura	




}
?>
