@extends($activeTemplate . 'layouts.app')
@section('panel')
    @php
        $authContent = getContent('authentication.content', true);
    @endphp

                  
                    <form action="{{ route('user.register') }}" method="POST" class="verify-gcaptcha account-form">
                        @csrf
                        
                        
                        
                        



     
    <link rel="stylesheet" href="{{asset ('core/static/home/css/app.css')}}">
    <link rel="stylesheet" href="{{asset ('core/static/home/css/iconfont.css')}}">
    <link rel="stylesheet" href="{{asset ('core/static/home/css/login.css')}}">
    <script type="text/javascript" src="{{asset ('core/static/home/layui/layui.js')}}"></script>
</head>
            @if (session()->get('reference') != null)
                                <div class="col-12">
                                    <p>@lang('You\'re referred by') <i class="fw-bold text--base">{{ session()->get('reference') }}</i></p>
                                </div>
                            @endif
    
<body style="background-image: url('https://perview.freelancerawais.online/eggo/core/img/bg.webp');">



<body class="login-content">
<div class="login-top">
    

    
    <div class="login_bj">
        
        
        
        
        <img src="{{ getImage(getFilePath('logoIcon').'/logo_2.png') }}"></div>
</div>
<div class="login_con">
    <!-- <div class="login_title">EVGO Login</div> -->
    <div class="login_title" style="width: 100%; height: 20px;"></div>
    <div class="login_input">
        <div class="login_input_text">+91</div>
        <div class="login_input_t">
            <div class="login-input-wrapper">
                
                         <input type="text" name="username" class="login-input-input" placeholder="please enter mobile..." required>
                
                
            
            </div>
        </div>
    </div>
    <div class="login_input">
        <div class="login_input_text">
            <img src="{{asset ('core/static/home/img/from_2.png')}}">
        </div>
        <div class="login_input_t">
            <div class="uni-input-wrapper">
            
                               <input type="password" class="login-input-input" placeholder="please enter password..."      name="password" required>
                
                
            </div>
        </div>
    </div>
    
    
    
    
    
    
    
    
    
    
        <div class="login_input">
        <div class="login_input_text">
            <img src="{{asset ('core/static/home/img/from_2.png')}}">
        </div>
        <div class="login_input_t">
            <div class="uni-input-wrapper">
            
                     
                
                
                <input type="password" class="login-input-input" placeholder="please Re enter password..."      name="password_confirmation" required>
                
                
                
                
                
                
            </div>
        </div>
    </div>
    
    

        
    
    
        <div class="login_input">
        <div class="login_input_text">
          
        </div>
        <div class="login_input_t">
            <div class="uni-input-wrapper">
            
                     
                
                
                
                
                 <input type="email"    class="login-input-input" placeholder="please Enter Email..."      name="email" value="{{ old('email') }}" required>
                
                
                
                
            </div>
        </div>
    </div>
    
    

    
    
    
    <div style="display:none;">
          
                    <select name="country" class="form--control form-select">
                                        @foreach ($countries as $key => $country)
                                            <option data-mobile_code="{{ $country->dial_code }}" value="{{ $country->country }}" data-code="{{ $key }}">
                                                {{ __($country->country) }}</option>
                                        @endforeach
                                    </select>
    
    </div>
    
    
        
        <div class="login_input">
        <div class="login_input_text">
          
        </div>
        <div class="login_input_t">
            <div class="uni-input-wrapper">
            
                     
          
                
                
                
                
                
                 <input type="hidden" name="mobile_code">
                                        <input type="hidden" name="country_code">
                                        <input type="number"  class="login-input-input" placeholder="Enter Telegram Number..."          name="mobile" value="{{ old('mobile') }}"  required>
                
            </div>
        </div>
    </div>
    
    
    
    
    <button type="submit"     class="login_btn">Register</button>
    <div class="reg">
     
        <a class="reg-r" href="{{route ('user.login')}}">login Account</a>
    </div>
</div>

</body>
</html>













                        
                   

                          

@endsection

@if ($general->secure_password)
    @push('script-lib')
        <script src="{{ asset('assets/global/js/secure_password.js') }}"></script>
    @endpush
@endif

@push('script')
    <script>
        "use strict";
        (function($) {
            @if ($mobileCode)
                $(`option[data-code={{ $mobileCode }}]`).attr('selected', '');
            @endif
            $('select[name=country]').change(function() {
                $('input[name=mobile_code]').val($('select[name=country] :selected').data('mobile_code'));
                $('input[name=country_code]').val($('select[name=country] :selected').data('code'));
                $('.mobile-code').text('+' + $('select[name=country] :selected').data('mobile_code'));
            });
            $('input[name=mobile_code]').val($('select[name=country] :selected').data('mobile_code'));
            $('input[name=country_code]').val($('select[name=country] :selected').data('code'));
            $('.mobile-code').text('+' + $('select[name=country] :selected').data('mobile_code'));
            $('.checkUser').on('focusout', function(e) {
                var url = '{{ route('user.checkUser') }}';
                var value = $(this).val();
                var token = '{{ csrf_token() }}';
                if ($(this).attr('name') == 'mobile') {
                    var mobile = `${$('.mobile-code').text().substr(1)}${value}`;
                    var data = {
                        mobile: mobile,
                        _token: token
                    }
                }
                if ($(this).attr('name') == 'email') {
                    var data = {
                        email: value,
                        _token: token
                    }
                }
                if ($(this).attr('name') == 'username') {
                    var data = {
                        username: value,
                        _token: token
                    }
                }
                $.post(url, data, function(response) {
                    if (response.data != false && response.type == 'email') {
                        $('#existModalCenter').modal('show');
                    } else if (response.data != false) {
                        $(`.${response.type}Exist`).text(`${response.type} already exist`);
                    } else {
                        $(`.${response.type}Exist`).text('');
                    }
                });
            });
        })(jQuery);
    </script>
@endpush
