This repository has been archived by the owner on Mar 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreport.php
63 lines (61 loc) · 1.87 KB
/
report.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
61
62
<?php
session_start();
$key_test=$_COOKIE['session_key'];
if (empty($key_test) || ($key_test != $_SESSION['key']))
{
session_destroy();
header("Location: login.php");
header("Pragma: no-cache");
exit;
}
include_once("lib/etc/site.conf");
include_once("$cfg_class_dir/printrepo.php");
$repo_id = $_COOKIE['repo_id'];
$record_id = $_COOKIE['key'];
$recordset_action = $_COOKIE['recordset_action'];
$_printrepo = new printrepo;
if (!empty($repo_id)) {
setcookie('repo_id', NULL);
}
if (!empty($recordset_action)) {
setcookie('recordset_action', NULL);
}
if (file_exists("$cfg_custom_layout_dir/print-page-head.php")) {
include("$cfg_custom_layout_dir/print-page-head.php");
} else {
include("$cfg_layout_dir/print-page-head.php");
}
if (!empty($_COOKIE['current_table']))
{
$table = $_COOKIE['current_table'];
$rights = $_SESSION['user_rights'][$table]['view'];
if ($_SESSION['db_admin']) $rights = 't';
$_SESSION['recordset_action'] = $_COOKIE['recordset_action'];
if ($_SESSION['current_table'] != $_COOKIE['current_table']) {
$_SESSION['current_table'] = $_COOKIE['current_table'];
}
if ($rights === 't') {
//$repo_id = $_COOKIE['repo_id'];
//echo "debug: record_id $record_id";
if (!empty($repo_id)) {
if (!empty($record_id)) {
?>
<script type="text/javascript">
document.cookie = "key=";
</script>
<?php
}
$_printrepo -> report_generate($repo_id, $record_id);
} else {
$_printrepo -> report_select();
}
} else {
echo "<div id=\"messages\" class=\"messages\" OnmouseOver=\"HideElement('messages');\">Naudotojas „".$_SESSION['user']['user']."“ negali žiūrėti/spausdinti šios lentelės.</div>";
}
}
if (file_exists("$cfg_custom_layout_dir/print-page-foot.php")) {
include("$cfg_custom_layout_dir/print-page-foot.php");
} else {
include("$cfg_layout_dir/print-page-foot.php");
}
?>