-
Notifications
You must be signed in to change notification settings - Fork 0
/
engine.php
37 lines (33 loc) · 846 Bytes
/
engine.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
<?php
// Imports
require_once("functions.php");
require_once("printer.php");
// Constants
define("DB_AUTH", ".dbaccess");
define("UPLOAD_DIR", "uploads");
// Main
if (isset($_POST["run"])) {
echo "<h1>Konkordanz</h1>";
// Determine data:
$filepath = uploadCSV($_FILES["csv_file"], UPLOAD_DIR);
$data = getDataFromCSV($filepath, getValuesFromDB(DB_AUTH));
$faculties = getFaculties($data);
if (isset($faculties)) {
// Print refresh link:
echo "<hr />".printRefresh();
// Print faculty table and chart:
echo printData($faculties, "Konkordanz");
// Print back button:
echo printBackButton();
// Print debug faculty sums per journal:
echo "<hr />".printDebug($data);
} else {
// Print back button:
echo printBackButton();
}
// Clean up uploaded files:
removeCSV($filepath);
} else {
require_once("form.html");
}
?>