0 ) ) { while ( $rowModelos = mysqli_fetch_assoc( $qrsModelos ) ) { $IDModelo = $rowModelos['IDMODELO']; $arrVentiladores[$IDModelo] = $rowModelos; } } else { $strMensaje = 'SPSERV.( ' . $idModulo . ' ).0002 - Ha ocurrido un error al consultar el Catálogo de Ventiladores del sistema. '; $strMensaje.= 'El catálago de Ventiladores debe de contener al menos un ventilador disponible.'; $arrErroresSistemaServ[base64_encode('ITT_ASW_MODE-DATA')] = $strMensaje; $mensajeError ++; } } else { $strMensaje = 'SPSERV.( ' . $idModulo . ' ).0001 - Ha ocurrido un error al consultar El Catálogo de Ventiladores del Sistema. '; $strMensaje.= 'Notifique al Departamento de Sistemas con la siguiente descripción: '; $strMensaje.= base64_encode( ' Error: ' . base64_encode(mysqli_error($conBaseDatos)) . ' para la Consulta: ' . base64_encode(utf8_decode($qryModelos) ) ); $arrErroresSistemaServ[base64_encode('ITT_ASW_MODE')] = $strMensaje; $mensajeError ++ ; } if ( !empty($arrVentiladores) ) { $arrVentiladoresJs = json_encode($arrVentiladores); $arrModelos = array(); $arrTipos = array(); foreach ( $arrVentiladores as $ventilador ) { $arrTipos[$ventilador['TIPO']] = $ventilador['TIPO']; if ( ( !empty($ventilador['PULGADAS']) ) && ( empty($ventilador['PRESION']) ) && ( !empty($ventilador['DESC']) ) ) { $arrModelos[$ventilador['TIPO']][$ventilador['IDMODELO']] = $ventilador['DESC']; } elseif ( ( empty($ventilador['PULGADAS']) ) && ( empty($ventilador['PRESION']) ) && ( !empty($ventilador['DESC']) ) ) { $arrModelos[$ventilador['TIPO']][$ventilador['IDMODELO']] = $ventilador['DESC']; } elseif ( ( empty($ventilador['PULGADAS']) ) && ( !empty($ventilador['PRESION']) ) && ( empty($ventilador['DESC']) ) ) { $arrModelos[$ventilador['TIPO']][$ventilador['IDMODELO']] = $ventilador['MODELO']." - Presión ".$ventilador['PRESION']; } elseif ( ( empty($ventilador['PULGADAS']) ) && ( !empty($ventilador['PRESION']) ) && ( !empty($ventilador['DESC']) ) ) { $arrModelos[$ventilador['TIPO']][$ventilador['IDMODELO']] = $ventilador['DESC']." - Presión ".$ventilador['PRESION']; } elseif ( ( empty($ventilador['PULGADAS']) ) && ( empty($ventilador['PRESION']) ) && ( empty($ventilador['DESC']) ) ) { $arrModelos[$ventilador['TIPO']][$ventilador['IDMODELO']] = $ventilador['MODELO']; } } $arrTipoVentiladorJs = json_encode($arrTipos); $arrModeloVentiladorJs = json_encode($arrModelos); } else { $strMensaje = 'SPSERV.( ' . $idModulo . ' ).0003 - Ha ocurrido un error al consultar el Catálogo de Ventiladores del sistema. '; $strMensaje.= 'La búsqueda de los Tipos y Modelos de los Ventiladores no se genero correctamente.'; $arrErroresSistemaServ[base64_encode('ITT_ASW_MODE-SEARCH')] = $strMensaje; $mensajeError ++; } $arrAtenuacion = array(); // Contiene todos Los Atenuadores Existentes $qryAtenuacion = ' SELECT * FROM ITT_ASW_ATEN '; $qryAtenuacion = utf8_encode($qryAtenuacion); $qrsAtenuacion = mysqli_query($conexion, $qryAtenuacion); if ( ( $qrsAtenuacion !== false ) ) { if ( ( mysqli_num_rows( $qrsAtenuacion ) > 0 ) ) { while ( $rowAtenuacion = mysqli_fetch_assoc( $qrsAtenuacion ) ) { $IDAtenuacion = $rowAtenuacion['IDATENUACION']; $arrAtenuacion[$IDAtenuacion] = $rowAtenuacion; } $arrAtenuacionJs = json_encode($arrAtenuacion); } else { $strMensaje = 'SPSERV.( ' . $idModulo . ' ).0005 - Ha ocurrido un error al consultar el Catálogo de Atenuadores del sistema. '; $strMensaje.= 'El catálago de atenuadores debe de contener al menos un atenuador disponible.'; $arrErroresSistemaServ[base64_encode('ITT_ASW_ATEN-DATA')] = $strMensaje; $mensajeError ++; } } else { $strMensaje = 'SPSERV.( ' . $idModulo . ' ).0004 - Ha ocurrido un error al consultar el Catálogo de Atenuadores del sistema. '; $strMensaje.= 'Notifique al Departamento de Sistemas con la siguiente descripción: '; $strMensaje.= base64_encode( ' Error: ' . base64_encode(mysqli_error($conBaseDatos)) . ' para la Consulta: ' . base64_encode(utf8_decode($qryAtenuacion) ) ); $arrErroresSistemaServ[base64_encode('ITT_ASW_ATEN')] = $strMensaje; $mensajeError ++; } $arrPotenciaSonora = array(); // Contiene todos Las Potencias Sonoras Existentes $qryPotenciaS = ' SELECT * FROM ITT_ASW_POSO '; $qryPotenciaS = utf8_encode($qryPotenciaS); $qrsPotenciaS = mysqli_query($conexion, $qryPotenciaS); if ( ( $qrsPotenciaS !== false ) ) { if ( ( mysqli_num_rows( $qrsPotenciaS ) > 0 ) ) { while ( $rowPotenciaS = mysqli_fetch_assoc( $qrsPotenciaS ) ) { $IDAtenuacion = $rowPotenciaS['IDPOTSON']; $arrPotenciaSonora[$IDAtenuacion] = $rowPotenciaS; } $arrPotenciaSonoraJs = json_encode($arrPotenciaSonora); } else { $strMensaje = 'SPSERV.( ' . $idModulo . ' ).0007 - Ha ocurrido un error al consultar el Catálogo de Potencias Sonoras del sistema. '; $strMensaje.= 'El catálago de Potencias Sonoras debe de contener al menos un registro disponible.'; $arrErroresSistemaServ[base64_encode('ITT_ASW_POSO-DATA')] = $strMensaje; $mensajeError ++; } } else { $strMensaje = 'SPSERV.( ' . $idModulo . ' ).0006 - Ha ocurrido un error al consultar el Catálogo de Potencias Sonoras del sistema. '; $strMensaje.= 'Notifique al Departamento de Sistemas con la siguiente descripción: '; $strMensaje.= base64_encode( ' Error: ' . base64_encode(mysqli_error($conBaseDatos)) . ' para la Consulta: ' . base64_encode(utf8_decode($qryPotenciaS) ) ); $arrErroresSistemaServ[base64_encode('ITT_ASW_POSO')] = $strMensaje; $mensajeError ++; } if ( $mensajeError != 0 ) { } $arrUnidadMedidaCaudal = array( "M3/S"=>"M3/S", "M3/MIN"=>"M3/MIN", "M3/H"=>"M3/H", "L/S"=>"L/S", "L/MIN"=>"L/MIN", "L/H"=>"L/H", "CM3/S"=>"CM3/S", "CM3/MIN"=>"CM3/MIN", "CM3/H"=>"CM3/H", "GALON/S"=>"GALON/S", "GALON/MIN"=>"GALON/MIN", "GALON/H"=>"GALON/H", "CFM"=>"CFM" ); $arrUnidadMedidaCaudalJs = json_encode($arrUnidadMedidaCaudal); $arrUnidadMedidaPresionE = array( "MPA"=>"MPA", "KPA"=>"KPA", "PA"=>"PA", "BAR"=>"BAR", "M CA"=>"M CA", "CM A"=>"CM A", "MM CA"=>"MM CA", "IN HG"=>"IN HG", "CM HG"=>"CM HG", "MM HG"=>"MM HG", "TORR"=>"TORR", "INWG"=>"INWG" ); $arrUnidadMedidaPresionEJs = json_encode($arrUnidadMedidaPresionE); $arrUnidadMedidaPotenciaA = array( "HP"=>"HP", "J/S"=>"J/S", "KCAL/H"=>"KCAL/H", "KW"=>"KW", "WATT"=>"WATT", "PIE-LIBRA(S)"=>"PIE-LIBRA(S)", "PIE-LIBRA(M)"=>"PIE-LIBRA(M)", "BHP"=>"BHP" ); $arrUnidadMedidaPotenciaAJs = json_encode($arrUnidadMedidaPotenciaA); $arrUnidadMedidaDiametro = array( "MM"=>"MM", "CM"=>"CM", "DM"=>"DM", "M"=>"M", "MI"=>"MI", "YARDA"=>"YARDA", "INCH"=>"INCH", "FT"=>"FT" ); $arrUnidadMedidaDiametroJs = json_encode($arrUnidadMedidaDiametro); $arrCurvaNCS = array( "NC15"=>"NC15", "NC20"=>"NC20", "NC25"=>"NC25", "NC30"=>"NC30", "NC35"=>"NC35", "NC40"=>"NC40", "NC45"=>"NC45", "NC50"=>"NC50", "NC55"=>"NC55", "NC60"=>"NC60", "NC65"=>"NC65", "NC70"=>"NC70" ); $arrCurvaNCSJs = json_encode($arrCurvaNCS); $arrFrecuencias = array( "63Hz", "125Hz", "250Hz", "500Hz", "1000Hz", "2000Hz", "4000Hz", "8000Hz"); $strTablaResultados = ""; if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { $transaccionPDF = $_POST["TRANSPDF"]; $arrDatosEntrada = json_decode($_POST["DATOSENTRADA"]); $arrConversiones = json_decode($_POST["CONVERSIONES"]); $arrLw = json_decode($_POST["LW"]); $arrKw = json_decode($_POST["KW"]); $arrLwAVentiladorS = json_decode($_POST["LWAV"]); $arrLwAVentilador = json_decode($_POST["LWAVA"]); $arrSonidoR = json_decode($_POST["SONIDOR"]); $arrCorreccion = json_decode($_POST["CORRECCION"]); $arrSonidoMasCorrecion = json_decode($_POST["SONMASCORR"]); $areaDeSalida = $_POST["AREASALIDA"]; $velocidadDeFluido = $_POST["VFLUIDO"]; $arrDatosLwFinal = json_decode($_POST["LWFINALDATOS"]); $sumaLogaritmicaLwFinal = $_POST["SUMALWFINAL"]; $arrDatosLwA = json_decode($_POST["LWADATOS"]); $sumaLogaritmicaLwA = $_POST["SUMALWA"]; $presionSonora = $_POST["PRESON"]; $presionSonoraA = $_POST["PRESONA"]; $arrDatosLwFinalVa = json_decode($_POST["LWFINALDATOSVA"]); $sumaLogaritmicaLwFinalVa = $_POST["SUMALWFINALVA"]; $arrDatosLwAVa = json_decode($_POST["LWADATOSVA"]); $sumaLogaritmicaLwAVa = $_POST["SUMALWAVA"]; $presionSonoraVa = $_POST["PRESONVA"]; $presionSonoraAVa = $_POST["PRESONAVA"]; $arrDatosAtenuador = json_decode($_POST["ATENUADOR"], true); require_once('shared/plantillasPDF/Seleccion_Atenuedores_General.php'); $formatoPDF = new crearPDF('P', 'mm', 'Letter'); $formatoPDF->tipoPDF = $transaccionPDF; $formatoPDF->datosEntrada = $arrDatosEntrada; $formatoPDF->conversiones = $arrConversiones; $formatoPDF->datosLw = $arrLw; $formatoPDF->datosKw = $arrKw; $formatoPDF->sonidoRegenerado = $arrSonidoR; $formatoPDF->correcionArea = $arrCorreccion; $formatoPDF->sonidoMasCorreccion = $arrSonidoMasCorrecion; $formatoPDF->LwAVentilador = $arrLwAVentiladorS; $formatoPDF->LwAVentiladorA = $arrLwAVentilador; $formatoPDF->areaDeSalida = $areaDeSalida; $formatoPDF->velocidadDeFluido = $velocidadDeFluido; $formatoPDF->datosLwFinal = $arrDatosLwFinal; $formatoPDF->sumaLogLwFinal = $sumaLogaritmicaLwFinal; $formatoPDF->datosLwA = $arrDatosLwA; $formatoPDF->sumaLogaritmicaLwA = $sumaLogaritmicaLwA; $formatoPDF->presionSonora = $presionSonora; $formatoPDF->presionSonoraA = $presionSonoraA; $formatoPDF->DatosLwFinalVa = $arrDatosLwFinalVa; $formatoPDF->sumaLogaritmicaLwFinalVa = $sumaLogaritmicaLwFinalVa; $formatoPDF->DatosLwAVa = $arrDatosLwAVa; $formatoPDF->sumaLogaritmicaLwAVa = $sumaLogaritmicaLwAVa; $formatoPDF->presionSonoraVa = $presionSonoraVa; $formatoPDF->presionSonoraAVa = $presionSonoraAVa; $formatoPDF->datosAtenuadores = $arrDatosAtenuador; $formatoPDF->p = 'I'; // I = Presenta en el navegador sin guardar; D = presenta opcion Guardar como; F = Guarda el documento sin abrirlo en el navegador $formatoPDF->narch = 'CalculosDeAtenuacion_'.$arrDatosAtenuador['MODELO'].'.pdf'; $formatoPDF->genera_PDF(); } ?>