<?php

$time_log_assets=time();

$setting_template='../../../settings_template.txt';

$variables=[];

$_Color='';

$_Template='';

$_Theme_Template='';

$_Css='';

$_Js='';

$_Css_Version='';

$_Js_Version='';

if (file_exists($setting_template)) {

    $lines = file($setting_template, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);

    foreach ($lines as $line) {

        list($nombre_variable, $valor) = explode('=', $line);

        $variables[$nombre_variable] = $valor;

    }

    /*recogemos los valores de las variables*/

    if (isset($variables['Color'])) {

        $_Color = $variables['Color'];



        //echo "El color es: $_Color";

    }

    if (isset($variables['Template'])) {

        $_Template = $variables['Template'];

        //echo "El Template es: $_template";

    }

    if (isset($variables['Theme_Template'])) {

        $_Theme_Template = $variables['Theme_Template'];

        //echo "El Theme_Template es: $_Theme_Template";

    }

    if (isset($variables['css'])) {

        $_Css = $variables['css'];

        //echo "El css es: $_Css";

    }

    if (isset($variables['js'])) {

        $_Js = $variables['js'];

        //echo "El js es: $_Js";

    }



    if (isset($variables['Rows_Columns'])) {

        $_Rows_Columns = $variables['Rows_Columns'];

    }else{

        $_Rows_Columns=4;

    }



    if (isset($variables['css_version'])) {

        $_Css_Version = $variables['css_version'];

        //echo "El css es: $_Css";

    }

    if (isset($variables['js_version'])) {

        $_Js_Version = $variables['js_version'];

        //echo "El js es: $_Js";

    }

}

/*terminan valores de configuracion pára el template*/



    require_once('../../../odbconexion/config.php');

    if(!empty($_SESSION['appUrlMenu_appquadrata'])){

      $appUrl=$_SESSION['appUrlMenu_appquadrata'];

    } else{

        $appUrl='';

    }



    $Contenido_Inicio='';

    $Modulo_Inicio='';

     try{    

      $Odbj_conexion = new odbconexion;

      $conexion=$Odbj_conexion->openconection();

      $consulta="SELECT * FROM configuracion_app_appquadrata";

      $Array_adapter_config=$conexion->query($consulta);

      $conexion->close();

      while($Field_config=$Array_adapter_config->fetch_assoc())

      {   

          $Contenido_Inicio=$Field_config['Contenido_Inicio'];

          $Modulo_Inicio=$Field_config['Modulo_Inicio'];

      }

  }catch (Exception $e) {

          echo 'Excepcion capturada: ',  $e->getMessage(), "

                      ";

  }

  $LocationAnterior='';

  if($appUrl=='' || $appUrl=='inicio'){ if($Contenido_Inicio=='Imagen') { $LocationAnterior= 'inicio/vista/imagen.php'; }else{ $LocationAnterior= $Modulo_Inicio; } }else{ $LocationAnterior= $appUrl; }

?>

<!DOCTYPE html>

<html class="<?php if($_Color!=''){ echo 'theme-user'; }else{ echo $_Theme_Template; }?>">

<head>

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title></title>

    

    <link rel="stylesheet" href="../../../dist/css/<?=$_Css;?>?time=<?=$_Css_Version;?>" />

    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>

        <style>

        .modal-container {

          display: block;

          position: fixed;

          z-index: 1;

          left: 0;

          top: 0;

          width: 100%;

          height: 100%;

          overflow: auto;

          background-color: rgba(0, 0, 0, 0.5);

        }

        

        .modal-content {

          display:flex;

          justify-content: space-around;

          flex-direction: column;

          align-items: center;

          background-color: #fefefe;

          margin: 15% auto;

          padding: 20px;

          border: 1px solid #888;

          width: 80%;

        }

        

        .modal-header{

            display: flex;

            padding: 10px 20px;

            flex-direction: column;

        }

        

        .modal-footer {

          padding: 10px 20px;

        }

        

        

        .close {

          color: #aaa;

          float: right;

          font-size: 28px;

          font-weight: bold;

        }

        

        .close:hover,

        .close:focus {

          color: black;

          text-decoration: none;

          cursor: pointer;

        }

        

        /* Estilos para el ícono de verificación */

        .swal-icon img {

          width: 80px; /* Tamaño del ícono */

          margin-bottom: 20px; /* Espaciado inferior */

        }

        

        .modal-header h2 {

          color: #4caf50; /* Color del texto */

          font-size: 18px !important; /* Tamaño del texto */

          font-weight: bold !important; /* Peso de la fuente */

          margin: 0; /* Eliminar margen */

        }

        

        .modal-content p{

            font-style: italic;

            font-size: 17px;

        }

        }

    </style>



</head>

<body>

<?php

$Location=!empty($_REQUEST['Location'])?$_REQUEST['Location']:'';

echo "<script>

    if(parent.document.getElementById('loadingpage')){

        parent.document.getElementById('loadingpage').style.display='none';

    }</script>";

?>

<div class="modal-container" id="myModal">

  <div class="modal-content">

    <div class="modal-header">

     <div class="swal-icon">

        <!-- Aquí puedes agregar un GIF animado de un ícono de verificación -->

        <svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="100" height="100" viewBox="0 0 48 48">

<path fill="#c8e6c9" d="M44,24c0,11-9,20-20,20S4,35,4,24S13,4,24,4S44,13,44,24z"></path><polyline fill="none" stroke="#4caf50" stroke-miterlimit="10" stroke-width="4" points="14,24 21,31 36,16"></polyline>

</svg>

      </div>

      <h2>¡Modificación exitosa!</h2>

    </div>

    <div class="modal-body">

      <p>¡Tu perfil ha sido actualizado con éxito!</p>

    </div>

    <div class="modal-footer">

      <button class="btn btn-primary" onclick="window.location.href='./<?=$Location;?>'">Permanecer en editar perfil</button>

      <button class="btn btn-danger" onclick="window.location.href='../../<?=$LocationAnterior;?>'">Volver a la pantalla anterior</button>

    </div>

  </div>

</div>

</body>

</html>

    