<?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++;

    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 "<select class='form-control form godown' name='godown_$ctr' style='width:100%'>";
    Echo "<option value=''></option>";
    $ggodown = mysqli_query($conn, 'SELECT * FROM `godown`')or die(mysqli_error($conn));
    while ($godown = mysqli_fetch_array($ggodown)) {
        Echo "<option value='$godown[gdcode]'>$godown[gdcode]</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 qty' name='qty_$ctr' value='0'></td>";
    Echo "</tr>";
    $ctr++;
} else {
    echo "ERROR";
}
?>
 