<?php
  if( $_POST['action'] == 'New' ){

    $IdArt  = $_POST['art'];
    $Val    = $_POST['val'];
    $Action = 'New';

    $position   = '../../';
  	require_once($position.'../switch/access.php');
  	require_once($position.'assets/global.php');
  	require_once($position.'assets/session.php');
  	require_once($position.'assets/funciones.php');

  }elseif( $Action == 'Edit' ){

    $Val    = $Precio[id];
    $Action = 'Edit';
    $IdArt  = $Art[id];

  }
?>

<div class="ItemOpc">
  <div
    class="card"
    style="
      position: relative;
    "
  >

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

    <div class="card-body">
      <div class="row">

        <input
          type="hidden"
          name="Precios[]"
          value="<?php echo $Val; ?>"
        />

        <!-- Id -->
        <input
          type="hidden"
          name="Precio[<?php echo $Val; ?>][Id]"
          value="<?php echo $Val; ?>"
        />
        <!-- End Id -->

        <!-- Action -->
        <input
          type="hidden"
          name="Precio[<?php echo $Val; ?>][Action]"
          value="<?php echo $Action; ?>"
        />
        <!-- End Action -->

        <!-- Precio -->
        <div class="col-sm-4">
          <label>Precio</label>
          <input
            name="Precio[<?php echo $Val; ?>][Precio]"
            class="form-control text-right"
            data-required="true"
            dara-type="number"
            value="<?php echo $Precio[precio]; ?>"
            autocomplete="off"
          />
        </div>
        <!-- End Precio -->

        <!-- RangoA -->
        <div class="col-sm-4">
          <label>RangoA</label>
          <input
            name="Precio[<?php echo $Val; ?>][RangoA]"
            class="form-control text-right"
            data-required="true"
            dara-type="number"
            value="<?php echo $Precio[rango_a]; ?>"
            autocomplete="off"
          />
        </div>
        <!-- End RangoA -->

        <!-- RangoB -->
        <div class="col-sm-4">
          <label>RangoB</label>
          <input
            name="Precio[<?php echo $Val; ?>][RangoB]"
            class="form-control text-right"
            data-required="true"
            dara-type="number"
            value="<?php echo $Precio[rango_b]; ?>"
            autocomplete="off"
          />
        </div>
        <!-- End RangoB -->


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