コード例 #1
0
 function sigesp_copia_saf()
 {
     require_once "../shared/class_folder/sigesp_include.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.php";
     require_once "../shared/class_folder/sigesp_c_reconvertir_monedabsf.php";
     /////agregado el 06/12/2007
     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();
     $io_conexion_origen = $io_conect->uf_conectar();
     $io_conexion_destino = $io_conect->uf_conectar_otra_bd($_SESSION["ls_hostname_destino"], $_SESSION["ls_login_destino"], $_SESSION["ls_password_destino"], $_SESSION["ls_database_destino"], $_SESSION["ls_gestor_destino"]);
     $this->io_sql_origen = new class_sql($io_conexion_origen);
     $this->io_sql_destino = new class_sql($io_conexion_destino);
     $ld_fecha = date("_d-m-Y");
     $ls_nombrearchivo = "resultado/" . $_SESSION["ls_data_des"] . "_saf_result_" . $ld_fecha . ".txt";
     $this->lo_archivo = @fopen("{$ls_nombrearchivo}", "a+");
     $this->io_rcbsf = new sigesp_c_reconvertir_monedabsf();
     $this->li_candeccon = 4;
     $this->li_tipconmon = 1;
     $this->li_redconmon = 1;
 }
コード例 #2
0
	function conexion($query_rs,$opciones,$informacion = '',$modo='select',$campo_id = '',$base_de_datos = '',$gestor = '',$usuario=''){
			
			global $obj_sql,$msj_error_conex,$ruta;
			
			if($_SESSION["ls_gestor"] == 'POSTGRES' and $modo=='insert'){$query_rs = $query_rs.'; SELECT lastval() AS valor_id; ';}
			
			$in=new sigesp_include();
			
			if($gestor == ''){$gestor = $_SESSION["ls_gestor"];}
			if($usuario==''){$usuario = $_SESSION["ls_login"];}
			
			if($base_de_datos==''){$con=$in->uf_conectar();}
			else{$con=$in->uf_conectar_otra_bd($_SESSION["ls_hostname"],$usuario,$_SESSION["ls_password"],$base_de_datos,$gestor);}
			
			$obj_sql=new class_sql($con);			
			$rs_data = $obj_sql->select($query_rs);			
			
			if($rs_data === false){
						
						if($tipo_mensaje=='clase_msj'){
								$msj_error = $informacion.'<br><br><b>ERROR:</b> <br>'.$obj_sql->message;
								$this->obj_msj->message($msj_error,$mensaje_sigesp=2,$ruta);
						}
						else{
						
								$msj_error_conex = $informacion.'<br><br><b>ERROR:</b> <br>'.$obj_sql->message;
								echo '<input type="hidden" name="txt_msj_error" id="txt_msj_error" value="'.$msj_error_conex.'">';					
								//echo $msj_error_conex;
						
						}
						
			}
			$cantidad = $obj_sql->num_rows($rs_data);
			$row=$obj_sql->fetch_row($rs_data);
				
			switch($modo){
  
					  case "update":					  				
									
							break;
							
					  case "delete":
							
							break;
							
					  case "insert":
								if($_SESSION["ls_gestor"] == 'MYSQLT' or $_SESSION["ls_gestor"] == 'MYSQLT'){ return mysql_insert_id();}
								if($_SESSION["ls_gestor"] == 'POSTGRES'){$insert_id = $row['valor_id']; return $insert_id;}
							break;
							
					   case "select":
								if($opciones == 'arreglo'){return array('rs'=>$rs_data, 'fila'=>$row, 'cantidad'=>$cantidad);}
								elseif($opciones == 'fila'){return $row;}		
							break;
								
			}	
								
			$obj_sql->free_result($rs_data);

	}
