<?php
date_default_timezone_set('Asia/Jakarta');
include 'config/koneksi.php';


// 🔥 AMBIL JSON
$input = json_decode(file_get_contents("php://input"), true);

$company_id = $input['company_id'] ?? null;

if (!$company_id) {
  echo json_encode([
    "success" => false,
    "message" => "company_id kosong"
  ]);
  exit;
}

$q = mysqli_query($conn, "
SELECT * FROM companies
WHERE id = '$company_id'
LIMIT 1
");

$data = mysqli_fetch_assoc($q);

echo json_encode([
  "success" => true,
  "data" => $data
]);