<?php
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
include 'confing.php';

$sql = "SELECT id, name, lat, log,address,main_service_name,per_hour_sallary,profile_image FROM vender";
$result = $conn->query($sql);

$vendors = [];

if ($result->num_rows > 0) {
    while($row = $result->fetch_assoc()) {
        $vendors[] = [
            'id' => $row['id'],
            'name' => $row['name'],
            'lat' => $row['lat'],
            'log' => $row['log'],
                        'address' => $row['address'],
            'main_service_name' => $row['main_service_name'],
            'per_hour_sallary' => $row['per_hour_sallary'],
            'profile_image' => $row['profile_image']

        ];
    }
}

echo json_encode($vendors);
?>
