<ul class="breadcrumb">
    <li><a href="<?= site_url('admin/dashboard') ?>">Home</a></li>
    <li class="active"><?php echo  $breadcum ?></li> 
</ul>
<div class="page-content-wrap">                
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default">
                <?php if ($this->session->flashdata('OnlineCategorySuccess')) { ?>  
                    <div class="alert alert-success"> <?= $this->session->flashdata('OnlineCategorySuccess') ?></div>
                <?php } ?>
                <div class="panel-heading">
                    <h3 class="panel-title"><?php echo $breadcum; ?></h3>
                    <ul class="panel-controls" style="margin-top: 2px;">                                     
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="fa fa-cog"></span></a>                                        
                            <ul class="dropdown-menu">
                                <li>
                                   <a href="<?= base_url() ?>admin/online-category-add"><span class="fa fa-plus-square"></span>Add New</a>
                                </li>                        
                            </ul>                                        
                    </li>                                        
                    </ul>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <table class="table datatable">
                            <thead>
                                <tr>
                                    <th>Category Name</th>                                     
                                    <th>Category Image</th>
                                    <th>URL</th>
                                    <th>Province</th>
                                    <th>Status</th>
                                    <th>Action</th>  
                                </tr>
                            </thead>
                            <tbody>   
                                <?php                                
                                    foreach ($category_data as $onlineCat) {
                                        $slug = $onlineCat['slug'];
                                        $province_id = $onlineCat['province_id'];

                                        $province_name = $this->common_model->getSingleFieldFromAnyTable('province_name', 'province_id', $province_id, 'tbl_province');
                                        ?>
                                        <tr id="trow">
                                            <td><?php echo (isset($onlineCat['online_cat_name'])) ? $onlineCat['online_cat_name'] : '-'; ?></td>   
                                            <td><a href="<?= base_url() ?>assets/uploads/online_item_images/<?= $onlineCat['online_cat_image'] ?>" class='fancybox' data-fancybox-group='Online Items'><img src="<?= $this->config->item('uploads') ?>online_item_images/<?php echo (isset($onlineCat['online_cat_image'])) ? $onlineCat['online_cat_image'] : '-'; ?>" width="50px" height="50px"></a></td>
<!--                                            <td><a href="<?= base_url() ?>assets/uploads/online_item_images/<?= $onlineCat['online_cat_image'] ?>" class='fancybox' data-fancybox-group='Online Items'><?php if ($onlineCat['online_cat_image'] && $onlineCat['online_cat_image'] != '') { ?>
                                                        <img src="<?= $this->config->item('uploads') ?>online_item_images/<?php echo (isset($onlineCat['online_cat_image'])) ? $onlineCat['online_cat_image'] : '-'; ?>" width="50px" height="50px">                                
                                                    <?php } else { ?>
                                                        <img src="<?= $this->config->item('adminassets'); ?>img/upload_image.png" width="50px" height="50px">
                                                    <?php } ?></a></td>-->
                                            <td><?php echo site_url('catering/' . $slug) ?></td>
                                            <td><?php echo $province_name ?></td>
                                            <td><?php echo (isset($onlineCat['status'])) && $onlineCat['status'] == 'active' ? "<span class='label label-success'>Active" : "<span class='label label-danger'>Inactive"; ?></td>
                                            <td>
                                                <?php echo anchor(base_url() . 'admin/online-category-edit/' . $onlineCat['online_cat_id'], '<span class="fa fa-pencil" title="Edit"></span>', 'class="btn btn-default btn-rounded btn-condensed btn-sm"'); ?>                                              

                                                <?php if ($onlineCat['status'] == 'active') { ?>
                                                    <a href="javascript:" data-href="<?= base_url() . 'admin/online-category-status/' . $onlineCat['online_cat_id'] . '/inactive' ?>" class="btn btn-default btn-rounded btn-condensed btn-sm changestatus"><span class="fa fa-ban" title="Inactive"></span></a>
                                                <?php } else { ?>    
                                                    <a href="javascript:" data-href="<?= base_url() . 'admin/online-category-status/' . $onlineCat['online_cat_id'] . '/active' ?>" class="btn btn-default btn-rounded btn-condensed btn-sm changestatus"><span class="fa fa-check-circle-o" title="Active"></span></a>
        <?php } ?>
                                                <a href="javascript:" data-href="<?= base_url() . 'admin/online-category-delete/' . $onlineCat['online_cat_id'] ?>" class="btn btn-danger btn-rounded btn-condensed btn-sm delete"><span class="fa fa-times" title="delete"></span></a>

                                            </td> 
                                        </tr>                                            
<?php } ?>   
                            </tbody>
                        </table>
                    </div>                                
                </div>
            </div>                                                
        </div>
    </div>
</div>
