

    <?php

    //validamos si la session no ha sido declarada, para incicializarla

    if (session_status() === PHP_SESSION_NONE) {

      session_start();

    }

    if(empty($_SESSION['login_appquadrata'])){

        echo"<script language='javascript'>window.location='../../../login'</script>;";

        exit();

    }





/*inicializamos valores para la configuracion del template*/

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

$variables=[];

$_Color='';

$_Template='';

$_Theme_Template='';

$_Css='';

$_Js='';

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";

    }

}

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

?>

<!DOCTYPE html>

<html  style="background-color: rgb(241, 245, 249);" lang="es" class="<?php if($_Color!=''){ echo 'theme-user'; }else{ echo $_Theme_Template; }?>">

<meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>

<meta name='description' content='Información sobre contenido de tu pagina'>

<meta name='keywords' content='aqui van los tags para ser encontrados por los boots de google ejemplo fibora,ti hyper solutions'>



<head>



<?php

    //Declaramos la variable time, para que al modificar un archivo, este no se guarde en cache y se vizualicen los cambios

    $time_log_assets=time();

    include('../../path.php');

    //require('../modelo/configuracion_app.php');



    require(ROOT_CONFIG);

    require(ROOT_CONTROLLER.'configuracion_app.php');

    $Obj_configuracion_app = new configuracion_app();   

?>



    <!--<link href='https://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css' rel='stylesheet'>-->

    <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.js'></script>

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

    <!-- BEGIN: CSS Assets-->

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

    <!-- END: CSS Assets-->

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

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

    <script src="../../../dist/js/noback.js?time=<?=$time_log_assets;?>" type="text/javascript"></script>

    <!--Comienza plugins JTABLE--->

    <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>

    <!--Termina plugins JTABLE--->

        

<?php



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

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

$Logo_APP='';

$Logo_Fav_Icon='';

$Titulo_App='';

$Descripcion_Login_App='';

$Contenido_Inicio='';

$Img_Inicio='';

$Modulo_Inicio='';

$Habilitar_Formulario_Registro="";

$Correo_Api='';

$Password_Correo_Api='';

$Password_Correo_Api_Encrypt='';

$Stripe_Api_Key='';

$Stripe_Client='';

$Mercado_Pago_Api_Key='';

$Mercado_pago_Client='';

$Usuario_Api_SMS='';

$Password_Api_SMS='';

$Password_Api_SMS_Encrypt='';



$Template='';

$Theme_Template='';

$Color_Template='';

$Loading_Page='';



$Id_Fk_Rol='';

$Fecha_Registro='';

$Fecha_Modifico='';



switch ($action) {

    case 'editar':



        echo"<TITLE>Editar configuracion_app</TITLE>";

        break;



    default:

        echo"<TITLE>Registrar configuracion_app</TITLE>";

        break;

}

require_once(ROOT_CHARACTER_FIX);

$Obj_fix_characters = new fix_characters();



