|
@@ -0,0 +1,64 @@
|
|
|
+@extends('layouts.join')
|
|
|
+@section('content')
|
|
|
+ <form action=""
|
|
|
+ method="post"
|
|
|
+ enctype="multipart/form-data"
|
|
|
+ onsubmit="return checkIn(this)">
|
|
|
+ @csrf
|
|
|
+
|
|
|
+ <p class="login-box-msg">Welcome! Please check in.</p>
|
|
|
+
|
|
|
+ @if (session('message'))
|
|
|
+ <div class="alert alert-danger">{{ session('message') }}</div>
|
|
|
+ @endif
|
|
|
+
|
|
|
+ <div class="form-group mb-3">
|
|
|
+ <input type="text" name="checkInToken" class="form-control" placeholder="Checkin Token"
|
|
|
+ value="<?= isset($_REQUEST['checkInToken']) ? $_REQUEST['checkInToken'] : ''?>"
|
|
|
+ required
|
|
|
+ <?= !isset($_REQUEST['checkInToken']) ? 'autofocus' : ''?>>
|
|
|
+ </div>
|
|
|
+ <div class="form-group mb-3">
|
|
|
+ <input type="date" name="dob" class="form-control" placeholder="Date of Birth" required <?= isset($_REQUEST['checkInToken']) ? 'autofocus' : ''?>>
|
|
|
+ </div>
|
|
|
+ <button type="submit" class="btn btn-primary btn-block mx-auto w-50 mt-4 mb-2">Check In</button>
|
|
|
+ </form>
|
|
|
+ <script>
|
|
|
+ function checkIn(_form) {
|
|
|
+ $.ajax({
|
|
|
+ type: 'post',
|
|
|
+ url: '/api/session/clientCheckInTokenLogIn',
|
|
|
+ data: $(_form).serialize(),
|
|
|
+ dataType: 'json'
|
|
|
+ })
|
|
|
+ .done(function (_data) {
|
|
|
+ console.log(_data);
|
|
|
+ if(_data.success) {
|
|
|
+ localStorage.sessionKey = _data.data.sessionKey;
|
|
|
+ localStorage.clientUid = _data.data.clientUid;
|
|
|
+ window.location = '/client/dashboard';
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ new Noty({
|
|
|
+ theme: 'mint',
|
|
|
+ type: 'error',
|
|
|
+ text: _data.message,
|
|
|
+ progressBar: false,
|
|
|
+ timeout: false,
|
|
|
+ }).show();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .fail(function (_data) {
|
|
|
+ console.log(_data);
|
|
|
+ new Noty({
|
|
|
+ theme: 'mint',
|
|
|
+ type: 'error',
|
|
|
+ text: _data.message,
|
|
|
+ progressBar: false,
|
|
|
+ timeout: false,
|
|
|
+ }).show();
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+@endsection
|