<section class="page-title centred">
            <div class="bg-layer" style="background-image: url(<?php echo base_url();?>assets/images/background/page-title.jpg);"></div>
            <div class="line-box">
                <div class="line-1"></div>
                <div class="line-2"></div>
            </div>
            <div class="auto-container">
                <div class="content-box">
                    <h1>Create Account</h1>                    
                </div>
            </div>
        </section>
        <!-- page-title end -->


        <!-- contact-style-two -->
        
        <!-- contact-style-two end -->


        <!-- contact-section -->
        <section class="contact-section alternat-2 sec-pad">
            <div class="auto-container">
                    <div class="row clearfix">
                        <div class="col-lg-8 col-md-8 col-sm-12 left-column">
                         <script>
$(document).ready(function(){
	//alert("asdf");
	
	$("#resend_otp").click(function(e){e.preventDefault();
		var mob=$(this).attr("href");
		$.ajax({
			 type: "POST",
			 url: '<?php echo base_url();?>home/ajax_resend_otp',
			 data: {mob:mob},
			 success: function(res){
				 alert("OTP Sent Again");
				//$(".otp_error").html(res);
			 }
		});
	});
	$("#verify_otp").submit(function(e){e.preventDefault();
		//var plid=$("#plid").val();
		$("#verify_otp1").html('<i class="fa fa-spin fa-spinner"></i> Loading..',true);
		var formdata=$(this).serialize();
		$.ajax({
			 type: "POST",
			 url: '<?php echo base_url();?>home/ajax_verify_otp',
			 data: {formdata:formdata},
			 success: function(res){//alert(res);return false;
			 	 $("#verify_otp1").html('Verify OTP');
				 if(res==1){
					$("#verify_otp").after("<br/><h3>Your Registration is Successful. Your Account is pending for Company Approval. You can download our App to start trading.</h3><a href='#' target='_blank' class='btn btn-warning'><i class='fa fa fa-android'></i> Download Android App</a>"); 
					$("#verify_otp").hide();
					//$("#verify_otp1").html("<h3>Your Account is pending for Company Approval</h3>");
					//window.setTimeout(function () {
					//	window.location.href = "<?php //echo base_url();?>home/dashboard";
					//}, 2000);
				 }else{
					$(".otp_error").html(res);
				 }
			 }
			 });
	});
	$("#signupform").submit(function(e){e.preventDefault();
		var formdata=$(this).serialize();
		//alert(formdata);//return false;
		$(".reg_error").hide();
		$(".reg_error").html("");
		if($("#pass").val()!=$("#cpass").val()){
		$(".reg_error").show();
		$(".reg_error").html("Your Both Passwords Doesnot Match.<br/>");return false;
		}
		if($("#pass").val().length<6){
		$(".reg_error").show();
		$(".reg_error").html("Make Sure Your Password is of 6 Character long.<br/>");return false;		
		}
		var phone=$("#phone").val();
		if(phone.length!=10 || !$.isNumeric(phone)){
		$(".reg_error").show();
		$(".reg_error").html("Please Enter a Valid 10 digit Phone Number.<br/>");return false;	
		}
		//$("#submitbtn").attr("disabled",true);
		$("#submitbtn").html('<i class="fa fa-spin fa-spinner"></i> Loading..',true);
		
		$.ajax({
			url: "<?php echo base_url();?>home/ajax_signup", // Url to which the request is send
			type: "POST",             // Type of request to be send, called as method
			data: new FormData(this), // Data sent to server, a set of key/value pairs (i.e. form fields and values)
			contentType: false,       // The content type used when sending data to the server.
			cache: false,             // To unable request pages to be cached
			processData:false,        // To send DOMDocument or non processed data file it is set to false
			success: function(res)   // A function to be called if request succeeds
			{
				// alert(res);
				 //return false;
				 console.log(res);return false;
				 if(res==0){
					 $(".error").html("Email id is Already Registered<br/>");
				 }else if(res==1){
					  $(".error").html("Phone Number is Already Registered<br/>");
				 }else if(res==2){
					  $(".error").html("Invalid Referral Id.<br/>");
				 }else{
					$("#resend_otp").attr("href",res);
					$("#signupform").hide(); 
					$("#verify_otp").show(); 
				 }
				// $("#submitbtn").removeAttr("disabled");
				 $("#submitbtn").html('Register');
			}
		});
	});
});
</script><div class="contact-form">
                        <form action="" method="post" id="signupform" enctype="multipart/form-data">
                            <div class="row">
                                <div class="col-xl-6 col-lg-6 col-md-6">
                                    <h4 class="sub-title">Personal Information</h4>
                                    <div class="section-field iq-mb-30">
                                    <label>Name</label>
                                    <input type="text" required class="form-control" name="name" placeholder="Full Name*">
                                    </div>
                                    <div class="section-field iq-mb-30">
                                    <label>Email</label>
                                    <input type="email" required class="form-control" name="email" placeholder="Email*">
                                    </div>
                                    <div class="section-field iq-mb-30">
                                    <label>Mobile</label>
                                    <input type="text" required  class="form-control" name="phone" id="phone" placeholder="Mobile*">
                                    </div>
                                    <div class="row">
                                    	<div class="col-md-6 section-field iq-mb-30">
                                    <label>Password</label>
                                    		<input type="password" class="form-control" name="password"  id="pass" required placeholder="Create Password*">
                                        </div>
                                        <div class="col-md-6 section-field iq-mb-30">
                                    <label>Confirm Password</label>
                                    		<input type="password" class="form-control" name="cpassword"  id="cpass" required placeholder="Confirm Password*">
                                        </div>
                                    </div>
                                 
                                    		<input type="hidden" class="form-control" name="city"  required placeholder="City*">
                                       
                                    		<input type="hidden" class="form-control" name="pincode" required placeholder="Pincode*">
                                        
                                </div>
                                <div class="col-xl-6 col-lg-6 col-md-6 additional-info">
                                    <h4 class="sub-title">KYC Details</h4>
                                    <div class="section-field iq-mb-30">
                                    <label>Aadhar</label>
                                    <input type="text" required class="form-control" name="aadhar"  placeholder="Aadhar No*">
                                    </div>
                                    <div class="section-field iq-mb-30">
                                    <label>Pan</label>
                                    <input type="text" required class="form-control" name="pan_no" placeholder="PAN No*">
                                    </div>
                                    <div class="row">
                                    <div class="form-group col-md-6 section-field iq-mb-30">
                                        <label style="color:#000;">Upload Aadhar Front</label>
                                        <input type="file" class="form-control" class="form-control" name="aadhar_doc">
                                    </div>
                                    <div class="form-group col-md-6 section-field iq-mb-30">
                                        <label style="color:#000;">Upload Aadhar Back</label>
                                        <input type="file" class="form-control" class="form-control"  name="aadhar_doc2">
                                    </div>
                                    </div>
                                    <div class="form-group section-field iq-mb-30">
                                        <label style="color:#000;">Upload PAN ID</label>
                                        <input type="file" class="form-control" class="form-control" name="pan_doc">
                                    </div>
                                </div>
                            </div>
                            <!--<div class="term-condition">
                                <h4 class="title">Terms and Conditions</h4>
                                <p>
                                    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
                                    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat ipsum dolor sit
                                    amet, consectetur adipiscing elit, sed do eiusmod tempor.
                                    <br>
                                    <br>
                                    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
                                    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat ipsum dolor sit
                                    amet, consectetur adipiscing elit, sed do eiusmod tempor.
                                </p>
                            </div>-->
                            <div class="row">
                                <div class="col-xl-6 col-lg-6">
                                	
                                        <div class="alert alert-danger reg_error" style="display:none;"></div>
                                        
                        <p>By Registering You agree with our terms & conditions</p>
                                    <button class="btn btn-warning" id="submitbtn" type="submit">Secure Sign Up <i class="fas fa-arrow-right"></i></button>
                                </div>
                            </div>
                        </form>
                        <form action="#" method="post" id="verify_otp" style="display:none;">
                                <div class="row">
                                    <div class="form-group col-md-4 offset-md-4">
                                    <div class="text-center section-field iq-mb-30">
                                    <p class="text-warning">Please Verify 6 Digit OTP sent to Your Mobile & Email</p>
                                        <i class="fa fa-mobile fa-5x text-warning"></i><hr/>
                    <input type="text" class="form-control" required name="otp" placeholder="6 Digit Code" style="text-align:center;" />
                                        <p class="text-danger otp_error"></p>
                                        </div>
                                        <button type="submit" id="verify_otp1" class="btn btn-warning">Verify OTP</button> 
                                        <button type="submit" id="resend_otp" class="btn btn-dark pull-right">Resend OTP</button> 
                                    </div>
                                </div>
                            </form></div>
                        </div>
                        
                    </div>
            </div>
        </section>
        <!-- contact-section end -->