コード例 #3
0
 function sigesp_apr_c_actspgcuentas()
 {
     $ld_fecha = date("_d-m-Y");
     $ls_nombrearchivo = "resultado/" . $_SESSION["ls_data_des"] . "_actualizar_cuentas_result_" . $ld_fecha . ".txt";
     $this->lo_archivo = @fopen("{$ls_nombrearchivo}", "a+");
     $this->ls_database_source = $_SESSION["ls_database"];
     $this->ls_dabatase_target = $_SESSION["ls_data_des"];
     require_once "../shared/class_folder/sigesp_include.php";
     require_once "../shared/class_folder/class_sql.php";
     require_once "../shared/class_folder/class_mensajes.php";
     require_once "../shared/class_folder/class_funciones.php";
     require_once "../shared/class_folder/class_funciones_db.php";
     require_once "class_folder/class_validacion.php";
     require_once "../shared/class_folder/class_fecha.php";
     require_once "../shared/class_folder/sigesp_c_reconvertir_monedabsf.php";
     /////agregado el 06/12/2007
     require_once "../shared/class_folder/sigesp_c_seguridad.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();
     $this->io_fecha = new class_fecha();
     $io_conect = new sigesp_include();
     $io_conexion_origen = $io_conect->uf_conectar();
     $io_conexion_destino = $io_conect->uf_conectar_otra_bd($_SESSION["ls_hostname_destino"], $_SESSION["ls_login_destino"], $_SESSION["ls_password_destino"], $_SESSION["ls_database_destino"], $_SESSION["ls_gestor_destino"]);
     $this->io_sql_origen = new class_sql($io_conexion_origen);
     $this->io_sql_destino = new class_sql($io_conexion_destino);
     $this->io_function_db = new class_funciones_db($io_conexion_destino);
     $this->io_seguridad = new sigesp_c_seguridad();
 }
コード例 #4
0
 function sigesp_cxp_c_cmp_islr($as_path)
 {
     require_once $as_path . "shared/class_folder/sigesp_include.php";
     require_once $as_path . "shared/class_folder/class_sql.php";
     require_once $as_path . "shared/class_folder/class_funciones.php";
     require_once $as_path . "shared/class_folder/class_mensajes.php";
     require_once $as_path . "shared/class_folder/sigesp_c_seguridad.php";
     require_once $as_path . "shared/class_folder/class_fecha.php";
     require_once $as_path . "shared/class_folder/class_datastore.php";
     require_once $as_path . "shared/class_folder/sigesp_c_generar_consecutivo.php";
     $this->io_keygen = new sigesp_c_generar_consecutivo();
     $io_include = new sigesp_include();
     $io_connect = $io_include->uf_conectar();
     $this->io_seguridad = new sigesp_c_seguridad();
     $this->io_sql = new class_sql($io_connect);
     $this->io_function = new class_funciones();
     $this->io_msg = new class_mensajes();
     $this->io_fec = new class_fecha();
     $this->DS = new class_datastore();
     $this->ds_detalle = new class_datastore();
     $this->la_empresa = $_SESSION["la_empresa"];
     $this->ls_codusu = $_SESSION["la_logusr"];
     $this->ls_basdatcmp = $_SESSION["la_empresa"]["basdatcmp"];
     if ($this->ls_basdatcmp != "") {
         $io_include->uf_obtener_parametros_conexion($as_path, $this->ls_basdatcmp, &$as_hostname, &$as_login, &$as_password, &$as_gestor);
         if ($as_hostname != "") {
             $this->io_keygen->io_conexion = $io_include->uf_conectar_otra_bd($as_hostname, $as_login, $as_password, $this->ls_basdatcmp, $as_gestor);
             $this->io_keygen->io_sql = new class_sql($this->io_keygen->io_conexion);
             $io_connectaux = $io_include->uf_conectar_otra_bd($as_hostname, $as_login, $as_password, $this->ls_basdatcmp, $as_gestor);
             $this->io_sqlaux = new class_sql($io_connectaux);
         } else {
             $this->io_msg->message("Esta mal configurada la BD integradora");
             print "<script language=JavaScript>";
             print "location.href='sigespwindow_blank.php'";
             print "</script>";
         }
     }
     $this->ls_codemp = $_SESSION["la_empresa"]["codemp"];
 }
