Val
This commit is contained in:
parent
c5a04e6f6a
commit
94e467a300
|
|
@ -45,24 +45,21 @@ class ControleurAccueil extends Controleur {
|
||||||
$claims = $this->synthese->getClaims();
|
$claims = $this->synthese->getClaims();
|
||||||
|
|
||||||
$claimsLabels = array();
|
$claimsLabels = array();
|
||||||
$claimsLabelsEng = array();
|
|
||||||
$claimsValues = array();
|
$claimsValues = array();
|
||||||
|
|
||||||
$tabclaims = [
|
$tabclaims = [
|
||||||
'claimsLabels' => [],
|
'claimsLabels' => [],
|
||||||
'claimsLabelsEng' => [],
|
|
||||||
'claimsValues' => []
|
'claimsValues' => []
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($claims as $v) {
|
foreach ($claims as $v) {
|
||||||
$tabclaims['claimsLabels'][] = $v['claimsLabels'];
|
$tabclaims['claimsLabels'][] = $v['claimsLabels'];
|
||||||
$tabclaims['claimsLabelsEng'][] = $v['claimsLabelsEng'];
|
|
||||||
$tabclaims['claimsValues'][] = $v['claimsValues'];
|
$tabclaims['claimsValues'][] = $v['claimsValues'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$dataTabClaims = json_encode($tabclaims,JSON_NUMERIC_CHECK);
|
$dataTabClaims = json_encode($tabclaims,JSON_NUMERIC_CHECK);
|
||||||
|
|
||||||
var_dump($dataTabClaims); exit();
|
//var_dump($dataTabClaims); exit();
|
||||||
|
|
||||||
|
|
||||||
$claimsLabels = [
|
$claimsLabels = [
|
||||||
|
|
@ -115,7 +112,9 @@ class ControleurAccueil extends Controleur {
|
||||||
'months' => $months,
|
'months' => $months,
|
||||||
'monthlyCotisations' => $monthlyCotisations,
|
'monthlyCotisations' => $monthlyCotisations,
|
||||||
'lossRatioLabels' => $lossRatioLabels,
|
'lossRatioLabels' => $lossRatioLabels,
|
||||||
'lossRatioValues' => $lossRatioValues
|
'lossRatioValues' => $lossRatioValues,
|
||||||
|
|
||||||
|
'dataTabClaims' => $dataTabClaims
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,13 @@ class Synthese extends Modele {
|
||||||
{
|
{
|
||||||
$idClient = $_SESSION['idClient_C'];
|
$idClient = $_SESSION['idClient_C'];
|
||||||
|
|
||||||
$sql = 'call sp_c_dashboard_claims_by_client(?)';
|
if (est_anglophone())
|
||||||
|
{
|
||||||
|
$sql = 'call sp_c_dashboard_claims_by_client_eng(?)';
|
||||||
|
}else{
|
||||||
|
$sql = 'call sp_c_dashboard_claims_by_client(?)';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$resultat = $this->executerRequete($sql, array($idClient));
|
$resultat = $this->executerRequete($sql, array($idClient));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,12 +96,13 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Répartition des sinistres
|
// Répartition des sinistres
|
||||||
|
const dataClaims = <?= $dataTabClaims ?>;
|
||||||
new Chart(document.getElementById('claimsPie'), {
|
new Chart(document.getElementById('claimsPie'), {
|
||||||
type: 'doughnut',
|
type: 'doughnut',
|
||||||
data: {
|
data: {
|
||||||
labels: <?= json_encode($claimsLabels) ?>,
|
labels: dataClaims.claimsLabels,
|
||||||
datasets: [{
|
datasets: [{
|
||||||
data: <?= json_encode($claimsValues) ?>
|
data: dataClaims.claimsValues
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user