<?php

// Created by Mr. Developer on 15.09.2020

header("Content-type:application/json");

require_once('connect.php');
$javob = mysqli_query($conn,"SET NAMES utf8"); 

$query = mysqli_query($conn, "SELECT gruppa_id, brend_id, brend_nomi, summa_1, summa_2, foiz_1, foiz_2 FROM brendlar");

$response = array();

while($row = mysqli_fetch_assoc($query)){
    
   	    $gruppa_id=$row['gruppa_id']; 
		$brend_id=$row['brend_id']; 
		$nomi=$row['brend_nomi'];  
		$soni = 0;
		$summa_1=$row['summa_1'];  
		$summa_2=$row['summa_2'];  
		$foiz_1=$row['foiz_1'];  
		$foiz_2=$row['foiz_2'];  
 
    
    array_push($response,
        array(
                'gruppa_id' => $gruppa_id,
                'brend_id' => $brend_id,
                'brend_nomi' => $nomi,
                'soni' => $soni,
                'summa_1' => $summa_1,
                'summa_2' => $summa_2,
                'foiz_1' => $foiz_1,
                'foiz_2' => $foiz_2
             )
        );
}

echo json_encode($response);

?>

