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

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$myyear = $_SESSION[$myyear];
mysqli_select_db($conn, $zdb);
$maindb = 'product';
$zroot = $_SESSION["zdbroot"];
$file = 'getitem.php';

if (isset($_REQUEST["prodcode"])) {
    $prodcode = $_REQUEST["prodcode"];

    $getitem = mysqli_query($conn, "SELECT name FROM $maindb where code = '$prodcode'") or die(mysqli_error($conn));
    $item = mysqli_fetch_array($getitem);
    if ($item['name'] != '') {
        echo "<option value='" . $prodcode . "' selected>" . $item['name'] . "</option>";
    }
}
?>