-
Notifications
You must be signed in to change notification settings - Fork 4
/
generate.php
23 lines (20 loc) · 909 Bytes
/
generate.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
$dayvel = $_POST['dayvel'];
$dayvelval = $_POST['dayvelval'];
$date = $_POST['date'];
$phval = $_POST['phval'];
$ph = $_POST['ph'];
$we = $_POST['we'];
$title = $_POST['title'];
$chart_button = isset($_POST['chart_button']);
$configfile = $_FILES['file']['tmp_name'];
if($chart_button){
header("Content-type: application/pdf");
header("Content-Disposition: attachment; filename=burndown-".date('Y-m-d-h-i-s').".pdf");
passthru("./generate --output stdout-chart --start-date $date --$dayvel $dayvelval --phval $phval --ph $ph --with-hd-we $we --title \"$title\" --config $configfile");
} else {
header("Content-type: text/plain");
header("Content-Disposition: attachment; filename=burndown-config-".date('Y-m-d-h-i-s').".txt");
passthru("./generate --output stdout-config --start-date $date --$dayvel $dayvelval --phval $phval --ph $ph --with-hd-we $we --title \"$title\" --config $configfile");
}
?>