コード例 #5
0
 function sigesp_copia_scgspgspi()
 {
     $ld_fecha = date("_d-m-Y");
     $ls_nombrearchivo = "resultado/" . $_SESSION["ls_data_des"] . "_scgspgspi_result_" . $ld_fecha . ".txt";
     $this->lo_archivo = @fopen("{$ls_nombrearchivo}", "a+");
     $this->ls_database_source = $_SESSION["ls_database"];
     $this->ls_dabatase_target = $_SESSION["ls_data_des"];
     require_once "../shared/class_folder/sigesp_include.php";
     require_once "../shared/class_folder/class_mensajes.php";
     require_once "../shared/class_folder/class_sql.php";
     require_once "class_folder/class_validacion.php";
     $this->io_mensajes = new class_mensajes();
     $this->io_validacion = new class_validacion();
     $io_conect = new sigesp_include();
     $io_conexion_origen = $io_conect->uf_conectar();
     $io_conexion_destino = $io_conect->uf_conectar_otra_bd($_SESSION["ls_hostname_destino"], $_SESSION["ls_login_destino"], $_SESSION["ls_password_destino"], $_SESSION["ls_database_destino"], $_SESSION["ls_gestor_destino"]);
     $this->io_sql_origen = new class_sql($io_conexion_origen);
     $this->io_sql_destino = new class_sql($io_conexion_destino);
 }
コード例 #6
0
 function sigesp_apr_salctabco()
 {
     require_once "class_folder/class_validacion.php";
     require_once "../shared/class_folder/class_fecha.php";
     require_once "../shared/class_folder/class_funciones.php";
     require_once "../shared/class_folder/sigesp_c_reconvertir_monedabsf.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();
     $this->io_fecha = new class_fecha();
     $this->io_rcbsf = new sigesp_c_reconvertir_monedabsf();
     $io_conect = new sigesp_include();
     $io_conexion_origen = $io_conect->uf_conectar();
     $io_conexion_destino = $io_conect->uf_conectar_otra_bd($_SESSION["ls_hostname_destino"], $_SESSION["ls_login_destino"], $_SESSION["ls_password_destino"], $_SESSION["ls_database_destino"], $_SESSION["ls_gestor_destino"]);
     $this->io_sql_origen = new class_sql($io_conexion_origen);
     $this->io_sql_destino = new class_sql($io_conexion_destino);
     $ld_fecha = date("_d-m-Y");
     $ls_nombrearchivo = "resultado/" . trim($_SESSION["ls_data_des"]) . "_saldos_banco_result_" . $ld_fecha . ".txt";
     $this->lo_archivo = @fopen("{$ls_nombrearchivo}", "a+");
     $this->dat = $_SESSION["la_empresa"];
 }
コード例 #7
0
 function sigesp_apr_c_salcontables()
 {
     $ld_fecha = date("_d-m-Y");
     $ls_nombrearchivo = "resultado/" . $_SESSION["ls_data_des"] . "_saldos_contables_result_" . $ld_fecha . ".txt";
     $this->lo_archivo = @fopen("{$ls_nombrearchivo}", "a+");
     $this->ls_database_source = $_SESSION["ls_database"];
     $this->ls_dabatase_target = $_SESSION["ls_data_des"];
     require_once "../shared/class_folder/class_sql.php";
     require_once "../shared/class_folder/class_datastore.php";
     require_once "../shared/class_folder/sigesp_include.php";
     require_once "../shared/class_folder/class_funciones.php";
     require_once "class_folder/class_sigesp_int.php";
     require_once "class_folder/class_sigesp_int_int.php";
     require_once "class_folder/class_sigesp_int_spg.php";
     require_once "class_folder/class_sigesp_int_scg.php";
     require_once "class_folder/class_sigesp_int_spi.php";
     require_once "../shared/class_folder/class_mensajes.php";
     require_once "../shared/class_folder/sigesp_c_seguridad.php";
     require_once "../shared/class_folder/sigesp_c_reconvertir_monedabsf.php";
     $this->io_rcbsf = new sigesp_c_reconvertir_monedabsf();
     require_once "class_folder/class_fecha.php";
     $this->io_sigesp_int = new class_sigesp_int_int();
     $this->io_function = new class_funciones();
     $this->io_fecha = new class_fecha_apr();
     $io_conect = new sigesp_include();
     $io_conexion_origen = $io_conect->uf_conectar();
     $io_conexion_destino = $io_conect->uf_conectar_otra_bd($_SESSION["ls_hostname_destino"], $_SESSION["ls_login_destino"], $_SESSION["ls_password_destino"], $_SESSION["ls_database_destino"], $_SESSION["ls_gestor_destino"]);
     $this->io_sql_origen = new class_sql($io_conexion_origen);
     $this->io_sql_destino = new class_sql($io_conexion_destino);
     $this->io_function = new class_funciones();
     $this->ds_scg = new class_datastore();
     $this->ds_saldos_contables = new class_datastore();
     $this->io_msg = new class_mensajes();
     $this->ls_codemp = $_SESSION["la_empresa"]["codemp"];
     $this->ls_periodo = $_SESSION["la_empresa"]["periodo"];
     $this->io_seguridad = new sigesp_c_seguridad();
 }
