<?php
header('content-type:application/json');
include($_SERVER['DOCUMENT_ROOT'] . "/API-Others/connection/conn.php");
// GROUP BY invoice_no ORDER BY category
$query = mysqli_query($conn, "SELECT *,COUNT(id) AS TOTAL FROM production_mix GROUP BY productionwarehouse,frametype, framesize, productionlevel");
$production_mix_list = array();
while ($spec = mysqli_fetch_assoc($query)) {
    $production_mix_list[] =  $spec;
}

$resultData = array('code' => $statusCode, 'message' => $statusMessage, 'production_mix_list' => $production_mix_list);
echo json_encode($resultData);
