From 8d176080957a4313a40792ec6f22f1f42bd1c79a Mon Sep 17 00:00:00 2001 From: jonsowman Date: Sat, 5 Jun 2010 16:36:59 +0100 Subject: [PATCH] Preloads most form fields when given an old UUID, doesn't do software and deltas yet --- predict/includes/functions.inc.php | 12 +++++ predict/index.php | 80 ++++++++++++++++++++---------- 2 files changed, 66 insertions(+), 26 deletions(-) diff --git a/predict/includes/functions.inc.php b/predict/includes/functions.inc.php index 4182902..bdfc24b 100644 --- a/predict/includes/functions.inc.php +++ b/predict/includes/functions.inc.php @@ -103,10 +103,22 @@ function makeINI($pred_model) { // makes an ini file $w_string .= "month = " . $pred_model['month'] . "\nsecond = " . $pred_model['sec'] . "\n"; $w_string .= "year = " . $pred_model['year'] . "\nday = " . $pred_model['day'] . "\nminute = "; $w_string .= $pred_model['min'] . "\n"; + // add our predictor stuff + $w_string .= "[predictor]\nlat-delta = " . $pred_model['delta_lat'] . "\n"; + $w_string .= "lon-delta = " . $pred_model['delta_lon'] . "\nsoftware = "; + $w_string .= $pred_model['software'] . "\n"; fwrite($fh, $w_string); fclose($fh); } +function getModelByUUID($uuid) { + if ( file_exists("preds/".$uuid."/scenario.ini") ) { + $pred_model = parse_ini_file("preds/".$uuid."/scenario.ini"); + return $pred_model; + } else { + return false; + } +} ?> diff --git a/predict/index.php b/predict/index.php index 4d272a6..fbe58ed 100644 --- a/predict/index.php +++ b/predict/index.php @@ -1,6 +1,16 @@ @@ -21,7 +31,7 @@ google.load("jqueryui", "1.8.1");