Commit f8747a16 authored by Anders Damsgaard's avatar Anders Damsgaard

show simulation inversion status

parent 9641d858
......@@ -82,6 +82,19 @@ if (isset($_GET['wait_id']) && !empty($_GET['wait_id'])) {
<h2 class="header col s12">Please wait</h2>
</div>
<div class="row center">
<h2 class="header col s12 orange">Inversion status:
<?php
if (!$statusfile = fopen("/home/adc/cosmo/input/status_" . $_GET['wait_id'], "r")) {
echo("Error! Sample data not found.");
}
echo fgets($statusfile);
fclose($statusfile);
?>
</h2>
</div>
<div class="row progress center-align s12">
<div class="indeterminate"></div>
</div>
......
......@@ -192,12 +192,27 @@ if (!chmod($outputfile, 0777)) {
// delete temporary file
//unlink($tmpfile);
// Create inversion status output file
$statusfile = ("/home/adc/cosmo/input/status_" . $id);
if (is_writable($statusfile)) {
if (!$handle = fopen($statusfile, 'w')) {
die("The php server could not open $statusfile.");
}
// write status to file
if (fwrite($handle, "Queued") === false) {
die("The php server could not write the status to $statusfile.");
}
} else {
die("The php server output file $statusfile is not writable");
}
// Finally redirect user after processing uploaded data. This header function
// call must be before any output!
//header("Location: /~ad/cosmo");
header("Location: /index.php?wait_id=". $id);
header("Location: /index.php?wait_id=" . $id);
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment