<?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><i class='fa fa-close remove' style=''></i></td>";
    Echo"<td><input type='text' class='form-control srno'   name='srno_$ctr'      value='$mctr' readonly></td>";
    Echo"<td><input type='text' class='form-control yearno'   name='yearno_$ctr'  value='' autofocus></td>";
    Echo"<td><input type='text' class='form-control billno'   name='billno_$ctr'    value='' ></td>";
    Echo"<td><input type='date' class='form-control billdate'   name='billdate_$ctr'  value=''></td>";
    Echo"<td><input type='text' class='form-control billamt text-right'   name='billamt_$ctr'  value='' ></td>";
    Echo "<td>";
    Echo "<select class='form-control exam select2' name='exam_$ctr' style='width:100%'>";
    Echo "<option value=''></option>";
    $getmexm = mysqli_query($conn, "SELECT code, name FROM `exam` order by name")or die(mysqli_error($conn));
    while ($mexm = mysqli_fetch_array($getmexm)) {
        Echo "<option value='$mexm[code]'>$mexm[name]</option>";
    }
    Echo "</select>";
//                                            echo "<input type='hidden' name='examname_$ctr' class='examname' value='$tran[examname]'>";
    Echo "</td>";
    Echo"</tr>";
    $ctr++;
} else {
    echo "ERROR";
}
?>
 