File: /mnt/data/dreamsai-wp/wp-content/dreams-ai/templates/register-form.php
<?php
/**
* Template Name: Dreams Register Template
*
* This is the template that displays the registration page.
*
* @package DreamsTour
* @version 1.0.0
* @author DreamsTour Team
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( is_user_logged_in() ) {
wp_safe_redirect( site_url( '/' ) );
exit;
}
$registration_enabled = get_option( 'users_can_register' );
$registration_disabled_message = esc_html__( 'Registration is currently disabled. Please enable "Anyone can register" in WordPress General Settings.', 'dreams-tour' );
$main_logo_url = '';
$logo_dark_url = '';
if ( in_array( 'dreams-theme-options-framework/dreams-theme-options-framework.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ) ) {
$main_logo = dreamstour_fl_framework_getoptions( 'frontend_logo' );
if ( ! empty( $main_logo ) && isset( $main_logo['url'] ) ) {
$main_logo_url = $main_logo['url'];
}
$logo_dark = dreamstour_fl_framework_getoptions( 'logo_dark' );
if ( ! empty( $logo_dark ) && isset( $logo_dark['url'] ) ) {
$logo_dark_url = $logo_dark['url'];
}
} else {
$main_logo_url = get_template_directory_uri() . '/assets/images/logo.svg';
$logo_dark_url = get_template_directory_uri() . '/assets/images/logo-dark.svg';
}
get_template_part( 'templates/header/header', 'none' );
?>
<div class="bg-light-2001">
<div class="main-wrapper authentication-wrapper">
<div class="container-fuild">
<div class="w-100 overflow-hidden position-relative flex-wrap d-block vh-100">
<div class="row justify-content-center align-items-center vh-100 overflow-auto flex-wrap">
<div class="col-xxl-4 col-lg-6 col-md-6 col-11 mx-auto">
<div class="p-4 text-center">
<img src="<?php echo esc_url( $logo_dark_url ); ?>" alt="<?php esc_attr_e( 'Logo', 'dreams-tour' ); ?>" class="img-fluid">
</div>
<div class="card authentication-card">
<div class="card-header">
<div class="text-center">
<h5 class="mb-1"><?php esc_html_e( 'Sign Up', 'dreams-tour' ); ?></h5>
<p><?php esc_html_e( 'Create your DreamsTour Account', 'dreams-tour' ); ?></p>
</div>
</div>
<div class="card-body">
<div id="dreams-register-message" class="">
<?php if ( ! $registration_enabled ) : ?>
<div class="alert alert-danger mb-3"><?php echo $registration_disabled_message; ?></div>
<?php endif; ?>
</div>
<form action="" method="post" id="dreams-tour-register-form" autocomplete="off" <?php if ( ! $registration_enabled ) echo 'data-disabled="1"'; ?>>
<?php wp_nonce_field( 'dreams_tour_register', 'dreams_tour_register_nonce' ); ?>
<div class="mb-3 d-flex w-100 gap-3">
<div class="flex-fill custom-radio p-0">
<input type="radio" class="form-check-input" name="user_type" id="dc-customer" value="regular_user" checked>
<label class="form-check-label w-100 text-center" for="dc-customer">
<?php esc_html_e( 'Customer', 'dreams-tour' ); ?>
</label>
</div>
<div class="flex-fill custom-radio p-0">
<input type="radio" class="form-check-input" name="user_type" id="dc-agent" value="agent" >
<label class="form-check-label w-100 text-center" for="dc-agent">
<?php esc_html_e( 'Agent', 'dreams-tour' ); ?>
</label>
</div>
</div>
<div class="mb-3">
<label class="form-label" for="full_name">
<?php esc_html_e( 'Name', 'dreams-tour' ); ?>
</label>
<div class="input-icon">
<span class="input-icon-addon">
<i class="isax isax-user" aria-hidden="true"></i>
</span>
<input type="text" name="full_name" id="full_name" class="form-control form-control-lg" placeholder="<?php esc_attr_e( 'Enter Full Name', 'dreams-tour' ); ?>" required>
</div>
</div>
<div class="mb-3">
<label class="form-label" for="username">
<?php esc_html_e( 'Username', 'dreams-tour' ); ?>
</label>
<div class="input-icon">
<span class="input-icon-addon">
<i class="isax isax-user" aria-hidden="true"></i>
</span>
<input type="text" name="username" id="username" class="form-control form-control-lg" placeholder="<?php esc_attr_e( 'Enter Username', 'dreams-tour' ); ?>" required>
</div>
</div>
<div class="mb-3">
<label class="form-label" for="email">
<?php esc_html_e( 'Email', 'dreams-tour' ); ?>
</label>
<div class="input-icon">
<span class="input-icon-addon">
<i class="isax isax-message" aria-hidden="true"></i>
</span>
<input type="email" name="email" id="email" class="form-control form-control-lg" placeholder="<?php esc_attr_e( 'Enter Email', 'dreams-tour' ); ?>" required>
</div>
</div>
<div class="mb-3">
<label class="form-label" for="password">
<?php esc_html_e( 'Password', 'dreams-tour' ); ?>
</label>
<div class="input-icon">
<span class="input-icon-addon">
<i class="isax isax-lock" aria-hidden="true"></i>
</span>
<input type="password" name="password" id="password" class="form-control form-control-lg pass-input" placeholder="<?php esc_attr_e( 'Enter Password', 'dreams-tour' ); ?>" required minlength="6">
<span class="input-icon-addon toggle-password" role="button" tabindex="0" aria-label="<?php esc_attr_e( 'Toggle password visibility', 'dreams-tour' ); ?>">
<i class="isax isax-eye-slash" aria-hidden="true"></i>
</span>
</div>
</div>
<div class="mb-3">
<label class="form-label" for="confirm_password">
<?php esc_html_e( 'Confirm Password', 'dreams-tour' ); ?>
</label>
<div class="input-icon">
<span class="input-icon-addon">
<i class="isax isax-lock" aria-hidden="true"></i>
</span>
<input type="password" name="confirm_password" id="confirm_password" class="form-control form-control-lg pass-input" placeholder="<?php esc_attr_e( 'Confirm Password', 'dreams-tour' ); ?>" required minlength="6">
<span class="input-icon-addon toggle-password" role="button" tabindex="0" aria-label="<?php esc_attr_e( 'Toggle password visibility', 'dreams-tour' ); ?>">
<i class="isax isax-eye-slash" aria-hidden="true"></i>
</span>
</div>
</div>
<div class="mt-3 mb-3">
<div class="d-flex">
<div class="form-check d-flex align-items-center mb-2">
<input class="form-check-input mt-0" type="checkbox" value="1" id="agree" name="agree_terms" required>
<label class="form-check-label ms-2 text-gray-9 fs-14" for="agree">
<?php
$terms_page_id = function_exists('dreamstour_fl_framework_getoptions') ? dreamstour_fl_framework_getoptions('terms_conditions_page') : 0;
$terms_url = $terms_page_id ? get_permalink( $terms_page_id ) : get_permalink( get_option( 'page_for_posts' ) );
printf(
esc_html__( 'I agree with the %sTerms Of Service%s.', 'dreams-tour' ),
'<a href="' . esc_url( $terms_url ) . '" class="link-primary fw-medium" target="_blank" rel="noopener">',
'</a>'
);
?>
</label>
</div>
</div>
</div>
<div class="mb-3">
<button type="submit" class="btn btn-xl btn-primary d-flex align-items-center justify-content-center w-100">
<?php esc_html_e( 'Register', 'dreams-tour' ); ?>
<i class="isax isax-arrow-right-3 ms-2" aria-hidden="true"></i>
</button>
</div>
<div class="d-flex justify-content-center">
<p class="fs-14">
<?php
$login_page_id = dreamstour_fl_framework_getoptions( 'header_login_link' );
$login_page_url = ! empty( $login_page_id ) ? get_permalink( $login_page_id ) : wp_login_url();
printf(
esc_html__( 'Already have an account? %sSign In%s', 'dreams-tour' ),
'<a href="' . esc_url( $login_page_url ) . '" class="link-primary fw-medium">',
'</a>'
);
?>
</p>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="coprright-footer">
<div class="fs-14">
<?php
$cr = dreamstour_fl_framework_getoptions( 'footer_copyright_text' );
if ( ! empty( $cr ) ) {
echo wp_kses_post( $cr );
}
?>
</div>
</div>
</div>
<div class="xb-cursor tx-js-cursor">
<div class="xb-cursor-wrapper">
<div class="xb-cursor--follower xb-js-follower"></div>
</div>
</div>
</div>
<div class="modal fade" id="registrationSuccessModal" tabindex="-1" aria-labelledby="registrationSuccessModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header align-items-center justify-content-center border-0">
<h5 class="modal-title" id="registrationSuccessModalLabel">
<?php esc_html_e( 'Registration Successful!', 'dreams-tour' ); ?>
</h5>
<button type="button" class="btn-close position-absolute end-0 top-0 m-2" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body text-center">
<div class="mb-3">
<i class="isax isax-tick-circle text-success" style="font-size: 3rem;"></i>
</div>
<p class="mb-0">
<?php esc_html_e( 'Your account has been created successfully. You will be redirected to the login page.', 'dreams-tour' ); ?>
</p>
</div>
<div class="modal-footer border-0 justify-content-center">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">
<?php esc_html_e( 'Continue to Login', 'dreams-tour' ); ?>
</button>
</div>
</div>
</div>
</div>
<?php get_template_part( 'templates/footer/footer', 'none' ); ?>