Files
erahn-click/resources/views/auth/registerportal.blade.php
T
2025-10-04 21:51:32 +08:00

218 lines
9.8 KiB
PHP

@extends('includes.login.index')
@section('content')
<title>Daftar Akaun | Portal Pelanggan</title>
<h6 style="text-align: center; margin-bottom: 10%;">Sila isi e-mel dan kata laluan</h6>
<form role="form" method="POST" action="{{ route('register') }}">
@csrf
<input type="hidden" name="icno" value="{{ $icno }}" />
<!-- nama -->
<div class="input-group input-group-outline my-3 bg-light">
<input class="form-control" placeholder="{{ __('Name') }}" type="text" name="name" value="{{ old('name') ? old('name') : $nama }}" readonly required autofocus>
</div>
@if ($errors->has('name'))
<span class="invalid-feedback" style="display: block;" role="alert">
<strong>{{ $errors->first('name') }}</strong>
</span>
@endif
<!-- email -->
<div class="input-group input-group-outline mb-3 {{ $errors->has('email') ? ' has-danger' : '' }}">
<input class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" placeholder="{{ __('E-mel') }}" type="email" name="email" value="{{ old('email') }}" required>
</div>
@if ($errors->has('email'))
<span class="invalid-feedback" style="display: block;" role="alert">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
<!-- password -->
<div class="input-group input-group-outline {{ $errors->has('password') ? ' has-danger' : '' }}" style="position: relative;">
<input id="password" onKeyUp="checkPasswordStrength();" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" placeholder="{{ __('Kata Laluan') }}" type="password" name="password" required>
<span
class="input-group-text border-0 position-absolute end-0 top-0 h-100 d-flex align-items-center"
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: 100%; display: flex; align-items: center; box-shadow: none; top: 0; bottom: 0;"
onclick="togglePasswordVisibility('password', 'eyeIcon-password')"
tabindex="0"
aria-label="Toggle password visibility"
>
<svg id="eyeIcon-password" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
</svg>
</span>
</div>
@if ($errors->has('password'))
<span class="invalid-feedback" style="display: block;" role="alert">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
<div class="text-muted font-italic mb-3">
<small>{{ __('password strength') }}: <span class="text-muted font-weight-700" id="password-strength-status">none</span></small>
</div>
<!-- confirmation password -->
<div class="input-group input-group-outline mb-3" style="position: relative;">
<input name="password_confirmation" id="password_confirmation" class="form-control" placeholder="{{ __('Sahkan Kata Laluan') }}" type="password" required>
<span
class="input-group-text border-0 position-absolute end-0 top-0 h-100 d-flex align-items-center"
style="cursor:pointer; z-index: 3; border-radius: 0 0.375rem 0.375rem 0; border-left: none; border: 1px solid #ced4da; background: transparent; padding: 0 12px; height: 100%; display: flex; align-items: center; box-shadow: none; top: 0; bottom: 0;"
onclick="togglePasswordVisibility('password_confirmation', 'eyeIcon-password_confirmation')"
tabindex="0"
aria-label="Toggle password visibility"
>
<svg id="eyeIcon-password_confirmation" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#6c757d" class="bi bi-eye" viewBox="0 0 16 16">
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
</svg>
</span>
</div>
<div>
<input class="custom-control-input" id="customCheckRegister" type="checkbox" required style="margin-top: 5%;">
<label class="custom-control-label" for="customCheckRegister">
<span class="text-muted">{{ __('Saya setuju dengan segala') }} <a href="https://www.arrahn.com.my/?page_id=1814" target="_blank">{{ __('Terma & Syarat') }}</a></span>
</label>
</div>
<div class="text-center">
<button type="submit" class="btn bg-gradient-dark w-100 my-4 mb-2" style="background: #4A4E59;">Daftar Akaun</button>
</div>
<p class="mt-6 text-sm text-center">
<a href="{{ route('login') }}">Log-Masuk</a>
<a href="#" class="text-dark text-gradient font-weight-bold"> | </a>
<a href="{{ route('password.request') }}">Lupa Kata Laluan</a>
</p>
</form>
<div id="modal-loading" name="myModal" class="modalloading modal fade" role="dialog" style="display:none">
<div class="modal-dialog-loading">
<img src="{{ asset('argon') }}/login/curvebars.svg" style="height:150px;width:150px;">
</div>
</div>
<script>
function checkPasswordStrength() {
var number = /([0-9])/;
var alphabets = /([a-zA-Z])/;
var special_characters = /([~,!,@,#,$,%,^,&,*,-,_,+,=,?,>,<])/;
if ($('#password').val().length > 0 && $('#password').val().length < 6) {
$('#password-strength-status').removeClass();
$('#password-strength-status').addClass('text-danger font-weight-700');
$('#password-strength-status').html("Weak (should be atleast 6 characters.)");
} else if ($('#password').val().length == 0) {
$('#password-strength-status').removeClass();
$('#password-strength-status').addClass('text-muted font-weight-700');
$('#password-strength-status').html("None");
} else {
if ($('#password').val().match(number) && $('#password').val().match(alphabets) && $('#password').val().match(special_characters)) {
$('#password-strength-status').removeClass();
$('#password-strength-status').addClass('text-success font-weight-700');
$('#password-strength-status').html("Strong");
} else {
$('#password-strength-status').removeClass();
$('#password-strength-status').addClass('text-yellow font-weight-700');
$('#password-strength-status').html("Medium (should include alphabets, numbers and special characters.)");
}
}
}
function checkSamePassword() {
if ($('#password').val() !== $('#confirm_password').val()) {
console.log('x sama dengan password');
}
}
function loading_close() {
$('#modal-loading').modal('hide');
}
function loading($timeout = false) {
// $('#modal-loading').modal('hide');
// $('#modal-loading').modal('show');
// $modal = $('#modal-loading');
// $modal.modal({
// backdrop: 'static',
// keyboard: false
// })
// $modal.modal('hide');
// $modal.modal('show');
// var blength = $(".modal-backdrop").length;
// if(blength > 1){
// $(".modal-backdrop:gt(0)").remove();//all el other than first will be removed
// }
// console.log('blength', $('.modal-backdrop').length);
$('.modal-backdrop').slice(1).remove();
$('#modal-loading').modal('show');
if ($timeout) {
setTimeout("loading_close()", $timeout);
}
}
// loading(500);
// var loading = document.getElementsByClassName('loading');
// loading.onclick = function(){
// loading();
// };
document.body.onclick = function(e) {
e = window.event ? event.srcElement : e.target;
if (e.className && e.className.indexOf('loading') != -1) loading();
}
// $('body').on('click', '.loading', function() {
// loading();
// });
$(function() {
$('.login-form').submit(function() {
if ($(this).valid()) {
//
} else {
loading_close();
}
});
});
var slideIndex = 0;
// showSlides();
// function showSlides() {
// var i;
// var slides = document.getElementsByClassName("mySlides");
// for (i = 0; i < slides.length; i++) {
// slides[i].style.display = "none";
// }
// slideIndex++;
// if (slideIndex > slides.length) {
// slideIndex = 1
// }
// slides[slideIndex - 1].style.display = "block";
// setTimeout(showSlides, 10000); // Change image every 2 seconds
// }
function togglePasswordVisibility(inputId, iconId) {
const passwordInput = document.getElementById(inputId);
const eyeIcon = document.getElementById(iconId);
if (passwordInput.type === 'password') {
passwordInput.type = 'text';
eyeIcon.setAttribute('fill', '#12B652');
} else {
passwordInput.type = 'password';
eyeIcon.setAttribute('fill', '#6c757d');
}
}
</script>
@endsection