  <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                   Manage Employees
                </h1>
              <ol class="breadcrumb">
                    <li><a href="<?php echo base_url();?>admin"><i class="fa fa-home"></i>Home</a></li>
                    <li class="active">Manage Employees</li>
                </ol>
            </section>
            <!-- Main content -->
            <div class="content">
                <div class="container-fluid">
                    <!-- Tabs -->
                    <!-- third row  -->
                    <div class="row">
                       
                        <div class="col-sm-12 col-md-12">
                        <?php if($this->session->flashdata("msg")){?>
                          <div class="alert alert-info alert-bordered">
                                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                            <div class="icon"><i class="fa fa-info-circle"></i></div>
                                            <strong><?php echo $this->session->flashdata("msg");?>!</strong> 
                                        </div><?php }?>
                            <div class="tab-container widget">
                                <ul class="nav nav-tabs">
                                    <li class="active"><a href="#home" data-toggle="tab" style="padding:5px;">
                                    <h4>Employees Listings</h4></a></li>
                                   
                                </ul>
                                <div class="panel-body">
      <?php if($this->uri->segment(3)){?>
      	<form class="form-inline" action="<?php echo base_url();?>admin/add_category/<?php echo $this->uri->segment(3);?>" method="post" enctype="multipart/form-data">
          <div class="form-group">
            <label for="email">Category Title</label>
            <input type="text" required class="form-control" name="cat" value="<?php echo $editcat->cat_name;?>">
          </div>
          <div class="form-group">
          	<input type="hidden" value="<?php echo $editcat->cat_image;?>" name="oldimg">
            <input type="file" class="form-control" name="img">
            <img width="30%" src="<?php echo base_url();?>assets/images/category/<?php echo $editcat->cat_image;?>" class="img img-responsive">
          </div>
          <button type="submit" class="btn btn-primary" name="submit">Update</button>
        </form>
      <?php }else{?>
      	<form class="form-inline" action="<?php echo base_url();?>admin/add_category" method="post" enctype="multipart/form-data">
          <div class="form-group">
            <label for="email">Category Title</label>
            <input type="text" required class="form-control" name="cat">
          </div>
          <div class="form-group">
            <input type="file" class="form-control" name="img">
          </div>
          <button type="submit" class="btn btn-primary" name="submit">Add</button>
        </form>
        <?php }?>
        
        <br/>
        <table class="table table-condensed table-bordered table-striped">
        	<thead><tr><th>S.No.</th><th>Category Image</th><th>Title</th><th>Action</th></tr></thead>
            <tbody>
            	<?php $i=1;foreach($cats as $cat){?>
                <tr><td><?php echo $i;?></td>
                <td width="100px"><img src="<?php echo base_url();?>assets/images/category/<?php echo $cat->cat_image;?>" class="img img-responsive"></td>
                <td><?php echo $cat->cat_name;?></td>
                <td><a href="<?php echo base_url();?>admin/category/<?php echo $cat->cid;?>" class="btn btn-xs btn-warning">Edit</a>
                	<a href="<?php echo $cat->cid;?>" class="btn btn-xs btn-danger catdelete">Delete</a></td>
                <?php $i++;}?>
            </tbody>
        </table>
      </div>
                            </div>
                            
                        </div>
                        
                    </div>
                    
                </div>
            </div>
            <!-- /.content -->
        </div>
  <footer class="main-footer">
            <!-- To the right -->
           <!-- <div class="pull-right hidden-xs">
                Developed by <i class="fa fa-heart"></i> Floatin
            </div>-->
            <!-- Default to the left -->
            <strong>Copyright &copy; 2017 <a href="#">CRM</a>.</strong> All rights reserved.
        </footer>
    </div>
   <script>
	$(document).ready(function(){
		$(".catdelete").click(function(e){e.preventDefault();
			var id=$(this).attr("href");$(this).closest("tr").remove();
			$.ajax({
							 type: "POST",
							 url: '<?php echo base_url();?>admin/catdelete',
							 data: {id:id},
							 success: function(response){
								 //alert(response);
							 }
							 });
		});
	});
</script>
   <!-- <script>
	$(document).ready(function(){
   function readURL(input,id) {
        if (input.files && input.files[0]) {
            var reader = new FileReader();
            
            reader.onload = function (e) {alert("asfda");
                $('#i'+id).attr('src', e.target.result);
            }
            
            reader.readAsDataURL(input.files[0]);
        }
    }
	$("#imgInp").change(function(){
        readURL(this,"front");
    });
	});
</script>-->
    <script src="<?php echo base_url();?>newadminassets/plugins/js/countUp.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/raphael.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/morris.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/jquery-jvectormap-2.0.2.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/jquery-jvectormap-world-mill-en.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/material.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/ripples.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/rendro-easy-pie-chart/dist/jquery.easypiechart.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/Chart.bundle.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/jquery.slimscroll.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/js/dashboard.js"></script>
    <script src="<?php echo base_url();?>newadminassets/js/widgets.js"></script>
    <script src="<?php echo base_url();?>newadminassets/js/app.js"></script>

    <!-- Color Switcher -->
    
    <!-- END Skin switcher -->


</body>

