-
Notifications
You must be signed in to change notification settings - Fork 1
/
checkSaveFiles.php
58 lines (49 loc) · 1.48 KB
/
checkSaveFiles.php
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
50
51
52
53
54
55
56
57
58
<?php
include("parts_checkSession.php");
include("function.php");
include("dbTempUpdate.php");
// user final selection
$selection = array();
$expIds = $_POST["exp_id"];
// Get user final selection for the update files
for ($i = 0; $i < count($expIds); $i++) {
// Treatment
if (isset($_POST["checkX_" . $expIds[$i]])) {
$selection[$expIds[$i]]["treatment"] = $_POST["checkX_" . $expIds[$i]];
} else {
header("Location: confirmFiles.php?" . SID );
$_SESSION["errFlg"] = "005";
exit();
}
// Soil
if (isset($_POST["checkS_" . $expIds[$i]])) {
$selection[$expIds[$i]]["soil"] = $_POST["checkS_" . $expIds[$i]];
} else {
$selection[$expIds[$i]]["soil"] = array();
}
// Weather
if (isset($_POST["checkW_" . $expIds[$i]])) {
$selection[$expIds[$i]]["weather"] = $_POST["checkW_" . $expIds[$i]];
} else {
$selection[$expIds[$i]]["weather"] = array();
}
// Observed data TFile
if (isset($_POST["checkT_" . $expIds[$i]])) {
$selection[$expIds[$i]]["observed"][0] = $_POST["checkT_" . $expIds[$i]];
} else {
$selection[$expIds[$i]]["observed"] = "";
}
// Observed data AFile
if (isset($_POST["checkA_" . $expIds[$i]])) {
$selection[$expIds[$i]]["observed"][1] = $_POST["checkA_" . $expIds[$i]];
} else {
$selection[$expIds[$i]]["observed"] = "";
}
}
// Update temp tables
updateTempFile(json_encode($selection), "U");
saveTempFile();
clearDssatSession();
header("Location: saveFiles.php?" . SID );
exit();
?>