<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <title><?php echo $SITE_NAME;?></title>
  <!-- MDB icon -->
  <link rel="icon" href="images/mdb-favicon.ico" type="image/x-icon">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.11.2/css/all.css">  
  <!-- Bootstrap core CSS -->
  <link rel="stylesheet" href="../css/bootstrap.min.css">
  <!-- Material Design Bootstrap -->
  <!--link rel="stylesheet" href="../css/mdb.min.css"-->
  <!-- Your custom styles (optional) -->
  <link rel="stylesheet" href="../fonts/fonts.css">
  <link rel="stylesheet" href="../css/style.css?version=02">
</head>
<body class="new_login">
<script>
    function CallNameFun()
    {
                    str = $("#registered_name").val().split(" ");  
                    length = str.length; 
                         
                     if(length>1)
                     {
                         
                        if(str[1]=='')
                        {
                            $("#registered_name").val('');
                            $("#CallError").html("Please enter proper full name");
                        }else
                        {
                            $("#CallError").html("");
                        }
                         
                     }else
                     {
                         $("#registered_name").val('');
                         $("#CallError").html("Please enter proper full name");
                     }    
         
    }
</script>
<div id="slideNav">
    <div id="closeMenu">
 <img src="images/close.png" alt="close"></div>
   <div class="linksBox">
  <div id="innerNavRight">
      <ul class="snip1135">
           <li class="current"><a href="#">Pages</a></li>
           <li><a href="#">Price List</a></li>
           <li><a href="#">Photo shoots</a></li>
           <li><a href="#">Elements</a></li>
           <li><a href="#">Blog</a></li>
           <li><a href="#">Proof Gallery</a></li>
           <li><a href="#">Login</a></li>
       </ul>
   </div>    
  </div>
