forked from ojalaquellueva/nsr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnsr.php
More file actions
49 lines (40 loc) · 1.3 KB
/
nsr.php
File metadata and controls
49 lines (40 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
///////////////////////////////////////////////
// Evaluates observations against nsr
// database and adds results to cache
// Connection to db must already exist
///////////////////////////////////////////////
include "dbw_open.php";
//////////////////////////////////////////////////////
// Set batch
//////////////////////////////////////////////////////
// Get batch number
$use_batch = false; // Assume no batching
if (isset($batch)) {
// Abort if bad batch #
if ( ! is_int( $batch ) ) {
die("ERROR: batch # must be a positive integer");
} else {
$use_batch = true; // All good, use batching
}
}
// Set batch WHERE clause
if ($use_batch==true) {
$BATCH_WHERE = " o.batch='$batch' ";
$BATCH_WHERE_NA = " batch='$batch' ";
} else {
// No batches, just set this clause to always true
$BATCH_WHERE = " 1 ";
$BATCH_WHERE_NA = " 1 ";
}
//////////////////////////////////////////////////////
// Process the observations [by batch if specified]
//////////////////////////////////////////////////////
include "prepare_observations.php";
include $nsr_includes_dir."check_absence.php";
include $nsr_includes_dir."check_presence.php";
include $nsr_includes_dir."check_cultivated.php";
include $nsr_includes_dir."infer_status.php";
include $nsr_includes_dir."append_to_cache.php";
include "db_close.php";
?>