 <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                   Manage Ads Categories
                </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 Ads Categories</li>
                </ol>
            </section>
            <!-- Main content -->
            <div class="content">
           
                <div class="container-fluid">
                 
                    <!-- Tabs -->
                    <!-- third row  -->
                    <div class="row"> 
                       <div class="col-md-12 col-sm-12">
                       <?php if($this->session->flashdata("msg")!==""){?>
                          <!--<div class="alert alert-info">
                                            <strong><?php echo $this->session->flashdata("msg");?>!</strong> 
                                        </div>--><?php }?>
                            <div class="panel panel-primary">
							
      <div class="panel-heading">Add New Category</div>
      <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>
         
          	<input type="hidden" value="<?php echo $editcat->cat_image;?>" name="oldimg">
            <input type="file"  class="btn btn-primary" name="img"/>
            <img width="30%" src="<?php echo base_url();?>assets/images/<?php echo $editcat->cat_image;?>" class="img img-responsive">
          
          <button type="submit" class="btn btn-success" 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>
          <input type="file" name="img" class="btn btn-primary"/>
          <button type="submit" class="btn btn-success" name="submit">Add Category</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/<?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;?>" id="<?php echo $cat->cat_image;?>" 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="#">dz48</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>

