<?php
    
    include 'Header.php';
    include 'Navbar.php';
	include 'Sidebar.php';

?>


<!-- BEGIN CONTENT -->
	<div class="page-content-wrapper">
		<div class="page-content">
			<!-- BEGIN PAGE HEADER-->
			<!-- BEGIN PAGE BREADCRUMB -->
			<ul class="page-breadcrumb breadcrumb">
				<li>
					<a href="#">Dashboard</a>
					<i class="fa fa-circle"></i>
				</li>
				<li>
					<a href="#">Member's Panel</a>
					<i class="fa fa-circle"></i>
				</li> 
				<li>
					<a href="#">Member's Profile</a>
					<i class="fa fa-circle"></i>
				</li>
			</ul>
			<!-- END PAGE BREADCRUMB -->
			<!-- END PAGE HEADER-->
			<!-- BEGIN PAGE CONTENT-->


			<!-- BEGIN EXAMPLE TABLE PORTLET-->
					<div class="portlet box blue">
						<div class="portlet-title">
							<div class="caption">
								<i class="fa fa-users"></i>MyBooster Member's Profile
							</div>
							<div class="tools">
								
							</div>
						</div>
						<div class="portlet-body">
							<div class="table-responsive">
								<table class="table table-striped table-bordered" id="memberDataTable">
								<thead>
									<tr>
									    <th>Sr No</th>
									    <th>Name</th>
									    <th>Member ID</th>
									    <th>Regd Date</th>
									    <th>Purchase PV</th>
									    <th>Sponsor ID</th>
									    <th>Placement ID</th>
									    <th>Mobile Number</th>
									    <th>Actions</th>
									</tr>
								</thead>
								<tbody>
								</tbody>
								</table>
							</div>
						</div>
					</div>
					<!-- END EXAMPLE TABLE PORTLET-->
			</div>
			</div>



<?php

	include 'Footer.php';

?>


 <script type="text/javascript">
        
        $(document).ready(function(){

        
          var dataTables = $('#memberDataTable tbody');

				  
		   $('#memberDataTable').DataTable({
              "responsive": true,
              "serverSide": true,
              // "searching": true,
              order: [[0, 'desc']],
              "processing": true,
              "language": {
                  "processing": "Hang on. Waiting for response... <img src=\"input-spinner.gif\" />" //add a loading image,simply putting <img src="loader.gif" /> tag.
              },
		
              "pagingType": "simple_numbers",
               "columnDefs": [ {

                  "targets": [4,5], // column or columns numbers

                  "orderable": false,  // set orderable for selected columns

                  "sortable": false,

              }],
             
			   
				"columns": [
                  { "name": "date_entered" },
				  { "name": "name" },
                  { "name": "date_entered" },
                  { "name": "date_entered" },

         
                ],

              "ajax":function (data, callback, settings) {

                  data['action']='MemberProfileList';

                  $.ajax({
                      url: 'includes/ajax.php',
                      type: 'POST',
                      data: data,
                      dataType: 'json', 
                      encode: true,
                  }).done(function(data){

                    callback(data);
                    var html ='';
                    var htmlData = data.data;

                    if(data.data!=''){
                      $.each(htmlData , function(i, item){
                        html += "<tr>";
                        html += "<td>"+item[0]+"</td>";
						html += "<td>"+item[2]+"</td>";
                        html += "<td>"+item[3]+"</td>";
                        html += "<td>"+item[8]+"</td>";
                        html += "<td>"+item[4]+"</td>";
                        html += "<td>"+item[5]+"</td>";
                        html += "<td>"+item[6]+"</td>";
                        html += "<td>"+item[7]+"</td>";
                        html += "<td><a href=\"Edit-Member-Profile.php?id="+item[1]+"&refer_id="+item[3]+"&customer_id="+item[9]+"\" target=\"_blank\" class=\"btn default btn-xs blue\"><i class=\"fa fa-edit blue\"></i><span class=\"text-muted\"></span>Edit</a></td>";
                        html += "</tr>";
						
                    });
                    }
                    else
                      html = "<tr> <td colspan=\"7\">No record found</td></tr>";
                    
                    
                    dataTables.html(html);
                    
                  });

              },
            });   
        });

        </script>


</body>
</html>