<?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];
$fseries = $_SESSION["society_" . $dbname];


if ($_REQUEST["ctr"]) {
    $ctr = $_REQUEST["ctr"];
    $hide = $_REQUEST["hide"];
    $member = $_REQUEST["member"];
    $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' size='6' maxlength='6' name='srno_" . $ctr . "' class='srno form-control  form' value='$mctr'></td>";
    echo "<td>";
    Echo "<select class='form-control form item fetchpart_$ctr debparty' name='debparty_$ctr' style='width:100%'>";
    Echo "<option value=''></option>";
    $gitem = mysqli_query($conn, "SELECT `accode`,`name` FROM `accmast` WHERE `active`='1' and `accode`!='$member' and `grpcode`!='001' and`grpcode`!='002'  and `series` = '$fseries'  order by name")or die(mysqli_error($conn));
    while ($item = mysqli_fetch_array($gitem)) {
        Echo "<option value='$item[accode]'>$item[name]</option>";
    }
    Echo "</select>";
    echo "</td>";
    echo "<td><input type='text' name='amount_$ctr' class='amtoth form-control form text-right' value='0.00' ></td>";
    echo "</tr>";
    $ctr++;
} else {
    echo "ERROR";
}
?>
 