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

$series = $_SESSION["society_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];

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  srno' name='srno_$ctr' value='$mctr'></td>";
    Echo "<td>";
    Echo "<select class='form-control form maintype mcode fetchpart_$ctr  select2' name='mcode_$ctr' style='width:100%'>";
    Echo "<option value=''></option>";
    $ggodown = mysqli_query($conn, "SELECT accode,name FROM  $zdb.`accmast` where `type`='I' and `series`='$series' order by name") or die(mysqli_error($conn));
    while ($godget = mysqli_fetch_array($ggodown)) {
        Echo "<option value='$godget[accode]'>$godget[name]</option>";
    }
    Echo "</select>";
    Echo "</td>";
    Echo "<td><input type='text' class='form-control form text-right numeric amount' name='amount_$ctr' value='0'></td>";
    Echo "</tr>";
    $ctr++;
} else {
    echo "ERROR";
}
?>
 