<?php
include("../../classes/manager.class.php");
$m = new Manager();

if ($_REQUEST['id']) {
    $id = $_REQUEST['id'];
    $qry = IngSetup::GetIngSetupById($id);
    if ($qry) {
        echo "<tr id='tr" . $id . "'>";
        echo '<td style="width: 30px; height: 30px; font-size: 12px; line-height: 15px; margin-top: 11px;" class="mini-stat-icon orange darken-2">';
        echo '<i id="trashing' . $id . '" style="cursor: pointer;font-size: 18px;margin-top: 7px;" class="mdi-action-delete"></i>';
        echo '</td>';
        echo '<td>';
        echo '<input class="form-control" style="width:100%!important;" type="text" readonly value="' . $qry->name . '">';
        echo '<input type="hidden" name="item[]" id="item" value="' . $qry->id . '">';
        echo '</td>';
        echo '<td>';
        echo '<input style="width:100%!important;" required maxlength="10" onkeypress="return isNumberKey(event)" class="form-control" type="text" name="per_unit[]" id="per_unit">';
        echo '</td>';
    }
}

?>
<script>
    $('#trashing<?=$id?>').on('click', function () {
        $(this).parent('td').parent('tr').remove();
    });
</script>
</tr>