<div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                   Add/Edit/Delete Artists
                </h1>
               <ol class="breadcrumb">
                    <li><a href="<?php echo base_url();?>"><i class="fa fa-home"></i>Dashboard</a></li>
                    <li class="active">Add/Edit/Delete</li>
                </ol>
            </section>
            <!-- Main content -->
            <div class="content">
                <div class="container-fluid">
                    <!-- Basic forms -->
                    <div class="row">
                        <div class="col-md-5">
                        <?php if($this->session->flashdata("msg")){echo $this->session->flashdata("msg");}?>
                        <div class="tab-container widget">
                                <ul class="nav nav-tabs">
                                    <li class="active"><a href="#home" data-toggle="tab">Basic Details</a></li>
                                    <li><a href="#profile" data-toggle="tab">Awards</a></li>
                                    <li><a href="#messages" data-toggle="tab">Achievements</a></li>
                                </ul>
                                <div class="tab-content">
                                    <div class="tab-pane active fade in" id="home">
                                        <?php if(is_numeric($this->uri->segment(3))){//print_r($gr);?>
                                 <form role="form" action="<?php echo base_url();?>admin/update_artist" enctype="multipart/form-data" method="post">
                                 <input type="hidden" name="aid" value="<?php echo $art->aid;?>" />
                    <div class="row">
                    <div class="col-md-6">
                    <div class="form-group label-floating">
                    <label class="control-label">Artist Name</label>
                    <input type="text" name="a_name" required id="com_name" value="<?php echo $art->a_name;?>" class="form-control" tabindex="0">
                    </div>
                    </div>
                    <div class="col-md-6">
                    <div class="form-group label-floating">
                    <label class="control-label">Nick Name</label>
                    <input type="text" name="a_nickname" value="<?php echo $art->a_nickname;?>" required  class="form-control" >
                    </div>
                    </div>
                    </div>
                    <div class="form-group label-floating">
                    <label class="control-label">Email</label>
                    <input type="email" name="a_email" id="email" value="<?php echo $art->a_email;?>" required class="form-control" tabindex="4">
                    </div>
                    <div class="row">
                    <div class="col-xs-12 col-sm-6 col-md-6">
                    <div class="form-group label-floating">
                    <label class="control-label">Contact Number</label>
                    <input type="text" name="a_phone" id="mobile" value="<?php echo $art->a_phone;?>" required class="form-control"  tabindex="5">
                    </div>
                    <div class="form-group label-floating">
                    <label class="control-label">Address</label>
                    <textarea class="form-control" name="a_address" rows="3"><?php echo $art->a_address;?></textarea>
                    </div>
                    <div class="form-group label-floating">
                    <label class="control-label">City</label>
                    <input type="text" name="a_city" id="mobile" class="form-control" value="<?php echo $art->a_city;?>"  tabindex="5">
                    </div>
                    </div>
                    <div class="col-xs-12 col-sm-6 col-md-6">
                    
                    <h4 class="text-primary">Add Profile Image</h4>
                    <input type="file" name="a_img"  class="btn btn-primary" id="imgInp" style="width: 180px;" />
                    <input type="hidden" name="oldimg" value="<?php echo $art->a_img;?>" />
                    <img id="blah" src="<?php echo base_url();?>assets/images/artists/<?php echo $art->a_img;?>" alt="Identity" class="img img-responsive" height="150" />
                    
                    </div>
                    
                    </div>
                    <div class="form-group label-floating">
                    <label class="control-label">About Artist</label>
                    <textarea class="form-control" name="about" rows="3"><?php echo $art->about;?></textarea>
                    </div>
                    <span class="text-danger" id="error"></span>
                    <input type="submit" id="register" value="Update Artist" class="btn btn-primary" tabindex="7">
                    <a href="<?php echo base_url();?>admin/artists" class="btn btn-default addcom">Cancel</a>
                    </form>
                                <?php }else{?>
                                 <form role="form" action="<?php echo base_url();?>admin/add_artist" enctype="multipart/form-data" method="post">
<div class="row">
<div class="col-md-6">
<div class="form-group label-floating">
<label class="control-label">Artist Name</label>
<input type="text" name="a_name" required id="com_name" class="form-control" tabindex="0">
</div>
</div>
<div class="col-md-6">
<div class="form-group label-floating">
<label class="control-label">Nick Name</label>
<input type="text" name="a_nickname" required  class="form-control" >
</div>
</div>
</div>
<div class="form-group label-floating">
<label class="control-label">Email</label>
<input type="email" name="a_email" id="email" required class="form-control" tabindex="4">
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-6">
<div class="form-group label-floating">
<label class="control-label">Contact Number</label>
<input type="text" name="a_phone" id="mobile" required class="form-control"  tabindex="5">
</div>
<div class="form-group label-floating">
<label class="control-label">Address</label>
<textarea class="form-control" name="a_address" rows="3"></textarea>
</div>
<div class="form-group label-floating">
<label class="control-label">City</label>
<input type="text" name="a_city" id="mobile" class="form-control"  tabindex="5">
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-6">

<h4 class="text-primary">Add Profile Image</h4>
<input type="file" name="a_img"  class="btn btn-primary" id="imgInp" style="width: 180px;" />
<img id="blah" src="<?php echo base_url();?>newadminassets/users/company.jpg" alt="Identity" class="img img-responsive" height="150" />

</div>

</div>
<div class="form-group label-floating">
<label class="control-label">About Artist</label>
<textarea class="form-control" name="about" rows="3"></textarea>
</div>
<span class="text-danger" id="error"></span>
<input type="submit" id="register" value="Add Artist" class="btn btn-primary" tabindex="7">
</form><?php }?>
                                    </div>
                                    <div class="tab-pane fade in" id="profile">
                                        <h2>Typography</h2>
                                        <p>
                                            Lorem ipsum dolor sit amet, consectetur adipisicing elit. At consequatur eveniet consequuntur ratione a. Sunt totam sapiente maiores corporis natus exercitationem, illo commodi? Expedita molestias aliquam iste molestiae. Pariatur, qui.
                                        </p>
                                    </div>
                                    <div class="tab-pane fade in" id="messages">
                                        <h2>Message</h2>
                                        <p>
                                            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis ratione, nisi maiores possimus culpa ut quas quae earum itaque, soluta reprehenderit neque eos. Placeat ratione, sapiente nemo expedita enim a.
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-7">
                            <div class="panel">
                                <h3 class="panel-heading">List of Artists</h3>
                                <div class="panel-body">
                                   <table class="table table-striped table-responsive table-bordered dataTable" id="example-2">
                                    	<thead><tr><th>S.No.</th><th>Image</th><th>Name/NickName</th><th>Email/Phone/Address</th><th>Action</th></tr></thead><tbody>
                                        <?php $i=1;foreach($artists as $g){?>
                                        <tr><td><?php echo $i;?></td>
                                        <td width="100px"><img class="img img-responsive" src="<?php echo base_url();?>assets/images/artists/<?php echo $g->a_img;?>" /></td>
                            <td><?php echo $g->a_name;?><br/><span class="label label-success"><?php echo $g->a_nickname;?></span><br/>
                            <b>Reg On -<br/> <?php echo date("d M Y",strtotime($g->a_reg_date));?></b></td>
										<td><i class="fa fa-envelope"></i> <?php echo $g->a_email;?><br/>
                                        	<i class="fa fa-mobile"></i> <?php echo $g->a_phone;?><br/>
                                            <i class="fa fa-map-marker"></i> <?php echo $g->a_address.' '.$g->a_city;?></td>
                                        <td><a href="<?php echo base_url();?>admin/artists/<?php echo $g->aid;?>" class="btn btn-xs btn-warning"><i class="fa fa-edit"></i></a>
                                         <a href="<?php echo $g->aid;?>" class="btn btn-xs btn-danger artists_delete"><i class="fa fa-trash-o"></i></a></td></tr>
                                        <?php $i++;}?></tbody>
                                        <tfoot><tr><th>S.No.</th><th>Image</th><th>Name/NickName</th><th>Email/Phone/Address</th><th>Action</th></tr></tfoot>
                                    </table>
                                </div>
                            </div>
                        </div>        
                    </div>
                    <!-- end basic forms -->
                    <!-- form elements -->
                    
                    <!-- end form elements -->
                    <!-- input variants  -->
                    
                    <!-- end input variants  -->
                    <!-- Validation   -->
                    
                    <!-- end validation -->
                </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; 2018 <a href="#">Docs</a>.</strong> All rights reserved.
        </footer>
    </div>
   
    
    <script src="<?php echo base_url();?>newadminassets/plugins/js/material.min.js"></script>
    <script>
	$(document).ready(function(){
		$(".artists_delete").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/artists_delete',
							 data: {id:id},
							 success: function(response){
								 //alert(response);
							 }
							 });
		});
   function readURL(input,id) {
        if (input.files && input.files[0]) {
            var reader = new FileReader();
            
            reader.onload = function (e) {//alert("asfda");
                $('#blah').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/ripples.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/js/jquery.slimscroll.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/dataTables.responsive.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/dataTables.bootstrap.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/dataTables.buttons.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/jszip.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/pdfmake.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/vfs_fonts.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/buttons.html5.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/buttons.print.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/plugins/datatables/buttons.colVis.min.js"></script>
    <script src="<?php echo base_url();?>newadminassets/js/datatables.js"></script>
    <script src="<?php echo base_url();?>newadminassets/js/app.js"></script>

</body>

