<?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"];
    $hide_var = "";
    if ($hide == 0) {
        $hide_var = 'style="display:none;"';
    }
    if($ctr == ""){
        $ctr == 0;
    }
    $mctr = $ctr;
//    browse($mctr);
    $mctr++;


    Echo "<tr>";
    Echo "<td td width='4%'><i class='fa fa-close remove' style='display:none;'></i></td>";
    Echo "<td td width='8%'><input type='text' class='form-control form text-right srno' name='srno_$ctr' value='$mctr'></td>";
    Echo "<td td width='40%'>";
    Echo "<select class='form-control form party select2 fetchpart_$ctr'  name='party_$ctr' style='width:100%'>";
    Echo "<option value=''></option>";
    $gexp = mysqli_query($conn,"SELECT * FROM `accmast` where `grpcode` > '002' order by name")or die(mysqli_error($conn));
    while ($showexp = mysqli_fetch_array($gexp)) {
        Echo "<option value='$showexp[accode]'>$showexp[name]</option>";
    }
    Echo "</select>";
    Echo "</td>";
    Echo "<td td width='20%'><input type='number' class='form-control form text-right amount' step='any' name='amount_$ctr' value='0'></td>";

    Echo "<input type='hidden' class='form-control form grpcode' name='grpcode_$ctr' value=''>";
    Echo "<td td width='30%'><input type='text' class='form-control form remark' name='remark_$ctr' value=''></td>";
    Echo "</tr >";
    $ctr++;
} else {
    echo "ERROR";
}
?>
 