forked from ArthurNovaes/monop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
teste.php
118 lines (106 loc) · 3.87 KB
/
teste.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
114
115
116
117
118
<!DOCTYPE html>
<html lang="pt">
<head>
<meta charset="UTF-8">
<title>MonOP</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/custom.css">
<link rel="shortcut icon" href="img/icone.png">
<link rel="stylesheet" href="css/header.css">
</head>
<body>
<div class="container">
<?php include "header.html"; ?>
</div>
<?php include "dashboard.php";
$dashboard = new Dashboard();
$dashboard->init();
?>
</head>
<h1>MONITORAMENTO DE OBRAS PÚBLICAS</h1>
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="http://goo.gl/dfhw4E" alt="Chania" width="460" height="345">
</div>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<script type="text/javascript" src="js/jsapi.js"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Estagio', 'TotalObras'],
['Em Execução', <?php echo $dashboard->getTotalObrasStatusEmExecucao(); ?>],
['Em Obras', <?php echo $dashboard->getTotalObrasStatusEmObras(); ?>],
['Em contratação', <?php echo $dashboard->getTotalObrasStatusEmContratacao(); ?>],
['Em licitação de obra', <?php echo $dashboard->getTotalObrasStatusEmLicitacao(); ?>],
['Concluído', <?php echo $dashboard->getTotalObrasStatusConcluido();?>]
]);
var options = {
title: 'Porcentagem por Status',
backgroundColor: 'fff',
};
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
}
</script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
["Element", "Density", { role: "style" } ],
["Médio", <?php echo $dashboard->getMediaInvestimento(); ?>, "#b87333"],
["Maior", <?php echo $dashboard->getMaiorInvestimento(); ?>, "silver"],
["Menor", <?php echo $dashboard->getMenorInvestimento(); ?>, "gold"],
]);
var view = new google.visualization.DataView(data);
view.setColumns([0, 1,
{ calc: "stringify",
sourceColumn: 1,
type: "string",
role: "annotation" },
2]);
var options = {
title: "Investimento",
width: 600,
height: 300,
bar: {groupWidth: "95%"},
legend: { position: "none" },
};
var chart = new google.visualization.ColumnChart(document.getElementById("piechart2"));
chart.draw(view, options);
}
</script>
<div class="container">
<div class="row">
<div class="col-md-5">
<div id="piechart" style="width: 400px; height: 300px;"></div>
</div>
<div class="col-md-5">
<div id="piechart2"></div>
</div>
</div>
</div>
</div>
<?php include "footer.html"; ?>
<script src="js/bootstrap.min.js"></script>
</body>
</html>