コード例 #8
0
 function sigesp_copia_sno_historico()
 {
     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //	     Function: sigesp_copia_sno_historico
     //		   Access: public
     //	  Description: Constructor de la Clase
     //	   Creado Por: Ing. Yesenia Moreno
     // Fecha Creación: 06/06/2006 								Fecha Última Modificación :
     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     require_once "../shared/class_folder/sigesp_include.php";
     require_once "../shared/class_folder/class_sql.php";
     require_once "../shared/class_folder/class_mensajes.php";
     require_once "../shared/class_folder/class_funciones.php";
     require_once "class_folder/class_validacion.php";
     require_once "../shared/class_folder/class_fecha.php";
     require_once "../shared/class_folder/sigesp_c_reconvertir_monedabsf.php";
     /////agregado el 06/12/2007
     $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();
     $this->io_fecha = new class_fecha();
     $io_conect = new sigesp_include();
     $io_conexion_origen = $io_conect->uf_conectar();
     $io_conexion_destino = $io_conect->uf_conectar_otra_bd($_SESSION["ls_hostname_destino"], $_SESSION["ls_login_destino"], $_SESSION["ls_password_destino"], $_SESSION["ls_database_destino"], $_SESSION["ls_gestor_destino"]);
     $this->io_sql_origen = new class_sql($io_conexion_origen);
     $this->io_sql_destino = new class_sql($io_conexion_destino);
     $ld_fecha = date("_d-m-Y");
     $ls_nombrearchivo = "resultado/" . $_SESSION["ls_data_des"] . "_sno_historico_result_" . $ld_fecha . ".txt";
     $this->lo_archivo = @fopen("{$ls_nombrearchivo}", "a+");
     $this->ls_codemp = $_SESSION["la_empresa"]["codemp"];
     $this->io_rcbsf = new sigesp_c_reconvertir_monedabsf();
     $this->li_candeccon = 4;
     $this->li_tipconmon = 1;
     $this->li_redconmon = 1000;
 }
コード例 #9
0
?>

