<?php
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');

$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);
$admin = $_SESSION["admin_" . $dbname];

if ($_REQUEST["ctr"]) {
    $ctr = $_REQUEST["ctr"];
    $hide = $_REQUEST["hide"];
    $prodtype = $_REQUEST["prodtype"];
    $hide_var = "";

    if ($hide == 0) {
        $hide_var = 'style="display:none;"';
    }
    $mctr = $ctr;

    $mctr++;
    echo "<tr>";
    echo "<td><i class='fa fa-close remove' $hide_var ></i></td>";
    echo "<td><input type='text' name='srno_$ctr' class='srno form-control text-right form focusFld_$ctr'  value='$mctr' readonly></td>";
    echo "<td>";
    echo "<input type='text' class='form-control form descrip' name='descrip_$ctr' value='$tran[descrip]'  maxlength='50'>";
    echo "</td>";
    echo "<td><input type='text' class='form-control form hsncode'                name='hsncode_$ctr'       value='$tran[hsncode]'></td>";
    echo "<td><input type='text' class='form-control form text-right macqty'      name='macqty_$ctr'      value='$tran[macqty]'></td>";
    echo "<td><input type='text' class='form-control form text-right qty'      name='qty_$ctr'      value='$tran[qty]'></td>";
    echo "<td><input type='text' class='form-control form text-right rate'     name='rate_$ctr'     value='$tran[rate]'></td>";
    echo "<td><input type='text' class='form-control form text-right amount'   name='amount_$ctr'   value='$tran[amount]' readonly></td>";
    echo "</tr >";
    $ctr++;
} else {
    echo "ERROR";
}
?>