HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/zuiderbos.komma.pro/app/storage/views/e5a918114b89ffdf8664e9780bb729a2
<div class="calenderOverview">

    <?php /* Define current month and year for checks*/ ?>
<?php   $month = \Carbon\Carbon::today()->month;
$year = \Carbon\Carbon::today()->year; ?>

<?php foreach($page->school
    ->calenderItems()
    ->with('translation')
    ->orderBy('calender.start_date', 'asc')
    ->where('active', 1)
    ->where('calender.date', '>=', \Carbon\Carbon::today())
    ->get() as $key => $calenderItem
): ?>

        <?php /* Check if the calender item isn't in the current defined month*/ ?>
    <?php if($calenderItem->getStartDate()->month != $month): ?>

        <?php /* Set current month to the month of the calender item */ ?>
        <?php $month = $calenderItem->getStartDate()->month; ?>

        <?php /* Same check for year */ ?>
        <?php if($calenderItem->getDate()->year != $year): ?>
            <?php $year = $calenderItem->getDate()->year; ?>
            <h3><?php echo $year; ?></h3>
        <?php endif; ?>

        <?php /* Show new month name */ ?>
        <h4><?php echo ucfirst(trans('calender.months.'.$month)); ?></h4>

    <?php endif; ?>

    <?php /* Calender item info */ ?>
    <article>
        <div class="date">
            <?php echo $calenderItem->getStartDate()->format('d'); ?>

            <sub><?php echo $calenderItem->getStartDate()->format('m'); ?></sub>
        </div>
        <p>
            <span><?php echo ucfirst(trans('calender.days.'.$calenderItem->getStartDate()->dayOfWeek)); ?> <?php echo $calenderItem->getStartDate()->format('j'); ?> <?php echo \Illuminate\Support\Facades\Lang::get('calender.months.'.$calenderItem->getStartDate()->format('n')); ?></span>
            <?php echo $calenderItem->translation->name; ?>

        </p>

    </article>

<?php endforeach; ?>
</div>