<?php 
$ls_tipdoc = $_GET['id'];
$ls_database_destino = $_SESSION["ls_data_des"];
$ls_database_fuente = $_SESSION["ls_database"];
require_once "../shared/class_folder/sigesp_include.php";
require_once "../shared/class_folder/class_mensajes.php";
require_once "../shared/class_folder/class_datastore.php";
require_once "../shared/class_folder/class_sql.php";
$io_conect = new sigesp_include();
//$conn		= $io_conect->uf_conectar();
$io_msg = new class_mensajes();
$io_dsprove = new class_datastore();
//$io_sql		= new class_sql($conn);
$io_conexion_destino = $io_conect->uf_conectar_otra_bd($_SESSION["ls_hostname_destino"], $_SESSION["ls_login_destino"], $_SESSION["ls_password_destino"], $_SESSION["ls_database_destino"], $_SESSION["ls_gestor_destino"]);
$io_sql_destino = new class_sql($io_conexion_destino);
//If (ThisForm.chk_TipoDoc.value=1)	contable
//	nCont = 2		1
//	nPres = 3		3
//Else								presupuestario
//	nCont = 2		1
//	nPres = 2		2
//Endif
if ($ls_tipdoc == 1) {
    $ls_sql = "SELECT codtipdoc, dentipdoc" . "  FROM cxp_documento" . " WHERE estcon= 1" . "   AND (estpre = 3 OR estpre = 4) ";
} else {
    $ls_sql = "SELECT codtipdoc, dentipdoc" . "  FROM cxp_documento" . " WHERE estcon= 1" . "   AND estpre= 2 ";
}
$rs_td = $io_sql_destino->select($ls_sql);
?>
コード例 #10
0
 function uf_transferir_proveedores($codpro, $as_hostname, $as_login, $as_password, $as_database, $as_gestor)
 {
     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     //	Funcion        uf_transferir_proveedores
     //	Access        public
     //	Arguments	  ai_totrows  // total de filas del detalle
     //				  ao_object  // objetos del detalle
     //	Returns	      lb_valido. Retorna una variable booleana
     //	Description   Busca registros de proveedores dada una base de datos.
     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     $lb_valido = true;
     $lb_existe = false;
     require_once "../shared/class_folder/sigesp_include.php";
     $io_conect = new sigesp_include();
     $io_conexion_destino = $io_conect->uf_conectar_otra_bd($as_hostname, $as_login, $as_password, $as_database, $as_gestor);
     $io_sql_destino = new class_sql($io_conexion_destino);
     $this->io_sql->begin_transaction();
     $lb_existe = $this->uf_select_proveedores_bd($codpro, $as_hostname, $as_login, $as_password, $as_database, $as_gestor);
     if (!$lb_existe) {
         $lb_valido = true;
         $li_total_select = 0;
         $li_total_insert = 0;
         $ls_sql = "SELECT codemp, cod_pro, nompro, dirpro, telpro, faxpro, nacpro, rifpro, nitpro, fecreg, capital, sc_cuenta," . "       obspro, estpro, estcon, estaso, ocei_fec_reg, ocei_no_reg, monmax, cedrep, nomreppro, emailrep, carrep," . "       registro, nro_reg, tomo_reg, folreg, fecregmod, regmod, nummod, tommod, folmod, inspector, foto," . "       codbansig, codban, codmon, codtipoorg, codesp, ctaban, numlic, fecvenrnc, numregsso, fecvensso," . "       numregince, fecvenince, estprov, pagweb, email, codpai, codest, codmun, codpar, graemp, tipconpro, tipperpro " . "  FROM rpc_proveedor " . "  WHERE cod_pro = '{$codpro}' ";
         $io_recordset = $this->io_sql->select($ls_sql);
         if ($io_recordset === false) {
             $lb_valido = false;
             $this->io_msg->message("Error al seleccionar Proveedor de la Base de Datos.");
         } else {
             $li_total_select = $this->io_sql->num_rows($io_recordset);
             while ($row = $this->io_sql->fetch_row($io_recordset)) {
                 $ls_codemp = $this->io_validacion->uf_valida_texto($row["codemp"], 0, 4, "");
                 $ls_cod_pro = $this->io_validacion->uf_valida_texto($row["cod_pro"], 0, 10, "");
                 $ls_nompro = $this->io_validacion->uf_valida_texto($row["nompro"], 0, 100, "");
                 $ls_dirpro = $this->io_validacion->uf_valida_texto($row["dirpro"], 0, 254, "");
                 $ls_telpro = $this->io_validacion->uf_valida_texto($row["telpro"], 0, 50, "");
                 $ls_faxpro = $this->io_validacion->uf_valida_texto($row["faxpro"], 0, 30, "");
                 $ls_nacpro = $this->io_validacion->uf_valida_texto($row["nacpro"], 0, 1, "");
                 $ls_rifpro = $this->io_validacion->uf_valida_texto($row["rifpro"], 0, 15, "");
                 $ls_nitpro = $this->io_validacion->uf_valida_texto($row["nitpro"], 0, 15, "");
                 $ld_fecreg = $this->io_validacion->uf_valida_fecha($row["fecreg"], "1900-01-01");
                 $li_capital = $row["capital"];
                 $ls_sc_cuenta = $this->io_validacion->uf_valida_texto($row["sc_cuenta"], 0, 25, "");
                 $ls_obspro = $this->io_validacion->uf_valida_texto($row["obspro"], 0, 8000, "");
                 $ls_estpro = $this->io_validacion->uf_valida_monto($row["estpro"], 0);
                 $ls_estcon = $this->io_validacion->uf_valida_monto($row["estcon"], 0);
                 $ls_estaso = $this->io_validacion->uf_valida_monto($row["estaso"], 0);
                 $ld_ocei_fec_reg = $this->io_validacion->uf_valida_fecha($row["ocei_fec_reg"], "1900-01-01");
                 $ls_ocei_no_reg = $this->io_validacion->uf_valida_texto($row["ocei_no_reg"], 0, 17, "");
                 $li_monmax = $row["monmax"];
                 $ls_cedrep = $this->io_validacion->uf_valida_texto($row["cedrep"], 0, 10, "");
                 $ls_nomreppro = $this->io_validacion->uf_valida_texto($row["nomreppro"], 0, 50, "");
                 $ls_emailrep = $this->io_validacion->uf_valida_texto($row["emailrep"], 0, 100, "");
                 $ls_carrep = $this->io_validacion->uf_valida_texto($row["carrep"], 0, 35, "");
                 $ls_registro = $this->io_validacion->uf_valida_texto($row["registro"], 0, 35, "");
                 $ls_nro_reg = $this->io_validacion->uf_valida_texto($row["nro_reg"], 0, 15, "");
                 $ls_tomo_reg = $this->io_validacion->uf_valida_texto($row["tomo_reg"], 0, 5, "");
                 $ls_folreg = $this->io_validacion->uf_valida_texto($row["folreg"], 0, 5, "");
                 $ld_fecregmod = $this->io_validacion->uf_valida_fecha($row["fecregmod"], "1900-01-01");
                 $ls_regmod = $this->io_validacion->uf_valida_texto($row["regmod"], 0, 35, "");
                 $ls_nummod = $this->io_validacion->uf_valida_texto($row["nummod"], 0, 15, "");
                 $ls_tommod = $this->io_validacion->uf_valida_texto($row["tommod"], 0, 5, "");
                 $ls_folmod = $this->io_validacion->uf_valida_texto($row["folmod"], 0, 5, "");
                 $ls_inspector = $this->io_validacion->uf_valida_monto($row["estprov"], 0);
                 $ls_foto = $row["foto"];
                 $ls_codbansig = $this->io_validacion->uf_valida_texto($row["codbansig"], 0, 3, "");
                 $ls_codban = $this->io_validacion->uf_valida_texto($row["codban"], 0, 3, "");
                 $ls_codmon = $this->io_validacion->uf_valida_texto($row["codmon"], 0, 3, "");
                 $ls_codtipoorg = $this->io_validacion->uf_valida_texto($row["codtipoorg"], 0, 2, "--");
                 $ls_codesp = $this->io_validacion->uf_valida_texto($row["codesp"], 0, 3, "");
                 $ls_ctaban = $this->io_validacion->uf_valida_texto($row["ctaban"], 0, 25, "");
                 $ls_numlic = $this->io_validacion->uf_valida_texto($row["numlic"], 0, 25, "");
                 $ld_fecvenrnc = $this->io_validacion->uf_valida_fecha($row["fecvenrnc"], "1900-01-01");
                 $ls_numregsso = $this->io_validacion->uf_valida_texto($row["numregsso"], 0, 15, "");
                 $ld_fecvensso = $this->io_validacion->uf_valida_fecha($row["fecvensso"], "1900-01-01");
                 $ls_numregince = $this->io_validacion->uf_valida_texto($row["numregince"], 0, 15, "");
                 $ld_fecvenince = $this->io_validacion->uf_valida_fecha($row["fecvenince"], "1900-01-01");
                 $ls_estprov = $this->io_validacion->uf_valida_monto($row["estprov"], 0);
                 $ls_pagweb = $this->io_validacion->uf_valida_texto($row["pagweb"], 0, 200, "");
                 $ls_email = $this->io_validacion->uf_valida_texto($row["email"], 0, 200, "");
                 $ls_codpai = $this->io_validacion->uf_valida_texto($row["codpai"], 0, 3, "---");
                 $ls_codest = $this->io_validacion->uf_valida_texto($row["codest"], 0, 3, "---");
                 $ls_codmun = $this->io_validacion->uf_valida_texto($row["codmun"], 0, 3, "---");
                 $ls_codpar = $this->io_validacion->uf_valida_texto($row["codpar"], 0, 3, "---");
                 if ($ls_codpai == "---") {
                     $ls_codest = "---";
                     $ls_codmun = "---";
                     $ls_codpar = "---";
                 }
                 if ($ls_codest == "---") {
                     $ls_codmun = "---";
                     $ls_codpar = "---";
                 }
                 if ($ls_codmun == "---") {
                     $ls_codpar = "---";
                 }
                 $ls_graemp = $this->io_validacion->uf_valida_texto($row["graemp"], 0, 4, "");
                 $ls_tipconpro = $this->io_validacion->uf_valida_texto($row["tipconpro"], 0, 1, "");
                 $ls_tipperpro = $this->io_validacion->uf_valida_texto($row["tipperpro"], 0, 1, "");
                 if ($ls_codtipoorg != "") {
                     $ls_sql = "INSERT INTO rpc_proveedor(codemp, cod_pro, nompro, dirpro, telpro, faxpro, nacpro, rifpro, nitpro," . "                          fecreg, capital, sc_cuenta, obspro, estpro, estcon, estaso, ocei_fec_reg," . "                          ocei_no_reg, monmax, cedrep, nomreppro, emailrep, carrep, registro," . "                          nro_reg, tomo_reg, folreg, fecregmod, regmod, nummod, tommod, folmod," . "                          inspector, foto, codbansig, codban, codmon, codtipoorg, codesp, ctaban," . "                          numlic, fecvenrnc, numregsso, fecvensso, numregince, fecvenince, estprov," . "                          pagweb, email, codpai, codest, codmun, codpar, graemp, tipconpro,tipperpro)" . "\t  VALUES ('" . $ls_codemp . "','" . $ls_cod_pro . "','" . $ls_nompro . "','" . $ls_dirpro . "','" . $ls_telpro . "'," . "             '" . $ls_faxpro . "','" . $ls_nacpro . "','" . $ls_rifpro . "','" . $ls_nitpro . "','" . $ld_fecreg . "'," . "             " . $li_capital . ",'" . $ls_sc_cuenta . "','" . $ls_obspro . "','" . $ls_estpro . "'," . "             '" . $ls_estcon . "','" . $ls_estaso . "','" . $ld_ocei_fec_reg . "','" . $ls_ocei_no_reg . "'," . "             " . $li_monmax . ",'" . $ls_cedrep . "','" . $ls_nomreppro . "','" . $ls_emailrep . "','" . $ls_carrep . "'," . "             '" . $ls_registro . "','" . $ls_nro_reg . "','" . $ls_tomo_reg . "','" . $ls_folreg . "'," . "             '" . $ld_fecregmod . "','" . $ls_regmod . "','" . $ls_nummod . "','" . $ls_tommod . "','" . $ls_folmod . "'," . "             '" . $ls_inspector . "','" . $ls_foto . "','" . $ls_codbansig . "','" . $ls_codban . "','" . $ls_codmon . "'," . "             '" . $ls_codtipoorg . "','" . $ls_codesp . "','" . $ls_ctaban . "','" . $ls_numlic . "','" . $ld_fecvenrnc . "'," . "             '" . $ls_numregsso . "','" . $ld_fecvensso . "','" . $ls_numregince . "','" . $ld_fecvenince . "'," . "             '" . $ls_estprov . "','" . $ls_pagweb . "','" . $ls_email . "','" . $ls_codpai . "','" . $ls_codest . "'," . "             '" . $ls_codmun . "','" . $ls_codpar . "','" . $ls_graemp . "','" . $ls_tipconpro . "','" . $ls_tipperpro . "')";
                     $li_row = $io_sql_destino->execute($ls_sql);
                     if ($li_row === false) {
                         $lb_valido = false;
                         $io_sql_destino->rollback();
                         $this->io_msg->message("Error al insertar Proveedor  " . $codpro);
                     } else {
                         $io_sql_destino->commit();
                         $li_total_insert++;
                     }
                 } else {
                     $io_sql_destino->rollback();
                     $this->io_msg->message("Hay data inconsistente en los Proveedores");
                 }
             }
         }
     }
     return $lb_valido;
 }
