-
Notifications
You must be signed in to change notification settings - Fork 0
/
add.php
62 lines (48 loc) · 1.67 KB
/
add.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
<!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><p>PORTABLE ECG MONITORING</p></center>
</div>
<?php
include('connexion.php');
include('Net/SSH2.php');
$id=$_GET["id"];
$nom=$_GET["nom"];
$prenom=$_GET["prenom"];
echo "<p style='color:white;'>ID = " . $id . "</p>";
echo "<p style='color:white;'> Nom = " . $nom . "</p>";
echo "<p style='color:white;'> Prenom = " . $prenom . "</p>";
if(isset($_POST['button1'])) {
$ssh = new Net_SSH2('127.0.0.1');
if (!$ssh->login('pi', '123456789')) {
exit('Login Failed');
}
$t=$_POST["time"];
$ssh->exec('cd /var/www/html && ./python.sh '.$t);
$out = $ssh->exec('cd /var/www/html && ./traitment.sh');
$out2 = substr($out,4);
echo $out2;
$sql2 = "INSERT INTO dataset (ID, dataset) VALUES ('$id', '$out2')";
if($result2 = $db->query($sql2) === TRUE){
echo "<p style='color:white;'>Enregistrer </p><br>";
} else {
echo "<p style='color:white;'>Error enregistrement </p><br>" . $db->error; }
}
?>
<form method="post">
<div class="box">
<ol class="odd center">
<li class="hex">
<div class="hex-content"><center>Enregistrer <br>Temps :<input type="number" min="10" max="30" step="1" value="10" class="time" name="time" /><center><i class="material-icons" style="font-size:36px">cloud_upload</i></center><input type="submit" name="button1" value="Button1" ></center></div>
</li>
</ol>
</div>
</form>
</body>
</html>