<section role="main" class="content-body">
					<header class="page-header">
						<h2>My Plan Purchases</h2>
						<div class="right-wrapper pull-right">
							<ol class="breadcrumbs">
								<li>
									<a href="<?php echo base_url();?>admin">
										<i class="fa fa-home"></i>
									</a>
								</li>
								<li><span>My Plan Purchases</span></li>
							</ol>
					
						</div>
					</header>
						<section class="panel">
							<header class="panel-heading">
                            <a href="<?php echo base_url();?>home/plans" class="btn btn-warning pull-right">Buy New Plan</a>
								<h2 class="panel-title">List of My Plan Purchases</h2>
							</header>
							<div class="panel-body">
								<table class="table table-bordered table-striped mb-none" id="datatable-tabletools" data-swf-path="assets/vendor/jquery-datatables/extras/TableTools/swf/copy_csv_xls_pdf.swf">
       		 <thead>
												<tr>
													<th>S.No.</th><th>PlanName</th><th>PurchaseDate</th>
													<th>ExpiryDate</th><th>Price</th><th>Featured Prod</th><th>Deals</th>
													<th>Action</th>
												</tr>
											</thead>
			<tbody>
                                            <?php  $i=1;foreach($pls as $pl){?>
                                            <tr>
                                            	<td><?php echo $i;?></td>
                                                <td><?php echo $pl->plname;?></td>
                                                <td><?php echo date("d M'y",strtotime($pl->pur_date));?></td>
                                                <td><?php echo date("d M'y",strtotime($pl->exp_date));?></td>
                                                <td><?php echo $pl->pl_price;?></td>
                                                <td><?php echo $pl->feat_pro;?></td>
                                                <td><?php echo $pl->deal_pro;?></td>
                                                <td></td>
                                            </tr>
                                            <?php $i++;}?>
                                            </tbody>
        </table>
        <div id="myModal" class="modal fade" role="dialog">
          <div class="modal-dialog modal-sm">
            <!-- Modal content-->
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title"></h4>
              </div>
              <div class="modal-body">
                <p>Loading User Details...</p>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
              </div>
            </div>
        
          </div>
        </div>
							</div>
						</section>
				</section>
                
			</div>

			
		</section>

		<!-- Vendor -->
        <script>
	$(document).ready(function(){
		$(".user_details").click(function(){
			var u=$(this).text();
			var id=$(this).attr("id");
			$(".modal-title").text(u);
			$.ajax({
							 type: "POST",
							 url: '<?php echo base_url();?>admin/ajax_user_details',
							 data: {id:id},
							 success: function(res){
								$(".modal-body").html(res);
							 }
							 });
		});
		$('#data-tables').dataTable();
		$(".in_feat").click(function(){
							var id=$(this).val();
							var v="";
							if ($(this).is(':checked')) {
								var v=$(this).val();
							}
							//alert(v);
							$.ajax({
							 type: "POST",
							 url: '<?php echo base_url();?>admin/in_feat',
							 data: {v:v,id:id},
							 success: function(response){
								// alert(response);
							 }
							 });
						});
		$(".userdel").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/userdel',
							 data: {id:id},
							 success: function(response){
								 //alert(response);
							 }
							 });
		});
	});
</script>
	<script src="<?php echo base_url();?>admin_assets/vendor/jquery-browser-mobile/jquery.browser.mobile.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/bootstrap/js/bootstrap.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/nanoscroller/nanoscroller.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/magnific-popup/magnific-popup.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/jquery-placeholder/jquery.placeholder.js"></script>
		
		<!-- Specific Page Vendor -->
		<script src="<?php echo base_url();?>admin_assets/vendor/select2/select2.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/jquery-datatables/media/js/jquery.dataTables.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/jquery-datatables/extras/TableTools/js/dataTables.tableTools.min.js"></script>
		<script src="<?php echo base_url();?>admin_assets/vendor/jquery-datatables-bs3/assets/js/datatables.js"></script>
		
		<!-- Theme Base, Components and Settings -->
		<script src="<?php echo base_url();?>admin_assets/javascripts/theme.js"></script>
		
		<!-- Theme Custom -->
		<script src="<?php echo base_url();?>admin_assets/javascripts/theme.custom.js"></script>
		
		<!-- Theme Initialization Files -->
		<script src="<?php echo base_url();?>admin_assets/javascripts/theme.init.js"></script>


		<!-- Examples -->
		<script src="<?php echo base_url();?>admin_assets/javascripts/tables/examples.datatables.default.js"></script>
		<script src="<?php echo base_url();?>admin_assets/javascripts/tables/examples.datatables.row.with.details.js"></script>
		<script src="<?php echo base_url();?>admin_assets/javascripts/tables/examples.datatables.tabletools.js"></script>
</body>
</html>