<?php

require('auth-validate.php');
require('../../db.php');


header('Content-Type: application/json');


$companies = getCompanies();

for($c = 0; $c < count($companies); $c++)
{
	$companies[$c]['file_rows'] = getRowsByCompany($companies[$c]['id_company']);
	$companies[$c]['row_updates'] = getRowUpdatesByCompany($companies[$c]['id_company']);
	$companies[$c]['drivers'] = getDriversByCompany($companies[$c]['id_company']);
}

echo json_encode($companies, JSON_PRETTY_PRINT);

?>