<?php
include "check_login.php";
include "dbcon.php";

$project_id = (int)$_GET['project_id'];

$q = mysqli_query($conn,"
    SELECT name, email, mobile
    FROM projects
    WHERE id=$project_id AND user_id IS NULL
");

if(mysqli_num_rows($q)==0){
    echo json_encode(['error'=>1]);
    exit;
}

$p = mysqli_fetch_assoc($q);

echo json_encode([
    'name'   => $p['name'],
    'email'  => $p['email'],
    'phone'  => $p['mobile']
]);