コード例 #11
0
	function uf_procesar_derechos_usuario($codemp, $codusu, $as_hostname, $as_login, $as_password,$as_database,$as_gestor)
	{
	/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	//	Funcion       uf_procesar_derechos_usuario
	//	Access        public
	//	Arguments	  ai_totrows  // total de filas del detalle
	//				  ao_object  // objetos del detalle
	//	Returns	      lb_valido. Retorna una variable booleana
	//	Description   Registra y Procesa los derechos asociados a un usuario 
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		$lb_valido=true;
		$lb_existe_derecho=false;
		require_once("../shared/class_folder/sigesp_include.php");
		$io_conect=new sigesp_include();
		$ls_codemp=$_SESSION["la_empresa"]["codemp"];
		$io_conexion_destino   = $io_conect->uf_conectar_otra_bd ($as_hostname, $as_login, $as_password,$as_database,$as_gestor);
		$io_sql_destino = new class_sql($io_conexion_destino);
		$this->io_sql->begin_transaction();
		$ls_sql="SELECT codsis, nomven, codintper, visible, enabled, leer, incluir, cambiar, eliminar, imprimir, ".
		        "		administrativo, anular, ejecutar ". 
				"  FROM sss_derechos_usuarios ".	
				" WHERE codemp = '".$ls_codemp."' AND codusu = '".$codusu."' ".			
				" ORDER BY codsis ";	
		$rs_data = $this->io_sql->select($ls_sql);
		if($rs_data===false)
		{ 
		 $lb_valido=false;
		 $this->io_msg->message("Error al seleccionar Derechos del Usuario ".$codusu." de la Base de Datos.".$this->io_funcion->uf_convertirmsg($this->io_sql->message));
		}
		else
		{   
		 $li_total_select = $this->io_sql->num_rows($rs_data);
		 while(($row=$this->io_sql->fetch_row($rs_data))&&($lb_valido))
		 {
		  $ls_codsis     	 = $this->io_validacion->uf_valida_texto($row["codsis"],0,3,"");
		  $ls_nomven    	 = $this->io_validacion->uf_valida_texto($row["nomven"],0,80,"");
		  $ls_codintper 	 = $this->io_validacion->uf_valida_texto($row["codintper"],0,126,"------------------------------------------------------------------------------------------------------------------------------");
		  $li_visible   	 = $this->io_validacion->uf_valida_monto($row["visible"],0);
		  $li_enabled   	 = $this->io_validacion->uf_valida_monto($row["enabled"],0);
		  $li_leer   		 = $this->io_validacion->uf_valida_monto($row["leer"],0);
		  $li_incluir   	 = $this->io_validacion->uf_valida_monto($row["incluir"],0);
		  $li_cambiar   	 = $this->io_validacion->uf_valida_monto($row["cambiar"],0);
		  $li_eliminar   	 = $this->io_validacion->uf_valida_monto($row["eliminar"],0);
		  $li_imprimir   	 = $this->io_validacion->uf_valida_monto($row["imprimir"],0);
		  $li_administrativo = $this->io_validacion->uf_valida_monto($row["administrativo"],0);
		  $li_anular         = $this->io_validacion->uf_valida_monto($row["anular"],0);
		  $li_ejecutar       = $this->io_validacion->uf_valida_monto($row["ejecutar"],0);
		  $lb_existe_derecho=$this->uf_select_derechos_usuario($codemp, $codusu, $ls_codsis, $ls_nomven, $ls_codintper, $as_hostname, $as_login, $as_password,$as_database,$as_gestor);
		  if (!$lb_existe_derecho)
		  { 
		    $lb_valido = $this->uf_select_ventana_sistema($ls_codsis, $ls_nomven, $as_hostname, $as_login, $as_password,$as_database,$as_gestor);
			if($lb_valido)
			{   
			   $ls_sql="INSERT INTO sss_derechos_usuarios(codemp, codusu, codsis, nomven, codintper, visible, enabled, ".
					   "                                  leer, incluir, cambiar, eliminar, imprimir, administrativo, anular, ejecutar) ".
					   "			VALUES ('".$codemp."','".$codusu."','".$ls_codsis."','".$ls_nomven."','".$ls_codintper."',".$li_visible.",".$li_enabled.",".
					   "                    ".$li_leer.",".$li_incluir.",". $li_cambiar.",".$li_eliminar.",".$li_imprimir.",".$li_administrativo.",".
					   "					".$li_anular.",".$li_ejecutar.")";		   	   			
			   $li_row=$io_sql_destino->execute($ls_sql);
			   if($li_row===false)
			   {
				 $lb_valido=false;
				 $this->io_msg->message("Error al Insertar el Derecho del Usuario  ".$codusu." ".$this->io_funcion->uf_convertirmsg($io_sql_destino->message));
			   }
			   else
			   { 
				$lb_valido = true;
			   }
			 }  
		  }
		 } // while
		}  // else
	 return $lb_valido;
	}