<table id="myTable" class="table table-bordered table-striped">
    <thead>
        <tr>
            <th><input type="checkbox" class="selectall">All</th>
            <th>Id</th>
            <th>Hotel</th>
            <th>Room</th>
            <th>Rate Type</th>
            <th>Rate Name</th>
            <th>Package Type</th>
            <th>Currency</th>
            <th>Vendor Type</th>
            <th>Vendor Name</th>            
            <th>Season</th>
            <th>Valid From</th>
            <th>Valid 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']);
                $data = ['auto_id'=>$listing['rate_type_id']];
                $ratePackage = $this->mainMenu()->fetchRoomRatePackage($data);
                ?>
        <tr>
            <td><input type="checkbox" class="check" rel="<?php echo $listing['id']; ?>"></td>
            <td><?php echo $i; ?></td>
            <td><?php echo $listing['hotel_name']; ?></td>
            <td>
                <label title="Click Here" rel='<?php echo $listing['id']; ?>' class="room_rate_commission_clickme text-green pointer">
                    <?php echo $listing['room_name']; ?>
                </label>
            </td>
            <td><?php echo $listing['rate_type']; ?></td>
            <td><?php echo $listing['rate_name']; ?> </td>
            <td><?php echo $ratePackage['name']; ?> </td>
            <td><?php echo $listing['currency']; ?></td>
            <td><?php echo $listing['vendor_type_name']; ?> </td>
            <td><?php echo $listing['vendor_name']; ?> </td>            
            <td><?php echo $listing['hotel_season_name']; ?> </td>
            <td><?php echo date('Y-m-d',strtotime($listing['valid_from'])); ?> </td>
            <td><?php echo date('Y-m-d',strtotime($listing['valid_to'])); ?> </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-room-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' => 'edit-room-rate'), ['query' => ['id' => $listing['id'],'rate_type'=>$listing['rate_type_id']]]); ?>" class="red pointer edit-form" title="Edit Hotel Details"> <i class="ace-icon fa fa-edit bigger-130"></i></a>  
                    <a class="red" href="<?php echo $this->url('hotel', array('action' => 'delete-hotel-room-details'), array('query' => array('data' => $listing['id']))); ?>" title="Delete"> <i class="ace-icon fa fa-trash-o bigger-130"></i> </a>
                </div>
            </td>
        </tr>
        <?php $i++;
            }
        } else { ?>
        <tr><td colspan="14" style="text-align: center;">No Record Found</td></tr>                               
<?php } ?>
    </tbody>    
</table>