<?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];

$zyear = right($zdb, 4);
$mfrdate = getzdates($zyear, 'S');
$mtodate = getzdates($zyear, 'E');

$myyear = $_SESSION[$myyear];
mysqli_select_db($conn, $zdb);

$getitem = mysqli_query($conn, "SELECT code, `name` FROM `product` ORDER BY `name`") or die(mysqli_error($conn));
$rows = array();
while($r = mysqli_fetch_assoc($getitem)) {
    $rows[] = $r;
}
echo json_encode($rows);
?>

