<?php
include("../classes/manager.class.php");
$m = new Manager();
$param_data = ControlConfifguration::GetConfiguration();
define('PROJECT_TAX',$param_data->is_tax);
define('PROJECT_TAX_AMOUNT',$param_data->tax);

if ($_REQUEST['id']) {
    $id = $_REQUEST['id'];
    $qry = IngSetup::GetIngSetupById($id);
    if ($qry) {
        echo "<tr id='tr" . $id . "'>";
        echo '<td></td>';
        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 class="form-control" style="width:100%!important;" type="text" readonly value="' . $qry->description . '">';
        echo '</td>';
        echo '<td>';
        echo '<input style="width:100%!important;" required maxlength="10" onkeypress="return isDoubleNumberKey(event)" class="form-control" type="text" name="quant[]" id="quant">';
        echo '<input type="hidden" name="qty[]" id="qty" value="">';
        echo '</td>';
        echo '<td>';
        echo '<input class="form-control" style="width:70%!important;" type="text" name="uom[]" value=""> '.$qry->unit;
        echo '</td>';
        //echo '<td>';
      //  echo '<input class="form-control" style="width:100%!important;" type="text" name="rent[]" value=""> ';
      //  echo '</td>';
        echo '<td>';
        echo '<input style="width:100%!important;" required maxlength="10" onkeypress="return isDoubleNumberKey(event)" class="form-control" type="text" name="rate[]" value="" id="rate">';
        echo '</td>';
        echo '<td id="subTotal">';
        echo '';
        echo '</td>';
        echo '<td>';
        echo '<input style="width:100%!important;" required maxlength="10" onkeypress="return isDoubleNumberKey(event)" class="form-control" type="text" name="tax[]" value="'.PROJECT_TAX_AMOUNT.'" id="tax">';
        echo '</td>';
        echo '<td>';
        echo '<input class="form-control" style="width:100%!important;" name="tax_amount_price[]" id="tax_amount_price" type="text" readonly>';
        echo '<input type="hidden" name="tax_amount[]" id="tax_amount">';
//        echo '<input style="width:100%!important;" required maxlength="10" onkeypress="return isDoubleNumberKey(event)" class="form-control" type="text" name="tax_amount[]" value="" id="tax_amount">';
        echo '</td>';
        echo '<td id="totalamount">';
        echo '';
        echo '</td>';
        echo '<input type="hidden" name="total_amount[]" id="total_amount">';
        //echo "</tr>";
    }
}

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