Made getModelByUUID PHP function

pull/73/head
jonsowman 2010-05-31 14:11:18 +01:00
rodzic 57347ffab5
commit 1aa1ca8d4c
3 zmienionych plików z 50 dodań i 11 usunięć

Wyświetl plik

@ -25,6 +25,26 @@ case "JSONexists":
} }
break; 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": case "submitForm":
$software_available = array("gfs", "gfs_hd"); $software_available = array("gfs", "gfs_hd");

Wyświetl plik

@ -8,10 +8,7 @@ body {
margin: 0; padding: 0; margin: 0; padding: 0;
} }
a:link { text-decoration: underline; color: #333 } a { text-decoration: underline; color: #333; cursor: pointer; }
a:active { text-decoration: underline; color: #333; }
a:hover { text-decoration: underline; color: #333; }
a:visited { text-decoration: underline; color: #333; }
/* The whoppping map in the centre */ /* The whoppping map in the centre */
#map_canvas { width: 100%; height: 100%; } #map_canvas { width: 100%; height: 100%; }
@ -75,11 +72,28 @@ a:visited { text-decoration: underline; color: #333; }
} }
#input_form { #input_form {
right: 0; bottom: 0;
border-right: none; border-right: none;
border-bottom: none; border-bottom: none;
width: 400px;
height:350px; 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 { td.right-td {

Wyświetl plik

@ -79,7 +79,7 @@ function initialize() {
<div id="scenario_template" class="box"> <div id="scenario_template" class="box">
<h1>Debug Window - <h1>Debug Window -
<a href='#'><span id="showHideDebug">Show</span></a></span> <a><span id="showHideDebug">Show</span></a></span>
</h1> </h1>
<span id="debuginfo">No Messages</span> <span id="debuginfo">No Messages</span>
</div> </div>
@ -91,7 +91,12 @@ function initialize() {
<div id="prediction_status"></div> <div id="prediction_status"></div>
</div> </div>
<div id="input_form" class="box"> <div id="bottom_right" class="box">
<div id="scenario_info" class="box">
info on scenario
</div>
<div id="input_form">
<form action="" id="modelForm" name="modelForm"> <form action="" id="modelForm" name="modelForm">
<table> <table>
<tr> <tr>
@ -161,8 +166,8 @@ function initialize() {
<tr> <tr>
<td>Landing prediction software: <td> <td>Landing prediction software: <td>
<select id="software" name="software"> <select id="software" name="software">
<option value="gfs" selected="selected">GFS (faster, less accurate)</option> <option value="gfs" selected="selected">GFS</option>
<option value="gfs_hd">GFS HD (slower, more accurate)</option> <option value="gfs_hd">GFS HD</option>
</select> </select>
<tr> <tr>
<td> <td>
@ -171,7 +176,7 @@ function initialize() {
</tr> </tr>
</table> </table>
</form> </form>
</div> </div></div>
</body> </body>