
<div class="breadcrumbs">
    <div class="breadcrumbs-inner">
        <?php
        if($this->session->flashdata('message')) {
        $message = $this->session->flashdata('message');
        ?>
            <div class="alert alert-<?php echo $message['class']; ?>">
                <button class="close" data-dismiss="alert" type="button">×</button>
                <?php echo $message['message']; ?>
            </div>
        <?php
        }
        ?>
        <div class="row m-0">
            <div class="col-sm-4">
                <div class="page-header float-left">
                    <div class="page-title">
                        <h1><?= $pTitle ?></h1>
                    </div>
                </div>
            </div>
            <div class="col-sm-8">
                <div class="page-header float-right">
                    <div class="page-title">
                        <ol class="breadcrumb text-right">
                            <li><a href="<?= base_url() ?>">Dashboard</a></li>
                            <li><a ><?= $menu ?></a></li>
                           <!--  <li class="active"><?= $smenu ?></li> -->
                        </ol>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<!-- PAGE-INDEX-ENDS -->

<!-- PAGE-CONTENT-STARTS -->

<div class="content">
    <div class="animated fadeIn">
        <div class="row">
            <div class="col-md-12">
                <div class="card">
                    <div class="card-header">
                         <strong class="card-title"> <?= $smenu ?></strong>
                    </div>
                    <div class="card-body">
                        <table id="bootstrap-data-table" class="table table-striped table-bordered">
                            <thead>
                                <tr>
                                    <th>No</th>
                                   
                                    <th>Service Name</th>
                                    <th>Service Image</th>
                                    <th>Action</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                if(!empty($serviceData)){
                                foreach($serviceData as $key =>  $service) { ?> 
                                <tr>
                                    <td><?php echo $key+1;?></td>
                                    
                                    <td><?= $service->service_name ?></td>
                                    <td> <div class="catagory_image_div">
                                                
                                   <img id="image_id_1" src="<?= (isset($service->image))? (base_url($service->image)):'' ?>" onerror="this.src='<?=base_url("assets/images/user_avatar.jpg")?>';" height="75" width="75" /> 
                                                </div></td>
                                    <td>
                                        <a class="btn btn-info btn-sm" href="<?= base_url('Service/edit/'.encode_param($service->id))?>">
                                            <i class="fa fa-fw fa-pencil"></i>
                                               Edit
                                        </a>
                                        <a class="btn btn-danger btn-sm" href="<?= base_url("Service/changeStatus/".encode_param($service->id))."/2" ?>"
                                            onClick="return doconfirm()">
                                            <i class="fa fa-fw fa-trash"></i>Delete
                                        </a>
                                         <?php if($service->status == 1){ ?>
                                          <a class="btn btn-sm btn-success" style="background-color:#ac2925" href="<?= base_url("Service/changeStatus/".encode_param($service->id))."/0" ?>">
                                            <i class="fa fa-cog"></i> De-activate
                                          </a>
                                        <?php } if($service->status == 0) { ?>
                                          <a class="btn btn-sm btn-success" href="<?= base_url("Service/changeStatus/".encode_param($service->id))."/1" ?>">
                                            <i class="fa fa-cog"></i> Activate
                                          </a>
                                        <?php } ?>
                                    </td>
                                </tr>
                                <?php }} ?> 
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<!-- PAGE-CONTENT-ENDS -->
<script type="text/javascript">        
        function doconfirm(){
        action = confirm("Are you sure to delete permanently?");
        if(action != true) return false;
        }
    </script>