<?php

require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include("includes/function.php");

$zdb = $_SESSION["zdbyear_$dbname"];
$ztit = $_SESSION["tit"];
$usertype = $_SESSION["usertype"]; 
$user = $_SESSION['username_' . $dbname];
$keyfld = "vouchno";

mysqli_select_db($conn, $zdb);

if (isset($_REQUEST["medium"])) {
    $medium = $_REQUEST["medium"];
    $exam = $_REQUEST["exam"];
    $section = $_REQUEST["section"];
    $session = $_REQUEST["session"];
    $vouchno = $_REQUEST["vouchno"];


    $mctr = 0;
    $srchresult = mysqli_query($conn, "SELECT * FROM `demdmain` WHERE `vouchno` = '$vouchno' AND `medmcode`='$medium' AND `examcode`='$exam' AND
                               `section`='$section' AND `session`='$session'")or die(mysqli_error($conn));
    
    $count = mysqli_num_rows($srchresult);
    if($count > 0){
        $success = true;
        echo $success; 
    }else{
        
        $success = false;
        echo $success;
    }
    
    }