<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('BlogSuccess')) { ?>  
                    <div class="alert alert-success"> <?= $this->session->flashdata('BlogSuccess') ?></div>
                <?php } ?>
                <div class="panel-heading">
                    <h3 class="panel-title">Manage Blog</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/blog-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>Blog Title</th>         
                                    <th>Slug</th>     
                                    <th>Blog Category</th> 
                                    <th>Blog Image</th>                              
                                    <th>Status</th>
                                    <th>Action</th>   
                                </tr>
                            </thead>
                            <tbody>         
                          <?php                               
                                    foreach ($blog_data as $blog) {
                                        ?>
                                        <tr id="trow">

                                            <td><strong><?php echo (isset($blog['blog_title'])) ? $blog['blog_title'] : '-'; ?></strong></td>
                                            <td><strong><?php echo (isset($blog['slug'])) ? $blog['slug'] : '-'; ?></strong></td>
                                            <td><strong><?php echo (isset($blog['bg_category_title'])) ? $blog['bg_category_title'] : '-'; ?></strong></td>
                                            <td><a class="fancybox" href="<?= base_url() ?>assets/uploads/blog_images/<?= $blog['blog_image'] ?>" data-fancybox-group="banner" title="<?= $blog['blog_title'] ?>"><img src="<?= base_url() ?>assets/uploads/blog_images/<?php echo (isset($blog['blog_image'])) ? $blog['blog_image'] : '-'; ?>" width="50px" height="50px"></a></td>
                                            
                                            <td><?php echo (isset($blog['status'])) && $blog['status'] == 'active' ? "<span class='label label-success'>Active" : "<span class='label label-danger'>Inactive"; ?></td>
                                            <td>
                                                <?php echo anchor(base_url() . 'admin/blog-edit/' . $blog['blog_id'], '<span class="fa fa-pencil" title="Edit"></span>', 'class="btn btn-default btn-rounded btn-condensed btn-sm"'); ?>                                                       
                                                <?php echo anchor(base_url() . 'admin/blog-comment/' . $blog['blog_id'], '<span class="fa fa-comment" title="View Comment"></span>', 'class="btn btn-default btn-rounded btn-condensed btn-sm"'); ?>
                                                <?php if ($blog['status'] == 'active') { ?>
                                                    <a href="javascript:" data-href="<?= base_url() . 'admin/blog-status/' . $blog['blog_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/blog-status/' . $blog['blog_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/blog-delete/' . $blog['blog_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>         
