98 lines
5.1 KiB
PHP
98 lines
5.1 KiB
PHP
<?php
|
|
$name = '';
|
|
$email = '';
|
|
if ( is_user_logged_in() ) {
|
|
$user = wp_get_current_user();
|
|
$name = $user->display_name;
|
|
$email = $user->user_email;
|
|
}
|
|
?>
|
|
|
|
<div class="wedocs-modal-backdrop fixed inset-0 bg-black/50 backdrop-blur-sm z-[60]" id="wedocs-modal-backdrop" style="display:none"></div>
|
|
|
|
<div
|
|
id="wedocs-contact-modal"
|
|
class="wedocs-contact-modal wedocs-hide-print fixed inset-0 z-[70] flex items-start justify-center p-4 sm:p-6 overflow-y-auto"
|
|
style="display:none"
|
|
role="dialog"
|
|
aria-modal="true"
|
|
>
|
|
<div class="w-full max-w-xl my-8 bg-white rounded-3xl shadow-2xl overflow-hidden border border-slate-200">
|
|
<div class="wedocs-modal-header flex items-center justify-between gap-4 px-6 py-5 border-b border-slate-100 bg-gradient-to-l from-brand-500/5 to-transparent">
|
|
<h3 class="text-lg font-bold text-slate-800 m-0">
|
|
<?php esc_html_e( 'چطور میتوانیم کمک کنیم؟', 'wedocs' ); ?>
|
|
</h3>
|
|
<a
|
|
href="#"
|
|
id="wedocs-modal-close"
|
|
class="wedocs-modal-close inline-flex items-center justify-center w-10 h-10 rounded-xl border border-slate-200 text-slate-500 hover:bg-slate-100 hover:text-slate-800 transition-colors"
|
|
aria-label="<?php echo esc_attr__( 'بستن', 'wedocs' ); ?>"
|
|
>
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/></svg>
|
|
</a>
|
|
</div>
|
|
|
|
<div class="wedocs-modal-body p-6">
|
|
<div id="wedocs-modal-errors" class="mb-4"></div>
|
|
|
|
<form id="wedocs-contact-modal-form" action="" method="post" class="space-y-4">
|
|
<div class="wedocs-form-row">
|
|
<label for="name" class="block text-sm font-medium text-slate-700 mb-2"><?php esc_html_e( 'نام', 'wedocs' ); ?></label>
|
|
<input
|
|
type="text"
|
|
name="name"
|
|
id="name"
|
|
value="<?php echo esc_attr( $name ); ?>"
|
|
required
|
|
class="w-full px-4 py-3 border border-slate-200 rounded-xl focus:ring-2 focus:ring-brand-500 focus:border-brand-500 transition-all"
|
|
/>
|
|
</div>
|
|
<div class="wedocs-form-row">
|
|
<label for="email" class="block text-sm font-medium text-slate-700 mb-2"><?php esc_html_e( 'ایمیل', 'wedocs' ); ?></label>
|
|
<input
|
|
type="email"
|
|
name="email"
|
|
id="email"
|
|
placeholder="you@example.com"
|
|
value="<?php echo esc_attr( $email ); ?>"
|
|
<?php disabled( is_user_logged_in() ); ?>
|
|
required
|
|
dir="ltr"
|
|
class="w-full px-4 py-3 border border-slate-200 rounded-xl focus:ring-2 focus:ring-brand-500 focus:border-brand-500 transition-all text-left"
|
|
/>
|
|
</div>
|
|
<div class="wedocs-form-row">
|
|
<label for="subject" class="block text-sm font-medium text-slate-700 mb-2"><?php esc_html_e( 'موضوع', 'wedocs' ); ?></label>
|
|
<input
|
|
type="text"
|
|
name="subject"
|
|
id="subject"
|
|
required
|
|
class="w-full px-4 py-3 border border-slate-200 rounded-xl focus:ring-2 focus:ring-brand-500 focus:border-brand-500 transition-all"
|
|
/>
|
|
</div>
|
|
<div class="wedocs-form-row">
|
|
<label for="message" class="block text-sm font-medium text-slate-700 mb-2"><?php esc_html_e( 'پیام', 'wedocs' ); ?></label>
|
|
<textarea
|
|
name="message"
|
|
id="message"
|
|
rows="5"
|
|
required
|
|
class="w-full px-4 py-3 border border-slate-200 rounded-xl focus:ring-2 focus:ring-brand-500 focus:border-brand-500 transition-all resize-none"
|
|
></textarea>
|
|
</div>
|
|
<div class="wedocs-form-action flex items-center justify-between gap-4 pt-2">
|
|
<p class="text-xs text-slate-500 m-0"><?php echo esc_html__( 'در اسرع وقت پاسخ داده میشود.', 'wedocs' ); ?></p>
|
|
<input
|
|
type="submit"
|
|
name="submit"
|
|
value="<?php echo esc_attr__( 'ارسال', 'wedocs' ); ?>"
|
|
class="px-6 py-3 bg-brand-500 hover:bg-brand-600 text-white rounded-xl font-semibold transition-colors shadow-md hover:shadow-lg cursor-pointer"
|
|
>
|
|
<input type="hidden" name="doc_id" value="<?php the_ID(); ?>">
|
|
<input type="hidden" name="action" value="wedocs_contact_feedback">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|