forked from devlab-oy/pupesoft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
raportit.php
94 lines (71 loc) · 2.43 KB
/
raportit.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
<?php
if (isset($_POST["tee"])) {
if ($_POST["tee"] == 'lataa_tiedosto') $lataa_tiedosto=1;
if ($_POST["kaunisnimi"] != '') $_POST["kaunisnimi"] = str_replace("/", "", $_POST["kaunisnimi"]);
}
//* Tämä skripti käyttää slave-tietokantapalvelinta *//
$useslave = 1;
// Näissä keisseissä ei slavea
if (($_REQUEST["toim"] == 'hyvaksynta' and $_REQUEST["tee"] == 'T') or $_REQUEST["toim"] == 'maksuvalmius' or $_REQUEST["toim_tee"] == 'kululasku') {
$useslave = 0;
}
if ($_REQUEST["toim"] == 'avoimet') {
// DataTables päälle
$pupe_DataTables = array("avoimet0", "avoimet1");
}
if ($_REQUEST["toim"] == 'hyvaksynta') {
// DataTables päälle
$pupe_DataTables = array("hyvaksynta");
}
if ($_REQUEST["toim"] == 'toimittajahaku' or $_REQUEST["toim"] == 'laskuhaku' or $_REQUEST["toim"] == 'myyrespaakirja') {
// DataTables päälle
$pupe_DataTables = $_REQUEST["toim"];
}
require "inc/parametrit.inc";
if (isset($tee) and $tee == "lataa_tiedosto") {
readfile("/tmp/".$tmpfilenimi);
exit;
}
$cleantoim = $toim;
// Rajataanko rappari näyttämään vain Omaa KustannusPaikkaa
if (substr($toim, -4) == '_OKP') {
// käyttäjän osasto kertoo oletuskustannuspaikan
$vainomakustp = TRUE;
if (empty($kukarow["osasto"])) {
echo "<br><br>".t("Käyttäjätiedoistasi puuttuu osasto")."!<br>";
require "inc/footer.inc";
exit;
}
$mul_kustp = array();
$mul_kustp[] = $kukarow["osasto"];
$cleantoim = substr($toim, 0, -4);
}
// Livesearch jutut
enable_ajax();
js_popup();
if (!isset($excel)) $excel = "";
if (!isset($livesearch_tee)) $livesearch_tee = "";
if ($livesearch_tee == "TILIHAKU") {
livesearch_tilihaku();
exit;
}
if ($excel == "YES") {
include 'inc/pupeExcel.inc';
$worksheet = new pupeExcel();
$format_bold = array("bold" => TRUE);
$excelrivi = 0;
}
require "inc/{$cleantoim}.inc";
if (isset($worksheet) and $excelrivi > 0) {
$excelnimi = $worksheet->close();
echo "<br><br><table>";
echo "<tr><th>".t("Tallenna tulos").":</th>";
echo "<form method='post' class='multisubmit'>";
echo "<input type='hidden' name='toim' value='$toim'>";
echo "<input type='hidden' name='tee' value='lataa_tiedosto'>";
echo "<input type='hidden' name='kaunisnimi' value='".ucfirst(strtolower($toim)).".xlsx'>";
echo "<input type='hidden' name='tmpfilenimi' value='$excelnimi'>";
echo "<td class='back'><input type='submit' value='".t("Tallenna")."'></td></tr></form>";
echo "</table><br>";
}
require "inc/footer.inc";