</div>
<div class="wrapper">

   <!-- Features -->
   <div class="innerDeader">
      <div class="container">
          <div class="logoBox">
            <img src="<?php echo ROOTPATH;?>/images/dpmoblogo.png" alt="close">
          </div>
          <h3 class="pageHead">Register</h3>
          <span><?php 
            if(isset($_SESSION['LoginSuccess']))
                echo "You have registered successfully on Daily Pay";
            else if(isset($_SESSION['OtpErr']))  
                echo $_SESSION['OtpErr'];  
            
          ?></span>
     </div>    
   </div>
   <div class="innerBody">
       <div class="container">
           
           <?php 
                if(isset($_SESSION['MobOtp'])) 
            	{
           ?>
          <div class="formBox">
            <form method="post"> 
          
          <div class="form-outline">
            <label class="form-label" for="form12">Enter OTP</label>
            <input type="number" name="Eotp" class="form-control"  />
          </div>
            
              
              
            <div class="bottSpace topSpace"> 
               <input type="submit"  class="btn btn-primary bigBtn" value="Submit OTP" name="SubmitOtp"    />
               <p class="signupLink"> 
                  <a href="<?php echo ROOTPATH; ?>/welcome/register.php?resendOtp=1"; >Resend OTP</a> / 
                  <a href="<?php echo ROOTPATH; ?>/welcome/register.php?CandelReg=1"; >Go Back</a> 
               </p>
            </div>
            
            </form>
            
        </div>    
        <?php 
        }
            else if(!isset($_SESSION['RegiDone'])) 
            {
        ?>
        <div class="formBox">
            <form method="post"> 
          <div class="form-outline">
            <label class="form-label" for="form12">Full Name</label>
            <input type="text"  name="registered_name"  id="registered_name"  class="form-control" onchange="CallNameFun();" required/>
            <span id="CallError"></span>
          </div>
          <div class="form-outline">
            <label class="form-label" for="form12">Mobile</label>
            <input type="number" name="registered_mob"  id="registered_mob"  class="form-control" required  maxlength="10" pattern=".{10,10}"/>
          </div>
          <div class="form-outline">
            <label class="form-label" for="form12">Email</label>
            <input type="email"   name="registered_email"  id="registered_email"  class="form-control" required />
          </div>
          <div class="form-outline">
            <label class="form-label" for="form12">Reference Id</label>
            <input type="text"  name="registered_refId"  id="registered_refId" class="form-control"   <?php if(isset($_REQUEST['RefId'])) { ?> value="<?php echo  $_REQUEST['RefId'];?>" <?php } ?>  <?php if(isset($_SESSION['userId'])) { ?> value="<?php echo  $_SESSION['userId'];?>" <?php } ?>  required />
            <span id="AvailbleId" style="color:green;"><?php echo $RefName;?></span>
          </div>  
          <div class="form-outline">
            <label class="form-label" for="form12">Address</label>
            <input type="text" name="registered_address"  id="registered_address"  class="form-control"  />
          </div>
          <div class="form-outline">
            <label class="form-label" for="typePassword">Password</label>
            <div class="position-relative">
            <input type="password" name="registered_password" id="registered_password"  class="form-control" required />
            <i class="show-password fa fa-eye" id="eyeReg" data-input="registered_password" alt="show" onclick="passShowHideregPass();"></i>
            </div>
          </div>
          <div class="form-outline">
            <label class="form-label" for="typePassword">6 Digit Transaction Pin</label>
            <div class="position-relative">
            <input type="password"   name="registered_txnpwd" id="registered_txnpwd"  class="form-control" required required minlength="6"    maxlength="6"  pattern="[0-9]*" inputmode="numeric"  />
            <i class="show-password fa fa-eye" id="eyeTr" data-input="registered_txnpwd" alt="show" onclick="passShowHideTrPass();"></i>
            </div>
          </div>
          
           <div class="form-outline">
            <label class="form-label" for="typePassword">Enter 4 Digit  Login Pin</label>
            <div class="position-relative">
            <input type="password" id="UserPin"   name="UserPin"   maxlength="4"  class="form-control" required   />
            <i class="show-password fa fa-eye" id="eyepin" data-input="UserPin" alt="show" onclick="passShowHidepin();"></i>
            </div>
          </div>
           

            <!-- Default checkbox -->
            <div class="bottSpace topSpace"> 
               <input type="submit"  class="btn btn-primary bigBtn" value="Register" name="SubmitRef"    />
               <!--input type="submit"  class="btn btn-primary bigBtn mt-2" value="Pool Register" name="SubmitRefpool"    /-->
               <!--input type="submit"  class="btn btn-primary bigBtn mt-2" style="background:#ffa126 !importatnt" value="Special 100 Register" name="SubmitSp100"    /--> 
               <!--input type="submit"  class="btn btn-primary bigBtn mt-2" style="background:#ffa126 !importatnt" value="Student Register" name="SubmitStudent"    /--> 
               <p class="signupLink">
                  <span style="color:#cfcfcf">Already have an account? </span>
                  <a class="text-white" href="<?php echo ROOTPATH;?>/">Login now</a>
               </p>
            </div>
            
            </form>
        </div>  
        
        <?php 
			}  
            else if(isset($_SESSION['LoginSuccess'])) 
            {
        ?>  
        <div class="formBox">
            <form method="post"> 
          <div class="form-outline">
            <label class="form-label" for="form12">Full Name</label>
            <input type="text"  class="form-control"  readonly value="<?php echo $_SESSION['LoginSuccess_name'];?>"/>
          </div>
          <div class="form-outline">
            <label class="form-label" for="form12">Mobile</label>
            <input type="text"  class="form-control"  readonly value="<?php echo $_SESSION['LoginSuccess_ph_no'];?>"/>
          </div>
          <div class="form-outline">
            <label class="form-label" for="form12">Userid</label>
            <input type="text"  class="form-control"  readonly value="<?php echo $_SESSION['LoginSuccess_Id'];?>"/>
          </div>
          <div class="form-outline">
            <label class="form-label" for="form12">Email</label>
            <input type="text"   class="form-control"  readonly value="<?php echo $_SESSION['LoginSuccess_email'];?>"/>
          </div>  
          <div class="form-outline">
            <label class="form-label" for="form12">Password</label>
            <input type="text"   class="form-control"  readonly value="<?php echo $_SESSION['LoginSuccess_password'];?>"/>
          </div>  
              
            <div class="bottSpace topSpace">  
               <p class="signupLink"> 
                  <a href="<?php echo ROOTPATH;?>/" class="btn btn-primary bigBtn" >Login now</a>
               </p>
            </div>
            </form>
        </div>  
            
        <?php 
              } else { 
         ?>      
                      
            <div class="formBox">
            <form method="post">   
            <div class="bottSpace topSpace">  
            
               <p class="signupLink"> 
                  <span> Registration Failed </span> <br>
                  <a href="<?php echo ROOTPATH;?>/"  class="btn btn-primary bigBtn" >
                        
                <?php 
                    if(isset($_SESSION['NameSet']))    
                        echo "Enter Proper Full Name";
                        else
                        echo "Please try again" ;   
                ?> 
                  </a>   
               </p>    
               
            </div>
            </form>
        </div>           
          
      <?php    
            }
       ?>
       </div>
   </div>
 
     
