tadd check for isotope concentrations - cosmo - front and backend for Markov-Chain Monte Carlo inversion of cosmogenic nuclide concentrations
git clone git://src.adamsgaard.dk/cosmo
Log
Files
Refs
README
LICENSE
---
commit 57aad56c378f4ef69cf3f7fcea729bcfc1cd12c5
parent a96aa07e0b423fc0e026035cb42440637f5e3cec
Author: Anders Damsgaard 
Date:   Tue, 18 Aug 2015 14:38:14 +0200

add check for isotope concentrations

Diffstat:
  M uploadhistory.php                   |      14 +++++++++++++-

1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/uploadhistory.php b/uploadhistory.php
t@@ -7,7 +7,7 @@
 $missing_fields = array(); // array of missing field names
 //die('"' . $_POST['sample_id'] . '", ' . isset($_POST['sample_id']));
 
-// Check required fields one by one
+// Check required fields if not set or blank, one by one
 if (!isset($_POST['sample_id']) || $_POST['sample_id'] == '') {
     array_push($missing_fields, 'Sample ID');
 }
t@@ -24,6 +24,18 @@ if (!isset($_POST['long']) || $_POST['long'] == '') {
     array_push($missing_fields, 'Longitude');
 }
 
+// Check TCN concentrations, at least one value is needed
+if ((!isset($_POST['conc_10Be']) || $_POST['conc_10Be'] == '') &&
+    (!isset($_POST['conc_26Al']) || $_POST['conc_26Al'] == '') &&
+    (!isset($_POST['conc_14C'])  || $_POST['conc_14C'] == '') &&
+    (!isset($_POST['conc_21Ne']) || $_POST['conc_21Ne']) == '') {
+        array_push($missing_fields, 'at least 1 TCN concentration');
+}
+
+// For each isotope concentration there should be uncertainty and production 
+// rate
+//if (isset($
+
 // If something is missing, send error to user and make him/her go back
 if (count($missing_fields) > 0) {
     $error_msg = '' .