<?php

session_start();
require("includes/dbconnect.php");
include ('includes/function.php');

$zdb = $_SESSION["zdbyear_$dbname"];
mysqli_select_db($conn, $zdb);

if ($_REQUEST["ctr2"]) {
    $ctr2 = $_REQUEST["ctr2"];
    $mctr2 = $ctr2;
    $mctr2++;

    echo "<tr>";
    echo "<td align='left'><input type='text' size='6' maxlength='6' maxlength='6' name='srno2_$ctr2' class='sno form-control form' value='$mctr2' style='height:33px;'/></td>";
    echo "<td align='left'>";
    echo "<select name='access2_$ctr2' style='height:34px;' class='form-control form'>";
    echo "<option value=''></option>";
    $getaccess = mysqli_query($conn, "SELECT `code`, `name` FROM `access` ORDER BY `name`") or die(mysqli_error($conn));
    while ($wacc = mysqli_fetch_array($getaccess)) {
        echo "<option value='$wacc[code]' >$wacc[name]</option>";
    }
    echo "</select>";
    echo "</td>";
    echo "<td align='center' valign='top'><input type='text' name='qty2_$ctr2' class='qty2 form-control form' value='' style='text-align:right;height:33px;'/></td>";
    echo "<td align='center' valign='top'><input type='text' name='unit2_$ctr2' class='unit2 form-control form' value='' style='text-align:left;height:33px;'/></td>";
    echo"</tr>";
    $ctr2++;
} else {
    echo "ERROR";
}
?>
 