</div>
  <!-- jQuery -->
  <script type="text/javascript" src="../js/jquery.min.js"></script>
  <!-- Bootstrap tooltips -->
  <script type="text/javascript" src="../js/popper.min.js"></script>
  <!-- Bootstrap core JavaScript -->
  <script type="text/javascript" src="../js/bootstrap.min.js"></script>
  <!-- MDB core JavaScript -->
  <script type="text/javascript" src="../js/mdb.min.js"></script>
  <!-- Your custom scripts (optional) -->
  <script type="text/javascript">
  
  $(document).ready(function(){
		 $("#showMenu").click(function(){ 
			 $("#slideNav").animate({
				top: '0',
				opacity: '1'
			 });
			 $(".linksBox").animate({
				right: '0',
				opacity: '1'
			 });
		 })
	 });
	 
	 
     $(document).ready(function(){
		 $("#closeMenu").click(function(){ 
			 $(".linksBox").animate({
				right: '-100%',
				opacity: '0'
			 });
			 $("#slideNav").animate({
				top: '-100%',
				opacity: '0'
			 });
		 })
	 });
	 
	 $(document).ready(function()
        {        
            var URL = "<?php echo ROOTPATH;?>";    
            $( "#registered_refId" ).change(function() 
            {       
                  
                       
              $.ajax({	
                    type: "POST",
                    url: URL+"/ajax/validation.php",
                    data: {userDatacheckTop:1,Data:$("#registered_refId").val()},
                    beforeSend: function(){ 
                    },
                    success: function(data)
                        {       
                            $("#AvailbleId").html("<span style='color:YELLOW;'>"+data+" &#x2713</span>");
                        }
                    });   
            });  
        });    
        
  </script>
	   <script>
function passShowHideregPass() {
  var x = document.getElementById("registered_password");
  if (x.type === "password") {
    x.type = "text";
     $("#eyeReg").addClass("fa-eye-slash").removeClass("fa-eye");
  } else {
    x.type = "password";
    $("#eyeReg").addClass("fa-eye").removeClass("fa-eye-slash");
  }
}
function passShowHideTrPass() {
  var x = document.getElementById("registered_txnpwd");
  if (x.type === "password") {
    x.type = "text";
    $("#eyeTr").addClass("fa-eye-slash").removeClass("fa-eye");
  } else {
    x.type = "password";
    $("#eyeTr").addClass("fa-eye").removeClass("fa-eye-slash");
  }
}
function passShowHidepin() {
  var x = document.getElementById("UserPin");
  if (x.type === "password") {
    x.type = "text";
    $("#eyepin").addClass("fa-eye-slash").removeClass("fa-eye");
  } else {
    x.type = "password";
    $("#eyepin").addClass("fa-eye").removeClass("fa-eye-slash");
  }
}
</script>
</body>
</html>

<?php 
    unset($_SESSION['LoginSuccess']); 
    
    unset($_SESSION['LoginSuccess_name']);
    unset($_SESSION['LoginSuccess_ph_no']);
    unset($_SESSION['LoginSuccess_Id']);
    unset($_SESSION['LoginSuccess_email']); 
    unset($_SESSION['RegiDone']);
    unset($_SESSION['NameSet']); 
?>