<?php

    header("Access-Control-Allow-Origin: *");
    header("Content-Type: application/json");
    header("Accept: application/json");

    require '../config/conn.php';

    //Fetching Privacy Policy
    $getPrivacyPolicy = "SELECT `description` FROM `appinfo` WHERE `id` = 1";
    $fetchPolicy = mysqli_query($conn,$getPrivacyPolicy);

    //Fetching About Us
    $getAboutUs = "SELECT `description` FROM `appinfo` WHERE `id` = 2";
    $fetchAboutUs = mysqli_query($conn,$getAboutUs);


    if($fetchPolicy)
    {

        while($row=$fetchPolicy->fetch_assoc())
        {
            $response['privacyPolicy'] = $row['description'];
        }

        if($fetchAboutUs)
        {
            $response['statusCode'] = 0;
            $response['message'] = "Successful";
            while($row=$fetchAboutUs->fetch_assoc())
            {
                $response['aboutUs'] = $row['description'];
            }
        }
        else
        {
            $response['statusCode'] = 4;
            $response['message'] = "Error in fetching about us";
        }



    }
    else
    {
        $response['statusCode'] = 4;
        $response['message'] = "Error in fetching privacy policy";
    }


    echo json_encode($response);


?>