<link rel="stylesheet" href="<?php echo base_url();?>newadminassets/plugins/datatables/dataTables.bootstrap.min.css">
<script src="<?php echo base_url();?>newadminassets/plugins/datatables/jquery.dataTables.min.js"></script>
<div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                  List Edit/Delete Albums
                </h1>
                <ol class="breadcrumb">
                    <li><a href="<?php echo base_url();?>"><i class="fa fa-home"></i>Dashboard</a></li>
                    <li class="active">List Edit/Delete Albums</li>
                </ol>
            </section>
            <!-- Main content -->
            <div class="content">
                <div class="container-fluid">
                    <!-- Basic forms -->
                    <div class="row">
                        
                        
                        <div class="col-md-12">
                            <div class="panel">
               
                                <h3 class="panel-heading">List of All Albums</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>Artist</th><th>Album Title</th><th>No of Songs</th><th>Artist</th><th>Genre</th><th>Language</th><th>Total Size</th><th>Downloads</th><th>Action</th></tr></thead>
                                        <tbody>
                                        <?php $i=1;foreach($albums as $alb){?>
                                        <tr>
                                        <td><?php echo $i;?></td>
                                        <td><?php echo $alb->lable_title;?><br/>
                                      <span class="badge badge-dark"><?php echo $alb->label_type;?></span></td>
                                        <td><?php echo $alb->album_name;?></td>
                                     <td><?php echo $this->db->get_where("album_songs",array("al_id"=>$alb->al_id))->num_rows();?></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                           				<td></td>
                                        <td>0</td>
                                        <td><a href="<?php echo $alb->album_name;?>" id="<?php echo $alb->al_id;?>" class="btn btn-success btn-xs open_popup" data-toggle="modal" data-target="#myModal"><i class="fa fa-music"></i> Playlists</a>
<a href="<?php echo $alb->al_id;?>" class="btn btn-xs btn-danger album_delete"><i class="fa fa-trash-o"></i></a></td>
                                        </tr>
                                        <?php $i++;}?>
                                        </tbody>
                                        <tfoot>
                                             <tr><th>S.No.</th><th>Album Title</th><th>No of Songs</th><th>Artist</th><th>Genre</th><th>Language</th><th>Total Size</th><th>Downloads</th><th>Action</th></tr>
                                        </tfoot>
                                    </table>
                                </div>
                            </div>
                        </div>        
                    </div>
                    <div class="modal fade" id="myModal" role="dialog">
                    <div class="modal-dialog modal-md">
                      <div class="modal-content">
                        <div class="modal-header">
                          <button type="button" class="close" data-dismiss="modal">&times;</button>
                          <h4 class="modal-title"><b id="agentname" class="text-success"></b> Playlist</h4>
                        </div>
                        <div class="modal-body">
               
                        <form role="form" class="form-inline" action="" method="post" id="moresong">
                          
                            <label for="email">Add More Songs:</label>
                            <input type="file" name="audio[]" multiple style="width:200px; border:1px solid #666;" class="btn btn-default"  />
                          
                          <button type="submit" class="btn btn-primary">Add Songs</button>
                        </form>
                          <table class="table table-condensed table-bordered">
						  	<thead><tr><th>S.No.</th><th>Title</th><th>Action</th></tr></thead>
                            <tbody id="playlist">
                            
                            </tbody>
                          </table>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
            </div>
            <!-- /.content -->
        </div>
         <footer class="main-footer">
            <strong>Copyright &copy; 2018 <a href="#">Artists Manage</a>.</strong> All rights reserved.
        </footer>
    </div>
   <script>
   	$(document).ready(function(){
		$("#zip").click(function(){
			$("#album").slideToggle();
		});
		$(".open_popup").click(function(e){e.preventDefault();
			var name=$(this).attr("href");//alert(name);
			//$("#passch").html('');
//			$("#edit_pass").val('');
//			$("#edit_pass_change").val('');
//			var id=$(this).attr("id");
			var id=$(this).attr('id');
			$("#agentname").text(name);
			$.ajax({
							 type: "POST",
							 url: '<?php echo base_url();?>admin/album_playlist',
							 data: {id:id},
							 success: function(response){
								// alert(response);
								 $("#playlist").html(response);
							 }
							 });
		});
		
		$(".addcom").click(function(){$("#showcom").slideToggle();});
		$(".album_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/album_delete',
							 data: {id:id},
							 success: function(response){
								 //alert(response);
							 }
							 });
		});
	});
</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/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>

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


</body>

