Where's my mistake?

3 posts by 2 authors in: Forums > CMS Builder
Last Post: May 6, 2013   (RSS)

By Toledoh - May 6, 2013

This is bugging me... why is it breaking the table after 2 rows?

http://www.perisherxcountry.org/pages.php?LOCAL-EVENT-CALENDAR-29

<?php foreach ($eventsRecords as $record): ?>

<?php //** DEFINE $DATE AS NEW VARIABLE FOR DATE IN RECORD: ?>
    <?php $date = date("F Y", strtotime($record['date'])); ?>

<?php //** DISPLAY DATE IF DIFFERENT FROM LAST DATE ?>

    <?php if (@$lastDate != $date): ?>
    
    <div class="calendar">
    <h2><?php echo $date ?></h2>
        <table>
            <thead>
                <tr>
                    <th>Date</th>
                    <th>Event</th>
                    <th>Contact</th>
                    <th>Entry</th>
                </tr>
            </thead>
            <tbody>
    
    <?php endif ?>

<?php //** SHOW WHAT EVER OTHER CONTENT I WANT FROM RECORDS ?>
            <tr>
                <td><?php echo date("D F", strtotime($record['date'])) ?><br /><?php echo date("g:i a", strtotime($record['date'])) ?></td>
                <td><?php echo htmlencode($record['event']) ?><br />
                Meet: <?php echo htmlencode($record['meeting_place']) ?></td>
                <td><?php echo htmlencode($record['contact_name']) ?><br />Ph: <?php echo htmlencode($record['contact_phone']) ?></td>
                <td>
                
                
                <?php if ($record['online_entry']): ?>
                    <a href="<?php echo htmlencode($record['online_entry']) ?>" target="_blank">Online &raquo;</a><br/>
                <?php endif ?>
                
                <?php if ($record['pdf_form']): ?>
                    <?php foreach ($record['pdf_form'] as $index => $upload): ?>
                    <a href="<?php echo $upload['urlPath'] ?>">Download &raquo;</a><br />
                    <?php endforeach ?>
                <?php endif ?>
                
                <?php if ($record['enter_on_the_day']): ?>On the day<?php endif ?>
                </td>
            </tr>

<?php //** END $LASTDATE VARIABLE ?>

<?php if (@$lastDate == $date): ?>
            </tbody>
        </table>
    </div>
<?php endif ?>


<?php //** SET $LASTDATE VARIABLE ?>
<?php $lastDate = $date; ?>

<?php endforeach; ?>
            </tbody>
        </table>
    </div>

Cheers,

Tim (toledoh.com.au)

By Toledoh - May 6, 2013

So clear after you point it out.  Thanks Jason!

Cheers,

Tim (toledoh.com.au)