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

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

if ($_REQUEST["ctr"]) {
    $ctr    = $_REQUEST["ctr"];
    $mctr = $ctr;
    $mctr++;
    $rgodown = $_REQUEST["godown"];

    Echo "<tr>";
    Echo "<td><i class='fa fa-close remove'></i></td>";
    Echo "<td><input type='text' class='form-control form text-right srno' name='srno_$ctr' value='$mctr'></td>";
    Echo "<td>";
    Echo "<select class='form-control form godown detailpart_$ctr rgodown_$ctr' name='godown_$ctr' style='width:100%' required>";
    Echo "<option value='$rgodown'>$rgodown</option>";
    $ggodown = mysqli_query($conn, 'SELECT * FROM `godown`')or die(mysqli_error($conn));
    while ($godown = mysqli_fetch_array($ggodown)) {
        Echo "<option value='$godown[gocode]'>$godown[gocode]</option>";
    }
    Echo "</select>";
    Echo "</td>";
    Echo "<td><input type='text' class='form-control form text-left batch' name='batch_$ctr' value=''></td>";
    Echo "<td><input type='text' class='form-control form text-right taka' name='taka_$ctr' value='0'></td>";
    Echo "<td><input type='text' class='form-control form text-right qty' name='qty_$ctr' value='0'></td>";
    Echo "<td><input type='text' class='form-control form text-right totqty' name='totqty_$ctr' value='0'></td>";
    Echo "<td><input type='text' class='form-control form text-right flag' name='flag_$ctr' value='0'></td>";
    Echo "<td><input type='text' class='form-control form text-right flagqty' name='flagqty_$ctr' value='0'></td>";
    Echo "<td><input type='text' class='form-control form text-right actqty' name='actqty_$ctr' value='0'></td>";
    Echo "</tr>";
    $ctr++;
} else {
    echo "ERROR";
}
?>
 