<div class="container">
    <div class="row">
        <div class="form-group col-md-12" style="margin-top:20px;">
            <ol class="breadcrumb">
                <li><a href="<?php echo base_url()?>administrator/home"><i class="glyphicon glyphicon-home"></i> Home</a></li>
                <li class="active">Products</li>
            </ol>
        </div>
        <div class="form-group col-md-12">
            <h3>Products</h3>
        </div>
        <div class="col-md-12 form-group">
            <?php
            if(!empty($error)){
                 echo "<div class='alert alert-danger'><i class='glyphicon glyphicon-exclamation-sign'></i> ".$error."</div>"; 
            }
            elseif(!empty($success)){
                 echo "<div class='alert alert-success'><i class='glyphicon glyphicon-ok-circle'></i> ".$success."</div>"; 
            }
            ?>
        </div>
        <div class="col-md-12 form-group">
            <form class="navbar-form navbar-left" role="search" method="POST">
                <div class="form-group">
                  <input type="text" id="search" name="search" class="form-control" placeholder="Search">
                </div>
                <button type="submit" class="btn btn-default">Submit</button>
            </form>
            <a href="<?php echo base_url().'administrator/product/new'?>" class="btn btn-success pull-right">Add New</a>
        </div>
        <div class="col-md-12">
            <table class="table">
                <tr>
                    <th>No</th>
                    <th>Title</th>
                    <th>Category</th>
                    <th>Status</th>
                    <th>Action</th>
                </tr>
                <?php 
                if(!empty($product)){
                    foreach($product as $key => $value){
                ?>
                <tr>
                    <td><?php echo $value->id;?></td>
                    <td><?php echo $value->title;?></td>
                    <td><?php echo $value->product_category_title;?></td>
                    <td><?php echo $value->status ? "Published" : "Hidden";?></td>
                    <td>
                        <a href="<?php echo base_url().'administrator/product/edit/'.$value->id;?>" class="btn btn-warning">
                            <i class="glyphicon glyphicon-edit"></i>
                        </a>
                        <a href="<?php echo base_url().'administrator/product/delete/'.$value->id;?>" class="btn btn-danger">
                            <i class="glyphicon glyphicon-remove"></i>
                        </a>
                    </td>
                </tr>
                <?php
                    }
                }else{
                ?>
                <tr>
                    <td colspan="7" align="center">No data available</td>
                </tr>
                <?php 
                }
                ?>
            </table>
        </div>
        <div class="col-md-12">
            <ul class="pagination pull-right">
                <?php echo $paging;?>
            </ul>    
        </div>
    </div>
</div>