<?php //echo "<pre>"; print_r($packageListing); die;?>
<table id="myTable" class="table table-bordered table-striped">
    <thead>
        <tr>
            <th><input type="checkbox" class="selectall">All</th>
            <th>Id</th>
            <th>Name</th>
            <th>City</th>            
            <th>Vendor</th>
            <th>From Date</th>
            <th>To Date</th>
            <th>Opening Time</th>
            <th>Closing Time</th>
            <th>Estimated Time</th>
            <th>Age From</th>
            <th>Age To</th>
            <th>Transfer</th>
            <th>Pickup Point</th>
            <th>Allocation</th>
            <th>Cut Off Days</th>
            <th>Price Plan Name</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']);
                $vendorName = $this->mainMenu()->fetchUserName($listing['vendor_id']);
                ?>
        <tr>
            <td><input type="checkbox" class="check" rel="<?php echo $listing['s_detail_id']; ?>"></td>
            <td><?php echo $i; ?></td>            
            <td><label title="Click Here" rel='<?php echo $listing['s_detail_id']; ?>' class="activity_fare_clickme text-green pointer"><?php echo $listing['sightseeing_name']; ?></label></td>
            <td><?php echo $listing['city_name']; ?></td>
            <td><?php echo $vendorName; ?></td>
            <td><?php echo date('d-m-Y',strtotime($listing['from_date'])); ?></td>
            <td><?php echo date('d-m-Y',strtotime($listing['to_date'])); ?></td>
            <td><?php echo $listing['opening_time']; ?></td>
            <td><?php echo $listing['closing_time']; ?></td>
            <td><?php echo $listing['estimated_time']; ?></td>           
            <td><?php echo $listing['age_from']; ?></td>
            <td><?php echo $listing['age_to']; ?></td>
            <td><?php if($listing['transfer']==1){ echo "Yes";}else{ echo "No";} ?></td>
            <td><?php echo $listing['pickup_point']; ?></td>
            <td><?php echo $listing['allocation']; ?></td>
            <td><?php echo $listing['cut_off_days']; ?></td>
            <td><?php echo $listing['price_plan_name']; ?></td>           
            <td><?php echo $userName; ?></td>
            <td>
                <div id="changestatus-<?php echo $listing['s_detail_id']; ?>" status="<?php echo $listing['status']; ?>"  class="iconsize <?php echo ($listing['status'] == '1' ? 'aprovestatus' : 'unaprovestatus'); ?>" name="ChangeStatus" onclick="changeRecordStatus('<?php echo $listing['s_detail_id']; ?>', 'sightseeing', 'change-rate-record-status', '<?php echo $listing['status']; ?>')">
                </div>
                        </td>
            <td>
                <div class="hidden-sm hidden-xs action-buttons"> 
                    <a href="<?php echo $this->url('sightseeing', array('action' => 'edit-rate'), array('query' => array('id' => $listing['s_detail_id']))); ?>" class="red pointer edit-form" title="Edit Sightseeing Details"> <i class="ace-icon fa fa-edit bigger-130"></i> 
                    </a>  
                    <a class="red" href="#" title="Scheduler Detail" > <i class="ace-icon fa fa-calendar bigger-130"></i></a>
                    <a class="red" href="<?php echo $this->url('sightseeing', array('action' => 'delete-sightseeing-rate-details'), array('query' => array('data' => $listing['s_detail_id']))); ?>" title="Delete"> <i class="ace-icon fa fa-trash-o bigger-130"></i> </a>
                </div>
            </td>
        </tr>
        <?php $i++;
            }
        } else { ?>
            <tr></tr>                               
<?php } ?>
    </tbody>    
</table>