//====================================================================
//  JSON DATA REQUESTS
//====================================================================
// BUILDING JSON DATA FROM 3 ELEMTS : devID, devPASS, TADNUMBER
//--------------------------------------------------------------------

  String post_json(String idCARD)
  {
    // Building The Buffer
    DynamicJsonDocument     data(2000);
    
    // Inserting Data
    data["request"]       = "attendance";
    data["divID"]         = devID;    // This is Predefined In The Seetings
    data["divPASS"]       = devPASS;  // This Is Predefined In the Settings
    data["divMAC"]        = devMac;   // This is from ESP8266 MacAddress Function
    data["divDate"]       = __DATE__;  // This is from RTC Module
    data["divTime"]       = __TIME__;  // This is from RTC Module
    data["userRFID"]      = idCARD;   // This is from RFID Card Scanned By User
    
    // Creating Output Memory
    String output;

    // Inserting Data To Output Variable
    serializeJson(data, output);

    // Clearing Data Memory
    data.clear();

    // Returnning Generated String
    return output;
  }

//--------------------------------------------------------------------
// BUILDING JSON DATA FROM 3 ELEMTS : devID, devPASS, TADNUMBER
//--------------------------------------------------------------------

  bool person_read(String json)
  {
    // Building The Buffer
    DynamicJsonDocument      data(3000); // building JSON Buffer
    // Reading Data From JSON
    DeserializationError  error = deserializeJson(data, json);
    
    // Make Sure Was Converted Correctly
    if(error) {
      Serial.println("Error Parsing JSON");
      return false;
    }
    
    // Reading Data
    u_id          = data["response"].as<String>();
    u_name        = data["name"].as<String>();
    u_package     = data["package"].as<String>();
    u_starttime   = data["starttime"].as<String>();
    u_timing      = data["timing"].as<String>();
    u_remain      = data["remain"].as<String>();
    u_valid       = data["valid"].as<String>();
    u_sysmsg      = data["sysmsg"].as<String>();
    
    // Clearing Buffer
    data.clear();

    // Successfull
    return true;
  }
