<?php $__env->startSection('content'); ?>
<!-- row -->
<div class="container-fluid row">

<div class="col-md-6">
      <div class="authincation-content">
          <div class="row no-gutters">
              <div class="col-xl-12">
                <?php if(session('status')): ?>
                  <div class="alert alert-success">
                    <?php echo e(session('status')); ?>

                  </div>
                <?php endif; ?>
                <?php if(session('warning')): ?>
                  <div class="alert alert-warning">
                    <?php echo e(session('warning')); ?>


                    <?php if(session('warning') && session('verifyuser')): ?>
                      <?php $vmd = md5(session('verifyuser')); ?>
                      <br><span id="reemail"><a href="#" onclick="resendmail(<?php echo e(session('verifyuser')); ?>,'<?php echo e($vmd); ?>')">Resend verification mail</a></span>
                    <?php endif; ?>
                  </div>
                <?php endif; ?>

                <div class="d-flex justify-content-center">
                  <div class=" spinner spinner-border m-5" role="status" id="spinner">
                    <span class="sr-only">Loading...</span>
                  </div>
                </div>

                  <div class="auth-form">
                      <h4 class="text-center mb-4">Sign in your account</h4>
                      <form action="<?php echo url('/user/loginpost');; ?>" method="post">
                        <?php echo e(csrf_field()); ?>

                          <div class="form-group">
                                <label class="mb-1"><strong>Phone</strong></small></label>
                                <div class="input-group mb-3">
                                  <div class="input-group-prepend">
                                    <select class="form-control">
                                        <option selected>&nbsp;+91&nbsp;</option>
                                    </select>
                                  </div>
                                  <input type="text" id="phone" name="phone" class="form-control" value="" placeholder="Enter 10 digit mobile number" maxlength="10" pattern="\d{10}" required >
                                </div>
                            </div>
                          <div class="form-group">
                              <label class="mb-1"><strong>Password</strong></label>
                              <input type="password" class="form-control" value="" name="password" id="password">
                          </div>
                          <div class="form-row d-flex justify-content-between mt-4 mb-2">
                              
                              <div class="form-group">
                                  <a class="text-primary" href="<?php echo url('/user/forgotpassword');; ?>">Forgot Password?</a>
                              </div>
                          </div>
                          <div class="text-center">
                              <button type="submit" class="btn btn-primary btn-block">Sign Me In</button>
                          </div>
                      </form>
                      
                  </div>
              </div>
          </div>
      </div>
  </div>

<style>
#spinner { display:none; } 
body.busy .spinner { display:block !important; }
</style>
  <div class="col-md-6">
    <div class="col-xl-12">
        <div class="authincation-content">
            <div class="row no-gutters">
              <div class="col-xl-12">
                  <div class="auth-form">
                      <p><h6 class="text-center mb-4">By Signing in, you are agreeing to our Terms and Conditions and Privacy Policy</h6></p>
                      <p><h6 class="text-center mb-4">Please check our home page for more details.</h6></p>
                  </div>
              </div>
          </div>
        </div>
    </div>
    <br>
    <div class="col-xl-12">
        <div class="authincation-content">
            <div class="row no-gutters">
              <div class="col-xl-12">
                  <div class="auth-form">
                      <div class="new-account mt-3">
                          <p>Don't have an account? </p>
                          <div class="text-center">
                              <a class="text-primary" href="<?php echo url('/user/register');; ?>"><button type="button" class="btn btn-primary btn-block">Sign up</button></a>
                          </div>
                      </div>
                  </div>
              </div>
          </div>
        </div>
    </div>
  </div>
</div>


                
 <script>        
         
            $('#phone').keypress(function(e) {
                var a = [];
                var k = e.which;
                

                for (i = 48; i < 58; i++)
                    a.push(i);

                if (!(a.indexOf(k)>=0))
                    e.preventDefault();
            });

    function resendmail(vid,vmd)
    {
      $('#reemail').html('');
      $('body').addClass('busy');
      //alert("here");
      var csrf = "<?php echo e(csrf_token()); ?>";
      $.ajax({
          type: "POST",
          url: "<?php echo e(url('user/resendverificationmail')); ?>",
          dataType : 'json',
          data: {_token: csrf, vid: vid, vmd: vmd},
          success: function( result ) {
            
             
            if(result.statusCode == 200){
                    
                    console.log(result);
                    alert("Verification Mail has been sent to your mail!");
                    $('#reemail').html('');
                    $('body').removeClass('busy');
                   
                    }
            else{
                alert("Oops! Something went wrong!");
                $('body').removeClass('busy');
            }
            
          }
      });  
      
                 
    }

  </script>    
<?php $__env->stopSection(); ?>			
<?php echo $__env->make('layout.public', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/ksstmorg/resources/views/public/login.blade.php ENDPATH**/ ?>