-
Notifications
You must be signed in to change notification settings - Fork 0
/
rec.php
94 lines (76 loc) · 2.82 KB
/
rec.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="testmanuel.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<body background="a.jpg">
<br>
<div class="header">
<center>ECG IDENTIFYING SYSTEM</center><i class="material-icons" style="font-size:30px;position:absolute;top:40px" onClick="parent.location='menu.html'">home</i>
</div>
<?php
include('connexion.php');
include('Net/SSH2.php');
$t=$_POST["time"];
$num=$_POST["num"];
if(isset($_POST['button3'])) {
$ssh = new Net_SSH2('127.0.0.1');
if (!$ssh->login('pi', '123456789')) {
exit('Login Failed');
}
$ssh->exec('cd /var/www/html && ./python.sh '.$t);
$out = $ssh->exec('cd /var/www/html && ./traitment.sh');
$out2 = substr($out,4);
echo "<p style='color:white;'>" . $out2 . "</p>";
echo "<p style='color:white;'>num : " . $num . "</p>";
if($num>=200){
$n3=$num-200;
$pres=100-$n3;}
else if($num>100){
$n2=($num*10)-1000;
$pres=1000-$n2;}
else if($num<=100){
$pres=11000-($num*100);}
echo "<p style='color:white;'>press : " . $pres . "</p>";
$sql = "SELECT dataset from person";
$result = $db->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$d=$out2-$row["dataset"];
echo "<p style='color:white;'>d : " . $d . "</p>";
if ($d < 0){
$d=$d*(-1);
echo "<p style='color:white;'>d -1 :" . $d . "</p>";}
if ($d<=$pres){
$sql2="SELECT ID from person";
$result = $db->query($sql2);
if ($result->num_rows > 0) {
while($row2 = $result->fetch_assoc()) {
$id2=$row2["ID"];
$sql3="SELECT * from person WHERE ID = '$id2'";
$result = $db->query($sql3);
if ($result->num_rows > 0) {
while($row3 = $result->fetch_assoc()) {
echo "<p style='color:white;'>id: " . $row3["ID"] . "<br> Nom : " . $row3["Nom"] . " Prenom : " . $row3["Prenom"] . " <br>Dataset : " . $row3["dataset"] . "</p><br>";
}
} else { echo "<p style='color:white;'>no person</p>";}
}
} else { echo "<p style='color:white;'>no ID</p>";}
} else {echo "<p style='color:white;'>found person but not matching precision</p>";}
}
} else {echo "<p style='color:white;'>0 results</p>";}
}
?>
<form method="post">
<div class="box" style="left:42%;">
<ol class="odd center">
<li class="hex">
<div class="hex-content">Reconnaisance Temps :<input type="number" min="10" max="30" step="1" value="10" class="time" name="time" />Precision :<input type="number" min="10" max="299" step="1" value="10" name="num" id="num" size="20" class="time" />%<i class="material-icons" style="font-size:25px">search</i><input type="submit" name="button3" value="Lancer"></div>
</li>
</ol>
</div>
</form>
</body>
</html>