-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathold_chart.php
62 lines (49 loc) · 1.86 KB
/
old_chart.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
<div class="row">
<div class="col-sm-1">
<div id="visualization" style="width: 500px; height: 400px;"></div>
<?php
//include database connection
include 'config.php';
//query all records from the database
$query = "select * from total_lead";
//execute the query
$result = mysqli_query($con,$query );
//get number of rows returned
$num_results = $result->num_rows;
if( $num_results > 0){
?>
<!-- load api -->
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
//load package
google.load('visualization', '1', {packages: ['corechart']});
</script>
<script type="text/javascript">
/* function drawVisualization() {
// Create and populate the data table.
var data = google.visualization.arrayToDataTable([
['PL', 'Ratings'],
<?php
while( $row = $result->fetch_assoc() ){
extract($row);
echo "['{$lead_month}', {$total_lead}],";
}
?>
]);
// Create and draw the visualization.
new google.visualization.PieChart(document.getElementById('visualization')).
draw(data, {title:"Genrate Leads in 2016 Per Months."});
}
google.setOnLoadCallback(drawVisualization); */
</script>
<?php
}else{
echo "No programming languages found in the database.";
}
?>
</div>
<div class="col-sm-7">
<!--Div that will hold the pie chart-->
<div id="chart_div"></div>
</div>
</div>