declare(strict_types=1);
include_once "LJCRoot.php";
$prefix = RelativePrefix();
include_once "$prefix/LJCPHPCommon/LJCDataManagerLib.php";
include_once "$prefix/LJCPHPCommon/LJCTextBuilderLib.php";
include_once "$prefix/LJCPHPCommon/LJCHTMLTableLib.php";
// LJCDataManagerLib: LJCConnectionValues, LJCDataManager
// LJCTextBuilderLib: LJCAttribute, LJCAttributes, LJCTextBuilder
// , LJCTextState
// LJCHTMLTableLib: LJCHTMLTable
// Get Result table.
private static function GetResultsTable(LJCTextState $textState)
{
$database = "DatabaseName";
$userID = "UserID";
$password = "Password";
$connectionValues = new LJCConnectionValues("localhost", $database, $userID
, $password);
$tableName = "Province";
$manager = new LJCDataManager($connectionValues, $tableName);
// Retrieves all column values.
$rows = $manager->Load();
$propertyNames = $manager->PropertyNames();
$ht = new LJCHTMLTable();
$ht->ColumnNames = $propertyNames;
$tb = new LJCTextBuilder();
$ht->TableAttribs = $tb->TableAttribs();
$result = $ht->ResultHTML($rows, $textState);
}
|