<?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;"';
    }
    $mctr = $ctr;
    $mctr++;
    Echo "<tr>";
    Echo "<td><i class='fa fa-close remove' $hide_var></i></td>";
    Echo "<td><input type='text' class='form-control form text-right srno2'      name='srno2_$ctr'        value='$mctr'></td>";
    Echo "<td>";
    Echo "<select class='form-control form subject2 fetchpart_$ctr' name='subject2_$ctr' style='width:100%'>";
    Echo "<option value=''></option>";
    $getsub = mysqli_query($conn, "SELECT * FROM `subject` order by name")or die(mysqli_error($conn));
    while ($sub = mysqli_fetch_array($getsub)) {
        Echo "<option value='$sub[name]'>$sub[name]</option>";
    }
    Echo "</select>";
    echo "<input type='hidden' name='subname2_$ctr' class='subname2' value=''>";
    Echo "</td>";
    Echo "<td><input type='number' step='any' class='form-control form text-right fifth'     name='fifth_$ctr'       value=''></td>";
    Echo "<td><input type='number' step='any' class='form-control form text-right sixth'     name='sixth_$ctr'       value=''></td>";
    Echo "<td><input type='number' step='any' class='form-control form text-right seventh'     name='seventh_$ctr'       value=''></td>";
    Echo "<td><input type='number' step='any' class='form-control form text-right eight'     name='eight_$ctr'       value=''></td>";
    Echo "<td><input type='number' step='any' class='form-control form text-right ninth'     name='ninth_$ctr'       value=''></td>";
    Echo "<td><input type='number' step='any' class='form-control form text-right tenth'     name='tenth_$ctr'       value=''></td>";
    Echo "</tr>";
    $ctr++;
    
} else {
    echo "ERROR";
}
?>
 