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

$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn,$zdb);

if (isset($_REQUEST['vouchno'])){
    $mvouch = $_REQUEST['vouchno'];
//    $series = $_REQUEST['series'];
    
        $getresn  = mysqli_query($conn,"SELECT `cancresn` FROM `visamain` WHERE `vouchno`='$mvouch' ORDER BY `name`")or die(mysqli_error($conn));
        $resn     = mysqli_fetch_array($getresn);

        Echo "<option value='$resn[cancresn]'>$resn[cancresn]</option>";
        $getcust2 = mysqli_query($conn,"SELECT name FROM `reason` ORDER BY `code` desc")or die(mysqli_error($conn));
        while ($cust2 = mysqli_fetch_array($getcust2)) {
              Echo "<option value='$cust2[name]'>$cust2[name]</option>";
        }
}
