<?php
define( 'SF_ROOT_DIR', "../../../" );
//define( 'SF_APP',      'sys' );

require_once( SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'configGlobal.php' );

$cn = Conexion::getConexion();

//-------------------------------------------------------------------------------------------------->

$a_Datos = $cn->getDSN();
$s_Database = $a_Datos['database'];

//PARAMETROS
$s_NombreTabla = "";
$b_Submit = false;
if( isset( $_POST['Control'] ) )
{
    $s_NombreTabla = $_POST['table_name'];
    $b_Submit = true;
}

?>

<?php $dir_url = Constantes::ROOT_DIR_APP ?>
<body style="">

<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $dir_url ?>/web/css/jquery/default/main.css" />
<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $dir_url ?>/web/css/jquery/default/grid.css" />
<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $dir_url ?>/web/css/jquery/default/tab.css" />
          
<script type="text/javascript" src="<?php echo $dir_url ?>/web/js/jquery/jquery-1.10.2.js"></script>
<script type="text/javascript" src="<?php echo $dir_url ?>/web/js/jquery/ui-1.10.3/jquery-ui.js"></script>

<link rel="stylesheet" type="text/css" href="<?php echo Constantes::ROOT_DIR_APP ?>/web/css/bootstrap/bootstrap.min.4.2.1.css" />

<link rel="stylesheet" type="text/css" href="<?php echo Constantes::ROOT_DIR_APP ?>/web/css/bootstrap/floating-labels.css">

<script type="text/javascript" src="<?php echo Constantes::ROOT_DIR_APP ?>/web/js/bootstrap/bootstrap.min.js"></script>

<style type="text/css">
.login100-form 
{
    background-color: #fff;
    border-radius: 10px;
    width: 100%;
}
</style>

<form class="form-signin login100-form" style="padding-bottom: 33px;" method="POST">

    <input type="hidden" name="Control" value="ok"/>

    <div class="form-group">
        <label for="table_name">Nombre de Tabla</label>
        <input type="text" class="form-control" id="table_name" name="table_name" aria-describedby="" placeholder="Nombre de Tabla" value="<?=$s_NombreTabla?>">
        <small id="emailHelp" class="form-text text-muted">Se ingresa tabla de la Base de Datos [<?=$s_Database?>].</small>
    </div>

    <button class="btn btn-lg btn-primary btn-block" type="submit">INGRESAR</button>

    <p class="mt-5 mb-3 text-muted text-center">&copy; 2018-2019</p>

</form>

<?php
if( $b_Submit )
{
    ?>
    <div>
        <?=pr( "submit" )?>
    </div>
    <?php
}
?>


</body>
