<?php

#Ensure that the client has provided a value for "FirstNameToSearch" 
if (isset($_REQUEST["email"]) && $_REQUEST["email"] != "" &&
        isset($_REQUEST["pass"]) && $_REQUEST["pass"] != "") {

    include_once './DataManager.php';

    #Setup variables 
    $email = $_REQUEST["email"];
    $pass = $_REQUEST["pass"];

    #Query the database to get the user details. 
    $row = DataManager::login($email, $pass);


    foreach ($row as $w) {
        #Build the result array (Assign keys to the values) 
        $result_data = array(
            'user_id' => $w['user_id'],
            'user_email' => $w['user_email'],
            'user_verify_code' => $w['user_verify_code']
        );
    } 
    
   

    #Output the JSON data 
    echo json_encode($result_data);
} else {
    echo "Could not complete query. Missing parameter";
}
?>