//lee las variables del formulario.



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

    require_once(ROOT_CONFIG);      

    $Odbj_conexion = new odbconexion;

    $conexion=$Odbj_conexion->openconection();

    $consulta="SELECT * FROM configuracion_app_appquadrata WHERE Id_Configuracion_App='$Id_Configuracion_App' ORDER BY Id_Configuracion_App DESC";

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

    $conexion->close();

    while($field_configuracion_app=$Array_adapter_configuracion_app->fetch_assoc())

    {

    $Logo_APP=$field_configuracion_app['Logo_APP'];

   $Logo_Fav_Icon=$field_configuracion_app['Logo_Fav_Icon'];

   $Titulo_App=$field_configuracion_app['Titulo_App'];

   $Descripcion_Login_App=$field_configuracion_app['Descripcion_Login_App'];

   $Contenido_Inicio=$field_configuracion_app['Contenido_Inicio'];

   $Img_Inicio=$field_configuracion_app['Img_Inicio'];

   $Modulo_Inicio=$field_configuracion_app['Modulo_Inicio'];

   $Habilitar_Formulario_Registro=$field_configuracion_app['Habilitar_Formulario_Registro'];

   $Correo_Api=$field_configuracion_app['Correo_Api'];

   $Password_Correo_Api=$field_configuracion_app['Password_Correo_Api'];

   $Password_Correo_Api_Encrypt=$field_configuracion_app['Password_Correo_Api_Encrypt'];

   $Stripe_Api_Key=$field_configuracion_app['Stripe_Api_Key'];

   $Stripe_Client=$field_configuracion_app['Stripe_Client'];

   $Mercado_Pago_Api_Key=$field_configuracion_app['Mercado_Pago_Api_Key'];

   $Mercado_pago_Client=$field_configuracion_app['Mercado_pago_Client'];

   $Usuario_Api_SMS=$field_configuracion_app['Usuario_Api_SMS'];

   $Password_Api_SMS=$field_configuracion_app['Password_Api_SMS'];

   $Password_Api_SMS_Encrypt=$field_configuracion_app['Password_Api_SMS_Encrypt'];

   $Id_Fk_Rol=$field_configuracion_app['Id_Fk_Rol'];

   $Fecha_Registro=$field_configuracion_app['Fecha_Registro'];

   $Fecha_Modifico=$field_configuracion_app['Fecha_Modifico'];

   

    }

/*inicializamos valores para la configuracion del template*/

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

        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_Template = $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['loadingpage'])) {

                $Loadin_Page = $variables['loadingpage'];

            }

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

                $_Rows_Columns = $variables['Rows_Columns'];

            }else{

                $_Rows_Columns=4;

            }

        }



        function rgbToHex($rgb) {

            // Extraer los valores de R, G y B del string RGB

            preg_match_all("/\d+/", $rgb, $matches);

            list($r, $g, $b) = $matches[0];



            // Convertir los valores de R, G y B a hexadecimal

            $hex = sprintf("#%02x%02x%02x", $r, $g, $b);



            return $hex;

        }



?>    

<script language='JavaScript'> 

var statSend = false;

function checkSubmit() {

    if (!statSend) {

        statSend = true;

        return true;

    } else {

        alert('La Informaci\u00F3n ya se est\u00E1 enviando, por favor espere...');

        return false;

    }

}

</script> 

<style>

    ::-webkit-scrollbar {

        display: none;

    }

</style>

</head>

<center>

<body onload="noback();">



  <?php

    //Comienza form del formulario

