-
Notifications
You must be signed in to change notification settings - Fork 1
/
result_system.php
113 lines (92 loc) · 2.94 KB
/
result_system.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!-- this is the result screen -->
<!DOCTYPE html>
<html>
<head>
<title>DigiVet</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1> Outcome</h1>
<?php
include 'database.php';
include 'functions.php';
$col_decision = 'decision';
$table_general = 'variables_general';
$query = "SELECT notUrgent FROM $table_general";
$stmt = $con->prepare($query);
$stmt->execute();
$notUrgent = $stmt->fetchColumn();
//print $notUrgent;
$query = "SELECT urgent FROM $table_general";
$stmt = $con->prepare($query);
$stmt->execute();
$urgent = $stmt->fetchColumn();
//print $urgent;
if (($notUrgent >= 3 AND $urgent ==1)OR($urgent>1)){
$toVeterinarian_decision = 1;
update_parameter($toVeterinarian_decision, $col_decision, $table_general);
}
else {
$toVeterinarian_decision = 0;
update_parameter($toVeterinarian_decision, $col_decision, $table_general);
}
if ($toVeterinarian_decision == 1){
print "<p>It is recommended to visit a veterinarian.</p>";
echo '<p>To contact one: press blue for yes, or yellow for no.</p>';
echo '<form action="contact.php">';
echo '<button type="submit" id="vet_blue"></button>';
echo '</form>';
echo '<form method="get" action="final.php">';
echo '<button type="submit" id="vet_yellow"></button>';
echo '</form>';
echo'<script>
$(document).ready(function() {
var audioElement = document.createElement("audio");
audioElement.setAttribute("src", "sounds/visitVet.mp3");
audioElement.setAttribute("autoplay", "autoplay");
//audioElement.load()
$.get();
audioElement.addEventListener("load", function() {
audioElement.play();
}, true);
$(".play").click(function() {
audioElement.play();
});
$(".pause").click(function() {
audioElement.pause();
});
});
</script> ';
}
elseif ($toVeterinarian_decision == 0) {
print "<p>It is not recommended to visit a veterinarian</p>";
echo '<p>If you would still like to contact one, press blue for yes, or yellow for no?</p>';
echo '<form action="contact.php">';
echo '<button type="submit" id="vet_blue"></button>';
echo '</form>';
echo '<form action="final.php">';
echo '<button type="submit" id="vet_yellow"></button>';
echo '</form>';
echo'<script>
$(document).ready(function() {
var audioElement = document.createElement("audio");
audioElement.setAttribute("src", "sounds/notVisitVet.mp3");
audioElement.setAttribute("autoplay", "autoplay");
//audioElement.load()
$.get();
audioElement.addEventListener("load", function() {
audioElement.play();
}, true);
$(".play").click(function() {
audioElement.play();
});
$(".pause").click(function() {
audioElement.pause();
});
});
</script> ';
}
?>
</body>
</html>