Commit 75e4038d authored by Anatole Rakotoson's avatar Anatole Rakotoson
Browse files

sommom

parent e2adbcbe
......@@ -156,6 +156,8 @@ class DashboardAction extends CAction
$list = [];
$iconList = ["fa-map-o","fa-cogs", "fa-flag-o", "fa-flask", "fa-graduation-cap"];
$list += array(
"chiffresDoss" =>[
"title"=>"<i class='fa fa-2x fa-folder-open-o'></i><br/>ANALYSE DES REPONSES SUR L'OBSERVATOIRE DES CETACES ",
......@@ -178,7 +180,7 @@ class DashboardAction extends CAction
array_push($preData, ["data" => ${"sommomForm" . $i ."Count"}[$t], "name" => ${"sommomForm" . $i ."Label"}[$t], "icon" => "success", "type" => "danger"]);
}
$list += array( "sommomForm".$i => [
"title" => "<i class='fa fa-2x fa-folder-open-o'></i><br/>".$formName[$i - 1],
"title" => "<i class='fa fa-2x ".$iconList[$i -1]."'></i><br/>".$formName[$i - 1],
"blocksize"=>"4 col-xs-6",
"bgColor" => Ctenat::$COLORS[0],
"color" => "#fff",
......@@ -339,7 +341,8 @@ class DashboardAction extends CAction
$zoneDataRadar = $newData;
//Donee map
$ll = PHDB::findOne(Lists::COLLECTION, array('name' => 'cetaces'));
//zone
$localisationLabel = [];
$pointGPS = [];
......@@ -354,6 +357,8 @@ class DashboardAction extends CAction
$resid = [];
$migr = [];
$structureop = [];
$act = [];
......@@ -365,12 +370,15 @@ class DashboardAction extends CAction
for($i = 0; $i < count($localisationLabel); $i++){
$espece[$i] = [];
$port[$i] = [];
$port[$i] = "";
$pointGPS[$i] = "";
$statutEspece[$i] = [];
$frequenceObs[$i] = [];
$periodePresence[$i] = [];
$periodeObs[$i] = [];
$structureop[$i] = [];
$act[$i] = [];
}
for($i = 0; $i < count($localisationLabel); $i++){
......@@ -386,7 +394,19 @@ class DashboardAction extends CAction
foreach($sommomForm1Data[2] as $data){
if(isset($data["zoneObs"])) {
if($data["zoneObs"] == $localisationLabel[$i]) {
array_push($espece[$i], $data["especeRec"] );
foreach ($ll['list'] as $in => $inp) {
if(isset($inp["nomVernaculaire"])){
if($data["especeRec"] == $in){
array_push($espece[$i], $inp["nomVernaculaire"] );
break;
}
} else {
if($data["especeRec"] == $in){
array_push($espece[$i], $inp["nomValide"] );
break;
}
}
}
}
}
}
......@@ -394,57 +414,156 @@ class DashboardAction extends CAction
foreach($sommomForm2Data[0] as $data){
if(isset($data["port"])) {
foreach($data["port"] as $pt){
for($i = 0; $i < count($localisationLabel); $i++){
if($pt == $localisationLabel[$i]) {
$act[$i] = $data["intitule"];
}
}
if(is_array($data["port"])) {
foreach($data["port"] as $pt){
for($i = 0; $i < count($localisationLabel); $i++){
if($pt == $port[$i]) {
array_push($act[$i], $data["intituleact"]);
}
}
}
}
}
}
foreach($sommomForm3Data[0] as $data){
if(isset($data["portExp"])) {
if(is_array($data["portExp"])) {
foreach($data["portExp"] as $pt){
for($i = 0; $i < count($localisationLabel); $i++){
if($pt == $port[$i]) {
array_push($structureop[$i], $data["intitule"]);
}
}
}
}
}
}
//espece
$cetacesLabel = [];
$planConserv = [];
$l = PHDB::findOne(Lists::COLLECTION, array('name' => 'cetaces'));
$i=0;
$i = 0;
foreach ($l['list'] as $in => $inp) {
if(isset($inp["nomVernaculaire"])){
array_push($cetacesLabel, $inp["nomVernaculaire"]);
} else {
array_push($cetacesLabel, $inp["nomValide"]);
}
$i++;
}
// foreach ($l['list'] as $in => $inp) {
// if(isset($inp["nomVernaculaire"])){
// array_push($cetacesLabel, $inp["nomVernaculaire"]);
// } else {
// array_push($cetacesLabel, $inp["nomValide"]);
// }
// $i++;
// }
// for($i = 0; $i < count($cetacesLabel); $i++){
// $planConserv[$i] = [];
// $reglementationJ[$i] = [];
// }
// for($i = 0; $i < count($cetacesLabel); $i++){
// foreach($sommomForm1Data[2] as $data){
// if(isset($data["especeCible"])) {
// if(is_array($data["especeCible"])) {
// foreach($data["especeCible"] as $dataCib){
// if($dataCib == $cetacesLabel[$i]) {
// array_push($planConserv[$i], $data["plan"] );
// }
// }
// }
// }
// }
// }
// for($i = 0; $i < count($cetacesLabel); $i++){
// foreach($sommomForm2Data[1] as $data){
// if(isset($data["especeP"])) {
// if(is_array($data["especeP"])) {
// foreach($data["especeP"] as $dataCib){
// if($dataCib == $cetacesLabel[$i]) {
// array_push($reglementationJ[$i], $data["plan"] );
// }
// }
// }
// }
// }
// }
//acteur
$acteurLabel = [];
$mapActeur = [];
$formdedie = [];
$pgmsci = [];
$pgmrech = [];
$outilsPed = [];
$siteDedie = [];
$eventdedie = [];
$equipeDedie = [];
for($i = 0; $i < count($cetacesLabel); $i++){
$planConserv[$i] = [];
foreach($sommomForm2Data[0] as $data){
if(isset($data["intituleact"])) {
array_push($acteurLabel, $data["intituleact"]);
}
}
for($i = 0; $i < count($cetacesLabel); $i++){
foreach($sommomForm1Data[2] as $data){
if(isset($data["especeCible"])) {
foreach($data["especeCible"] as $dataCib){
if($dataa == $cetacesLabel[$i]) {
array_push($planConserv[$i], $data["plan"] );
}
for($i = 0; $i < count($acteurLabel); $i++){
$mapActeur[$i] = "";
$pgmrech[$i] = [];
$formdedie[$i] = [];
$pgmsci[$i] = [];
}
for($i = 0; $i < count($acteurLabel); $i++){
if(isset($sommomForm2Data[0][$i]["pointGPS"])) {
$mapActeur[$i] = $sommomForm2Data[0][$i]["pointGPS"];
}
}
foreach($sommomForm4Data[2] as $data){
if(isset($data["partenaire"])) {
if(is_array($data["partenaire"])) {
foreach($data["partenaire"] as $pt){
for($i = 0; $i < count($acteurLabel) ; $i++){
if($pt == $acteurLabel[$i]) {
array_push($pgmrech[$i], $data["intitule"]);
}
}
}
}
}
}
// for($i = 0; $i < count($cetacesLabel); $i++){
// var_dump($cetacesLabel[$i]);
// var_dump($planConserv[$i]);
// }
foreach($sommomForm5Data[0] as $data){
if(isset($data["partenaire"])) {
if(is_array($data["partenaire"])) {
foreach($data["partenaire"] as $pt){
for($i = 0; $i < count($acteurLabel) ; $i++){
if($pt == $acteurLabel[$i]) {
array_push($formdedie[$i], $data["intitule"]);
}
}
}
}
}
}
foreach($sommomForm4Data[0] as $data){
if(isset($data["partenaire"])) {
if(is_array($data["partenaire"])) {
foreach($data["partenaire"] as $pt){
for($i = 0; $i < count($acteurLabel) ; $i++){
if($pt == $acteurLabel[$i]) {
array_push($pgmsci[$i], $data["intitule"]);
}
}
}
}
}
}
$mapView = [$localisationLabel, $pointGPS, $port, $espece, $statutEspece, $frequenceObs, $periodePresence, $periodeObs, $obs, $resid, $migr, $act];
$mapviewAct = [$acteurLabel,$mapActeur,$formdedie, $pgmsci, $pgmrech];
$graph = [
// "dossier" =>[
......@@ -475,21 +594,21 @@ class DashboardAction extends CAction
"title"=>"fréquence de presence des cétaces par mois",
"data" => $monthPreData,
"lbls" => $monthLabel,
"url" => "/graph/co/dash/g/costum.views.custom.ctenat.graph.barMany"
"url" => "/graph/co/dash/g/graph.views.co.sommom.barMany"
],
"freqobs" =>[
"title"=>"fréquence d'observation des cétaces par mois",
"data" => $monthObsData,
"lbls" => $monthLabel,
"url" => "/graph/co/dash/g/costum.views.custom.ctenat.graph.barMany"
"url" => "/graph/co/dash/g/graph.views.co.sommom.barMany"
],
"typeparzone" =>[
"title"=>"type de cétacés par zone d'observation",
"data" => $zoneData,
"lbls" => $zoneLabel,
"url" => "/graph/co/dash/g/costum.views.custom.ctenat.graph.pieMany"
"url" => "/graph/co/dash/g/graph.views.co.sommom.pieMany"
],
"statut" =>[
"title"=>"statut des cétacés",
......@@ -544,7 +663,9 @@ class DashboardAction extends CAction
$params = [
"title" => $title,
"blocks" => $blocks
"blocks" => $blocks,
"mapView" => $mapView,
"mapviewAct" => $mapviewAct
];
if(Yii::app()->request->isAjaxRequest)
echo $controller->renderPartial($tpl,$params,true);
......
......@@ -727,8 +727,9 @@ function addAllZoneInMap(){
} else {
if($('#acteur').hasClass("activ-A")){
mapCO.clearMap();
mapCO.addElts(listEltMaps);
mapCO.addElts(listActeurMap);
mapCO.addElts(listEltMaps);
$('#zone').addClass("activ-Z");
} else {
mapCO.clearMap();
......@@ -751,8 +752,9 @@ function addAllActinMap(){
} else {
if($('#zone').hasClass("activ-Z")){
mapCO.clearMap();
mapCO.addElts(listActeurMap);
mapCO.addElts(listEltMaps);
mapCO.addElts(listActeurMap);
$('#acteur').addClass("activ-A");
} else {
mapCO.clearMap();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment