-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhistoryiframe.php
More file actions
77 lines (57 loc) · 2.07 KB
/
historyiframe.php
File metadata and controls
77 lines (57 loc) · 2.07 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
require_once('classes/autoloader.php');
require_once('include/apistatuscodes.inc');
$logger = new logging();
$sHelper = new sessionHelper();
$dbm = new dbHelper();
if (is_file("include/customfunctions.php.inc")) {
include "include/customfunctions.php.inc";
}
require_once("include/header.php.inc");
echo "<div id='message'></div>";
$s2 = new Edit();
$s2->showHtml();
require_once("include/footer.php.inc");
class Edit
{
private $logger;
private $formHelper;
private $session;
private $sessionHelper;
private $quaryHelper;
private $dbm;
function __construct()
{
$this->logger = new logging();
$this->formHelper = new formHelper();
$this->session = new sessionObject($_REQUEST['sessionid']);
$this->sessionHelper = new sessionHelper();
$this->quaryHelper = new QueryHelper();
$this->dbm = new dbHelper();
}
public function showHtml()
{
if ($this->sessionHelper->isUserAllowedToEditSession($this->session)) {
$this->showHtmlAllowedViewHistoryIframe();
} else {
echo "User not allowed to view history, only the owner of the session can do that.";
}
}
private function showHtmlAllowedViewHistoryIframe()
{
$con = $this->dbm->connectToLocalDb();
$id = $_REQUEST['id'];
$id = $this->dbm->escape($con, $id);
$sqlGetCharterHistory = "SELECT * FROM mission_incremental_save WHERE id=" . $id;
$charterHistoryResult = $this->dbm->executeQuery($con, $sqlGetCharterHistory, __FILE__, __LINE__);
echo '<h2>This page shows an older version of charter text or notes text for charter title<br>' . $this->session->getTitle() . '</h2>';
while ($row = $charterHistoryResult->fetch_array(MYSQLI_ASSOC)) {
echo "Saved at " . $row['timestamp_saved'] . '<br>';
echo $row['charter'];
echo $row['notes'];
}
/* free result set */
$charterHistoryResult->close();
}
}
?>