<?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];
$success = false;


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

    echo "<option value=''></option>";
    
    $getm = mysqli_query($conn, "SELECT code,name FROM `rawmat` WHERE `rawmatgrp`='$itemgrp' order by name ") or die(mysqli_error($conn));
    while ($ttgrp = mysqli_fetch_array($getm)) {
        echo "<option value='$ttgrp[code]'>$ttgrp[name]</option>";
    }

}