<?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 style='width:3%;'><i class='fa fa-close remove' style='display: none;'></i></td>";
    Echo "<td style='width:5%;'><input type='text' class='form-control form srno' name='srno_$ctr' value='$mctr'></td>";
    Echo "<td style='width:5%;'><input type='date' class='form-control form date' name='date_$ctr' value=''></td>";
    Echo "<td style='width:20%;'>";
    Echo "<select class='form-control form party select2' name='accode_$ctr'>";
    Echo "<option value='$showparty3[accode]'>$showparty3[name]</option>";
    $getparty = mysqli_query($conn,"SELECT `name`,`accode` FROM `accmast` WHERE `grpcode`= '010' order by name ") or die(mysqli_error($conn));
    while ($showparty = mysqli_fetch_array($getparty)) {
        Echo "<option value='$showparty[accode]'>$showparty[name]</option>";
    }
    Echo "</select>";
    Echo "</td>";
    Echo "<td style='width:10%;'><input type='number' class='form-control form repacost text-right'        name='repacost_$ctr'   value=''></td>";
    Echo "<td style='width:20%;'><input type='text' class='form-control form remark'                       name='remark_$ctr'     value=''></td>";
    Echo "</tr>";
    $ctr++;
} else {
    echo "ERROR";
}
?>
 