<?php

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

$zdb = $_SESSION["zdbyear_" . $dbname];
$zyear = right($zdb, 4);

mysqli_select_db($conn, $zdb);

$code = $_REQUEST['code'];

if (isset($code) != "") {
    $fetchimage = mysqli_query($conn, "SELECT * FROM `artiimage` WHERE `code`='$code' ORDER BY `imageno`")or die(mysqli_error($conn));

    while ($img = mysqli_fetch_assoc($fetchimage)) {
        $rows = array(
            "imageno" => $img['imageno'],
            "imagepath" => $img['imgpath'] . "?m=" . mt_rand()
        );
    }

    header("Content-type : application/json");
    Echo json_encode($rows);
}
?>