<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.3/Chart.min.js"></script>	
<div class="vd_content-wrapper">
      <div class="vd_container">
        <div class="vd_content clearfix">
          <div class="vd_head-section clearfix">
            <div class="vd_panel-header">
              <ul class="breadcrumb">
                <li><a href="<?php echo base_url();?>admin">Home</a> </li>
                <li class="active">Add Art</li>
              </ul>
              
 
            </div>
          </div>
          <!-- vd_head-section -->
          
          <div class="vd_title-section clearfix">
            <div class="vd_panel-header">
              <h1>Manage Custom Arts</h1>
              <small class="subtitle">Add, Edit Art</small>
              
<!-- vd_panel-menu --> 
            </div>
            <!-- vd_panel-header --> 
          </div>
          <!-- vd_title-section -->
          
          <div class="vd_content-section clearfix">
            
         <div class="row">
                	
                    
                    <!-- User Activity -->
                    <div class="col-md-5"><?php if($this->session->flashdata("msg")!==""){echo $this->session->flashdata("msg"); }?>
                        <div class="panel panel-success">
							
      <div class="panel-heading">Add/Edit Art</div>
      <div class="panel-body">
      
      <?php if($this->uri->segment(3)){?>
      	<form  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">Art Class</label>
            <input type="text" required class="form-control" name="cat" value="<?php echo $editcat->cat_name;?>">
          </div>
          <div class="form-group ">
            <label for="email">Art Image</label>
          	<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/category/<?php echo $editcat->cat_image;?>" class="img img-responsive">
          </div><br/>
          <button type="submit" class="btn btn-success" name="submit">Update</button>
        </form>
      <?php }else{?>
      	<form  action="<?php echo base_url();?>admin/add_art_submit" method="post" enctype="multipart/form-data">
         
          <div class="form-group ">
            <label for="email">Art Class</label>
            <input type="text" required class="form-control" name="title">
          </div>
          <div class="form-group ">
            <label for="email">Art Image</label>
          <input type="file" name="img" class="btn btn-default"/></div><br/>
          <button type="submit" class="btn btn-success" name="submit">Add Art</button>
        </form>
        <?php }?>
      </div>
    </div>
                    </div>
                    
                    <div class="col-md-7">
                     <div class="panel panel-success">
							
      <div class="panel-heading">Listing All Arts</div>
      <div class="panel-body">
                    <table class="table table-striped table-responsive">
        	<thead><tr><th>S.No.</th><th>Image</th><th>Class</th><th>Action</th></tr></thead>
            <tbody>
            	<?php $i=1;foreach($arts as $art){?>
                <tr><td><?php echo $i;?></td>
                <td width="100px"><img src="<?php echo base_url();?>assets/images/<?php echo $art->aimage;?>" class="img img-responsive"></td>
                <td><?php echo $art->aclass;?></td>
                <td>
              <a href="<?php echo base_url();?>admin/add_art/<?php echo $art->aid;?>" class="btn btn-xs btn-warning"><i class="fa fa-edit"></i></a>
                	<a href="<?php echo $art->aid;?>"  class="btn btn-xs btn-danger artdelete"><i class="fa fa-trash-o"></i></a></td>
                <?php $i++;}?></tr>
            </tbody>
        </table>
        </div></div>
                    </div>
                    
                    
                    <!-- End Chat Room -->
                </div>
          </div>
          <!-- .vd_content-section --> 
          
        </div>
        <!-- .vd_content --> 
      </div>
      <!-- .vd_container --> 
    </div>
    <!-- .vd_content-wrapper --> 
    
    <!-- Middle Content End --> 
    
  </div>
  <!-- .container --> 
</div>
<!-- .content -->

<!-- Footer Start -->
  <footer class="footer-1"  id="footer">      
    <div class="vd_bottom ">
        <div class="container">
            <div class="row">
              <div class=" col-xs-12">
                <div class="copyright">
                  	Copyright &copy;2018 HadesIndia. All Rights Reserved 
                </div>
              </div>
            </div><!-- row -->
        </div><!-- container -->
    </div>
  </footer>
<!-- Footer END -->
  

</div>

<!-- .vd_body END  -->
<a id="back-top" href="#" data-action="backtop" class="vd_back-top visible"> <i class="fa  fa-angle-up"> </i> </a>

<!--
<a class="back-top" href="#" id="back-top"> <i class="icon-chevron-up icon-white"> </i> </a> -->

<!-- Javascript =============================================== --> 
<!-- Placed at the end of the document so the pages load faster --> 
<script>
	$(document).ready(function(){
		$(".enable").click(function(e){e.preventDefault();
			var st=$(this).text();
			var id=$(this).attr("href");
			if(st=="Enable"){
			$(this).text("Disable");
			}else{
			$(this).text("Enable");	
			}
			$.ajax({
							 type: "POST",
							 url: '<?php echo base_url();?>admin/catenable',
							 data: {id:id,st:st},
							 success: function(response){
								 //alert(response);
							 }
							 });
		});
		$(".catdelete").click(function(e){e.preventDefault();
		if (!confirm("Sure you want to delete?")){
				  return false;
				}
			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 type="text/javascript" src='<?php echo base_url();?>adminassets/plugins/jquery-ui/jquery-ui.custom.min.js'></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/jquery-ui-touch-punch/jquery.ui.touch-punch.min.js"></script>

<script type="text/javascript" src="<?php echo base_url();?>adminassets/js/caroufredsel.js"></script> 
<script type="text/javascript" src="<?php echo base_url();?>adminassets/js/plugins.js"></script>

<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/breakpoints/breakpoints.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/dataTables/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/prettyPhoto-plugin/js/jquery.prettyPhoto.js"></script> 

<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/mCustomScrollbar/jquery.mCustomScrollbar.concat.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/tagsInput/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/bootstrap-switch/bootstrap-switch.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/blockUI/jquery.blockUI.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/plugins/pnotify/js/jquery.pnotify.min.js"></script>

<script type="text/javascript" src="<?php echo base_url();?>adminassets/js/theme.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>adminassets/custom/custom.js"></script>


</body>
</html>