<?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];
$fseries = $_SESSION["series_" . $dbname];


if (isset($_REQUEST['saleorder'])) {
    $saleorder = $_REQUEST['saleorder'];
    $getprod = mysqli_query($conn, "SELECT a.barcode,a.item,b.name FROM `sordtran` a, item b WHERE a.`vouchno`='$saleorder' and a.item=b.code and a.series= '$fseries' order by a.vouchno,a.srno")or die(mysqli_error($conn));

    Echo "<option></option>";
    while ($item1 = mysqli_fetch_array($getprod)) {
        Echo "<option value='$item1[item]'>$item1[item] || $item1[name]</option>";
    }
}
?>