(time() + 180*3600)) { die("The time was too far in the future, 180 days max"); } // now we have a populated model, run the predictor runPred($pred_model); } function runPred($pred_model) { // do things $pred_software = $_POST['software']; // check the software requested is available $software_available = array('grib', 'dap'); if (!in_array($pred_software, $software_available)) { die("Invalid software selected: " . $pred_software); } // SANITY CHECK ALL POST VARS HERE // // make in INI file makePredDir($pred_model); makeINI($pred_model); if ( $pred_software == $software_available[0] ) { // using grib //runGRIB(); } else if ( $pred_software == $software_available[1] ) { // using dap //runDAP(); } else { die("We couldn't find the software you asked for"); } } function makePredDir($pred_model) { shell_exec("mkdir preds/" . $pred_model['uuid']); //make sure we use the POSTed uuid } function makeINI($pred_model) { // makes an ini file $fh = fopen("preds/" . $pred_model['uuid'] . "/scenario.ini", "a"); //append $w_string = "[launch-site]\nlatitude = " . $pred_model['lat'] . "\naltitude = " . $pred_model['alt'] . "\n"; $w_string .= "longitude = " . $pred_model['lon'] . "\n[atmosphere]\nwind-error = "; $w_string .= $pred_model['wind_error'] . "\n[altitude-model]\nascent-rate = " . $pred_model['asc'] . "\n"; $w_string .= "descent-rate = " . $pred_model['des'] . "\nburst-altitude = "; $w_string .= $pred_model['burst'] . "\n[launch-time]\nhour = " . $pred_model['hour'] . "\n"; $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"; fwrite($fh, $w_string); fclose($fh); } function runGRIB() { // runs the grib predictor } ?> CUSF Landing Prediction 2 - GUI test

Debug Window

No Messages
Launch Site:
Latitude:
Longitude:
Launch altitude (m):
Launch Time: " maxlength="2" size="2"> : " maxlength="2" size="2">
Launch Date:
Ascent Rate (m/s):
Descent Rate (sea level m/s):
Burst Altitude (m):
Float time at apogee (s):
Landing prediction software: