<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
	<title>Associate Update | Admin Panel</title>

	<!-- Favicons -->
<link rel="shortcut icon" type="image/x-icon" href="../UserProfile/images/logo/logo.png">

	<!-- Bootstrap CSS -->
	<link rel="stylesheet" href="assets/plugins/bootstrap/css/bootstrap.min.css">

	<!-- Fontawesome CSS -->
	<link rel="stylesheet" href="assets/plugins/fontawesome/css/fontawesome.min.css">
	<link rel="stylesheet" href="assets/plugins/fontawesome/css/all.min.css">
	 
	<!-- Animate CSS -->
	<link rel="stylesheet" href="assets/css/animate.min.css">

	<!-- Main CSS -->
	<link rel="stylesheet" href="assets/css/admin.css">
		<!-- Datatables CSS -->
	<link rel="stylesheet" href="assets/plugins/datatables/datatables.min.css">

</head>

<body>
	<div class="main-wrapper">
	
		<!-- Header -->
	<?php include 'include/header.php'; ?>
		<!-- /Header -->
		
		<!-- Sidebar -->
		<?php include 'include/leftmenu.php'; ?>
		<!-- /Sidebar -->
		
		<div class="page-wrapper">
			<div class="content container-fluid">
			<?php
			$member_user_id=$_REQUEST['user_name'];
			$str="Select * from tbl_memberreg where member_user_id='$member_user_id'";
			$res=mysqli_query($connection,$str);
			$row=mysqli_fetch_array($res);
			
			
			?>
				<!-- Page Header -->
				<div class="page-header">
					<div class="row">
						<div class="col">
							<h5 class="page-title text-white">Update Associate  Details <span style="color:yellow"><?php echo $row['member_user_id']; ?></span></h5>
    					
						</div>
					
					</div>
				</div>
				
					<form action="Apk/UpdateAssociateDetails" method="post" id="frmreg">
                	<div class="row">
						<div class="col-sm-12">
							<div class="card">
								<div class="card-header">
								<h6 class="card-title">Personal Details </h6>
								</div>
								<div class="card-body">

									<div class="table-responsive">
										<div class="card filter-card">
						<div class="card-body pb-0">
							<div class="row filter-row">
								<div class="col-sm-6 col-md-3">
									<div class="form-group">
										<label>Sponsor Id</label>
									<input type="text" class="form-control"  placeholder="" name="sponsor_id" id="sponsor_id"  maxLength="10" style="text-transform:uppercase;background-color:#fff" value="<?php echo $row['sponcer_id']; ?>"  maxLength="10" readonly=""/>
									</div>
								</div>
									<div class="col-sm-6 col-md-5">
									<div class="form-group">
										<label>Sponsor Name</label>
										<input type="text" class="form-control" required="" readonly="" name="sponsor_name" id="sponsor_name"   placeholder=""  style="text-transform:uppercase;background-color:#fff" value="<?php echo $row['sponcer_name']; ?>" >
									</div>
								</div>

								<div class="col-sm-6 col-md-4">
									<div class="form-group">
										<label>Associate Id</label>
									<input type="text" class="form-control"  placeholder="" name="member_user_id" id="member_user_id"  maxLength="10" style="text-transform:uppercase;background-color:#fff" value="<?php echo $row['member_user_id']; ?>"  maxLength="10" readonly=""/>
									</div>
								</div>
									<div class="col-sm-6 col-md-4">
									<div class="form-group">
										<label>Associate Name</label>
											<input type="text" class="form-control"  placeholder="" name="member_name" id="member_name"  style="text-transform:uppercase;" onkeydown="return ((event.keyCode >= 65 && event.keyCode <= 90) || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 32)" maxLength="100" value="<?php echo $row['member_name']; ?>"/>
									</div>
								</div>
								
									<div class="col-sm-6 col-md-4">
									<div class="form-group">
										<label>Contact No</label>
											<input type="text" class="form-control" placeholder="" name="contact" id="contact" onkeydown="return ( event.ctrlKey || event.altKey || (47<event.keyCode &amp;&amp; event.keyCode<58 &amp;&amp; event.shiftKey==false) || (95<event.keyCode &amp;&amp; event.keyCode<106) || (event.keyCode==8) || (event.keyCode==9) || (event.keyCode>34 &amp;&amp; event.keyCode<40) || (event.keyCode==46) )" maxLength="10" value="<?php echo $row['contact']; ?>"/>
									</div>
								</div>
								
								<div class="col-sm-6 col-md-4">
									<div class="form-group">
										<label>PAN No</label>
											<input type="text" class="form-control" placeholder="" name="pan_no" id="pan_no" maxLength="10" style="text-transform:uppercase;" value="<?php echo $row['pan_no']; ?>" />
									</div>
								</div>
								
									<div class="col-sm-6 col-md-4">
									<div class="form-group">
										<label>Aadhar No</label>
											<input type="text" class="form-control" placeholder="" name="aadhar_no" id="aadhar_no" maxLength="12" onkeydown="return ( event.ctrlKey || event.altKey || (47<event.keyCode &amp;&amp; event.keyCode<58 &amp;&amp; event.shiftKey==false) || (95<event.keyCode &amp;&amp; event.keyCode<106) || (event.keyCode==8) || (event.keyCode==9) || (event.keyCode>34 &amp;&amp; event.keyCode<40) || (event.keyCode==46) )" value="<?php echo $row['aadhar_number']; ?>"/>
									</div>
								</div>
									<div class="col-sm-6 col-md-4">
									<div class="form-group">
										<label>LEFT BUSINESS</label>
											<input type="text" class="form-control" placeholder="" name="left_business" id="left_business"  style="background-color:#fff" value="<?php echo $row['left_business']; ?>" disabled />
									</div>
								</div>
									<div class="col-sm-6 col-md-4">
									<div class="form-group">
										<label>RIGHT BUSINESS</label>
											<input type="text" class="form-control" placeholder="" name="right_business" id="right_business" maxLength="10" style="background-color:#fff" value="<?php echo $row['right_business']; ?>" disabled />
									</div>
								</div>
							</div>	
							<div class="row filter-row">
								<div class="col-sm-4 col-md-3">
									<div class="form-group">
							      
										<button class="btn btn-success btn-rounded" id="btnsubmit" type="button" onClick="SubmitForm()" style="width:150px;padding-top:10px">Submit</button>
									
									</div>
								
								</div>
							    	<div class="col-sm-6 col-md-6">
									<div class="form-group">
							      <span id="lblmsg" style="color:red; margin-left:10px"></span>
									</div>
									
								</div>

							</div>
						</div>
					</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				    </form>
	<!-- jQuery -->
	<script src="assets/js/jquery-3.5.0.min.js"></script>

	<!-- Bootstrap Core JS -->
	<script src="assets/js/popper.min.js"></script>
	<script src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>

	<!-- Slimscroll JS -->
	<script src="assets/plugins/slimscroll/jquery.slimscroll.min.js"></script>
		<script src="assets/plugins/datatables/jquery.dataTables.min.js"></script>
	<script src="assets/plugins/datatables/datatables.min.js"></script> 

	<!-- Custom JS -->
	<script src="assets/js/admin.js"></script>
	<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script>

function SubmitForm()
{
    var member_user_id=$.trim($("#member_user_id").val());
	var member_name=$.trim($("#member_name").val());
	var contact=$.trim($("#contact").val());
	var pan_no=$.trim($("#pan_no").val());
	var aadhar_no=$.trim($("#aadhar_no").val());
	if(member_user_id.length!=10)
	{
		swal("!Please Fill Assocaite Id");
		return;
	}
	else if(member_name.length==0)
	{
        swal("Fill Associate Name");
		return;
	}


	else if(contact.length!=10)
	{
        swal("!Please Fill Valid Contact Id");
		return;
	}
	else if(pan_no.length!=10)
	{
        swal("!Please Fill Valid PAN No");
		return;
	}
	else if(aadhar_no.length!=12)
	{
        swal("!Please Fill Valid Aadhar No");
		return;
	}
	else
	{
		$("#btnsubmit").attr("disabled", true);
		$("#frmreg").submit();
	}
 }
</script>
</body>

</html>