echo "<div class='intro-y box form-box'>";

    

    switch ($action) {

    case 'editar':

        echo "

            <div class='flex items-center p-5 border-b border-slate-200/60 dark:border-darkmode-400'>

                <h2 class='font-medium text-base mr-auto'>

                    EDITAR CONFIGURACION APP

                </h2>

            </div>";

        break;

    

    default:

        echo"

            <div class='flex items-center p-5 border-b border-slate-200/60 dark:border-darkmode-400'>

                <h2 class='font-medium text-base mr-auto'>

                    REGISTRAR CONFIGURACION APP

                </h2>

            </div>";

        break;

    }



    switch($_Rows_Columns){

        case 1:

        $cols_columns=12;

        break;

        case 2:

        $cols_columns=6;

        break;

        case 3:

        $cols_columns=4;

        break;

        case 4:

        $cols_columns=3;

        break;

        default:

        $cols_columns=12;

        break;



    }



    echo "<div class='p-5'>

            <form name='registrar'onsubmit='loadingpage();return checkSubmit();' action='guardar.php' method='Post' enctype='multipart/form-data'>      

            <div class='grid grid-cols-12 gap-x-5'>

                <div class='col-span-12 xl:col-span-12'>";

                    echo "<input type='hidden' name='Id_Configuracion_App' value='$Id_Configuracion_App'>";

                    echo "<div class='grid grid-cols-12 gap-x-5'>";

                    echo " 

                            <div class='mt-3  col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Logo APP:</label>";

                                        if ($Logo_APP=='') {

                                            echo"<img id='blahLogo_APP' src='../../../dist/images/upload.png' style='border-style: inset;width:140px;height:140px;border-radius:150px;padding:7px;' />";

                                        }else{

                                            $time=time();

                                            $time=filectime($Logo_APP);

                                            echo"<input type='hidden' name='Logo_APP' value='$Logo_APP'>";

                                            echo"<img id='blahLogo_APP' src='$Logo_APP?dummy=$time' alt='Empresa' style='border-style: inset;width:140px;height:140px;border-radius:150px;padding:7px;' />";

                                        }

                            /*echo "

                                <br>

                                <input class='btn btn-primary' name='Foto_file'  capture='camera'  accept='image/x-png,image/gif,image/jpeg' type='file' onchange=\"document.getElementById('blahFoto').src = window.URL.createObjectURL(this.files[0]);\" style='max-width:80%;'/>";*/

                             echo "<input type='file' name='logoapp' id='Logo_AP' class='inputfile inputfile-2' accept='image/x-png,image/gif,image/jpeg' onchange=\"document.getElementById('spanLogo_App').innerHTML=this.files[0].name;document.getElementById('blahLogo_APP').src = window.URL.createObjectURL(this.files[0]);\"  style='max-width:80%;'/>

                                  <label for='Logo_AP'><svg xmlns='http://www.w3.org/2000/svg' class='iborrainputfile' width='20' height='17' viewBox='0 0 20 17'><path d='M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z'></path></svg><span class='iborrainputfile' id='spanLogo_App'>Seleccionar archivo</span>

                                  </label>";

                      echo "</div>";  

                     /* echo " 

                                <div class='mt-3'>

                                    <label for='update-profile-form-7' class='form-label'>Logo APP: </label>";

                                     ?>

                                    <!-- imagen input -->

                                    <tr>

                                        <td colspan="2" align="center" >

                                        <div class="container">

                                            <div class="row">



                                                <?php 



                                                    if ($Logo_APP=='') {

                                                        echo"<img id='blah' src='../../../dist/images/blank_img.png' style='height:100px;' />";

                                                    }

                                                    else

                                                    {

                                                                $time=time();

                                                                $time=filectime($Logo_APP);

                                                        echo"<input type='hidden' name='Logo_APP' value='$Logo_APP'>";

                                                        echo"<img id='blah' src='$Logo_APP?dummy=$time' alt='tusabogados' />";

                                                    }

                                                 ?>

                                                



                                                <br>

                                                <input class="btn btn-primary" name="logoapp"  capture="camera"  accept="image/x-png,image/gif,image/jpeg" type='file' onchange="document.getElementById('blah').src = window.URL.createObjectURL(this.files[0]);" />

                                            </div>

                                        </div>

                                    </td>

                                    </tr>

                                    <!-- finish imagen input -->



                                    <?php

                                    //<input id='Logo_APP' name='Logo_APP' value='$Logo_APP' type='text' class='form-control'>

                               echo "</div>";*/

                               echo " 

                                <div class='mt-3  col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                        <label for='update-profile-form-7' class='form-label'>Logo Fav Icon:</label>";

                                            if ($Logo_Fav_Icon=='') {

                                                echo"<img id='blahLogo_Fav_Icon' src='../../../dist/images/upload.png' style='border-style: inset;width:140px;height:140px;border-radius:150px;padding:7px;' />";

                                            }else{

                                                $time=time();

                                                $time=filectime($Logo_Fav_Icon);

                                                echo"<input type='hidden' name='Logo_Fav_Icon' value='$Logo_Fav_Icon'>";

                                                echo"<img id='blahLogo_Fav_Icon' src='$Logo_Fav_Icon?dummy=$time' alt='Empresa' style='border-style: inset;width:140px;height:140px;border-radius:150px;padding:7px;' />";

                                            }

                                /*echo "

                                    <br>

                                    <input class='btn btn-primary' name='Foto_file'  capture='camera'  accept='image/x-png,image/gif,image/jpeg' type='file' onchange=\"document.getElementById('blahFoto').src = window.URL.createObjectURL(this.files[0]);\" style='max-width:80%;'/>";*/

                                 echo "<input type='file' name='logofavicon' id='Logo_Fav_Icon' class='inputfile inputfile-2' accept='image/x-png,image/gif,image/jpeg' onchange=\"document.getElementById('spanLogo_Fav_Icon').innerHTML=this.files[0].name;document.getElementById('blahLogo_Fav_Icon').src = window.URL.createObjectURL(this.files[0]);\"  style='max-width:80%;'/>

                                      <label for='Logo_Fav_Icon'><svg xmlns='http://www.w3.org/2000/svg' class='iborrainputfile' width='20' height='17' viewBox='0 0 20 17'><path d='M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z'></path></svg><span class='iborrainputfile' id='spanLogo_Fav_Icon'>Seleccionar archivo</span>

                                      </label>";

                          echo "</div>";

                            /*     echo " 

                                <div class='mt-3'>

                                    <label for='update-profile-form-7' class='form-label'>Logo Fav Icon: </label>";

                                    ?>

                                    <!-- imagen input -->

                                    <tr>

                                        <td colspan="2" align="center" >

                                        <div class="container">

                                            <div class="row">



                                                <?php 



                                                    if ($Logo_Fav_Icon=='') {

                                                        echo"<img id='blahh' src='../../../dist/images/blank_img.png' style='height:100px;' />";

                                                    }

                                                    else

                                                    {

                                                                $time=time();

                                                                $time=filectime($Logo_Fav_Icon);

                                                        echo"<input type='hidden' name='Logo_Fav_Icon' value='$Logo_Fav_Icon'>";

                                                        echo"<img id='blahh' src='$Logo_Fav_Icon?dummy=$time' alt='tusabogados' />";

                                                    }

                                                 ?>

                                                



                                                <br>

                                                <input class="btn btn-primary" name="logofavicon"  capture="camera"  accept="image/x-png,image/gif,image/jpeg" type='file' onchange="document.getElementById('blahh').src = window.URL.createObjectURL(this.files[0]);" />

                                            </div>

                                        </div>

                                    </td>

                                    </tr>

                                    <!-- finish imagen input -->



                                    <?php

                                    //<input id='Logo_Fav_Icon' name='Logo_Fav_Icon' value='$Logo_Fav_Icon' type='text' class='form-control'>

                                echo "</div>";*/

                                 echo " 

                                <div class='mt-3   col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Titulo App: </label>

                                    <input id='Titulo_App' name='Titulo_App' value='".ucwords(str_replace('_',' ',$Titulo_App))."' type='text' class='form-control'>

                                </div>";

                                 echo " 

                                <div class='mt-3   col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Descripcion Login App: </label>

                                    <input id='Descripcion_Login_App' name='Descripcion_Login_App' value='$Descripcion_Login_App' type='text' class='form-control'>

                                </div>";

                                echo " 

                                <div class='mt-3   col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Contenido de inicio: </label>

                                    <select name='Contenido_Inicio' id='Contenido_Inicio' class='form-control' onchange='selectContenidoInicio(this.value);'>

                                        <option value='Imagen' "; if($Contenido_Inicio=='Imagen'){echo "selected";}echo ">Imagen</option>

                                        <option value='Modulo' "; if($Contenido_Inicio=='Modulo'){echo "selected";}echo ">Módulo</option>

                                    </select>

                                </div>";

                                echo " 

                                <div class='mt-3   col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns' id='inicio_imagen' style='display:none;'>

                                    <label for='update-profile-form-7' class='form-label'>Imagen de inicio: </label>";

                                    ?>



                                    <!-- imagen input -->

                                    <tr>

                                        <td colspan="2" align="center" >

                                        <div class="container">

                                            <div class="row">



                                                <?php 



                                                    if ($Img_Inicio=='') {

                                                        echo"<img id='blahhh' src='../../../dist/images/blank_img.png' style='height:100px;' />";



                                                        echo"<input type='hidden' name='Img_Inicio' value='$Img_Inicio'>";

                                                    }

                                                    else

                                                    {

                                                                $time=time();

                                                                $time=filectime($Img_Inicio);

                                                        echo"<input type='hidden' name='Img_Inicio' value='$Img_Inicio'>";

                                                        echo"<img id='blahhh' src='$Img_Inicio?dummy=$time' alt='tusabogados' />";

                                                    }

                                                 ?>

                                                



                                                <br>

                                                <input class="btn btn-primary" name="imginicio"  capture="camera"  accept="image/x-png,image/gif,image/jpeg" type='file' onchange="document.getElementById('blahhh').src = window.URL.createObjectURL(this.files[0]);" />

                                            </div>

                                        </div>

                                    </td>

                                    </tr>

                                    <!-- finish imagen input -->



                                    <?php

                                echo "</div>";

                                echo " 

                                <div class='mt-3   col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns' id='inicio_modulo' style='display:none;'>

                                    <label for='update-profile-form-7' class='form-label'>Contenido de inicio: </label>

                                    <select name='Modulo_Inicio' id='Modulo_Inicio' class='form-control'>";

                                    //require_once(ROOT_CONFIG);      

                                    $Odbj_conexion = new odbconexion;

                                    $conexion=$Odbj_conexion->openconection();

                                    $consulta="SELECT * FROM modulo_app_appquadrata";

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

                                    $conexion->close();

                                            echo "<option value='Inicio' "; if($Modulo_Inicio=='Inicio'){ echo "selected";} echo ">inicio</option>";

                                        while($Field_modulo_app=$Adapter_modulo_app->fetch_assoc())

                                        {



                                            echo "<option value='{$Field_modulo_app['Href_Modulo']}' "; if($Modulo_Inicio==$Field_modulo_app['Href_Modulo']){ echo "selected";} echo ">{$Field_modulo_app['Titulo_Modulo']}</option>";

                                        }    



                                echo "</select>

                                </div>";

                                $checksi="";

                                if($Habilitar_Formulario_Registro=='Si'){

                                    $checksi="checked";

                                }

                                echo " 

                                

                                <div class='mt-3    col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns ml-5 flex'>

                                    <label for='update-profile-form-7' class='form-label'>¿Habilitar formulario de registro para usuarios públicos?: </label><br>

                                        <div class='form-label'>";

                                                echo "<div class='form-check form-switch w-full sm:w-auto sm:ml-auto mt-5 sm:mt-8'>

                                                <label for='R_SI' class='mr-10'>Si

                                                    <input type='checkbox'  class='show-code form-check-input mr-0 ml-3' id='R_SI' name='Habilitar_Formulario_Registro' value='Si' {$checksi}/>

                                                </label>

                                            </div>

                                        </div>    

                                </div>";

                                 echo " 

                                <div class='mt-3   col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Selecciona un rol por defecto para el formulario de registro: </label>

                                    <select name='Id_Fk_Rol' class='form-control'>";

                                    //require_once(ROOT_CONFIG);      

                                    $Odbj_conexion = new odbconexion;

                                    $conexion=$Odbj_conexion->openconection();

                                    $consulta="SELECT * FROM rol_appquadrata WHERE Id_Rol!=1";

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

                                    $conexion->close();

                                        while($Field_rol=$Adapter_rol->fetch_assoc())

                                        {



                                            echo "<option value='{$Field_rol['Id_Rol']}' "; if($Id_Fk_Rol==$Field_rol['Id_Rol']){ echo "selected";} echo ">{$Field_rol['Titulo_Rol']}</option>";

                                        }    



                                echo "</select>



                                </div>";

                                 echo " 

                                <div class='mt-3   col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Correo Api: </label>

                                    <input id='Correo_Api' name='Correo_Api' value='$Correo_Api' type='text' class='form-control'>

                                </div>";

                                 echo " 

                                <div class='mt-3   col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Password Correo Api: </label>

                                    <input id='Password_Correo_Api' name='Password_Correo_Api' value='$Password_Correo_Api' type='password' class='form-control'>

                                </div>";

                                 echo " 

                                <div class='mt-3   col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Stripe Api Key: </label>

                                    <input id='Stripe_Api_Key' name='Stripe_Api_Key' value='$Stripe_Api_Key' type='text' class='form-control'>

                                </div>";

                                 echo " 

                                <div class='mt-3  col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Stripe Client: </label>

                                    <input id='Stripe_Client' name='Stripe_Client' value='$Stripe_Client' type='text' class='form-control'>

                                </div>";

                                 echo " 

                                <div class='mt-3  col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Mercado Pago Api Key: </label>

                                    <input id='Mercado_Pago_Api_Key' name='Mercado_Pago_Api_Key' value='$Mercado_Pago_Api_Key' type='text' class='form-control'>

                                </div>";

                                 echo " 

                                <div class='mt-3  col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Mercado pago Client: </label>

                                    <input id='Mercado_pago_Client' name='Mercado_pago_Client' value='$Mercado_pago_Client' type='text' class='form-control'>

                                </div>";

                                 echo " 

                                <div class='mt-3  col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Usuario Api SMS: </label>

                                    <input id='Usuario_Api_SMS' name='Usuario_Api_SMS' value='$Usuario_Api_SMS' type='text' class='form-control'>

                                </div>";

                                 echo " 

                                <div class='mt-3  col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Password Api SMS: </label>

                                    <input id='Password_Api_SMS' name='Password_Api_SMS' value='$Password_Api_SMS' type='password' class='form-control'>

                                </div>";

                                echo " 

                                <div class='mt-3  col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Columnas del formulario: </label>

                                    <select id='Rows_Columns' name='Rows_Columns' class='form-control'>";

                                    

                                    if($_Rows_Columns=='1'){

                                        echo "<option value='1' selected>Una Columna</option>";

                                    }else{

                                        echo "<option value='1'>Una columna</option>";

                                    }

                                    

                                    if($_Rows_Columns=='2'){

                                        echo "<option value='2' selected>Dos columnas</option>";

                                    }else{

                                        echo "<option value='2'>Dos columnas</option>";

                                    }

                                    

                                    if($_Rows_Columns=='3'){

                                        echo "<option value='3' selected>Tres columnas</option>";

                                    }else{

                                        echo "<option value='3'>Tres columnas</option>";

                                    }



                                    if($_Rows_Columns=='4'){

                                        echo "<option value='4' selected>Cuatro columnas</option>";

                                    }else{

                                        echo "<option value='4'>Cuatro columnas</option>";

                                    }

                                    

                                echo "    

                                    </select>

                                </div>";

                                 echo " 

                                <div class='mt-3  col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Plantilla: </label>

                                    <select id='Template' name='Template' class='form-control' onchange='setTemplateThemeImg(this.value);'>";

                                    

                                    if($Template=='rubick'){

                                        echo "<option value='rubick' selected>Rubick</option>";

                                    }else{

                                        echo "<option value='rubick'>Rubick</option>";

                                    }

                                    

                                    if($Template=='tinker'){

                                        echo "<option value='tinker' selected>Tinker</option>";

                                    }else{

                                        echo "<option value='tinker'>Tinker</option>";

                                    }

                                    

                                    if($Template=='icewall'){

                                        echo "<option value='icewall' selected>Icewall</option>";

                                    }else{

                                        echo "<option value='icewall'>Icewall</option>";

                                    }



                                    if($Template=='enigma'){

                                        echo "<option value='enigma' selected>Enigma</option>";

                                    }else{

                                        echo "<option value='enigma'>Enigma</option>";

                                    }

                                    

                                echo "    

                                    </select>

                                </div>";

                                echo " 

                                <div class='mt-3  col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns' id='contenedor_image_template'>

                                    <img id='template-theme-img' style='width:200px;height:200px;display: flex;align-items: center;justify-content: center;' src='loading-page/theme-1.php'></img>    

                                </div>";

                                 echo " 

                                <div class='mt-3 col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Plantilla: </label>

                                    <select id='Theme_Template' name='Theme_Template' class='form-control' onchange='validarTemaPlantilla(this.value);'>

                                        <option value='$Theme_Template'>".str_replace('theme-','Tema ',$Theme_Template)."</option>

                                        <option value='theme-1'>Tema 1</option>

                                        <option value='theme-2'>Tema 2</option>

                                        <option value='theme-3'>Tema 3</option>

                                        <option value='theme-4'>Tema 4</option>

                                        <option value='Color personalizado'>Color personalizado</option>

                                    </select>

                                </div>";

                                $Color_Template_Hexa='#000000';

                                if($Theme_Template=='Color personalizado'){

                                    $Color_Template_Hexa=rgbToHex($Color_Template);

                                }

                                 echo "

                                <div class='mt-3  col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns' id='contenedor_color_template'>

                                    <label for='update-profile-form-7' class='form-label'>Color_Plantilla: </label>

                                    <input id='Color_Template' name='Color_Template' value='$Color_Template_Hexa' type='color' class='form-control'>

                                </div>";

                                 echo " 

                                <div class='mt-3  col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns'>

                                    <label for='update-profile-form-7' class='form-label'>Loading Page: </label>

                                    <select id='Loading_Page' name='Loading_Page' class='form-control'  onchange='setLoadingIframe(this.value);'>

                                        <!--<option value='$Loadin_Page'>".str_replace('theme-','Tema ',$Loadin_Page)."</option>-->

                                        ";

                                        if($Loadin_Page=='theme-1.php'){

                                            echo"<option value='theme-1' selected>Tema 1</option>";

                                        }else{

                                            echo"<option value='theme-1'>Tema 1</option>";

                                        }

                                        if($Loadin_Page=='theme-2.php'){

                                            echo"<option value='theme-2' selected>Tema 2</option>";

                                        }else{

                                            echo"<option value='theme-2'>Tema 2</option>";

                                        }

                                        if($Loadin_Page=='theme-3.php'){

                                            echo"<option value='theme-3' selected>Tema 3</option>";

                                        }else{

                                            echo"<option value='theme-3'>Tema 3</option>";

                                        }

                                        if($Loadin_Page=='theme-4.php'){

                                            echo"<option value='theme-4' selected>Tema 4</option>";

                                        }else{

                                            echo"<option value='theme-4'>Tema 4</option>";

                                        }

                                        if($Loadin_Page=='theme-5.php'){

                                            echo"<option value='theme-5' selected>Tema 5</option>";

                                        }else{

                                            echo"<option value='theme-5'>Tema 5</option>";

                                        }

                                        if($Loadin_Page=='theme-6.php'){

                                            echo"<option value='theme-6' selected>Tema 6</option>";

                                        }else{

                                            echo"<option value='theme-6'>Tema 6</option>";

                                        }

                                echo "

                                    </select>

                                </div>";

                                 echo " 

                                <div class='mt-3  col-span-12 lg:col-span-$cols_columns xl:col-span-$cols_columns' id='contenedor_color_template'>

                                    <iframe id='iframe-theme-loading' style='border-radius:100%;width:200px;height:200px;display: flex;align-items: center;justify-content: center;'></iframe> 

                                </div>";

                                                   

          echo "      

                    </div>        

                </div>

            </div>";

         switch ($action) {

            case 'editar':



          echo "<div class='flex justify-end mt-4'>

                    <input type='hidden' name='action' value='editar'>

                    <a href='../../inicio#$Id_Configuracion_App' class='btn btn-danger w-20 mr-auto'  onclick=\"addUrl('','');\"> Cancelar</a>

                    <button type='submit' class='btn btn-primary flex items-center'>Guardar</button>

                </div>";

            break;

            

            default:

        echo   "<div class='flex justify-end mt-4'>

                    <input type='hidden' name='action' value='registrar'>

                    <a href='../../inicio#$Id_Configuracion_App' class='btn btn-danger w-20 mr-auto'  onclick=\"addUrl('','');\"> Cancelar</a>

                    <button type='submit' class='btn btn-primary flex items-center'>Guardar</button>

                </div>";

            break;

        }                

            

