<?php
$BreakfastItems = getBreakfastItems();
$breakfastMenus = $BreakfastItems['menus'];
$breakfastSelection = isset($BreakfastItems['selections']) ? $BreakfastItems['selections'] : array();
$lunchItems = getLunchItems();
$lunchMenus = $lunchItems['menus'];
$lunchSelections = isset($lunchItems['selections']) ? $lunchItems['selections'] : array();
$dinnerItems = getDinnerItems();
$dinnerMenus = $dinnerItems['menus'];
$dinnerSelections = isset($dinnerItems['selections']) ? $dinnerItems['selections'] : array();
?>
<?php if (!empty($breakfastMenus) || !empty($lunchMenus) || !empty($dinnerMenus)): ?>
    <section id="specialMeal">
        <div class="v-gap-20"></div>
        <div class="container text-center tab-content-items">
            <?php if (!empty($breakfastMenus)): ?>
                <input id="tab1" class="tab-input" checked="checked" type="radio" name="tabs">
                <label for="tab1" class="tab-input text-uppercase" >Breakfast</label>
            <?php endif; ?>
            <?php if (!empty($lunchMenus)): ?>    
                <input id="tab2" class="tab-input" type="radio" name="tabs">
                <label for="tab2" class="tab-input text-uppercase">Lunch</label>
            <?php endif; ?>
            <?php if (!empty($lunchMenus)): ?>    
                <input id="tab3" class="tab-input" type="radio" name="tabs">
                <label for="tab3" class="tab-input text-uppercase">Dinner</label>
            <?php endif; ?>
            <?php if (!empty($breakfastMenus)): ?>
                <div class="tab-content" id="breakfastSchedule">
                    <div class="row">
                        <?php foreach ($breakfastMenus as $bm): ?>
                            <?php if (!empty($breakfastSelection) && !empty($breakfastSelection[$bm->id])): ?>
                                <?php foreach ($breakfastSelection[$bm->id] as $bs): ?>
                                    <div class="col c6 block item-block">
                                        <div class="block-tab-content odd text-left">
                                            <div class="block-item-part-left">
                                                <div class="item-title"><?php echo $bs->title . '-' . $bm->title ?></div>
                                            </div>
                                            <div class="block-item-part-mid">
                                                <div>&nbsp;</div>
                                            </div>
                                            <div class="block-item-part-right"><span class="price"><?php echo getItemPrice($bs) ?></span>&nbsp;&nbsp;<a href="<?php echo site_url('online-order#categoryTab' . $bs->category . 'Content') ?>"><span class="btn-add-to-cart btn btn-sm btn-c">+</span></a></div>
                                            <div class="item-description"><?php echo trim($bs->content) ? $bs->content : '&nbsp;' ?></div>
                                        </div>
                                    </div>
                                <?php endforeach; ?>
                            <?php else: ?>
                                <div class="col c6 block item-block">
                                    <div class="block-tab-content odd text-left">
                                        <div class="block-item-part-left">
                                            <div class="item-title"><?php echo $bm->title ?></div>
                                        </div>
                                        <div class="block-item-part-mid">
                                           <div>&nbsp;</div>
                                        </div>
                                        <div class="block-item-part-right"><span class="price"><?php echo getItemPrice($bm) ?></span>&nbsp;&nbsp;<a href="<?php echo site_url('online-order#categoryTab' . $bm->category . 'Content') ?>"><span class="btn-add-to-cart btn btn-sm btn-c">+</span></a></div>
                                        <div class="item-description"><?php echo $bm->content ?></div>
                                    </div>
                                </div>
                            <?php endif; ?>
                        <?php endforeach; ?>
                    </div>
                </div>
            <?php endif; ?>
            <?php if (!empty($lunchMenus)): ?>    
                <div class="tab-content" id="lunchSchedule">
                    <div class="row">
                        <?php foreach ($lunchMenus as $bm): ?>
                            <?php if (!empty($lunchSelections) && !empty($lunchSelections[$bm->id])): ?>
                                <?php foreach ($lunchSelections[$bm->id] as $bs): ?>
                                    <div class="col c6 block item-block">
                                        <div class="block-tab-content odd text-left">
                                            <div class="block-item-part-left">
                                                <div class="item-title"><?php echo $bs->title . '-' . $bm->title ?></div>
                                            </div>
                                            <div class="block-item-part-mid">
                                              <div>&nbsp;</div>
                                            </div>
                                            <div class="block-item-part-right"><span class="price"><?php echo getItemPrice($bs) ?></span>&nbsp;&nbsp;<a href="<?php echo site_url('online-order#categoryTab' . $bs->category . 'Content') ?>"><span class="btn-add-to-cart btn btn-sm btn-c">+</span></a></div>
                                            <div class="item-description"><?php echo trim($bs->content) ? $bs->content : '&nbsp;' ?></div>
                                        </div>
                                    </div>
                                <?php endforeach; ?>
                            <?php else: ?>
                                <div class="col c6 block item-block">
                                    <div class="block-tab-content odd text-left">
                                        <div class="block-item-part-left">
                                            <div class="item-title"><?php echo $bm->title ?></div>
                                        </div>
                                        <div class="block-item-part-mid">
                                            <div>&nbsp;</div>
                                        </div>
                                        <div class="block-item-part-right"><span class="price"><?php echo getItemPrice($bm) ?></span>&nbsp;&nbsp;<a href="<?php echo site_url('online-order#categoryTab' . $bm->category . 'Content') ?>"><span class="btn-add-to-cart btn btn-sm btn-c">+</span></a></div>
                                        <div class="item-description"><?php echo $bm->content ?></div>
                                    </div>
                                </div>
                            <?php endif; ?>
                        <?php endforeach; ?>
                    </div>
                </div>
            <?php endif; ?>
            <?php if (!empty($dinnerMenus)): ?>    
                <div class="tab-content" id="dinnerSchedule">
                    <div class="row">
                        <?php foreach ($dinnerMenus as $bm): ?>
                            <?php if (!empty($dinnerSelections) && !empty($dinnerSelections[$bm->id])): ?>
                                <?php foreach ($dinnerSelections[$bm->id] as $bs): ?>
                                    <div class="col c6 block item-block">
                                        <div class="block-tab-content odd text-left">
                                            <div class="block-item-part-left">
                                                <div class="item-title"><?php echo $bs->title . '-' . $bm->title ?></div>
                                            </div>
                                            <div class="block-item-part-mid">
                                                <div>&nbsp;</div>
                                            </div>
                                            <div class="block-item-part-right"><span class="price"><?php echo getItemPrice($bs) ?></span>&nbsp;&nbsp;<a href="<?php echo site_url('online-order#categoryTab' . $bs->category . 'Content') ?>"><span class="btn-add-to-cart btn btn-sm btn-c">+</span></a></div>
                                            <div class="item-description"><?php echo trim($bs->content) ? $bs->content : '&nbsp;' ?></div>
                                        </div>
                                    </div>
                                <?php endforeach; ?>
                            <?php else: ?>
                                <div class="col c6 block item-block">
                                    <div class="block-tab-content odd text-left">
                                        <div class="block-item-part-left">
                                            <div class="item-title"><?php echo $bm->title ?></div>
                                        </div>
                                        <div class="block-item-part-mid">
                                            <div>&nbsp;</div>
                                        </div>
                                        <div class="block-item-part-right"><span class="price"><?php echo getItemPrice($bm) ?></span>&nbsp;&nbsp;<a href="<?php echo site_url('online-order#categoryTab' . $bm->category . 'Content') ?>"><span class="btn-add-to-cart btn btn-sm btn-c">+</span></a></div>
                                        <div class="item-description"><?php echo $bm->content ?></div>
                                    </div>
                                </div>
                            <?php endif; ?>
                        <?php endforeach; ?>
                    </div>
                </div>
            <?php endif; ?>
        </div>
        <div class="v-gap-40"></div>
    </section>
<?php endif; ?>