<?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];
$zroot = $_SESSION["zdbroot"];

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><input type='text' name='srno_$ctr' class='form-control form' value='$mctr'></td>";
    echo "<td>";
    echo "<select class='form-control form' name='staff_$ctr'>";
    echo "<option value='$row[staff]'>$fetst2[name]</option>";
    $getstaff = mysqli_query($conn, "Select * from $zroot.`passmain` order by user");
    while ($fetst = mysqli_fetch_array($getstaff)) {
        echo "<option value='$fetst[code]'>$fetst[user]</option>";
    }


    echo "</select>";
    echo "</td>";
    echo "</tr>";
    $ctr++;
} else {
    echo "ERROR";
}
?>
 