<?php foreach ($items as $item) { ?>
  <tr class="text-center">
    <td style="padding:8px 2px;"><?php echo $item['promotion_id']; ?></td>
    <td class="text-left">
      <a href="<?php echo $link_item_edit; ?>&promo_id=<?php echo $item['promotion_id']; ?>"><?php echo $item['title']; ?></a>
      <?php if (!empty($item['meta']['notes'])) { ?>
        <span class="small text-muted isl-ml-5" data-toggle="tooltip" title="<?php echo $item['meta']['notes']; ?>"><i class="fa fa-file-text-o"></i></span>
      <?php } ?>
    </td>
    <td><?php echo $item['times_used'] ?> / <?php echo $item['limit_usage'] ? $item['limit_max_usage']: 'Unlimited'; ?></td>
    <td><?php echo $item['duration_start']; ?> - <?php echo $item['duration_end'] ? $item['duration_end'] : 'Not set'; ?></td>
    <td class="text-center input-priority">
      <input type="number" name="priority_order[<?php echo $item['promotion_id']; ?>]" value="<?php echo $item['priority']; ?>" class="form-control input-sm item-priority-order">
    </td>
    <td>
      <?php if ($item['stop']) { ?>
        <a class="btn btn-sm btn-success btn-xs" data-isl-update='{"action":"stop", "id":<?php echo $item['promotion_id']; ?>, "value":0}' data-toggle="tooltip" title="Click to disable stop execution"><i class="fa fa-check"></i></a>
      <?php } else { ?>
        <a class="btn btn-sm btn-danger btn-xs" data-isl-update='{"action":"stop", "id":<?php echo $item['promotion_id']; ?>, "value":1}' data-toggle="tooltip" title="Click to enable stop execution"><i class="fa fa-close"></i></a>
      <?php } ?>
    </td>
    <td>
      <?php if ($item['status']) { ?>
        <a class="btn btn-sm btn-success btn-xs" data-isl-update='{"action":"status", "id":<?php echo $item['promotion_id']; ?>, "value":0}' data-toggle="tooltip" title="Click to disable status"><i class="fa fa-check"></i></a>
      <?php } else { ?>
        <a class="btn btn-sm btn-danger btn-xs" data-isl-update='{"action":"status", "id":<?php echo $item['promotion_id']; ?>, "value":1}' data-toggle="tooltip" title="Click to enable status"><i class="fa fa-close"></i></a>
      <?php } ?>
    </td>
    <td style="padding:8px 2px;">
      <a href="<?php echo $link_item_edit; ?>&promo_id=<?php echo $item['promotion_id']; ?>" class="btn btn-primary btn-sm"><i class="fa fa-pencil"></i></a>
      <a class="btn btn-danger btn-sm" data-isl-update='{"action":"delete", "id":<?php echo $item['promotion_id']; ?>}'><i class="fa fa-trash-o"></i></a>
    </td>
  </tr>
<?php } ?>
