/
index2.php
156 lines (91 loc) · 4.97 KB
/
index2.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
// Check the IP address of the user
include_once("inc_files/inc_ipcheck.php");
// Perform the top-of-page security check
include_once("inc_files/inc_checkcookie.php");
$usercheck = filter_input(INPUT_POST, 'usercheck', FILTER_SANITIZE_STRING);
$checkform_user = filter_input(INPUT_POST, 'checkform_user', FILTER_SANITIZE_STRING);
if ($_POST['action']) { $action = filter_input(INPUT_POST, 'action', FILTER_SANITIZE_STRING); include_once("inc_files/functions_actions.php"); include("inc_files/action_" . $action . ".php"); }
elseif ($_GET['action']) { $action = filter_input(INPUT_GET, 'action', FILTER_SANITIZE_STRING); include_once("inc_files/functions_actions.php"); include("inc_files/action_" . $action . ".php"); }
// Include the standard header file
include_once("inc_files/inc_header.php");
Logo($settings_style,$settings_name);
echo "<div id=\"mainpage\">";
// Column Left
include("inc_files/inc_col_left_1.php");
//Column Centre
// Alert Functions
if ($user_usertype_current > 4) { CheckExpenses(); }
if ($user_usertype_current > 3) { CheckFutureTenders(); }
if ($user_usertype_current > 3) { CheckInvoicesToBeIssued($_COOKIE['user']); }
if ($user_usertype_current > 3) { CheckInvoicesOverdue($_COOKIE['user']); }
CheckOutstandingTimesheets($_COOKIE['user']);
CheckOutstandingTasks($_COOKIE['user']);
CheckCheckList();
CheckTelephoneMessages($_COOKIE['user']);
echo "<div id=\"column_centre\">";
$displaytime = time() + 30; //86400;
if ($invoiceduemessage != "" AND $_GET['page'] == NULL AND $_COOKIE['invoiceduemessage'] == NULL AND $_POST['action'] != "invoice_due_setcookie") { echo "<h1 class=\"heading_alert\">Invoices Overdue </h1>" . $invoiceduemessage . "<form action=\"index2.php\" method=\"post\"><input type=\"hidden\" value=\"".time()."\" name=\"invoiceduemessage\" /><input type=\"hidden\" name=\"action\" value=\"invoice_due_setcookie\" /><input type=\"submit\" value=\"Hide for 24 hours\" /></form>"; }
if ($invoicemessage != "" AND $_GET['page'] == NULL) { $timesheetaction = $timesheetaction . "<div class=\"warning\"><p><strong>Invoices To Be Issued Today</strong></p>" . $invoicemessage . "</div>"; }
if ($alertmessage) { $timesheetaction = $timesheetaction . "<div class=\"warning\"><p><strong>Error</strong></p><p>" . $alertmessage . "</p></div>"; }
if ($actionmessage) { $timesheetaction = $timesheetaction . "<div class=\"warning\"><p><strong>Information</strong></p><p>" . $actionmessage . "</p></div>"; }
if ($techmessage != "" AND $settings_showtech == "1" AND $usertype_status == "admin") { $timesheetaction = $timesheetaction . "<div class=\"warning\"><p><strong>Support Messages</strong></p><p>" . $techmessage . "</p></div>"; }
// This includes the "outstanding" section, which alerts users to outstanding actions.
AlertBoxShow(intval($_COOKIE['user']));
if ($useraction == "defineuser") {
include("inc_files/inc_alertuser.php");
}
// Check for any upcoming holidays
if (!$_GET['page']) {
$today = TimeFormatDay(time());
echo "<h1>" . $today . "</h1>";
echo "<div id=\"HolidayList\" class=\"FloatBoxHalf\">";
ListHolidays();
GetNextBankHoliday(time());
if ($prefs_nonworking) {
UserLocationList($prefs_nonworking);
}
echo "</div>";
if ($module_media == 1) {
echo "<div id=\"MediaList\" class=\"FloatBoxHalf\">";
MediaLatestList();
echo "</div>";
}
echo "<div id=\"DateList\" class=\"FloatBoxHalf\">"; DateList(1); echo "</div>";
if ($module_tasks == 1) {
echo "<div id=\"TaskList\" class=\"FloatBoxHalf\"><h2>My Tasks</h2>"; MiniTaskList($_COOKIE['user']); echo "</div>";
}
}
if ($proj_id > 0) { $proj_id = intval($proj_id); }
elseif ($_GET['proj_id'] > 0) { $proj_id = intval($_GET['proj_id']); }
elseif ($_POST['proj_id'] > 0) { $proj_id = intval($_POST['proj_id']); }
else { unset($proj_id); }
if ($useraction != "defineuser") {
// Add the project title, if there is one either through POST or GET
$proj_details = ProjectTitle();
$proj_id = $proj_details[0];
if ($proj_id) {
$proj_title = "<h1 id=\"project_title\"><a href=\"#\" onclick=\"ShowProjectSwitcher()\">" . $proj_details[1] . " " . $proj_details[2] . "</a></h1>";
} else {
unset($proj_title);
}
if ($proj_title) { echo $proj_title; }
// Include the relevant page if the $_GET[page] variable is not blank, otherwise deliver the default page
if ($page_redirect != NULL) {
$inc_file = "inc_files/inc_".$page_redirect.".php";
} elseif ($_GET['page'] != NULL) {
$inc_file = "inc_files/inc_".$_GET['page'].".php";
} elseif ($_POST['page'] != NULL) {
$inc_file = "inc_files/inc_".$_POST['page'].".php";
} else {
$inc_file = "inc_files/inc_default.php";
}
if (file_exists($inc_file)) { include($inc_file); } else { include("inc_files/inc_default.php?" . $page_variables); }
}
echo "</div>";
echo "</div>";
echo $alertscript;
// Finish with the standard footer
FooterBar();
echo "</body>";
echo "</html>";