user_login.blade.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. @extends('frontend.layouts.app')
  2. @section('content')
  3. <section class="gry-bg py-5">
  4. <div class="profile">
  5. <div class="container">
  6. <div class="row">
  7. <div class="col-xxl-4 col-xl-5 col-lg-6 col-md-8 mx-auto">
  8. <div class="card">
  9. <div class="text-center pt-4">
  10. <h1 class="h4 fw-600">
  11. {{ translate('Login to your account.')}}
  12. </h1>
  13. </div>
  14. <div class="px-4 py-3 py-lg-4">
  15. <div class="">
  16. <form class="form-default" role="form" action="{{ route('login') }}" method="POST">
  17. @csrf
  18. @if (addon_is_activated('otp_system') && env("DEMO_MODE") != "On")
  19. <div class="form-group phone-form-group mb-1">
  20. <input type="tel" id="phone-code" class="form-control{{ $errors->has('phone') ? ' is-invalid' : '' }}" value="{{ old('phone') }}" placeholder="" name="phone" autocomplete="off">
  21. </div>
  22. <input type="hidden" name="country_code" value="">
  23. <div class="form-group email-form-group mb-1 d-none">
  24. <input type="email" class="form-control {{ $errors->has('email') ? ' is-invalid' : '' }}" value="{{ old('email') }}" placeholder="{{ translate('Email') }}" name="email" id="email" autocomplete="off">
  25. @if ($errors->has('email'))
  26. <span class="invalid-feedback" role="alert">
  27. <strong>{{ $errors->first('email') }}</strong>
  28. </span>
  29. @endif
  30. </div>
  31. <div class="form-group text-right">
  32. <button class="btn btn-link p-0 opacity-50 text-reset" type="button" onclick="toggleEmailPhone(this)">{{ translate('Use Email Instead') }}</button>
  33. </div>
  34. @else
  35. <div class="form-group">
  36. <input type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" value="{{ old('email') }}" placeholder="{{ translate('Email') }}" name="email" id="email" autocomplete="off">
  37. @if ($errors->has('email'))
  38. <span class="invalid-feedback" role="alert">
  39. <strong>{{ $errors->first('email') }}</strong>
  40. </span>
  41. @endif
  42. </div>
  43. @endif
  44. <div class="form-group">
  45. <input type="password" class="form-control {{ $errors->has('password') ? ' is-invalid' : '' }}" placeholder="{{ translate('Password')}}" name="password" id="password">
  46. </div>
  47. <div class="row mb-2">
  48. <div class="col-6">
  49. <label class="aiz-checkbox">
  50. <input type="checkbox" name="remember" {{ old('remember') ? 'checked' : '' }}>
  51. <span class=opacity-60>{{ translate('Remember Me') }}</span>
  52. <span class="aiz-square-check"></span>
  53. </label>
  54. </div>
  55. <div class="col-6 text-right">
  56. <a href="{{ route('password.request') }}" class="text-reset opacity-60 fs-14">{{ translate('Forgot password?')}}</a>
  57. </div>
  58. </div>
  59. <div class="mb-5">
  60. <button type="submit" class="btn btn-primary btn-block fw-600">{{ translate('Login') }}</button>
  61. </div>
  62. </form>
  63. @if (env("DEMO_MODE") == "On")
  64. <div class="mb-5">
  65. <table class="table table-bordered mb-0">
  66. <tbody>
  67. <tr>
  68. <td>{{ translate('Seller Account')}}</td>
  69. <td>
  70. <button class="btn btn-info btn-sm" onclick="autoFillSeller()">{{ translate('Copy credentials') }}</button>
  71. </td>
  72. </tr>
  73. <tr>
  74. <td>{{ translate('Customer Account')}}</td>
  75. <td>
  76. <button class="btn btn-info btn-sm" onclick="autoFillCustomer()">{{ translate('Copy credentials') }}</button>
  77. </td>
  78. </tr>
  79. <tr>
  80. <td>{{ translate('Delivery Boy Account')}}</td>
  81. <td>
  82. <button class="btn btn-info btn-sm" onclick="autoFillDeliveryBoy()">{{ translate('Copy credentials') }}</button>
  83. </td>
  84. </tr>
  85. </tbody>
  86. </table>
  87. </div>
  88. @endif
  89. @if(get_setting('google_login') == 1 || get_setting('facebook_login') == 1 || get_setting('twitter_login') == 1)
  90. <div class="separator mb-3">
  91. <span class="bg-white px-3 opacity-60">{{ translate('Or Login With')}}</span>
  92. </div>
  93. <ul class="list-inline social colored text-center mb-5">
  94. @if (get_setting('facebook_login') == 1)
  95. <li class="list-inline-item">
  96. <a href="{{ route('social.login', ['provider' => 'facebook']) }}" class="facebook">
  97. <i class="lab la-facebook-f"></i>
  98. </a>
  99. </li>
  100. @endif
  101. @if(get_setting('google_login') == 1)
  102. <li class="list-inline-item">
  103. <a href="{{ route('social.login', ['provider' => 'google']) }}" class="google">
  104. <i class="lab la-google"></i>
  105. </a>
  106. </li>
  107. @endif
  108. @if (get_setting('twitter_login') == 1)
  109. <li class="list-inline-item">
  110. <a href="{{ route('social.login', ['provider' => 'twitter']) }}" class="twitter">
  111. <i class="lab la-twitter"></i>
  112. </a>
  113. </li>
  114. @endif
  115. </ul>
  116. @endif
  117. </div>
  118. <div class="text-center">
  119. <p class="text-muted mb-0">{{ translate('Dont have an account?')}}</p>
  120. <a href="{{ route('user.registration') }}">{{ translate('Register Now')}}</a>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. </section>
  129. @endsection
  130. @section('script')
  131. <script type="text/javascript">
  132. var isPhoneShown = true,
  133. countryData = window.intlTelInputGlobals.getCountryData(),
  134. input = document.querySelector("#phone-code");
  135. for (var i = 0; i < countryData.length; i++) {
  136. var country = countryData[i];
  137. if(country.iso2 == 'bd'){
  138. country.dialCode = '88';
  139. }
  140. }
  141. var iti = intlTelInput(input, {
  142. separateDialCode: true,
  143. utilsScript: "{{ static_asset('assets/js/intlTelutils.js') }}?1590403638580",
  144. onlyCountries: @php echo json_encode(\App\Models\Country::where('status', 1)->pluck('code')->toArray()) @endphp,
  145. customPlaceholder: function(selectedCountryPlaceholder, selectedCountryData) {
  146. if(selectedCountryData.iso2 == 'bd'){
  147. return "01xxxxxxxxx";
  148. }
  149. return selectedCountryPlaceholder;
  150. }
  151. });
  152. var country = iti.getSelectedCountryData();
  153. $('input[name=country_code]').val(country.dialCode);
  154. input.addEventListener("countrychange", function(e) {
  155. // var currentMask = e.currentTarget.placeholder;
  156. var country = iti.getSelectedCountryData();
  157. $('input[name=country_code]').val(country.dialCode);
  158. });
  159. function toggleEmailPhone(el){
  160. if(isPhoneShown){
  161. $('.phone-form-group').addClass('d-none');
  162. $('.email-form-group').removeClass('d-none');
  163. $('input[name=phone]').val(null);
  164. isPhoneShown = false;
  165. $(el).html('{{ translate('Use Phone Instead') }}');
  166. }
  167. else{
  168. $('.phone-form-group').removeClass('d-none');
  169. $('.email-form-group').addClass('d-none');
  170. $('input[name=email]').val(null);
  171. isPhoneShown = true;
  172. $(el).html('{{ translate('Use Email Instead') }}');
  173. }
  174. }
  175. function autoFillSeller(){
  176. $('#email').val('seller@example.com');
  177. $('#password').val('123456');
  178. }
  179. function autoFillCustomer(){
  180. $('#email').val('customer@example.com');
  181. $('#password').val('123456');
  182. }
  183. function autoFillDeliveryBoy(){
  184. $('#email').val('deliveryboy@example.com');
  185. $('#password').val('123456');
  186. }
  187. </script>
  188. @endsection