-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathreview.php
More file actions
50 lines (44 loc) · 908 Bytes
/
review.php
File metadata and controls
50 lines (44 loc) · 908 Bytes
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
<!DOCTYPE html>
<html>
<style>
#myProgress {
width: 100%;
background-color: red;
}
#myBar {
width: 1%;
height: 30px;
background-color: #4CAF50;
}
</style>
<body onload="move()">
<?php
$val = $_GET['comp'];
$result=json_decode(exec('python load_review.py '.$val),true);
#echo $result[2];
echo "<b><h2>Reviews</h2></b>";
foreach($result as &$value)
{
$by = 'A User';
list($id,$cid,$rid,$uid,$expert,$text)=explode("#",$value);
if ($rid == '1')
{
$by = 'A market expert';
}
echo "<br>$text<br><br>By: $by<br><hr><br><br>";
}
$result= exec('python sentiment.py '. $val);
echo "<br><br><br>The Trust level is : " . $result. "%";
?>
<div id="myProgress">
<div id="myBar"></div>
</div>
<script>
function move() {
var elem = document.getElementById("myBar");
var width = <?php echo $result?>;
elem.style.width = width + '%';
}
</script>
</body>
</html>