tech4biz/admin/api/careers-get-upload-list.php
2024-10-24 17:20:08 +05:30

43 lines
1.1 KiB
PHP

<?PHP
require_once "../db/config.php";
require_once "../includes/functions.php";
$_REQUEST_METHOD = strtoupper($_SERVER['REQUEST_METHOD']);
$response = array();
if ($_REQUEST_METHOD === 'POST') {
$getUserQuery = "SELECT * FROM `careers_form`";
$getUser = $connection->query($getUserQuery);
if ($getUser->num_rows > 0) {
$user_array = [];
while ($user = $getUser->fetch_object()) {
$user_array[] = array(
'first_name' => $user->first_name,
'last_name' => $user->last_name,
'email' => $user->email,
'contact_number' => $user->contact_number,
'created_date' => $user->created_date,
'location' => $user->location,
'resume_file' => $user->resume_file,
);
}
$response["MESSAGE"] = "Get all contact data";
$response["CODE"] = 200;
$response["DATA"] = $user_array;
} else {
$response["MESSAGE"] = "contact does not exist";
}
} else {
$response["MESSAGE"] = "INVALID REQUEST";
}
echo json_encode($response);