forked from webERP-team/webERP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SalesAnalysis_UserDefined.php
48 lines (33 loc) · 1.87 KB
/
SalesAnalysis_UserDefined.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
<?php
include('includes/session.php');
if (!in_array($PageSecurity,$_SESSION['AllowedPageSecurityTokens'])){
echo '<html><body><br /><br /><br /><br /><br /><br /><br /><div class="centre"><font color="red" size="4"><b>' . _('The security settings on your account do not permit you to access this function') . '</b></font></div></body></html>';
exit;
}
include('includes/ConstructSQLForUserDefinedSalesReport.inc');
if (isset($_GET['ProducePDF'])){
include ('includes/PDFSalesAnalysis.inc');
if ($Counter >0) {
$pdf->OutputD('SalesAnalysis_' . date('Y-m-d') . '.pdf');
$pdf->__destruct();
} else {
$pdf->__destruct();
$Title = _('User Defined Sales Analysis Problem');
include('includes/header.php');
echo '<p>' . _('The report did not have any none zero lines of information to show and so it has not been created');
echo '<br /><a href="' . $RootPath . '/SalesAnalRepts.php?SelectedReport=' . $_GET['ReportID'] . '">' . _('Look at the design of this report') . '</a>';
echo '<br /><a href="' . $RootPath . '/index.php">' . _('Back to the menu') . '</a>';
include('includes/footer.php');
exit;
}
} /* end if we wanted a PDF file */
if ($_GET['ProduceCVSFile']==True){
include('includes/CSVSalesAnalysis.inc');
$Title = _('Sales Analysis Comma Separated File (CSV) Generation');
include('includes/header.php');
echo 'http://' . getenv(SERVER_NAME) . $RootPath . '/' . $_SESSION['reports_dir'] . '/SalesAnalysis.csv';
echo '<meta http-equiv="Refresh" content="0; url=' . $RootPath . '/' . $_SESSION['reports_dir'] . '/SalesAnalysis.csv">';
echo '<p>' . _('You should automatically be forwarded to the CSV Sales Analysis file when it is ready') . '. ' . _('If this does not happen') . ' <a href="' . $RootPath . '/' . $_SESSION['reports_dir'] . '/SalesAnalysis.csv">' . _('click here') . '</a> ' . _('to continue') . '<br />';
include('includes/footer.php');
}
?>