<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created: 3/21/2019
//
include ("check_session.php");
include ("encrypt_decrypt.php");

$query = "SHOW TABLES LIKE '" . BWB_TABLE_PREFIX . "bat_login';";
$result = $bwb_dbh->query($query);
if ($result->rowCount() < 1)	{
	echo -1;
	exit;
}

$query = "SELECT * FROM " . BWB_TABLE_PREFIX . "bat_login";
$result = $bwb_dbh->query($query);
if ($result->rowCount() < 1)	{
	echo -1;
	exit;
}

/////////////////////////////////////////////////////////////////
$query = "SELECT * FROM " . BWB_TABLE_PREFIX . "bat_login";
$result = $bwb_dbh->query($query);
$row = $result->fetch(PDO::FETCH_ASSOC);
$userid = $row['UserID'];
$encrypt_password = $row['password'];
$decrypt_password = doDecrypt($encrypt_password, $userid);

echo $userid . "@@@@@" . $decrypt_password;
?>