echo "  </form>

        </div>

    </div>";





    //Termina form del formulario

?>

<script src="../../../dist/js/app.js"></script>

<script type="text/javascript">

function selectContenidoInicio(myThis){

    if(myThis=='Imagen'){

        document.getElementById('inicio_imagen').style.display = 'block';

        document.getElementById('inicio_modulo').style.display = 'none';

    }else if(myThis=='Modulo'){

        document.getElementById('inicio_modulo').style.display = 'block';

        document.getElementById('inicio_imagen').style.display = 'none';

    }



}



window.onload=function() {

    selectContenidoInicio($("#Contenido_Inicio").val());

}

</script> 



<script type="text/javascript">

    function setTemplateThemeImg(theme){

    var myIframeTheme=document.getElementById('template-theme-img');

    var myIframeThemeContenedor=document.getElementById('theme-img');

    if(theme!=''){

        myIframeTheme.src = '../../../dist/template_img/'+theme+'.png';

        myIframeThemeContenedor.style.display='block';

    }else{

        myIframeThemeContenedor.style.display='none';

    }

}

</script>  

<script type="text/javascript">

    function validarTemaPlantilla(theme){

        var contenedor_color=document.getElementById('contenedor_color_template');

        if(theme=='Color personalizado'){

            contenedor_color.style.display='block';

        }else{

            contenedor_color.style.display='none';

        }



    }



    function setLoadingIframe(loadingPage){

        var iframeLoading = document.getElementById('iframe-theme-loading');

        iframeLoading.src = '../../../dist/loadingpage_configuracion/'+loadingPage;

    }

</script>

<script type="text/javascript">

  window.onload=function(){



    setLoadingIframe(document.getElementById('Loading_Page').value);

    window.scrollTo(0,0);

    window.parent.scrollTo(0,0);

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



    var myThemeTemplate=document.getElementById('Theme_Template').value;

    

    validarTemaPlantilla(myThemeTemplate);

    setTemplateThemeImg(document.getElementById('Template').value);

  }



  function loadingpage(){

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

   }

</script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.4/jquery.min.js" integrity="sha512-pumBsjNRGGqkPzKHndZMaAG+bir374sORyzM3uulLV14lN5LyykqNk8eEeUlUkB3U0M4FApyaHraT65ihJhDpQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script type="text/javascript">

  function addUrl(urlmenu,event){

    $.ajax({

      url: '../../script.php',

      type: 'POST',

      data: {"urlmenu":urlmenu,"event":event},

      success: function(data, textStatus, xhr) {

      if(eval(data)==''){

        $("#menu_inicio").removeClass("side-menu--active"); 

      }else{

        $("#menu_"+eval(data)).removeClass("side-menu--active"); 

      }

      $("#menu_"+urlmenu).addClass("side-menu--active");

                

      }

    });



  }

</script>

</body>



    </center>

</html>