<?php
  if( $_POST['action'] == 'New' ){
    $Position   = '../../';
    require_once($Position.'config/config.php');
    require_once($Position.'config/conexion.php');
    require_once($Position.'funciones/funciones.php');
    $Action = 'New';
    $cont   = $_POST[cont];
    $SegSes = $_POST[seg];
  }else{
    $Action = 'Edit';
    $SegSes = $SegSes;
    $cont   = $SigCont;
  }
?>

<!-- Sesion -->
<div class="Sesion">
  <div class="card">
    <div
      class="card-body"
      style="
        position:relative;
        border-left: 3px solid #be1724;
      "
    >

      <!-- Btn Eliminar Sesión -->
      <button
        type="button"
        class="btn btn-sm btn-danger DelSesion"
        style="
          position: absolute;
          top: 0px;
          right: 0px;
        "
      >
        <i class="fa fa-times"></i>
      </button>
      <!-- End Btn Eliminar Sesión -->


      <div class="row">

        <input type="hidden" name="Sesions[]" value="<?php echo $SegSes; ?>" />
        <input type="hidden" name="Sesion[<?php echo $SegSes; ?>][Action]" value="<?php echo $Action; ?>" />
        <input type="hidden" name="Sesion[<?php echo $SegSes; ?>][Id]" value="<?php echo $Ses[Id]; ?>" />

        <!-- Fecha -->
        <div class="form-group col-sm-6">
          <label>Fecha</label>
          <input
            autocomplete="off"
            class="form-control form-control-sm datepicker"
            name="Sesion[<?php echo $SegSes; ?>][Fecha]"
            value="<?php
              if( $Ses[Fecha] ){
                echo CambioFechaInversa($Ses[Fecha]);
              }else{
                echo CambioFechaInversa(date('Y-m-d'));
              }
            ?>"
          />
        </div>
        <!-- End Fecha -->

        <!-- Precio -->
        <div class="form-group col-sm-6">
          <label>Precio Individual</label>
          <input
            autocomplete="off"
            class="form-control form-control-sm"
            name="Sesion[<?php echo $SegSes; ?>][Precio]"
            value="<?php echo $Ses[Precio]; ?>"
          />
        </div>
        <!-- End Precio -->

        <!-- Link -->
        <div class="form-group col-sm-12">
          <label>Link</label>
          <input
            autocomplete="off"
            class="form-control form-control-sm"
            name="Sesion[<?php echo $SegSes; ?>][Link]"
            value="<?php echo $Ses[Link]; ?>"
          />
        </div>
        <!-- End Link -->

      </div>
    </div>
  </div>

</div>
<!-- End Sesion -->
