<?php

require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include ('includes/function.php');
//include ('includes/simgeImage.php');
$zdb = $_SESSION["zdbyear_" . $dbname];
$zyear = right($zdb, 4);
mysqli_select_db($conn, $zdb);


    if (isset($_REQUEST["voucher"])) {
        $vouchno = $_REQUEST["voucher"];
        $maindb = $_REQUEST["maindb"];
    
        // $maindb = "estimain";
        $voucher = substr($vouchno, 0, -1);
    
        mysqli_query($conn, "UPDATE `$maindb` SET pay = '1' WHERE vouchno in ($voucher)") or die(mysqli_error($conn));
    
        $ctr++;
        echo "1";
    }
?>