Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Σταύρος Παπαδάκης
e-epal
Commits
70e9508f
Commit
70e9508f
authored
Jun 26, 2017
by
Χάρης Παπαδόπουλος
Browse files
Merge branch 'report-fix' into 'develop'
Fix total numbers See merge request !215
parents
07184b44
a2328a8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
drupal/modules/epal/src/Controller/ReportsCreator.php
View file @
70e9508f
...
...
@@ -363,7 +363,9 @@ class ReportsCreator extends ControllerBase
}
//χωρητικότητα για όλο το σχολείο
$capacityTotal
=
array_sum
(
$capacity
);
$capacityTotal
=
array_reduce
(
$capacity
,
function
(
$sum
,
$v
)
{
return
$sum
+=
(
$v
>
0
)
?
intval
(
$v
)
:
0
;
},
0
);
//βρες αριθμό μαθητών γισ κάθε τάξη
$num
=
array
();
...
...
@@ -379,11 +381,13 @@ class ReportsCreator extends ControllerBase
//βρες ποσοστά συμπλήρωσης
if
(
isset
(
$capacity
[
$classId
-
1
])
&&
$capacity
[
$classId
-
1
]
>
0
)
{
$perc_str
=
number_format
(
$num
[
$classId
-
1
]
/
$capacity
[
$classId
-
1
]
*
100
,
2
);
}
elseif
(
isset
(
$capacity
[
$classId
-
1
])
&&
$capacity
[
$classId
-
1
]
==
-
1
)
{
$perc_str
=
'-'
;
}
else
{
$perc_str
=
'-'
;
$stat_complete
=
false
;
}
array_push
(
$perc
,
$perc_str
);
array_push
(
$perc
,
$perc_str
);
}
if
(
$stat_complete
===
true
&&
$capacityTotal
>
0
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment