Skip to content

Commit

Permalink
(CS) Fix absence displaying on start page
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrauen committed Jul 1, 2015
1 parent 688640a commit d50c281
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system/churchservice/churchservice.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ function churchservice_getAbsents($year = null) {
FROM {cdb_person} p, {cs_absent} a, {cs_absent_reason} ar
WHERE a.absent_reason_id=ar.id AND p.id=a.person_id
AND p.id in (" . db_implode($allPersonIds) . ") ";
if ($year == null) $sql .= "AND DATEDIFF(a.enddate,NOW())>=-1 AND DATEDIFF(a.enddate,NOW())<=31";
if ($year == null) $sql .= "AND DATEDIFF(a.startdate,NOW())>=-1 AND DATEDIFF(a.startdate,NOW())<=31";
else $sql .= "AND (DATE_FORMAT(a.startdate, '%Y')=$year OR DATE_FORMAT(a.enddate, '%Y')=$year)";
$sql .= "
ORDER BY a.startdate";
Expand Down

0 comments on commit d50c281

Please sign in to comment.