From 1aa1ca8d4ca3789b0eb3512b6f9ce3316c035ac9 Mon Sep 17 00:00:00 2001 From: jonsowman Date: Mon, 31 May 2010 14:11:18 +0100 Subject: [PATCH] Made getModelByUUID PHP function --- predict/ajax.php | 20 ++++++++++++++++++++ predict/css/pred.css | 26 ++++++++++++++++++++------ predict/index.php | 15 ++++++++++----- 3 files changed, 50 insertions(+), 11 deletions(-) diff --git a/predict/ajax.php b/predict/ajax.php index 2dc9921..8ba5e4a 100644 --- a/predict/ajax.php +++ b/predict/ajax.php @@ -25,6 +25,26 @@ case "JSONexists": } break; +case "getModelByUUID": + $uuid = ( isset($_GET['uuid']) ? $_GET['uuid'] : false ); + if( !uuid ) die ("No uuid given to getModelByUUID"); + // make a new model + $pred_model = array(); + if ( !file_exists("preds/".$uuid."/scenario.ini") ) { + $pred_model['valid'] = false; + } else { + // populate the array, JSON encode it and return + $pred_model = parse_ini_file("preds/".$uuid."/scenario.ini"); + if ( verifyModel($pred_model) ){ + $pred_model['valid'] == true; + } else { + $pred_model['valid'] == false; + } + $pred_model['uuid'] = $uuid; + } + echo json_encode($pred_model); + break; + case "submitForm": $software_available = array("gfs", "gfs_hd"); diff --git a/predict/css/pred.css b/predict/css/pred.css index 71d75d1..77b2f93 100644 --- a/predict/css/pred.css +++ b/predict/css/pred.css @@ -8,10 +8,7 @@ body { margin: 0; padding: 0; } -a:link { text-decoration: underline; color: #333 } -a:active { text-decoration: underline; color: #333; } -a:hover { text-decoration: underline; color: #333; } -a:visited { text-decoration: underline; color: #333; } +a { text-decoration: underline; color: #333; cursor: pointer; } /* The whoppping map in the centre */ #map_canvas { width: 100%; height: 100%; } @@ -75,11 +72,28 @@ a:visited { text-decoration: underline; color: #333; } } #input_form { - right: 0; bottom: 0; border-right: none; border-bottom: none; - width: 400px; height:350px; + width: 400px; + padding: 5px; +} + +#scenario_info { + border-right: none; + height:100px; + width: 400px; + padding: 5px; + top: -115px; + overflow: hidden; +} + + +#bottom_right { + right: 0; + bottom: 0; + width: 400px; + padding: 0px; } td.right-td { diff --git a/predict/index.php b/predict/index.php index 13b2731..ad18887 100644 --- a/predict/index.php +++ b/predict/index.php @@ -79,7 +79,7 @@ function initialize() {

Debug Window - -Show +Show

No Messages
@@ -91,7 +91,12 @@ function initialize() {
-
+
+
+info on scenario +
+ +
@@ -161,8 +166,8 @@ function initialize() {
Landing prediction software:
@@ -171,7 +176,7 @@ function initialize() {
-
+