<div id="story" class="light-wrapper customer-wrapper">
    <div class="container-fluid inner-customer-dashboard ">
        <div class="col-md-3">
            <?php echo $this->load->view('customer/site_nav') ?>
        </div>
        <div class="col-md-9">
            <h3 class="text-center">Address List</h3>
            <table class="table table-responsive">
                <tbody>
                    <tr class="even">
                        <th class="bdr-bottom bdr-right">Name</th>
                        <th class="bdr-bottom bdr-right">Address</th>
                    </tr>
                    <tr class="odd">
                        <td class="bdr-bottom bdr-right">Primary</td>
                        <?php
                        $primaary_address = $primary[0]->street . ', ' . $primary[0]->city . ', ' . $primary[0]->postcode;
                        $primaary_address .= $primary[0]->country != null ? ', ' . $primary[0]->country : '';
                        ?>
                        <td class="bdr-bottom bdr-right"><?php echo $primaary_address ?></td>

                    </tr>
                    <?php if (!empty($secondary)): ?>
                        <?php $index = 2; ?>
                        <?php foreach ($secondary as $sndAdd): ?>
                            <tr class="<?php $index % 2 == 0 ? print'even' : print'odd' ?>">
                                <?php
                                $sndAddString = null;
                                $sndAddString = $sndAdd->house != null ? 'House-' . $sndAdd->house : '';
                                $sndAddString.= $sndAdd->floor_or_apt != null ? ', Floor/Apt-' . $sndAdd->floor_or_apt : '';
                                $sndAddString.= $sndAdd->building != null ? ', Building-' . $sndAdd->building : '';
                                $sndAddString.=', ' . $sndAdd->street;
                                $sndAddString.=', ' . $sndAdd->city;
                                $sndAddString.=', ' . $sndAdd->postcode;
                                $sndAddString.=$sndAdd->state != null ? ', ' . $sndAdd->state : '';
                                $sndAddString.=$sndAdd->country != null ? ', ' . $sndAdd->country : '';
                                ?>
                                <td class="bdr-bottom bdr-right"><?php echo $sndAdd->postcode ?></td>
                                <td class="bdr-bottom bdr-right"><?php echo $sndAddString ?></td>
                            </tr>
                            <?php $index++; ?>
                        <?php endforeach; ?>
                    <?php endif; ?>

                </tbody>
            </table>
        </div>
    </div>
</div>
