Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php class Conexion { private $cn; public function __construct() { $servidor = DB_HOST;..
Decoded Output download
<?php
class Conexion { private $cn; public function __construct() { $servidor = DB_HOST; $database = DB_NAME; $userid = DB_USER; $upsswd = DB_PASS; $info = array("Database" => $database, "Uid" => $userid, "PWD" => $upsswd); $this->cn = sqlsrv_connect($servidor, $info); } public function getConecta() { return $this->cn; } function executeQuery($query) { $sql = sqlsrv_query($this->getConecta(), $query, array(), array("Scrollable" => SQLSRV_CURSOR_KEYSET)) or die(print_r(sqlsrv_errors(), true)); return $sql; } function fetchArray($result) { return sqlsrv_fetch_array($result); } function getNumRows($result) { return sqlsrv_num_rows($result); } function close() { } function error() { return $this->_error; } function FormatErrors($errors) { echo "Error information: "; foreach ($errors as $error) { echo "SQLSTATE: " . $error["SQLSTATE"] . ''; echo "Code: " . $error["code"] . ''; echo "Message: " . $error["message"] . ''; } } function ExecSP($query) { } function mssql_escape($data) { if (is_numeric($data)) { return $data; } $unpacked = unpack("H*hex", $data); return "0x" . $unpacked["hex"]; } public function fechasactuales() { $resultados = array(); $sql = "SELECT" . " MIN(SUBSTRING(aim.cod_validacion, 1, 6)) AS FECMIN" . ", MAX(SUBSTRING(aim.cod_validacion, 1, 6)) AS FECMAX" . " FROM dbo.A_IOSFA_mensual aim WITH(NOLOCK)" . " WHERE CAST(SUBSTRING(aim.cod_validacion,1,6) AS int)>=2020;"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])); } sqlsrv_free_stmt($stmt); return $resultados; } public function setfechafilt($modo, $fechafilt, $sesionid, $encabezados) { switch ($modo) { case 0: $sql = "INSERT INTO IOSFA_Params_Estad (FecFiltro, IdSesion, Titulos,FecHs_in) VALUES ('" . $fechafilt . "','" . $sesionid . "','" . $encabezados . "',GETDATE());"; break; case 1: $sql = "UPDATE IOSFA_Params_Estad SET FecFiltro='" . $fechafilt . "', Titulos='" . $encabezados . "',FecHs_ac=GETDATE() WHERE IdSesion='" . $sesionid . "';"; break; case 2: $sql = "DELETE IOSFA_Params_Estad WHERE IdSesion='" . $sesionid . "';"; break; } $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } sqlsrv_free_stmt($stmt); return true; } public function getfechafilt($sesionid) { $resultados = array(); $sql = "SELECT ip.FecFiltro, ip.Titulos FROM dbo.IOSFA_Params_Estad ip WHERE ip.IdSesion='" . $sesionid . "';"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])); } sqlsrv_free_stmt($stmt); return $resultados; } public function filtrados($param1, $param2) { $resultados = array(); $sql = "EXEC dbo.sp_INFO_IOSFA " . $param1 . "," . $param2 . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])); } sqlsrv_free_stmt($stmt); return $resultados; } public function Prepara_Hist($m3, $m2, $m1, $obrasoc, $opcion) { $resultados = array(); $sql = "EXEC sp_prepara_hist '" . $m3 . "','" . $m2 . "','" . $m1 . "'," . $obrasoc . "," . $opcion . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])); } sqlsrv_free_stmt($stmt); return $resultados; } public function Traer_622aP($obrasoc, $periodo, $offset, $per_page) { $results = array(); $sql = "EXEC sp_Bus622a0 " . $obrasoc . ",'" . $periodo . "'," . $offset . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r("SE AGOTO TIEMPO DE ESPERA AL SERVIDOR", true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_622bP($obrasoc, $periodo, $offsetb, $per_page) { $results = array(); $sql = "EXEC sp_Bus622b0 " . $obrasoc . ",'" . $periodo . "'," . $offsetb . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])) . "|" . trim(utf8_decode($row[4])) . "|" . trim(utf8_decode($row[5])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_622cP($obrasoc, $periodo, $offsetc, $per_page) { $results = array(); $sql = "EXEC sp_Bus622c0 " . $obrasoc . ",'" . $periodo . "'," . $offsetc . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])) . "|" . trim(utf8_decode($row[4])) . "|" . trim(utf8_decode($row[5])) . "|" . trim(utf8_decode($row[6])) . "|" . trim(utf8_decode($row[7])) . "|" . trim(utf8_decode($row[8])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_622dP($obrasoc, $periodo, $offsetd, $per_page) { $results = array(); $sql = "EXEC sp_Bus622d0 " . $obrasoc . ",'" . $periodo . "'," . $offsetd . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])) . "|" . trim(utf8_decode($row[4])) . "|" . trim(utf8_decode($row[5])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_622eP($obrasoc, $periodo, $offsete, $per_page) { $results = array(); $sql = "EXEC sp_Bus622e0 " . $obrasoc . ",'" . $periodo . "'," . $offsete . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])) . "|" . trim(utf8_decode($row[4])) . "|" . trim(utf8_decode($row[5])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_622fP($obrasoc, $periodo, $offsetf, $per_page) { $results = array(); $sql = "EXEC sp_Bus622f0 " . $obrasoc . ",'" . $periodo . "'," . $offsetf . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])); } sqlsrv_free_stmt($stmt); return $results; } public function Totales_622fP($obrasoc, $periodo) { $results = array(); $sql = "EXEC sp_Bus622f0 " . $obrasoc . ",'" . $periodo . "'," . $offsetf . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_ConsumoAfil_x($storedproc, $obrasoc, $afiliadonro) { $results = array(); $sql = "EXEC dbo." . $storedproc . " " . $obrasoc . "," . $afiliadonro . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_ConsumoAfil_0($storedproc, $obrasoc, $qp1, $qp2, $offsetf, $per_page) { $results = array(); $sql = "EXEC dbo." . $storedproc . " " . $obrasoc . "," . $qp1 . "," . $qp2 . "," . $offsetf . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])) . "|" . trim(utf8_decode($row[4])) . "|" . trim(utf8_decode($row[5])) . "|" . trim(utf8_decode($row[6])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_ConsumoAfil($storedproc, $obrasoc, $qp1, $offsetf, $per_page) { $results = array(); $sql = "EXEC dbo." . $storedproc . " " . $obrasoc . "," . $qp1 . "," . $offsetf . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])) . "|" . trim(utf8_decode($row[4])) . "|" . trim(utf8_decode($row[5])) . "|" . trim(utf8_decode($row[6])) . "|" . trim(utf8_decode($row[7])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_3CSingle0T($storedproc, $obrasoc, $offsetf, $per_page) { $results = array(); $sql = "EXEC dbo." . $storedproc . " " . $obrasoc . "," . $offsetf . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])) . "|" . trim(utf8_decode($row[4])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_2CSingle1T($storedproc, $obrasoc, $offsetf, $per_page) { $results = array(); $sql = "EXEC " . $storedproc . " " . $obrasoc . "," . $offsetf . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_3CSingle2T($storedproc, $obrasoc, $periodo, $offsetf, $per_page) { $results = array(); $sql = "EXEC " . $storedproc . " " . $obrasoc . ",'" . $periodo . "'," . $offsetf . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])) . "|" . trim(utf8_decode($row[4])) . "|" . trim(utf8_decode($row[5])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_3CSingle3T($storedproc, $obrasoc, $periodo, $offsetf, $per_page) { $results = array(); $sql = "EXEC " . $storedproc . " " . $obrasoc . ",'" . $periodo . "'," . $offsetf . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])) . "|" . trim(utf8_decode($row[4])) . "|" . trim(utf8_decode($row[5])) . "|" . trim(utf8_decode($row[6])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_4CSingle3T($storedproc, $obrasoc, $offsetf, $per_page) { $results = array(); $sql = "EXEC " . $storedproc . " " . $obrasoc . "," . $offsetf . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])) . "|" . trim(utf8_decode($row[4])) . "|" . trim(utf8_decode($row[5])) . "|" . trim(utf8_decode($row[6])) . "|" . trim(utf8_decode($row[7])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_5CSingle3T($storedproc, $obrasoc, $periodo, $offsetf, $per_page) { $results = array(); $sql = "EXEC " . $storedproc . " " . $obrasoc . ",'" . $periodo . "'," . $offsetf . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])) . "|" . trim(utf8_decode($row[4])) . "|" . trim(utf8_decode($row[5])) . "|" . trim(utf8_decode($row[6])) . "|" . trim(utf8_decode($row[7])); } sqlsrv_free_stmt($stmt); return $results; } public function recetasxafiliado($storedproc, $obrasoc, $qp1, $qp2, $offsetf, $per_page) { $resultados = array(); $sql = "EXEC dbo." . $storedproc . " " . $obrasoc . "," . $qp1 . "," . $qp2 . "," . $offsetf . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])) . "|" . trim(utf8_decode($row[4])) . "|" . trim(utf8_decode($row[5])) . "|" . trim(utf8_decode($row[6])) . "|" . trim(utf8_decode($row[7])) . "|" . trim(utf8_decode($row[8])) . "|" . trim(utf8_decode($row[9])) . "|" . trim(utf8_decode($row[10])) . "|" . trim(utf8_decode($row[11])) . "|" . trim(utf8_decode($row[12])) . "|" . trim(utf8_decode($row[13])); } sqlsrv_free_stmt($stmt); return $resultados; } public function getrecportroqel($parametros) { $linfil = explode("|", $parametros); $pfvta = $linfil[0]; $pcodt = $linfil[1]; $pafili = $linfil[2]; $pcopami = $linfil[3]; $pcarafarm = $linfil[4]; $sql = "SELECT " . "FVENTA,CANTIDADC,PRECVENTAC,ACARGOOSC,ACARGOAFIC,IMP100C,PLANAFI,CODTROQUEL,Nombre,Presentacion,AudTipoDebito,AudCanTroqDeb,NOMBREAFI,Farmacia" . " FROM A_IOSFA_mensual" . " WHERE FVENTA = '.{$pfvta}.'" . " AND CODTROQUEL = '.{$pcodt}.'" . " AND AFILIADO = '.{$pafili}.'" . " AND CODIGOPAMI = '.{$pcopami}.'" . " AND CaratulaFarmacia='.{$pcarafarm}.';"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])) . "|" . trim(utf8_decode($row[4])) . "|" . trim(utf8_decode($row[5])) . "|" . trim(utf8_decode($row[6])) . "|" . trim(utf8_decode($row[7])) . "|" . trim(utf8_decode($row[8])) . "|" . trim(utf8_decode($row[9])) . "|" . trim(utf8_decode($row[10])) . "|" . trim(utf8_decode($row[11])) . "|" . trim(utf8_decode($row[12])); } sqlsrv_free_stmt($stmt); return $resultados; } public function Traer_Detalle622a($obrasoc, $pcia, $periodo, $offsetf, $per_page) { $results = array(); $sql = "EXEC dbo.sp_Bus622a1 " . $obrasoc . ",'" . $pcia . "','" . $periodo . "'," . $offsetf . "," . $per_page . ";"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])) . "|" . trim(utf8_decode($row[4])); } sqlsrv_free_stmt($stmt); return $results; } function getfechaddehta() { $sql = "SELECT " . "MIN(substring(aim.cod_validacion, 1, 6)) AS mindate, " . "MAX(substring(aim.cod_validacion, 1, 6)) AS maxdate " . "FROM dbo.A_IOSFA_mensual aim " . "WHERE SUBSTRING(aim.cod_validacion, 1, 6) BETWEEN '202005' AND '202112';"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])); } sqlsrv_free_stmt($stmt); return $resultados; } public function EstadMens_Excel_0($desde) { $resultados = array(); $sql = "SELECT t1.IdReg" . ", t1.ID_origen" . ", t1.OS" . ", t1.PLANAFI" . ", t1.cod_validacion" . ", t1.codValAfiliado" . ", t1.NUMEROMAT" . ", t1.NOMBREPROF" . ", CONVERT(varchar,t1.FechaIngreso,120) AS fechaingre" . ", t1.FEMISION" . ", t1.FVENTA" . ", t1.AFILIADO" . ", t1.CODIGOPAMI" . ", t1.Farmacia" . ", t1.Provincia" . ", t1.Localidad" . ", t1.EsIOSFA" . ", t1.IOSFA" . ", t1.CANTIDADC" . ", t1.PRECVENTAC" . ", t1.ACARGOOSC" . ", t1.ACARGOAFIC" . ", t1.IMP100C" . ", t1.CODTROQUEL" . ", t1.Nombre" . ", t1.Presentacion" . ", t1.Monodroga" . ", t1.Accion" . ", t1.afilSexo" . ", t1.Forma" . ", t1.Potencia" . ", t1.UnidadPotencia" . ", t1.TipoUnidad" . ", t1.Unidades" . ", t1.Vias" . ", t1.NroLote" . ", t1.CaratulaFarmacia" . ", t1.NOMBREAFI" . " FROM Auditoria.dbo.A_IOSFA_mensual t1 WITH(NOLOCK)" . " WHERE t1.Provincia IS NOT NULL" . " AND T1.CODTROQUEL IS NOT NULL" . " AND t1.ACARGOOSC IS NOT NULL" . " AND t1.ACARGOAFIC IS NOT NULL" . " AND t1.PRECVENTAC IS NOT NULL" . " AND SUBSTRING(t1.cod_validacion, 1, 6) = '" . $desde . "';"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); echo "ERROR: "; } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])) . "|" . trim(utf8_decode($row[4])) . "|" . trim(utf8_decode($row[5])) . "|" . trim(utf8_decode($row[6])) . "|" . trim(utf8_decode($row[7])) . "|" . trim(utf8_decode($row[8])) . "|" . trim(utf8_decode($row[9])) . "|" . trim(utf8_decode($row[10])) . "|" . trim(utf8_decode($row[11])) . "|" . trim(utf8_decode($row[12])) . "|" . trim(utf8_decode($row[13])) . "|" . trim(utf8_decode($row[14])) . "|" . trim(utf8_decode($row[15])) . "|" . trim(utf8_decode($row[16])) . "|" . trim(utf8_decode($row[17])) . "|" . trim(utf8_decode($row[18])) . "|" . trim(utf8_decode($row[19])) . "|" . trim(utf8_decode($row[20])) . "|" . trim(utf8_decode($row[21])) . "|" . trim(utf8_decode($row[22])) . "|" . trim(utf8_decode($row[23])) . "|" . trim(utf8_decode($row[24])) . "|" . trim(utf8_decode($row[25])) . "|" . trim(utf8_decode($row[26])) . "|" . trim(utf8_decode($row[27])) . "|" . trim(utf8_decode($row[28])) . "|" . trim(utf8_decode($row[29])) . "|" . trim(utf8_decode($row[30])) . "|" . trim(utf8_decode($row[31])) . "|" . trim(utf8_decode($row[32])) . "|" . trim(utf8_decode($row[33])) . "|" . trim(utf8_decode($row[34])) . "|" . trim(utf8_decode($row[35])) . "|" . trim(utf8_decode($row[36])) . "|" . trim(utf8_decode($row[37])); } sqlsrv_free_stmt($stmt); return $resultados; } public function EstadMens_Excel_1($afiliado) { $resultados = array(); $sql = "SELECT " . "CAST(aim.cod_validacion AS NUMERIC(20,2)) AS cod_validacion " . ", aim.Farmacia " . ", aim.Provincia " . ", aim.FVENTA " . ", aim.PLANAFI " . ", aim.AFILIADO " . ", aim.CODTROQUEL " . ", RTRIM(CONCAT ( " . "RTRIM(SUBSTRING(aim.Nombre, 1, 70)) " . ", ' - Presentacion: ' " . ", RTRIM(SUBSTRING(aim.Presentacion, 1, 80)) " . ")) AS NombrePresen " . ", aim.Monodroga " . ", aim.CANTIDADC " . ", aim.ACARGOOSC " . ", aim.ACARGOAFIC " . "FROM " . "dbo.A_IOSFA_mensual aim " . "WHERE aim.AFILIADO = '" . $afiliado . "' " . "ORDER BY 1, 2, 3, 5; "; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])) . "|" . trim(utf8_decode($row[1])) . "|" . trim(utf8_decode($row[2])) . "|" . trim(utf8_decode($row[3])) . "|" . trim(utf8_decode($row[4])) . "|" . trim(utf8_decode($row[5])) . "|" . trim(utf8_decode($row[6])) . "|" . trim(utf8_decode($row[7])) . "|" . trim(utf8_decode($row[8])) . "|" . trim(utf8_decode($row[9])) . "|" . trim(utf8_decode($row[10])) . "|" . trim(utf8_decode($row[11])); } sqlsrv_free_stmt($stmt); return $resultados; } } ?>
Did this file decode correctly?
Original Code
<?php
class Conexion { private $cn; public function __construct() { $servidor = DB_HOST; $database = DB_NAME; $userid = DB_USER; $upsswd = DB_PASS; $info = array("\104\141\164\141\x62\141\163\x65" => $database, "\125\151\x64" => $userid, "\120\x57\x44" => $upsswd); $this->cn = sqlsrv_connect($servidor, $info); } public function getConecta() { return $this->cn; } function executeQuery($query) { $sql = sqlsrv_query($this->getConecta(), $query, array(), array("\x53\x63\162\157\154\x6c\141\x62\x6c\145" => SQLSRV_CURSOR_KEYSET)) or die(print_r(sqlsrv_errors(), true)); return $sql; } function fetchArray($result) { return sqlsrv_fetch_array($result); } function getNumRows($result) { return sqlsrv_num_rows($result); } function close() { } function error() { return $this->_error; } function FormatErrors($errors) { echo "\x45\162\162\157\x72\x20\151\156\146\x6f\162\x6d\141\x74\151\157\156\x3a\x20"; foreach ($errors as $error) { echo "\x53\x51\114\123\124\x41\124\105\72\x20" . $error["\x53\121\114\x53\x54\101\x54\105"] . ''; echo "\x43\x6f\x64\145\72\x20" . $error["\143\x6f\x64\x65"] . ''; echo "\x4d\x65\x73\x73\x61\147\145\72\40" . $error["\x6d\x65\x73\163\141\147\145"] . ''; } } function ExecSP($query) { } function mssql_escape($data) { if (is_numeric($data)) { return $data; } $unpacked = unpack("\x48\52\x68\145\170", $data); return "\60\170" . $unpacked["\x68\x65\x78"]; } public function fechasactuales() { $resultados = array(); $sql = "\123\x45\x4c\x45\103\x54" . "\40\x4d\x49\x4e\50\123\125\102\x53\x54\x52\x49\116\x47\50\x61\151\x6d\56\x63\x6f\144\137\166\141\154\151\144\141\x63\151\x6f\156\54\x20\x31\x2c\40\66\x29\51\x20\101\123\40\106\x45\103\x4d\111\x4e" . "\54\40\x4d\101\130\x28\123\125\x42\x53\x54\x52\x49\x4e\107\50\141\x69\x6d\x2e\x63\x6f\144\137\166\x61\154\151\x64\141\x63\x69\x6f\x6e\54\x20\x31\54\40\66\51\x29\40\101\x53\x20\106\105\103\115\101\x58" . "\40\x46\122\x4f\x4d\x20\x64\142\x6f\56\101\x5f\x49\117\x53\106\101\137\155\x65\156\x73\x75\141\x6c\x20\x61\151\x6d\40\x57\111\x54\110\x28\x4e\x4f\x4c\117\x43\x4b\51" . "\40\x57\x48\105\122\x45\40\x43\x41\x53\x54\50\123\125\102\x53\x54\122\111\x4e\107\50\x61\x69\x6d\56\x63\x6f\144\137\166\141\154\x69\x64\x61\x63\x69\157\156\54\61\54\x36\51\40\101\x53\x20\151\x6e\x74\51\76\75\x32\60\x32\x30\73"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])) . "\174" . trim(utf8_decode($row[1])); } sqlsrv_free_stmt($stmt); return $resultados; } public function setfechafilt($modo, $fechafilt, $sesionid, $encabezados) { switch ($modo) { case 0: $sql = "\x49\x4e\123\x45\x52\124\40\111\116\x54\x4f\x20\x49\117\123\x46\x41\x5f\x50\x61\x72\x61\155\x73\137\x45\163\164\141\144\40\x28\x46\145\x63\106\151\x6c\164\x72\157\54\x20\x49\x64\x53\x65\163\x69\157\x6e\x2c\x20\x54\151\164\165\154\x6f\x73\x2c\x46\x65\143\x48\163\137\151\156\51\40\x56\101\x4c\x55\x45\x53\x20\x28\47" . $fechafilt . "\47\54\47" . $sesionid . "\47\54\47" . $encabezados . "\x27\54\x47\x45\124\104\101\x54\105\50\x29\51\73"; break; case 1: $sql = "\x55\x50\x44\x41\x54\105\40\x49\x4f\x53\x46\101\x5f\x50\x61\162\x61\155\x73\x5f\x45\x73\x74\141\x64\40\123\x45\x54\x20\x46\145\143\x46\151\x6c\x74\x72\157\75\x27" . $fechafilt . "\x27\54\x20\x54\x69\164\165\154\157\163\75\x27" . $encabezados . "\47\x2c\x46\x65\143\110\x73\x5f\141\143\x3d\x47\105\124\x44\x41\124\105\x28\51\40\x57\110\105\122\105\40\111\144\123\145\163\x69\x6f\x6e\75\x27" . $sesionid . "\x27\73"; break; case 2: $sql = "\x44\x45\114\105\x54\x45\40\x49\x4f\x53\106\x41\137\x50\x61\x72\141\x6d\163\137\105\163\164\141\x64\x20\x57\110\x45\122\x45\x20\x49\x64\x53\x65\x73\151\157\156\75\47" . $sesionid . "\47\73"; break; } $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } sqlsrv_free_stmt($stmt); return true; } public function getfechafilt($sesionid) { $resultados = array(); $sql = "\x53\105\114\105\103\124\x20\151\x70\x2e\x46\x65\143\x46\x69\154\x74\x72\157\x2c\40\x69\x70\56\124\151\164\x75\154\x6f\x73\x20\106\122\x4f\115\x20\x64\x62\157\x2e\111\117\123\106\x41\x5f\x50\141\162\141\x6d\163\x5f\105\163\x74\141\144\40\151\160\40\x57\110\105\x52\x45\40\151\160\x2e\111\x64\123\x65\163\151\x6f\x6e\x3d\47" . $sesionid . "\47\x3b"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])) . "\x7c" . trim(utf8_decode($row[1])); } sqlsrv_free_stmt($stmt); return $resultados; } public function filtrados($param1, $param2) { $resultados = array(); $sql = "\x45\x58\x45\103\40\144\142\x6f\x2e\x73\x70\x5f\111\x4e\x46\x4f\x5f\x49\117\x53\x46\101\40" . $param1 . "\54" . $param2 . "\x3b"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])); } sqlsrv_free_stmt($stmt); return $resultados; } public function Prepara_Hist($m3, $m2, $m1, $obrasoc, $opcion) { $resultados = array(); $sql = "\x45\130\x45\103\40\163\160\137\160\x72\145\160\141\162\x61\137\x68\151\163\x74\40\x27" . $m3 . "\x27\54\x27" . $m2 . "\47\54\x27" . $m1 . "\x27\54" . $obrasoc . "\x2c" . $opcion . "\x3b"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])) . "\x7c" . trim(utf8_decode($row[1])); } sqlsrv_free_stmt($stmt); return $resultados; } public function Traer_622aP($obrasoc, $periodo, $offset, $per_page) { $results = array(); $sql = "\105\130\105\x43\x20\x73\160\x5f\102\165\x73\66\x32\62\x61\x30\40" . $obrasoc . "\x2c\x27" . $periodo . "\47\x2c" . $offset . "\54" . $per_page . "\x3b"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r("\x53\x45\40\101\x47\117\124\x4f\x20\x54\111\x45\115\x50\117\x20\x44\105\40\x45\123\120\x45\122\101\40\x41\114\x20\123\105\x52\x56\111\104\117\122", true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\174" . trim(utf8_decode($row[1])) . "\174" . trim(utf8_decode($row[2])) . "\x7c" . trim(utf8_decode($row[3])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_622bP($obrasoc, $periodo, $offsetb, $per_page) { $results = array(); $sql = "\x45\x58\105\x43\x20\x73\160\137\102\165\163\66\x32\x32\x62\60\x20" . $obrasoc . "\54\x27" . $periodo . "\47\54" . $offsetb . "\x2c" . $per_page . "\x3b"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\x7c" . trim(utf8_decode($row[1])) . "\x7c" . trim(utf8_decode($row[2])) . "\x7c" . trim(utf8_decode($row[3])) . "\x7c" . trim(utf8_decode($row[4])) . "\174" . trim(utf8_decode($row[5])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_622cP($obrasoc, $periodo, $offsetc, $per_page) { $results = array(); $sql = "\x45\x58\105\103\x20\x73\160\137\x42\x75\x73\x36\62\x32\x63\60\x20" . $obrasoc . "\x2c\47" . $periodo . "\x27\x2c" . $offsetc . "\x2c" . $per_page . "\73"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\174" . trim(utf8_decode($row[1])) . "\x7c" . trim(utf8_decode($row[2])) . "\x7c" . trim(utf8_decode($row[3])) . "\174" . trim(utf8_decode($row[4])) . "\174" . trim(utf8_decode($row[5])) . "\174" . trim(utf8_decode($row[6])) . "\174" . trim(utf8_decode($row[7])) . "\x7c" . trim(utf8_decode($row[8])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_622dP($obrasoc, $periodo, $offsetd, $per_page) { $results = array(); $sql = "\105\x58\x45\103\x20\163\160\x5f\102\x75\x73\66\x32\62\x64\60\x20" . $obrasoc . "\x2c\x27" . $periodo . "\x27\x2c" . $offsetd . "\x2c" . $per_page . "\73"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\x7c" . trim(utf8_decode($row[1])) . "\174" . trim(utf8_decode($row[2])) . "\174" . trim(utf8_decode($row[3])) . "\174" . trim(utf8_decode($row[4])) . "\174" . trim(utf8_decode($row[5])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_622eP($obrasoc, $periodo, $offsete, $per_page) { $results = array(); $sql = "\x45\x58\x45\103\40\163\x70\137\102\x75\x73\66\62\62\145\60\40" . $obrasoc . "\54\47" . $periodo . "\47\54" . $offsete . "\54" . $per_page . "\x3b"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\x7c" . trim(utf8_decode($row[1])) . "\x7c" . trim(utf8_decode($row[2])) . "\174" . trim(utf8_decode($row[3])) . "\174" . trim(utf8_decode($row[4])) . "\x7c" . trim(utf8_decode($row[5])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_622fP($obrasoc, $periodo, $offsetf, $per_page) { $results = array(); $sql = "\x45\130\105\103\40\x73\160\x5f\x42\x75\x73\x36\62\x32\x66\60\x20" . $obrasoc . "\54\47" . $periodo . "\47\x2c" . $offsetf . "\x2c" . $per_page . "\x3b"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\x7c" . trim(utf8_decode($row[1])) . "\x7c" . trim(utf8_decode($row[2])) . "\174" . trim(utf8_decode($row[3])); } sqlsrv_free_stmt($stmt); return $results; } public function Totales_622fP($obrasoc, $periodo) { $results = array(); $sql = "\105\x58\105\103\x20\x73\160\137\102\165\x73\66\62\x32\x66\x30\40" . $obrasoc . "\x2c\47" . $periodo . "\x27\54" . $offsetf . "\x2c" . $per_page . "\x3b"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\x7c" . trim(utf8_decode($row[1])) . "\x7c" . trim(utf8_decode($row[2])) . "\x7c" . trim(utf8_decode($row[3])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_ConsumoAfil_x($storedproc, $obrasoc, $afiliadonro) { $results = array(); $sql = "\105\130\x45\x43\x20\144\142\157\56" . $storedproc . "\40" . $obrasoc . "\54" . $afiliadonro . "\x3b"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\x7c" . trim(utf8_decode($row[1])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_ConsumoAfil_0($storedproc, $obrasoc, $qp1, $qp2, $offsetf, $per_page) { $results = array(); $sql = "\105\x58\x45\x43\40\x64\x62\157\56" . $storedproc . "\x20" . $obrasoc . "\54" . $qp1 . "\x2c" . $qp2 . "\x2c" . $offsetf . "\54" . $per_page . "\73"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\174" . trim(utf8_decode($row[1])) . "\x7c" . trim(utf8_decode($row[2])) . "\174" . trim(utf8_decode($row[3])) . "\174" . trim(utf8_decode($row[4])) . "\x7c" . trim(utf8_decode($row[5])) . "\x7c" . trim(utf8_decode($row[6])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_ConsumoAfil($storedproc, $obrasoc, $qp1, $offsetf, $per_page) { $results = array(); $sql = "\105\130\105\x43\x20\144\x62\157\56" . $storedproc . "\40" . $obrasoc . "\54" . $qp1 . "\54" . $offsetf . "\x2c" . $per_page . "\73"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\x7c" . trim(utf8_decode($row[1])) . "\x7c" . trim(utf8_decode($row[2])) . "\x7c" . trim(utf8_decode($row[3])) . "\174" . trim(utf8_decode($row[4])) . "\174" . trim(utf8_decode($row[5])) . "\174" . trim(utf8_decode($row[6])) . "\174" . trim(utf8_decode($row[7])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_3CSingle0T($storedproc, $obrasoc, $offsetf, $per_page) { $results = array(); $sql = "\x45\x58\x45\103\x20\x64\142\157\56" . $storedproc . "\x20" . $obrasoc . "\54" . $offsetf . "\x2c" . $per_page . "\x3b"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\x7c" . trim(utf8_decode($row[1])) . "\x7c" . trim(utf8_decode($row[2])) . "\174" . trim(utf8_decode($row[3])) . "\174" . trim(utf8_decode($row[4])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_2CSingle1T($storedproc, $obrasoc, $offsetf, $per_page) { $results = array(); $sql = "\x45\x58\105\103\x20" . $storedproc . "\40" . $obrasoc . "\x2c" . $offsetf . "\54" . $per_page . "\73"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\x7c" . trim(utf8_decode($row[1])) . "\x7c" . trim(utf8_decode($row[2])) . "\174" . trim(utf8_decode($row[3])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_3CSingle2T($storedproc, $obrasoc, $periodo, $offsetf, $per_page) { $results = array(); $sql = "\105\x58\x45\103\x20" . $storedproc . "\40" . $obrasoc . "\54\x27" . $periodo . "\x27\x2c" . $offsetf . "\x2c" . $per_page . "\73"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\174" . trim(utf8_decode($row[1])) . "\x7c" . trim(utf8_decode($row[2])) . "\174" . trim(utf8_decode($row[3])) . "\174" . trim(utf8_decode($row[4])) . "\x7c" . trim(utf8_decode($row[5])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_3CSingle3T($storedproc, $obrasoc, $periodo, $offsetf, $per_page) { $results = array(); $sql = "\x45\130\105\103\40" . $storedproc . "\x20" . $obrasoc . "\x2c\47" . $periodo . "\x27\x2c" . $offsetf . "\54" . $per_page . "\73"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\x7c" . trim(utf8_decode($row[1])) . "\x7c" . trim(utf8_decode($row[2])) . "\174" . trim(utf8_decode($row[3])) . "\174" . trim(utf8_decode($row[4])) . "\x7c" . trim(utf8_decode($row[5])) . "\x7c" . trim(utf8_decode($row[6])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_4CSingle3T($storedproc, $obrasoc, $offsetf, $per_page) { $results = array(); $sql = "\105\130\105\x43\40" . $storedproc . "\x20" . $obrasoc . "\54" . $offsetf . "\54" . $per_page . "\73"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\x7c" . trim(utf8_decode($row[1])) . "\174" . trim(utf8_decode($row[2])) . "\174" . trim(utf8_decode($row[3])) . "\174" . trim(utf8_decode($row[4])) . "\174" . trim(utf8_decode($row[5])) . "\x7c" . trim(utf8_decode($row[6])) . "\x7c" . trim(utf8_decode($row[7])); } sqlsrv_free_stmt($stmt); return $results; } public function Traer_5CSingle3T($storedproc, $obrasoc, $periodo, $offsetf, $per_page) { $results = array(); $sql = "\105\130\x45\x43\x20" . $storedproc . "\x20" . $obrasoc . "\x2c\x27" . $periodo . "\x27\54" . $offsetf . "\x2c" . $per_page . "\x3b"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\174" . trim(utf8_decode($row[1])) . "\x7c" . trim(utf8_decode($row[2])) . "\174" . trim(utf8_decode($row[3])) . "\174" . trim(utf8_decode($row[4])) . "\174" . trim(utf8_decode($row[5])) . "\x7c" . trim(utf8_decode($row[6])) . "\174" . trim(utf8_decode($row[7])); } sqlsrv_free_stmt($stmt); return $results; } public function recetasxafiliado($storedproc, $obrasoc, $qp1, $qp2, $offsetf, $per_page) { $resultados = array(); $sql = "\105\130\105\103\40\144\142\157\x2e" . $storedproc . "\x20" . $obrasoc . "\x2c" . $qp1 . "\54" . $qp2 . "\x2c" . $offsetf . "\54" . $per_page . "\73"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])) . "\174" . trim(utf8_decode($row[1])) . "\174" . trim(utf8_decode($row[2])) . "\x7c" . trim(utf8_decode($row[3])) . "\x7c" . trim(utf8_decode($row[4])) . "\174" . trim(utf8_decode($row[5])) . "\x7c" . trim(utf8_decode($row[6])) . "\174" . trim(utf8_decode($row[7])) . "\174" . trim(utf8_decode($row[8])) . "\174" . trim(utf8_decode($row[9])) . "\x7c" . trim(utf8_decode($row[10])) . "\x7c" . trim(utf8_decode($row[11])) . "\x7c" . trim(utf8_decode($row[12])) . "\x7c" . trim(utf8_decode($row[13])); } sqlsrv_free_stmt($stmt); return $resultados; } public function getrecportroqel($parametros) { $linfil = explode("\174", $parametros); $pfvta = $linfil[0]; $pcodt = $linfil[1]; $pafili = $linfil[2]; $pcopami = $linfil[3]; $pcarafarm = $linfil[4]; $sql = "\123\x45\x4c\105\103\124\x20" . "\x46\x56\x45\116\124\101\x2c\x43\x41\116\x54\111\104\101\104\103\x2c\x50\122\105\x43\126\105\x4e\x54\101\x43\x2c\x41\x43\x41\122\107\x4f\x4f\x53\103\x2c\x41\x43\x41\122\x47\117\101\106\x49\x43\54\x49\115\x50\x31\60\x30\x43\x2c\120\114\x41\116\101\x46\111\x2c\x43\117\104\x54\x52\x4f\x51\x55\x45\x4c\54\x4e\157\155\x62\x72\145\54\x50\162\145\x73\145\x6e\x74\x61\143\x69\157\156\x2c\x41\x75\x64\x54\151\x70\157\104\145\142\x69\x74\157\54\x41\x75\144\x43\x61\x6e\x54\x72\x6f\x71\104\x65\x62\x2c\x4e\117\x4d\x42\122\105\x41\106\x49\54\x46\x61\162\155\141\x63\151\141" . "\40\106\x52\117\115\40\x41\137\111\x4f\123\106\101\x5f\155\145\156\163\x75\141\154" . "\40\x57\x48\x45\122\105\x20\x46\x56\105\116\x54\x41\x20\x3d\40\47\x2e{$pfvta}\56\x27" . "\x20\x41\116\104\x20\x43\x4f\x44\x54\x52\117\121\125\105\x4c\x20\75\x20\47\x2e{$pcodt}\56\x27" . "\40\101\x4e\104\40\x41\x46\x49\114\x49\x41\x44\x4f\x20\x3d\x20\47\x2e{$pafili}\x2e\47" . "\x20\101\x4e\104\x20\x43\117\x44\x49\x47\x4f\120\101\x4d\x49\40\x3d\x20\x27\x2e{$pcopami}\x2e\47" . "\40\x41\116\104\x20\x43\141\162\141\164\165\154\x61\x46\x61\162\155\x61\143\151\x61\x3d\47\x2e{$pcarafarm}\x2e\47\73"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])) . "\174" . trim(utf8_decode($row[1])) . "\174" . trim(utf8_decode($row[2])) . "\174" . trim(utf8_decode($row[3])) . "\174" . trim(utf8_decode($row[4])) . "\x7c" . trim(utf8_decode($row[5])) . "\x7c" . trim(utf8_decode($row[6])) . "\174" . trim(utf8_decode($row[7])) . "\x7c" . trim(utf8_decode($row[8])) . "\x7c" . trim(utf8_decode($row[9])) . "\x7c" . trim(utf8_decode($row[10])) . "\174" . trim(utf8_decode($row[11])) . "\x7c" . trim(utf8_decode($row[12])); } sqlsrv_free_stmt($stmt); return $resultados; } public function Traer_Detalle622a($obrasoc, $pcia, $periodo, $offsetf, $per_page) { $results = array(); $sql = "\105\130\x45\x43\40\144\142\157\56\163\160\x5f\x42\x75\163\66\x32\62\141\x31\40" . $obrasoc . "\54\47" . $pcia . "\x27\54\47" . $periodo . "\x27\x2c" . $offsetf . "\x2c" . $per_page . "\73"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $results[] = trim(utf8_decode($row[0])) . "\174" . trim(utf8_decode($row[1])) . "\174" . trim(utf8_decode($row[2])) . "\x7c" . trim(utf8_decode($row[3])) . "\x7c" . trim(utf8_decode($row[4])); } sqlsrv_free_stmt($stmt); return $results; } function getfechaddehta() { $sql = "\x53\105\114\x45\x43\124\x20" . "\115\111\116\50\x73\165\x62\x73\164\162\151\x6e\147\x28\141\151\155\x2e\143\x6f\x64\137\x76\x61\154\151\144\141\143\x69\157\x6e\54\x20\x31\x2c\40\x36\x29\51\40\101\x53\x20\155\151\156\x64\141\x74\145\x2c\x20" . "\x4d\x41\130\x28\163\165\x62\x73\164\x72\x69\x6e\x67\x28\x61\151\x6d\x2e\143\157\x64\x5f\x76\x61\154\151\144\x61\143\x69\157\x6e\54\40\61\x2c\x20\66\x29\51\40\x41\123\x20\x6d\x61\x78\x64\141\164\x65\40" . "\106\x52\117\x4d\x20\x64\x62\157\x2e\x41\137\111\x4f\123\106\x41\137\x6d\x65\156\163\x75\x61\x6c\x20\x61\151\155\x20" . "\127\110\105\122\105\x20\x53\125\x42\123\x54\x52\x49\x4e\x47\x28\141\151\x6d\56\x63\157\144\x5f\166\141\x6c\151\x64\141\143\151\157\x6e\x2c\x20\x31\x2c\40\x36\x29\x20\102\x45\124\x57\x45\105\116\x20\47\62\x30\x32\x30\60\x35\x27\x20\101\x4e\x44\x20\47\x32\x30\62\x31\61\x32\x27\x3b"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])) . "\174" . trim(utf8_decode($row[1])); } sqlsrv_free_stmt($stmt); return $resultados; } public function EstadMens_Excel_0($desde) { $resultados = array(); $sql = "\123\x45\x4c\x45\103\124\x20\164\x31\56\x49\144\x52\145\x67" . "\54\x20\164\x31\x2e\111\104\x5f\157\x72\151\x67\x65\156" . "\54\40\164\61\x2e\117\x53" . "\54\x20\x74\x31\56\x50\x4c\101\x4e\101\106\x49" . "\54\40\164\61\x2e\143\157\144\137\x76\x61\x6c\151\x64\x61\143\151\x6f\x6e" . "\54\40\x74\61\56\x63\157\x64\x56\x61\154\x41\146\151\154\x69\141\x64\157" . "\x2c\x20\x74\61\x2e\x4e\125\115\x45\122\x4f\115\x41\124" . "\x2c\x20\x74\61\x2e\116\117\x4d\102\122\x45\x50\122\117\106" . "\x2c\x20\x43\117\x4e\x56\x45\122\x54\50\166\x61\x72\143\150\141\162\x2c\x74\61\56\106\x65\143\150\141\111\156\147\162\145\163\x6f\x2c\x31\x32\60\51\x20\101\123\x20\146\x65\x63\150\141\x69\156\147\162\145" . "\x2c\x20\164\61\56\106\105\x4d\111\123\111\x4f\x4e" . "\x2c\40\x74\x31\56\x46\126\x45\x4e\x54\101" . "\x2c\x20\164\61\56\x41\x46\111\x4c\111\101\104\x4f" . "\54\40\164\x31\56\103\x4f\104\x49\107\117\120\x41\x4d\x49" . "\54\40\164\61\56\x46\x61\x72\155\x61\x63\151\x61" . "\54\40\x74\x31\56\x50\x72\157\166\151\x6e\x63\151\x61" . "\x2c\x20\x74\x31\56\x4c\157\x63\x61\154\x69\x64\141\144" . "\x2c\x20\164\61\x2e\x45\163\111\117\123\106\101" . "\54\x20\164\x31\x2e\x49\117\123\106\101" . "\x2c\x20\164\x31\56\103\101\x4e\124\111\104\101\x44\x43" . "\x2c\x20\164\61\x2e\120\x52\105\x43\x56\x45\x4e\124\x41\x43" . "\54\40\164\61\x2e\x41\x43\x41\x52\x47\117\x4f\123\x43" . "\54\40\x74\x31\x2e\x41\103\101\122\x47\x4f\101\x46\111\x43" . "\x2c\40\x74\x31\56\111\x4d\120\x31\x30\x30\x43" . "\x2c\x20\164\61\56\103\x4f\x44\x54\x52\x4f\x51\x55\105\114" . "\54\x20\x74\x31\x2e\x4e\157\x6d\142\x72\145" . "\x2c\40\164\x31\x2e\120\162\x65\163\x65\x6e\164\x61\x63\151\x6f\156" . "\54\x20\164\x31\56\x4d\x6f\156\x6f\x64\162\x6f\147\x61" . "\x2c\40\x74\x31\56\x41\143\x63\x69\157\x6e" . "\x2c\40\164\61\56\141\146\151\154\123\145\x78\157" . "\54\40\x74\61\x2e\106\157\x72\155\x61" . "\54\40\164\61\56\120\157\164\145\x6e\143\x69\141" . "\x2c\40\164\x31\x2e\x55\x6e\151\144\x61\x64\120\x6f\164\x65\156\x63\x69\x61" . "\x2c\x20\x74\61\x2e\x54\151\x70\157\x55\156\151\x64\141\144" . "\x2c\40\164\x31\x2e\x55\156\151\144\x61\x64\x65\163" . "\x2c\40\164\x31\x2e\126\151\141\x73" . "\54\40\164\61\56\x4e\x72\x6f\x4c\x6f\164\x65" . "\54\40\164\61\56\x43\141\x72\x61\164\x75\x6c\141\x46\141\x72\155\141\x63\x69\141" . "\54\40\164\61\x2e\x4e\x4f\x4d\102\x52\x45\x41\x46\x49" . "\40\106\x52\117\x4d\x20\x41\165\144\x69\x74\x6f\162\151\x61\56\x64\142\157\56\x41\x5f\111\117\x53\x46\101\137\155\x65\156\163\x75\x61\154\40\164\61\40\x57\x49\x54\x48\x28\x4e\117\114\x4f\103\113\51" . "\40\127\110\105\x52\105\40\164\x31\x2e\x50\162\157\166\x69\x6e\143\151\x61\40\x49\123\x20\x4e\117\124\40\x4e\x55\114\114" . "\x20\x41\x4e\x44\x20\124\61\x2e\x43\117\104\124\122\117\121\125\105\114\x20\x49\123\40\x4e\x4f\124\x20\x4e\x55\114\x4c" . "\40\x41\116\x44\x20\x74\x31\56\x41\103\101\x52\107\117\x4f\123\x43\40\x49\x53\x20\x4e\117\124\40\116\x55\114\x4c" . "\x20\101\116\x44\x20\164\x31\x2e\x41\x43\101\122\107\x4f\101\x46\111\x43\x20\x49\123\x20\116\x4f\x54\40\116\125\114\114" . "\x20\101\116\x44\x20\x74\x31\x2e\120\122\105\103\126\x45\x4e\124\101\103\x20\111\123\x20\x4e\x4f\124\40\116\125\114\x4c" . "\40\x41\x4e\104\x20\123\x55\102\123\x54\122\111\116\x47\50\164\61\56\x63\x6f\x64\x5f\x76\141\x6c\x69\x64\x61\143\151\157\156\x2c\40\61\x2c\40\x36\x29\x20\x3d\x20\x27" . $desde . "\47\x3b"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); echo "\x45\x52\122\x4f\122\x3a\40"; } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])) . "\174" . trim(utf8_decode($row[1])) . "\x7c" . trim(utf8_decode($row[2])) . "\174" . trim(utf8_decode($row[3])) . "\x7c" . trim(utf8_decode($row[4])) . "\x7c" . trim(utf8_decode($row[5])) . "\x7c" . trim(utf8_decode($row[6])) . "\x7c" . trim(utf8_decode($row[7])) . "\174" . trim(utf8_decode($row[8])) . "\174" . trim(utf8_decode($row[9])) . "\x7c" . trim(utf8_decode($row[10])) . "\174" . trim(utf8_decode($row[11])) . "\174" . trim(utf8_decode($row[12])) . "\174" . trim(utf8_decode($row[13])) . "\174" . trim(utf8_decode($row[14])) . "\x7c" . trim(utf8_decode($row[15])) . "\x7c" . trim(utf8_decode($row[16])) . "\174" . trim(utf8_decode($row[17])) . "\174" . trim(utf8_decode($row[18])) . "\174" . trim(utf8_decode($row[19])) . "\174" . trim(utf8_decode($row[20])) . "\x7c" . trim(utf8_decode($row[21])) . "\x7c" . trim(utf8_decode($row[22])) . "\x7c" . trim(utf8_decode($row[23])) . "\x7c" . trim(utf8_decode($row[24])) . "\174" . trim(utf8_decode($row[25])) . "\174" . trim(utf8_decode($row[26])) . "\x7c" . trim(utf8_decode($row[27])) . "\x7c" . trim(utf8_decode($row[28])) . "\174" . trim(utf8_decode($row[29])) . "\174" . trim(utf8_decode($row[30])) . "\x7c" . trim(utf8_decode($row[31])) . "\x7c" . trim(utf8_decode($row[32])) . "\x7c" . trim(utf8_decode($row[33])) . "\x7c" . trim(utf8_decode($row[34])) . "\x7c" . trim(utf8_decode($row[35])) . "\174" . trim(utf8_decode($row[36])) . "\x7c" . trim(utf8_decode($row[37])); } sqlsrv_free_stmt($stmt); return $resultados; } public function EstadMens_Excel_1($afiliado) { $resultados = array(); $sql = "\123\x45\x4c\105\x43\x54\40" . "\103\x41\x53\124\50\x61\x69\x6d\x2e\x63\157\x64\x5f\166\141\x6c\151\x64\141\143\151\157\x6e\x20\101\x53\40\116\x55\x4d\x45\122\x49\x43\x28\x32\60\54\62\x29\51\40\101\x53\40\143\157\144\x5f\166\141\x6c\151\x64\x61\x63\x69\x6f\x6e\x20" . "\54\x20\141\x69\155\56\x46\x61\x72\x6d\x61\x63\151\141\40" . "\54\x20\141\x69\155\56\120\x72\x6f\x76\x69\x6e\x63\x69\x61\40" . "\x2c\x20\x61\x69\x6d\x2e\106\126\x45\x4e\x54\x41\40" . "\x2c\40\141\x69\155\x2e\120\114\x41\116\101\x46\111\40" . "\54\40\x61\151\155\56\x41\x46\x49\x4c\111\101\x44\x4f\x20" . "\x2c\40\141\x69\x6d\56\x43\117\x44\x54\122\x4f\121\x55\x45\114\40" . "\54\x20\122\124\122\x49\x4d\50\103\x4f\x4e\103\101\124\40\50\x20" . "\x52\x54\122\x49\115\x28\123\x55\x42\x53\124\122\x49\116\x47\x28\141\151\x6d\56\x4e\x6f\x6d\x62\x72\x65\54\x20\x31\x2c\40\x37\x30\51\51\x20" . "\x2c\x20\x27\40\x2d\x20\x50\162\145\x73\145\x6e\164\x61\143\151\x6f\x6e\x3a\40\x27\40" . "\54\x20\122\x54\122\x49\x4d\50\x53\x55\x42\x53\124\122\111\x4e\x47\x28\141\x69\155\56\120\162\145\163\x65\x6e\x74\x61\143\151\x6f\x6e\54\40\x31\54\40\70\60\x29\x29\x20" . "\x29\x29\40\x41\123\x20\116\x6f\x6d\142\162\x65\x50\x72\x65\163\x65\156\x20" . "\x2c\40\x61\x69\x6d\56\x4d\x6f\156\157\x64\162\x6f\147\x61\x20" . "\54\x20\141\x69\155\x2e\x43\x41\x4e\x54\111\x44\x41\x44\x43\x20" . "\x2c\x20\x61\x69\x6d\x2e\x41\103\101\122\x47\x4f\117\x53\103\x20" . "\54\40\141\151\x6d\x2e\101\103\x41\x52\107\117\101\106\111\x43\x20" . "\x46\122\x4f\x4d\40" . "\144\142\157\x2e\101\137\x49\x4f\123\106\101\137\155\x65\156\163\x75\141\x6c\40\141\151\155\x20" . "\127\110\x45\122\105\x20\141\151\155\56\101\106\x49\114\x49\x41\x44\117\x20\x3d\x20\x27" . $afiliado . "\x27\40" . "\x4f\x52\104\105\x52\40\x42\x59\40\61\54\40\x32\54\x20\63\x2c\40\x35\73\x20"; $stmt = sqlsrv_query($this->getConecta(), $sql); if ($stmt === false) { die(print_r(sqlsrv_errors(), true)); } while ($row = sqlsrv_fetch_array($stmt, SQLSRV_FETCH_NUMERIC)) { $resultados[] = trim(utf8_decode($row[0])) . "\174" . trim(utf8_decode($row[1])) . "\174" . trim(utf8_decode($row[2])) . "\x7c" . trim(utf8_decode($row[3])) . "\x7c" . trim(utf8_decode($row[4])) . "\x7c" . trim(utf8_decode($row[5])) . "\x7c" . trim(utf8_decode($row[6])) . "\x7c" . trim(utf8_decode($row[7])) . "\174" . trim(utf8_decode($row[8])) . "\174" . trim(utf8_decode($row[9])) . "\174" . trim(utf8_decode($row[10])) . "\174" . trim(utf8_decode($row[11])); } sqlsrv_free_stmt($stmt); return $resultados; } }
Function Calls
None |
Stats
MD5 | 2d13544165f6de3fc7fc1c55de7518b3 |
Eval Count | 0 |
Decode Time | 188 ms |