<?php $status_color = array('color:#FF9900;', 'color:#219921;', 'color:#D52229;') ?>
<fieldset style="margin-top:0px; margin-bottom: 0px; padding-bottom: 0px; border-radius: 0px 0px 10px 10px">
    <div class="row report-row">
        <div id="entireReport">
            <table class="table table-responsive table-bordered" id="reportTableContent">
                <tr class="table-bg-color">
                    <th class="text-center text-capitalize">Name</th>
                    <th class="text-center text-capitalize">Phone</th>
                    <th class="text-center text-capitalize">Email</th>
                    <th class="text-center text-capitalize">Request On</th>
                    <th class="text-center text-capitalize">Booking For</th>
                    <th class="text-center text-capitalize">Guest</th>
                    <th class="text-center text-capitalize">Time</th>
                    <th class="text-center text-capitalize">msg&del</th>
                    <th class="text-center text-capitalize">update</th>

                </tr>
                <?php if (!empty($list)): ?>
                    <?php foreach ($list as $entity): ?>
                        <tr class="table-bg-color-white">
                            <td class="text-center text-capitalize"><?php echo $entity->first_name . ' ' . $entity->last_name ?></td>
                            <td class="text-center text-capitalize"><?php echo $entity->res_phone ?></td>
                            <td class="text-center text-capitalize"><?php echo $entity->res_email ?></td>
                            <td class="text-center text-capitalize"><?php echo date($this->config->item('dateformat'), strtotime($entity->created_at)) ?></td>
                            <td class="text-center text-capitalize"><?php echo date($this->config->item('dateformat'), strtotime($entity->res_date)) ?></td>
                            <td class="text-center text-capitalize"><?php echo $entity->guest_number ?></td>
                            <td class="text-center text-capitalize"><?php echo $entity->time_from ?></td>
                            <td class="text-center"><a href="javascript:void(0)" onclick="openMessage('<?php echo $entity->id ?>')"><i class="fa fa-envelope-square fa-2x" style='color: #000000'></i></a> &nbsp;&nbsp;<i class="fa fa-2x">|</i>&nbsp;&nbsp;<a href="javascript:void()" onclick="deleteReservation('<?php echo $entity->id ?>', '<?php echo $segment ?>')"><i class="fa fa-close fa-2x" style='color: #FF0000'></i></a></td>
                            <td class="text-center text-capitalize">
                                <select id="updateBookingStatus_<?php echo $entity->id ?>" class="form-control" style="height: 30px; padding: 2px; <?php echo $status_color[$entity->status] ?>" onchange="updateBookingStatus('<?php echo $entity->id ?>', '<?php echo $segment ?>')">
                                    <option value="1" <?php $entity->status == 1 ? print 'selected="true"' : print'' ?>>Confirmed</option>
                                    <option value="2" <?php $entity->status == 2 ? print 'selected="true"' : print'' ?>>Cancelled</option>
                                    <option value="0" <?php $entity->status == 0 ? print 'selected="true"' : print'' ?>>Pending</option>
                                </select>
                            </td>
                        </tr>
                        <tr style='display: none;' id='reservationMessage_<?php echo $entity->id ?>' class="table-bg-color-white">
                            <td colspan="9"><?php $entity->res_message != null ? print $entity->res_message : 'no message' ?></td>
                        </tr>
                    <?php endforeach; ?>

                    <?php if (!empty($list) && $maxCounter > 1): ?>
                        <tr>
                            <td colspan="9">
                                <div class="table-bg-color">
                                    <?php if (isset($maxCounter) && $maxCounter > 1): ?>
                                        <div class="main-arrowbg text-center pull-left">
                                            <ul class="pagination">
                                                <?php for ($i = 0; $i < $maxCounter; $i++): ?>
                                                    <li <?php $segment == $i ? print'class="active"' : '' ?>><a href="javascript:void(0)" onclick="paginateReport('<?php echo $i?>')" style="padding: 5px 10px !important"><?php echo $i + 1; ?></a></li>
                                                <?php endfor; ?>
                                            </ul>
                                        </div>
                                    <?php endif ?>
                                </div>
                            </td>
                        </tr>
                    <?php endif; ?>
                <?php else: ?>
                    <tr class="table-bg-color-white">
                        <td colspan="9">No Booking available</td>
                    </tr>
                <?php endif; ?>
            </table>

            <div class="pages-height">&nbsp;</div>
        </div>
    </div>
</fieldset>
