<?php
include($_SERVER['DOCUMENT_ROOT'] . "/API/connection/conn.php");
header('content-type:application/json');
$query = mysqli_query($conn, "SELECT * FROM config WHERE config_type_id = '1' ");
 $titles = array();
 while ($spec = mysqli_fetch_assoc($query)) {
     $titles[] =  $spec;
 }

 $query = mysqli_query($conn, "SELECT * FROM config WHERE config_type_id = '2' ");
 $qualifications = array();
 while ($spec = mysqli_fetch_assoc($query)) {
     $qualifications[] =  $spec;
 }

 $query = mysqli_query($conn, "SELECT * FROM config WHERE config_type_id = '3' ");
 $inventory_categories = array();
 while ($spec = mysqli_fetch_assoc($query)) {
     $inventory_categories[] =  $spec;
 }

 $query = mysqli_query($conn, "SELECT * FROM config WHERE config_type_id = '4' ");
 $inventory_item_description = array();
 while ($spec = mysqli_fetch_assoc($query)) {
     $inventory_item_description[] =  $spec;
 }

 $query = mysqli_query($conn, "SELECT * FROM config WHERE config_type_id = '5' ");
 $inventory_warehouses = array();
 while ($spec = mysqli_fetch_assoc($query)) {
     $inventory_warehouses[] =  $spec;
 }

 $query = mysqli_query($conn, "SELECT * FROM config WHERE config_type_id = '6' ");
 $production_warehouses = array();
 while ($spec = mysqli_fetch_assoc($query)) {
     $production_warehouses[] =  $spec;
 }

 $query = mysqli_query($conn, "SELECT * FROM config WHERE config_type_id = '7' ");
 $unit_of_measurement = array();
 while ($spec = mysqli_fetch_assoc($query)) {
     $unit_of_measurement[] =  $spec;
 }

 $query = mysqli_query($conn, "SELECT * FROM config WHERE config_type_id = '8' ");
 $vendor = array();
 while ($spec = mysqli_fetch_assoc($query)) {
     $vendor[] =  $spec;
 }

 $query = mysqli_query($conn, "SELECT * FROM config WHERE config_type_id = '9' ");
 $field_of_study = array();
 while ($spec = mysqli_fetch_assoc($query)) {
     $field_of_study[] =  $spec;
 }

 $query = mysqli_query($conn, "SELECT * FROM config WHERE config_type_id = '10' ");
 $marital_status = array();
 while ($spec = mysqli_fetch_assoc($query)) {
     $marital_status[] =  $spec;
 }

 $query = mysqli_query($conn, "SELECT * FROM config WHERE config_type_id = '11' ");
 $referrals = array();
 while ($spec = mysqli_fetch_assoc($query)) {
     $referrals[] =  $spec;
 }

 $query = mysqli_query($conn, "SELECT * FROM config WHERE config_type_id = '12' ");
 $vaccines = array();
 while ($spec = mysqli_fetch_assoc($query)) {
     $vaccines[] =  $spec;
 }

 $query = mysqli_query($conn, "SELECT * FROM config WHERE config_type_id = '13' ");
 $jobs = array();
 while ($spec = mysqli_fetch_assoc($query)) {
     $jobs[] =  $spec;
 }

 $query = mysqli_query($conn, "SELECT * FROM config WHERE config_type_id = '14' ");
 $countries = array();
 while ($spec = mysqli_fetch_assoc($query)) {
     $countries[] =  $spec;
 }

 $query = mysqli_query($conn, "SELECT * FROM config WHERE config_type_id = '15' ");
 $religion = array();
 while ($spec = mysqli_fetch_assoc($query)) {
     $religion[] =  $spec;
 }

 $query = mysqli_query($conn, "SELECT * FROM config WHERE config_type_id = '16' ");
 $charges = array();
 while ($spec = mysqli_fetch_assoc($query)) {
     $charges[] =  $spec;
 }

$statusCode = 200;
$statusMessage = "Signed In Successfully";

$resultData = array('code' => $statusCode, 'message' => $statusMessage, 'titles' => $titles, 'qualifications' => $qualifications, 'field_of_study' => $field_of_study, 'marital_status' => $marital_status, 'referrals' => $referrals, 'inventory_categories' => $inventory_categories, 'inventory_item_description' => $inventory_item_description, 'inventory_warehouses' => $inventory_warehouses, 'production_warehouses' => $production_warehouses, 'unit_of_measurement' => $unit_of_measurement, 'vendor' => $vendor, 'vaccines' => $vaccines, 'jobs' => $jobs, 'countries' => $countries, 'religion' => $religion, 'charges' => $charges);
echo json_encode($resultData);
