-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.php
More file actions
62 lines (49 loc) · 1.75 KB
/
node.php
File metadata and controls
62 lines (49 loc) · 1.75 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
50
51
52
53
54
55
56
57
58
59
60
61
62
<script type="text/javascript">
function average(inputData){
var arr = JSON.parse(inputData);
var sum = 0;
var index = document.getElementById("resultFrameNumber").value;
var len = arr[index].length;
for( i=0; i<len; i++){
if( arr[index][i] ) sum += arr[index][i];
}
//var ave = sum/len;
var ave = sum/len;
document.getElementById("result").innerHTML = ave;
document.getElementById("resultField").value = ave;
document.getElementById("weight").value = 1/arr.length;
document.getElementById("subset").innerHTML = arr[index];
document.forms["nodeResult"].submit();
}
function median(inputData){
}
function min(inputData){
}
function max(inputData){
}
</script>
<?php
$peerID = $_POST['peerID'];
$name = $_POST['name'];
$orgID = $_POST['orgID'];
$inputData = $_POST['inputData'];
$procedure = $_POST['procedure'];
$resultFrameNumber = $_POST['resultFrameNumber'];
echo "<form id=\"nodeResult\" action=\"backend.php\" method=\"post\" target=\"resultFrame$resultFrameNumber\">";
echo "<input type=\"hidden\" name=\"name\" value=\"$name\">";
echo "<input type=\"hidden\" name=\"peerID\" value=\"$peerID\">";
echo "<input type=\"hidden\" name=\"procedure\" value=\"$procedure\">";
echo "<input type=\"hidden\" name=\"resultFrameNumber\" id=\"resultFrameNumber\" value=\"$resultFrameNumber\">";
echo "<input type=\"hidden\" name=\"inputData\" value=\"'$inputData'\">";
echo "<input type=\"hidden\" name=\"weight\" id=\"weight\">";
echo "<input type=\"hidden\" name=\"result\" id=\"resultField\" value=\"$result\">";
echo "</form>";
echo "<html><body onload=\"$procedure($inputData)\">";
echo "peerID: $peerID";
echo "<br>";
echo "\"$procedure\" of: <br>[<a id=\"subset\"></a>] <br>";
echo "<br>";
echo "result: <a id=\"result\"></a>";
echo "<br>";
echo "</body></html>";
?>