-
Notifications
You must be signed in to change notification settings - Fork 1
/
analysis.php
93 lines (73 loc) · 3.45 KB
/
analysis.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
<?php session_start(); ?>
<?php error_reporting(0) ?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Know Your Leader</title>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</head>
<body>
<?php include "includes/backend.php" ?>
<script type="text/javascript">
var sum_negative = <?php echo $sum_negative; ?>;
sum_negative = parseFloat(sum_negative);
var sum_positive = <?php echo $sum_positive; ?>;
sum_positive = parseFloat(sum_positive);
var sum_neutral = <?php echo $sum_neutral; ?>;
sum_neutral = parseFloat(sum_neutral);
// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Opinion');
data.addColumn('number', 'value');
data.addRows([
['Favour', sum_positive],
['DisFavour', sum_negative],
['Neutral', sum_neutral]
]);
// Set chart options
var options = {'title':'How People Rate',
'width':400,
'height':300};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
<div class="header">
<div class="header_top">
<div class="social">
<a href="#"><button class="btn btn-small btn-warning" style="margin-top: 2px;">Login</button></a>
<a href="https://www.facebook.com/dosw.iitr?fref=ts" target="_blank"><img src="images/google.png" width="30px" height="25px" style="margin-top: 2px;" /></a>
</div>
</div>
<div class="header_content">
<div class="logo">
<img src="images/leader.jpg" width="150px" height="150px" style="margin-top:15px;" />
</div>
<div class="title">
<h1><?php echo $_SESSION['name']; ?></h1>
</div>
</div>
</div>
<div class="body">
<div class="body_content">
<div id="chart_div" style="background-color:#FFF; width:400px; height:300px; margin-top:10px; margin-left: 10px;"></div>
<div id="twitter_feed" style="background-color:#FFF; width:300px; height:300px; margin-top:10px;float:right">
<a class="twitter-timeline" width="300px" height="300px" href="https://twitter.com/desirecool219/politicians" data-widget-id="391828279025344512">Recent Tweets</a>
</div>
</div>
</div>
<?php include "includes/footer.php" ?>
</body>
</html>