<?php

	include 'header.php';
	include 'navbar.php';

	$parentID = $parentName = $left = "";
    if(!empty($_SESSION['parentID']))
	   $parentID = $_SESSION['parentID'];
	  
	if(!empty($_SESSION['parentName']))
      $parentName = $_SESSION['parentName'];


    if(!empty($_SESSION['leg']))
      $leg = $_SESSION['leg'];
	
	else
	  $leg = 'left';

	if(empty($_GET['viewType']))
		$_GET['viewType']=1;
      

?>



 <div class="col-lg-12 mx-auto">
             
    <!-- partial -->
    <div class="container-fluid page-body-wrapper">
	 <!--h2 class="text-center mb-4"></h2-->

      <div class="main-panel">
        <div class="content-wrapper">
          <div class="row">
		  <div class="col-md-5 grid-margin" id="img_register">
			<div class="card">
				<img src="../images/register.png">
			</div>
		   </div>


            <div class="col-md-7 grid-margin">
              <div class="card">
                <div class="card-body">
                  <h4 class="card-title">Add a New Member</h4>
                  <form id="frm_reg" action="#">
                    <div>
                      <h3>Account</h3>
                      <section>
                        <h6>Account</h6>
                        <div class="form-group">
                          <label>Sponsor ID:</label>
                          <input type="text" name="sponsorID" id="sponsorID" class="form-control" aria-describedby="sponsorName" placeholder="Enter Sponsor ID" maxlength="9" value="<?php echo $_SESSION['refer_id'];?>" readonly>
                          <small name="sponsorName" id="sponsorName" class="form-text text-muted"><?php echo $_SESSION['username'];?></small>
                        </div>
                        <div class="form-group">
                          <label>Placement ID:</label>
                          <input type="text" name="placementID" id="placementID" class="form-control" aria-describedby="placementName" placeholder="Enter Placement ID" maxlength="9" value="<?php echo $parentID;?>" readonly>
                          <small name="placementName" id="placementName" class="form-text text-muted"><?php echo $parentName;?></small>
                        </div>
                       	<div class="form-group">
							<label>Select Leg:</label>
                            <select name="cmbPlacement" id="cmbPlacement" class="form-control" required>
                                <option value="left">Left</option>
                                <option value="right">Right</option>
                            </select>
                        </div>
					  </section>
                      <h3>Profile</h3>
                      <section>
                        <h6>Profile</h6>
						<div class="row">
							<div class="form-group col-md-6">
							  <label>First Name:</label>
							  <input type="text" name="firstName" id="firstName" class="form-control" required aria-invalid="true" aria-describedby="emailHelp" placeholder="Enter First Name">
							  <small id="emailHelp" class="form-text text-muted"></small>
							</div>
							<div class="form-group col-md-6">
							  <label>Last Name:</label>
							  <input type="text" name="lastName" id="lastName" class="form-control" placeholder="Last Name">
							  <small id="emailHelp2" class="form-text text-muted"></small>
							</div>
						</div>
						<div class="row">
							<div class="form-group col-md-6">
							  <label>Email Address:</label>
							  <input type="email" name="emailID" id="emailID" class="form-control" placeholder="Email Address" type="email">
							</div>
							<div class="form-group col-md-6">
							  <label>Mobile Number:</label>
							  <input type="text" name="mobileNumber" id="mobileNumber" class="form-control" placeholder="Mobile Number">
							</div>
						</div>
						<div class="row">
							<div class="form-group col-md-6">
							  <label>Password:</label>
							  <input type="password" name="password" id="password" class="form-control" placeholder="Password">
							</div>
							<div class="form-group col-md-6">
							  <label>Confirm Password:</label>
							  <input type="password" name="confirmPassword" id="confirmPassword" class="form-control" placeholder="Confirm Password">
							</div>
						</div>
						<div class="row">
							<div class="form-group">
								<div class="form-check form-check-flat mt-2">
									<label class="form-check-label">
										<input name="terms" id="terms" type="checkbox" class="form-control" checked="">
										I accept Terms & Conditions and Privacy Policy.
										<i class="input-helper"></i>
									</label>
								</div>
							</div>
						</div>
						<div class="dot-opacity-loader" id="loader_Registration">
						  <span></span>
						  <span></span>
						  <span></span>
						</div>
						<input type="text" name="countryCode" id="countryCode" class="form-control" hidden>
                      </section>
					 </div>
                  </form>
                </div>
              </div>
            </div>
          </div>
 
        </div>
        <!-- content-wrapper ends -->
       


<script type="text/javascript">

  jQuery().ready(function() {

   $("#loader_Registration").hide();

   var parentID = "<?php echo $parentID;?>";
   var parentName = "<?php echo $parentName;?>";
   var leg = "<?php echo $leg;?>";
   var viewType = "<?php echo $_GET['viewType'];?>";


	if(parentID!="" && parentName!="" && leg!="")
	{
		if(viewType==2)
		{
			$("#placementDetails").show();
			$("#cmbPlacement").val(leg);
			$("#cmbPlacement").attr("disabled",true);
		}

		else
		{
			$("#placementDetails").hide();
			$("#cmbPlacement").val(leg);
			$("#cmbPlacement").attr("disabled",true);
		}
	}


	else
	{
		$("#placementDetails").hide();
	}


});

</script>


<?php
	include 'footer.php';
?>