<?php
//////////////////////////////////////////////////////////////////////////////// INICIO MENU DE OPCIONES
namespace Saireh;

echo "<main class='container'>";
echo "<section class='row text-center'>";
echo "<h2 class='text-dark text-left'><b>Generar bancos</b></h2>";
// echo $_SERVER['PHP_SELF']."&codigo=".$_SESSION['codigo_cedula'];

if (isset($result_upload) && $result_upload != "") {
    echo "<div id='response_alert'>";
    echo "$result_upload";
    echo "</div>";
}

echo "<div class='col-sm-12 justify-content-center m-auto'>";
echo "<form autocomplete='off' name = 'entrada' action = '" . $_SERVER['PHP_SELF'] . "' method = 'POST'  enctype='multipart/form-data'>";
echo "<input type = 'hidden' name = 'inicio' value = '1'>";
echo "<div class='form-group form-inline' style='padding-top: 20px;'>";
echo "<label name='label-novedad'>Tipo de Archivo:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                  <select style='width:250px;' name='nomina' id='nomina' class='form-control'required>
                      <option value='' selected> Seleccione";
echo "<option value='ERP'>Asientos de Nómina</option>";

echo "</select>";
echo "</div>&nbsp;&nbsp;";
echo "<div class='form-group form-inline' id='div_nomina'>";
echo "<label name='label-novedad'>Tipo de Nómina:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                  <select style='width:250px;' name='tipo_nomina' id='tipo_nomina' class='form-control'required>
                      <option value='' selected> Seleccione";
$consulta = getPeriodo($enlace);
while ($fila = mysqli_fetch_array($consulta)) {
    echo "<option value='" . $fila['codigo'] . "'>" . ucwords(strtolower($fila['detalle'])) . "";
}
echo "</select>";
echo "</div>&nbsp;&nbsp;";



echo "<div class='form-group form-inline' id='div_periodo'>";
echo "<label name='label-novedad'>Período:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
                  <select style='width:250px;' name='periodo' id='periodo' class='form-control' required>
                      <option value='' selected> Seleccione";
echo "</select>";

echo "
          </div>&nbsp;&nbsp;";

//Agregado por Miguelangel para que funcione con una contraseña de envío --- 19/10/22
echo "<div class='form-group form-inline' id='div_periodo'>";
echo "<span class='col-sm-12 '> ";
echo "<label name='label-novedad'>Contraseña:</label>";
echo "</span>";
echo "<td  align = 'left'> <input type='password' name='contrasena' size = '20' maxlength = '8'>  </td>";
echo "</div>";
///Hasta aquí

echo "<div class='form-group form-inline' id='div_fecha_pago' style='display:none'>";
echo "<span class='col-sm-12 '> ";
echo "<label name='label-novedad'>Fecha de pago:</label>";
echo "</span>";
echo "<input type='text' style='height: 30px;text-align: center;' id='fecha_pago' name='fecha_pago' >";
echo "</div>";



echo "<div class='form-group form-inline' id='div_tabla' style='display:none'>";
echo "<label name='label-novedad'>Seleccione Archivo:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
      <select style='width:350px;' name='archivo' id='archivo' class='form-control'>
      <option value='' selected> Seleccione";
$consultaQ = getArchivoAsiento($enlace);
while ($fila = mysqli_fetch_array($consultaQ)) {
    echo "<option value='" . $fila['archivo'] . "'>" . $fila['archivo'] . "";
}
echo "</select>";
echo "</div>&nbsp;&nbsp;";


echo '<input name="generarBanco" type="submit" class="boton" id="enviarNomina" value="Transmitir reporte"></input>';
echo "</form>";
echo "</section>";
echo "</main>";
