<?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"];
    $medium = $_REQUEST["medium"];
    
    $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 srno3'  name='srno3_$ctr'  value='$mctr'></td>";
    Echo "<td>";
    Echo "<select class='form-control form subject3 fetchpart_$ctr' name='subject3_$ctr' style='width:100%'>";
    $getsub = mysqli_query($conn, "SELECT * FROM `subject` order by name")or die(mysqli_error($conn));
    Echo "<option value=''></option>";
    while ($sub = mysqli_fetch_array($getsub)) {
        Echo "<option value='$sub[name]'>$sub[name]</option>";
    }
    Echo "</select>";
    echo "<input type='hidden' name='subname3_$ctr' class='subname3' value=''>";
    Echo "</td>";
    Echo "<td><input type='number' step='any' class='form-control form text-right pqrelm'  name='pqrelm_$ctr' value=''></td>";
    Echo "</tr>";
    $ctr++;
    $mctr++;
} else {
    echo "ERROR";
}
?>
 