<?php

  if( $_POST['Action'] == 'New' ){

    $Action     = $_POST['Action'];
    $Item       = $_POST['Item'];
    $Next       = $_POST['Next'];

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

    $Next         = $ItemIn[Id];
    $ItemId       = $ItemIn[Id];
    $ItemTitle    = $ItemIn[Nombre];

  }
?>

  <li class="ui-state-default ItemBox">
    <?php echo $ItemSel[Item]; ?>
    <input type="hidden" name="Items[]" value="<?php echo $Next; ?>" />
    <input type="hidden" name="Item[<?php echo $Next; ?>][Action]" value="<?php echo $Action; ?>" />
    <input type="hidden" name="Item[<?php echo $Next; ?>][Id]" value="<?php echo $Next; ?>" />
    <input type="hidden" name="Item[<?php echo $Next; ?>][ItemId]" value="<?php if( $Action == 'Edit' ){ echo $ItemId; } ?>" />

    <div class="row">

      <!-- Title -->
      <div class="col-sm-8">
        <input autocomplete="off" placeholder="Nombre" date-required="true" class="form-control" name="Item[<?php echo $Next; ?>][Nombre]" value="<?php echo $ItemTitle; ?>" />
      </div>
      <!-- End Title -->

      <!-- Icono -->
      <div class="col-sm-4">
        <?php if( $Action == 'Edit' ){ ?>
          <img style="background-color:#000; max-width:100px;" src="<?php echo $UrlSite; ?>/images/icons/<?php echo $Next; ?>.png" />
        <?php } ?>
        <div style="border:1px solid #333;">
          <input class="/*dropify*/" type="file" name="icon<?php echo $Next; ?>"  />
        </div>
      </div>
      <!-- End Icono -->

      <button type="button" style="position: absolute;right: 3px;top: 3px;" class="btn btn-sm btn-danger DelSec">
        <i class="fa fa-times"></i>
      </button>

    </div>

  </li>
