++$i,'date'=>date('d-m-Y',strtotime($row1['stock_date'])), 'prod_name' => $get_product['name'].' '.$get_product['product_url'],'price'=>$get_product['price'],'offer_unit'=>$get_product['offer_unit'],'comp_name'=>$set_comp['name'], 'old_stock' => $row1['old_stock'], 'new_stock' => $row1['new_stock'],'today_sales'=>$today_sales,'total_stock'=>$row1['current_stock']); } if(!empty($data)) { echo json_encode(array( "aaData"=>$data)); } else { echo json_encode(array('aaData'=>[])); } ?>