Skip to content

Commit

Permalink
Correcoes gerais
Browse files Browse the repository at this point in the history
  • Loading branch information
Lcunha committed Oct 15, 2013
1 parent ea59338 commit e47706d
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .settings/org.eclipse.core.resources.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding//view/header.php=UTF-8
4 changes: 2 additions & 2 deletions controller/CategoriaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class CategoriaController{
public function __construct(){
$this->categoriaDAO = new CategoriaDAO();
}
public function _listarTodos(){
return $this->categoriaDAO->listarTodos();
public function _listarTodas(){
return $this->categoriaDAO->listarTodas();
}
public function _listarTodasAlfabicamente(){
return $this->categoriaDAO->listarTodasAlfabicamente();
Expand Down
13 changes: 13 additions & 0 deletions controller/CrimeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,17 @@ public function _inserirCrimeArrayParse($arrayCrime){
next($arrayKey);
}
}
public function _retornarDadosDeSomaFormatado(){
$tempoDAO = new TempoDAO();
$dadosTempo = new Tempo();
$arrayDadosTempo = $tempoDAO->listarTodos();
for($i=0; $i<count($arrayDadosTempo);$i++){
$dadosTempo = $arrayDadosTempo[$i];
$dados[$i] = $dadosTempo->__getIntervalo();
}
for($i=0;$i<count($dados);$i++){
$dadosCrime[$i]= $this->_somaDeCrimePorAno($dados[$i]);
}
return "data : [$dadosCrime[0],$dadosCrime[1],$dadosCrime[2],$dadosCrime[3],$dadosCrime[4],$dadosCrime[5],$dadosCrime[6],$dadosCrime[7],$dadosCrime[8],$dadosCrime[9],$dadosCrime[10]]";
}
}
4 changes: 2 additions & 2 deletions controller/NaturezaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class NaturezaController{
public function __construct(){
$this->naturezaDAO = new NaturezaDAO();
}
public function _listarTodos(){
return $this->naturezaDAO->listarTodos();
public function _listarTodas(){
return $this->naturezaDAO->listarTodas();
}
public function _listarTodasAlfabicamente(){
return $this->naturezaDAO->listarTodasAlfabicamente();
Expand Down
9 changes: 9 additions & 0 deletions controller/TempoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,13 @@ public function _inserirTempoArrayParse($arrayTempo){
$this->tempoDAO->inserirTempo($dadosTempo);
}
}
public function _retornarDadosFormatados(){
$dadosTempo = new Tempo();
$arrayDadosTempo = $this->_listarTodos();
for($i=0; $i<count($arrayDadosTempo);$i++){
$dadosTempo = $arrayDadosTempo[$i];
$dados[$i] = $dadosTempo->__getIntervalo();
}
return "labels : [\"$dados[0]\",\"$dados[1]\",\"$dados[2]\",\"$dados[3]\",\"$dados[4]\",\"$dados[5]\",\"$dados[6]\",\"$dados[7]\",\"$dados[8]\",\"$dados[9]\",\"$dados[10]\"]";
}
}
19 changes: 14 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@

<?php include './view/header.php'; ?>
<?php include './view/viewController.php'?>
<?php include './view/navigation.php'; ?>
<?php include './view/footer.php'; ?>
<?php
//include './view/header.php';
//include './view/viewController.php';
//include './view/navigation.php';
//include './view/footer.php';
include './controller/CrimeController.php';
include './controller/NaturezaController.php';
include './controller/TempoController.php';
include_once './model/Tempo.php';
$crimeCO = new CrimeController();
$crimeCO = new CrimeController();
$tempoCO = new TempoController();
echo $crimeCO->_retornarDadosDeSomaFormatado();
?>
8 changes: 8 additions & 0 deletions views/CategoriaView.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
include_once('./controller/CategoriaView.php');
class CategoriaView{
private $categoriaCO;
public function __construct(){
$this->categoriaCO = new CategoriaController();
}
}
8 changes: 8 additions & 0 deletions views/CrimeView.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
include_once('./controller/CrimeView.php');
class CrimeView{
private $crimeCO;
public function __construct(){
$this->crimeCO = new CrimeController();
}
}
8 changes: 8 additions & 0 deletions views/NaturezaView.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
include_once('./controller/NaturezaView.php');
class NaturezaView{
private $naturezaCO;
public function __construct(){
$this->naturezaCO = new NaturezaController();
}
}
8 changes: 8 additions & 0 deletions views/TempoView.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
include_once('./controller/TempoView.php');
class TempoView{
private $tempoCO;
public function __construct(){
$this->tempoCO = new TempoController();
}
}

0 comments on commit e47706d

Please sign in to comment.