From 821fb3f6499c23b20b442285589acf2927765575 Mon Sep 17 00:00:00 2001 From: Frederico Gendorf Date: Thu, 10 May 2018 14:19:08 -0300 Subject: [PATCH] =?UTF-8?q?Vers=C3=A3o=201.0.1=20bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/REPRegistros.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/code/REPRegistros.php b/code/REPRegistros.php index b224f4e..516d796 100644 --- a/code/REPRegistros.php +++ b/code/REPRegistros.php @@ -46,9 +46,9 @@ public function coletaRegistrosPonto() { * @return array */ public function getInclusaoAlteracaoEmpresa($registros) { + $y = 0; for ($x = 0; sizeof($registros) > $x; ++$x) { if (substr($registros[$x], 9, 1) == 2) { - ++$y; $regarray[$y]["NSR"] = substr($registros[$x], 0, 9); $regarray[$y]["tipo"] = substr($registros[$x], 9, 1); $regarray[$y]["data"] = substr($registros[$x], 10, 8); @@ -58,6 +58,7 @@ public function getInclusaoAlteracaoEmpresa($registros) { $regarray[$y]["cei"] = substr($registros[$x], 37, 12); $regarray[$y]["razaosocial"] = substr($registros[$x], 49, 150); $regarray[$y]["local"] = substr($registros[$x], 199, 100); + ++$y; } } return $regarray; @@ -70,14 +71,15 @@ public function getInclusaoAlteracaoEmpresa($registros) { * @return array */ public function getMarcacaoPonto($registros) { + $y = 0; for ($x = 0; sizeof($registros) > $x; ++$x) { if (substr($registros[$x], 9, 1) == 3) { - ++$y; $regarray[$y]["NSR"] = substr($registros[$x], 0, 9); $regarray[$y]["tipo"] = substr($registros[$x], 9, 1); $date = DateTime::createFromFormat("dmYHi", substr($registros[$x], 10, 8) . substr($registros[$x], 18, 4)); $regarray[$y]["datahorario"] = $date->format("Y-m-d H:i:s"); $regarray[$y]["pis"] = substr($registros[$x], 22, 12); + ++$y; } } return $regarray; @@ -90,14 +92,15 @@ public function getMarcacaoPonto($registros) { * @return array */ public function getMarcacaoPontoMatricula($registros) { + $y = 0; for ($x = 0; sizeof($registros) > $x; ++$x) { if (substr($registros[$x], 9, 1) == 7) { - ++$y; $regarray[$y]["NSR"] = substr($registros[$x], 0, 9); $regarray[$y]["tipo"] = substr($registros[$x], 9, 1); $date = DateTime::createFromFormat("dmYHi", substr($registros[$x], 10, 8) . substr($registros[$x], 18, 4)); $regarray[$y]["datahorario"] = $date->format("Y-m-d H:i:s"); $regarray[$y]["matricula"] = substr($registros[$x], -6); + ++$y; } } return $regarray; @@ -110,15 +113,16 @@ public function getMarcacaoPontoMatricula($registros) { * @return array */ public function getAjusteRelogio($registros) { + $y = 0; for ($x = 0; sizeof($registros) > $x; ++$x) { if (substr($registros[$x], 9, 1) == 4) { - ++$y; $regarray[$y]["NSR"] = substr($registros[$x], 0, 9); $regarray[$y]["tipo"] = substr($registros[$x], 9, 1); $regarray[$y]["dataantes"] = substr($registros[$x], 10, 8); $regarray[$y]["horarioantes"] = substr($registros[$x], 18, 4); $regarray[$y]["dataajustada"] = substr($registros[$x], 22, 8); $regarray[$y]["horaajustada"] = substr($registros[$x], 30, 4); + ++$y; } } return $regarray; @@ -132,15 +136,16 @@ public function getAjusteRelogio($registros) { * @return array */ public function getInclusaoAlteracaoEmpregado($registros) { + $y = 0; for ($x = 0; sizeof($registros) > $x; ++$x) { if (substr($registros[$x], 9, 1) == 5) { - ++$y; $regarray[$y]["NSR"] = substr($registros[$x], 0, 9); $regarray[$y]["tipo"] = substr($registros[$x], 9, 1); $regarray[$y]["data"] = substr($registros[$x], 10, 12); $regarray[$y]["acao"] = substr($registros[$x], 22, 1); $regarray[$y]["pis"] = substr($registros[$x], 23, 12); $regarray[$y]["colaborador"] = substr($registros[$x], 35, 52); + ++$y; } } return $regarray;