<?php
    
    include 'Header.php';
    include 'Navbar.php';
	include 'Sidebar.php';
	include 'includes/admin_API_Config.php';

	if(!empty($_GET['refer_id']))
	{

		$obj = new API_Config;
		$data = array();
		$data['memberID'] = $_GET['refer_id'];
		$response = json_decode($obj->call_API("API_Member_Details.php", $data));
		//var_dump($response);
		error_reporting(0);

		$profile = $response->profile;

	}

?>


<!-- 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 Details</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 Details <?php 		echo $profile->id;
?>
					</div>
					<div class="tools">
						
					</div>
				</div>
				<div class="portlet-body">
					<div class="col-md-3">
						<form class="search-form" method="POST" name="frmSearchMember" id="frmSearchMember">
							<div class="input-group">
								<input type="text" class="form-control col-md-3 form-control-solid" placeholder="Search Member ID" name="memberID" id="memberID" maxlength="9">
								<span class="input-group-btn">
								<a href="javascript:;" class="btn submit" id="btnSearchMember" type="submit"><i class="icon-magnifier"></i></a>
								</span>
							</div>
						</form>
					</div>
					<p>&nbsp;</p><p>&nbsp;</p>

					<div class="tabbable-custom nav-justified">
						<ul class="nav nav-tabs nav-justified">
							<li class="active">
								<a href="#profile" data-toggle="tab">
								Profile</a>
							</li>
							<li>
								<a href="#purchases" data-toggle="tab">
								Purchases</a>
							</li>
							<li>
								<a href="#payout" data-toggle="tab">
								Payout</a>
							</li>
						</ul>
						<div class="tab-content">
							<div class="tab-pane active" id="profile">
							<?php

								if(!empty($profile))
								{
									echo "<table>";
									echo '<tbody>
                                      <tr>
                                          <td>User ID: </td>
                                          <td>' . $profile->id . '</td>
                                      </tr>
                                      <tr>
                                          <td>Name: </td>
                                          <td>' . ucwords($profile->first_name . ' ' . $profile->last_name)  . '</td>
                                      </tr>
                                      <tr class="job">
                                          <td>Last Name: </td>
                                          <td>' . $profile->id . '</td>
                                      </tr>
                                      <tr class="job">
                                          <td>Gender: </td>
                                          <td>' . $profile->id . '</td>
                                      </tr>
                                      <tr class="job">
                                          <td>Email-ID: </td>
                                          <td>' . $profile->id . '</td>
                                      </tr>
                                      <tr class="job">
                                          <td>Mobile Number: </td>
                                          <td>' . $profile->id . '</td>
                                      </tr>
                                   </tbody>';



									echo "</table>";
								}

							?>
							</div>
							<div class="tab-pane" id="purchases">
								
							</div>
							<div class="tab-pane" id="payout">
								
							</div>
						</div>
					</div>				
			   </div>
			</div>
			<!-- END EXAMPLE TABLE PORTLET-->

	
			
			</div>
			</div>



<?php

	include 'footer.php';

?>


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

		    $("#btnSearchMember").click(function(){

				var memberID = $("#memberID").val();

				if(memberID.length == 9)
				{
					window.location.href = 'Member-Details.php?refer_id=' + memberID;
				}

				else
					return false;

			});

	
			$("#memberID").on("keypress keyup blur paste change",function(event) {

		   	   $(this).val($(this).val().replace(/[^\d].+/, ""));
				if ((event.which < 48 || event.which > 57)) {
					event.preventDefault();
				}
				
			});

        

		});

   </script>


</body>
</html>