-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOnlineVisitors-Test-1.php
60 lines (44 loc) · 1.93 KB
/
OnlineVisitors-Test-1.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace TEST;
require_once('vendor/autoload.php');
// require_once('src/functions.onlinevisitors.php');
use function OnlineVisitors\{executeOnlineVisitorsInsertRow, executeGetOnlineVisitorsLatestIPAddressesWithTime};
//* ===================================================================================================================== */
executeOnlineVisitorsInsertRow();
$SelectOptionsAry = executeGetOnlineVisitorsLatestIPAddressesWithTime();
//* ===================================================================================================================== */
$NewLine = chr(0x0D);
$SelectOptions = "";
foreach ($SelectOptionsAry as $Key => $Value) {
$SelectOptions .= "\t\t\t\t" . '<option value="' . $Key + 1 . '">' . $Value . '</option>' . PHP_EOL;
}
// Remove First 3x Tab Characters
$SelectOptions = substr($SelectOptions, 4);
// Remove Last PHP_EOL
$SelectOptions = substr($SelectOptions, 0, -1);
/* ===================================================================================================================== */
$HTML = <<<HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Online Visitors">
<title>Online Visitors Test</title>
</head>
<body>
<main>
<form name ="FrmSelOptions" action="" method="get">
<label for="SelOnlineVisitors">Online Visitors: </label>
<select name="SelOnlineVisitors" id="SelOnlineVisitors">
<option value="0" selected></option>{$NewLine}
{$SelectOptions}
</select>
</form>
</main>
</body>
</html>
HTML;
/* ===================================================================================================================== */
echo $HTML;
/* ===================================================================================================================== */