Login , Register ,and onboarding

This commit is contained in:
Thanakorn S
2026-04-28 11:59:49 +07:00
parent d8c55d278a
commit d8fd30c961
25 changed files with 2394 additions and 110 deletions
+20 -1
View File
@@ -1,5 +1,5 @@
<?php
session_start();
require '../session.php';
require '../config.php';
require '../include_header.php';
// successful login
@@ -16,6 +16,12 @@
<div class="card " style="max-width:420px; width:100%;">
<div class="card-body p-5">
<div class="text-center mb-3">
<?php if (!empty($_SESSION['verify_error'])): ?>
<div class="alert alert-danger small py-2 mb-3">
<i class="ti ti-alert-circle me-1"></i>
<?php echo htmlspecialchars($_SESSION['verify_error']); unset($_SESSION['verify_error']); ?>
</div>
<?php endif; ?>
<a href="index.html" class="mb-5 d-inline-block"><img
src="data:image/svg+xml,%3csvg%20width='62'%20height='67'%20viewBox='0%200%2062%2067'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M30.604%2066.378L0.00805664%2048.1582V35.7825L30.604%2054.0023V66.378Z'%20fill='%23302C4D'/%3e%3cpath%20d='M61.1996%2048.1582L30.604%2066.378V54.0023L61.1996%2035.7825V48.1582Z'%20fill='%23E66239'/%3e%3cpath%20d='M30.5955%200L0%2018.2198V30.5955L30.5955%2012.3757V0Z'%20fill='%23657E92'/%3e%3cpath%20d='M61.191%2018.2198L30.5955%200V12.3757L61.191%2030.5955V18.2198Z'%20fill='%23A3B2BE'/%3e%3cpath%20d='M30.604%2048.8457L0.00805664%2030.6259V18.2498L30.604%2036.47V48.8457Z'%20fill='%23302C4D'/%3e%3cpath%20d='M61.1996%2030.6259L30.604%2048.8457V36.47L61.1996%2018.2498V30.6259Z'%20fill='%23E66239'/%3e%3c/svg%3e"
alt="" width="36">
@@ -48,8 +54,18 @@
</div>
</div>
<button class="btn btn-primary w-100" onclick="login();">Sign in</button>
<p class="text-center text-muted small mt-3 mb-0">
Don't have an account?
<a href="<?php echo $server_url?>login/register.php" class="link-primary">Create one</a>
</p>
<?php }else{ ?>
<!-- second step login -->
<div class="alert alert-warning small py-2 mb-3">
<i class="ti ti-mail me-1"></i>
OTP is sent via your company's SMTP setting.
If no SMTP is configured, you will be signed in directly without OTP.
<a href="<?php echo $server_url?>setting/smtp.php" class="alert-link ms-1">Configure SMTP →</a>
</div>
<div class="mb-3">
<label for="otp" class="form-label d-flex justify-content-between">
<span>One Time Password</span>
@@ -96,6 +112,9 @@
// reqquest new otp function
function request_new_otp() {