user_registration.blade.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. @extends('frontend.layouts.app')
  2. @section('content')
  3. <section class="gry-bg py-4">
  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('Create an account.')}}
  12. </h1>
  13. </div>
  14. <div class="px-4 py-3 py-lg-4">
  15. <div class="">
  16. <form id="reg-form" class="form-default" role="form" action="{{ route('register') }}" method="POST">
  17. @csrf
  18. <div class="form-group">
  19. <input type="text" class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" value="{{ old('name') }}" placeholder="{{ translate('Full Name') }}" name="name">
  20. @if ($errors->has('name'))
  21. <span class="invalid-feedback" role="alert">
  22. <strong>{{ $errors->first('name') }}</strong>
  23. </span>
  24. @endif
  25. </div>
  26. @if (addon_is_activated('otp_system'))
  27. <div class="form-group phone-form-group mb-1">
  28. <input type="tel" id="phone-code" class="form-control{{ $errors->has('phone') ? ' is-invalid' : '' }}" value="{{ old('phone') }}" placeholder="" name="phone" autocomplete="off">
  29. </div>
  30. <input type="hidden" name="country_code" value="">
  31. <div class="form-group email-form-group mb-1 d-none">
  32. <input type="email" class="form-control {{ $errors->has('email') ? ' is-invalid' : '' }}" value="{{ old('email') }}" placeholder="{{ translate('Email') }}" name="email" autocomplete="off">
  33. @if ($errors->has('email'))
  34. <span class="invalid-feedback" role="alert">
  35. <strong>{{ $errors->first('email') }}</strong>
  36. </span>
  37. @endif
  38. </div>
  39. <div class="form-group text-right">
  40. <button class="btn btn-link p-0 opacity-50 text-reset" type="button" onclick="toggleEmailPhone(this)">{{ translate('Use Email Instead') }}</button>
  41. </div>
  42. @else
  43. <div class="form-group">
  44. <input type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" value="{{ old('email') }}" placeholder="{{ translate('Email') }}" name="email">
  45. @if ($errors->has('email'))
  46. <span class="invalid-feedback" role="alert">
  47. <strong>{{ $errors->first('email') }}</strong>
  48. </span>
  49. @endif
  50. </div>
  51. @endif
  52. <div class="form-group">
  53. <input type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" placeholder="{{ translate('Password') }}" name="password">
  54. @if ($errors->has('password'))
  55. <span class="invalid-feedback" role="alert">
  56. <strong>{{ $errors->first('password') }}</strong>
  57. </span>
  58. @endif
  59. </div>
  60. <div class="form-group">
  61. <input type="password" class="form-control" placeholder="{{ translate('Confirm Password') }}" name="password_confirmation">
  62. </div>
  63. <div class="form-group">
  64. <input type="text" class="form-control" placeholder="{{ translate('Invitation code') }}" name="invit" id="invit">
  65. </div>
  66. @if(get_setting('google_recaptcha') == 1)
  67. <div class="form-group">
  68. <div class="g-recaptcha" data-sitekey="{{ env('CAPTCHA_KEY') }}"></div>
  69. </div>
  70. @endif
  71. <div class="mb-3">
  72. <label class="aiz-checkbox">
  73. <input type="checkbox" name="checkbox_example_1" required>
  74. <span class=opacity-60>{{ translate('By signing up you agree to our terms and conditions.')}}</span>
  75. <span class="aiz-square-check"></span>
  76. </label>
  77. </div>
  78. <div class="mb-5">
  79. <button type="submit" class="btn btn-primary btn-block fw-600">{{ translate('Create Account') }}</button>
  80. </div>
  81. </form>
  82. @if(get_setting('google_login') == 1 || get_setting('facebook_login') == 1 || get_setting('twitter_login') == 1)
  83. <div class="separator mb-3">
  84. <span class="bg-white px-3 opacity-60">{{ translate('Or Join With')}}</span>
  85. </div>
  86. <ul class="list-inline social colored text-center mb-5">
  87. @if (get_setting('facebook_login') == 1)
  88. <li class="list-inline-item">
  89. <a href="{{ route('social.login', ['provider' => 'facebook']) }}" class="facebook">
  90. <i class="lab la-facebook-f"></i>
  91. </a>
  92. </li>
  93. @endif
  94. @if(get_setting('google_login') == 1)
  95. <li class="list-inline-item">
  96. <a href="{{ route('social.login', ['provider' => 'google']) }}" class="google">
  97. <i class="lab la-google"></i>
  98. </a>
  99. </li>
  100. @endif
  101. @if (get_setting('twitter_login') == 1)
  102. <li class="list-inline-item">
  103. <a href="{{ route('social.login', ['provider' => 'twitter']) }}" class="twitter">
  104. <i class="lab la-twitter"></i>
  105. </a>
  106. </li>
  107. @endif
  108. </ul>
  109. @endif
  110. </div>
  111. <div class="text-center">
  112. <p class="text-muted mb-0">{{ translate('Already have an account?')}}</p>
  113. <a href="{{ route('user.login') }}">{{ translate('Log In')}}</a>
  114. <p style="margin-top: 10px;"><a href="{{ route('shops.create') }}" id="shopurl">{{ translate('Registered Shop')}}</a></p>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. </section>
  123. @endsection
  124. @section('script')
  125. @if(get_setting('google_recaptcha') == 1)
  126. <script src="https://www.google.com/recaptcha/api.js" async defer></script>
  127. @endif
  128. <script type="text/javascript">
  129. var invit=getQueryString('leader_id');
  130. $("#invit").val(invit);
  131. function getQueryString(name) {
  132. var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
  133. var r = window.location.search.substr(1).match(reg);
  134. if (r != null) {
  135. return unescape(r[2]);
  136. }
  137. return null;
  138. }
  139. if(invit){
  140. document.getElementById("shopurl").href="{{ route('shops.create') }}"+'?leader_id='+invit;
  141. }
  142. @if(get_setting('google_recaptcha') == 1)
  143. // making the CAPTCHA a required field for form submission
  144. $(document).ready(function(){
  145. // alert('helloman');
  146. $("#reg-form").on("submit", function(evt)
  147. {
  148. var response = grecaptcha.getResponse();
  149. if(response.length == 0)
  150. {
  151. //reCaptcha not verified
  152. alert("please verify you are humann!");
  153. evt.preventDefault();
  154. return false;
  155. }
  156. //captcha verified
  157. //do the rest of your validations here
  158. $("#reg-form").submit();
  159. });
  160. });
  161. @endif
  162. var isPhoneShown = true,
  163. countryData = window.intlTelInputGlobals.getCountryData(),
  164. input = document.querySelector("#phone-code");
  165. for (var i = 0; i < countryData.length; i++) {
  166. var country = countryData[i];
  167. if(country.iso2 == 'bd'){
  168. country.dialCode = '88';
  169. }
  170. }
  171. var iti = intlTelInput(input, {
  172. separateDialCode: true,
  173. utilsScript: "{{ static_asset('assets/js/intlTelutils.js') }}?1590403638580",
  174. onlyCountries: @php echo json_encode(\App\Models\Country::where('status', 1)->pluck('code')->toArray()) @endphp,
  175. customPlaceholder: function(selectedCountryPlaceholder, selectedCountryData) {
  176. if(selectedCountryData.iso2 == 'bd'){
  177. return "01xxxxxxxxx";
  178. }
  179. return selectedCountryPlaceholder;
  180. }
  181. });
  182. var country = iti.getSelectedCountryData();
  183. $('input[name=country_code]').val(country.dialCode);
  184. input.addEventListener("countrychange", function(e) {
  185. // var currentMask = e.currentTarget.placeholder;
  186. var country = iti.getSelectedCountryData();
  187. $('input[name=country_code]').val(country.dialCode);
  188. });
  189. function toggleEmailPhone(el){
  190. if(isPhoneShown){
  191. $('.phone-form-group').addClass('d-none');
  192. $('.email-form-group').removeClass('d-none');
  193. isPhoneShown = false;
  194. $(el).html('{{ translate('Use Phone Instead') }}');
  195. }
  196. else{
  197. $('.phone-form-group').removeClass('d-none');
  198. $('.email-form-group').addClass('d-none');
  199. isPhoneShown = true;
  200. $(el).html('{{ translate('Use Email Instead') }}');
  201. }
  202. }
  203. </script>
  204. @endsection