<?php
session_start();
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];
$salent = $_SESSION["salent"];
$maindb = "chalmain";
if (isset($_REQUEST['timesheetno'])) {
    $timesheetno = $_REQUEST["timesheetno"];
$myquery = mysqli_query($conn, "Select `timesheetno` from `$maindb` where timesheetno = '$timesheetno'") or die(mysqli_error($conn));
$fetdet = mysqli_fetch_array($myquery);
$numrows = mysqli_num_rows($myquery);

echo $numrows;
}