<table id="myTable" class="table table-bordered table-striped">
    <thead>
        <tr>
            <th><input type="checkbox" class="selectall">All</th>
            <th>Id</th>
            <th>Code</th>
            <th>Name</th>
            <th>Available From</th>
            <th>Available To</th>         
            <th>Created By</th>
            <th>Status</th>
            <th>Action</th>
        </tr>
    </thead>
    
    <tbody>
        <?php
        if ($packageListing) {
            $i = 1;
            foreach ($packageListing as $listing) {
                $userName = $this->mainMenu()->fetchUserName($listing['created_by']);
                $currency = $this->mainMenu()->fetchCurrencyCode($listing['currency']);
                ?>
        <tr>
            <td><input type="checkbox" class="check" rel="<?php echo $listing['id']; ?>"></td>
            <td><?php echo $i; ?></td>
            <td><?php echo $listing['code']; ?></td>
            <td><?php echo $listing['name']; ?></td>           
            <td><?php if($listing['available_start_date']!='000-00-00'){ echo date('Y-m-d',strtotime($listing['available_end_date']));} ?></td>           
            <td><?php if($listing['available_end_date']!='000-00-00'){ echo date('Y-m-d',strtotime($listing['available_end_date']));} ?></td>       
            <td><?php echo $userName; ?></td>
            <td>
                <div id="changestatus-<?php echo $listing['id']; ?>" status="<?php echo $listing['status']; ?>"  class="iconsize <?php echo ($listing['status'] == '1' ? 'aprovestatus' : 'unaprovestatus'); ?>" name="ChangeStatus" onclick="changeRecordStatus('<?php echo $listing['id']; ?>', 'hotel', 'change-record-status', '<?php echo $listing['status']; ?>')">
                </div>
                        </td>
            <td>
                <div class="hidden-sm hidden-xs action-buttons"> 
                    <a href="<?php echo $this->url('hotel', array('action' => 'terms-policy'), array('query' => array('id' => $listing['id']))); ?>" class="red pointer edit-form" title="Edit Hotel Details"> <i class="ace-icon fa fa-edit bigger-130"></i></a>  
                </div>
            </td>
        </tr>
        <?php $i++;
            }
        } else { ?>
            <tr></tr>                               
<?php } ?>
    </tbody>    
</table>