Merge pull request #6 from ja-rg/master
Actualiza rest_horarios y otros
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once "/usr/share/nginx/html/paad/vendor/autoload.php";
|
print_r ($_SERVER);
|
||||||
|
require_once "/saa_dsk/www/vendor/autoload.php";
|
||||||
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
|
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
|
||||||
$dotenv->load();
|
$dotenv->load();
|
||||||
use \SeinopSys\PostgresDb;
|
use \SeinopSys\PostgresDb;
|
||||||
|
|||||||
@@ -197,9 +197,9 @@ if($user->periodo_id!= ""){
|
|||||||
<button type="button" class="btn btn-outline-danger" onclick="window.location.href = window.location.href"><span class="ing-borrar ing-fw"></span> Limpiar</button>
|
<button type="button" class="btn btn-outline-danger" onclick="window.location.href = window.location.href"><span class="ing-borrar ing-fw"></span> Limpiar</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="text-right">
|
<!--<p class="text-right">
|
||||||
<button class="btn btn-secondary" id="exportar"><span class="ing-descargar"></span>Descargar xls</button>
|
<button class="btn btn-secondary" id="exportar"><span class="ing-descargar"></span>Descargar xls</button>
|
||||||
</p>
|
</p>-->
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,14 @@ require_once $ruta_superior."/include/bd_pdo_rest.php";
|
|||||||
require_once __DIR__."/token.php";
|
require_once __DIR__."/token.php";
|
||||||
require_once __DIR__."/LogCambios.php";
|
require_once __DIR__."/LogCambios.php";
|
||||||
|
|
||||||
|
function quitaAcentos($cadena) {
|
||||||
|
// Normalizar la cadena para descomponer caracteres acentuados en sus formas base y acentos
|
||||||
|
$cadenaNormalizada = Normalizer::normalize($cadena, Normalizer::FORM_D);
|
||||||
|
// Utilizar una expresión regular para eliminar los caracteres diacríticos
|
||||||
|
$cadenaSinAcentos = preg_replace('/\p{M}/u', '', $cadenaNormalizada);
|
||||||
|
return $cadenaSinAcentos;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------ACTUALIZA HORARIOS--------------------------
|
//--------------ACTUALIZA HORARIOS--------------------------
|
||||||
if(!empty($_GET["fecha"])){
|
if(!empty($_GET["fecha"])){
|
||||||
$hoy = $_GET["fecha"];
|
$hoy = $_GET["fecha"];
|
||||||
@@ -271,7 +279,11 @@ try{
|
|||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
// Encontrar los "hash" que están en $sgu pero no están en $bd
|
// Encontrar los "hash" que están en $sgu pero no están en $bd
|
||||||
$hashes_no_en_sgu = array_diff($hashes_bd, $hashes_sgu);
|
//$hashes_no_en_sgu = array_udiff($hashes_bd, $hashes_sgu, 'strcasecmp');
|
||||||
|
$hashes_no_en_sgu = array_udiff($hashes_bd, $hashes_sgu, function($a, $b){
|
||||||
|
return strcasecmp(quitaAcentos($a), quitaAcentos($b));
|
||||||
|
});
|
||||||
|
|
||||||
if($debug) echo "hashes_no_en_sgu ".count($hashes_no_en_sgu)."<br>";
|
if($debug) echo "hashes_no_en_sgu ".count($hashes_no_en_sgu)."<br>";
|
||||||
|
|
||||||
if(count($hashes_no_en_sgu)>0){
|
if(count($hashes_no_en_sgu)>0){
|
||||||
@@ -305,7 +317,10 @@ try{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Encontrar los "hash" que están en $sgu pero no están en $bd
|
// Encontrar los "hash" que están en $sgu pero no están en $bd
|
||||||
$hashes_no_en_bd = array_diff($hashes_sgu, $hashes_bd);
|
//$hashes_no_en_bd = array_udiff($hashes_sgu, $hashes_bd, 'strcasecmp');
|
||||||
|
$hashes_no_en_bd = array_udiff($hashes_sgu, $hashes_bd, function($a, $b){
|
||||||
|
return strcasecmp(quitaAcentos($a), quitaAcentos($b));
|
||||||
|
});
|
||||||
|
|
||||||
//echo "hashes_no_en_bd ".count($hashes_no_en_bd)."<br>";
|
//echo "hashes_no_en_bd ".count($hashes_no_en_bd)."<br>";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user