update patients form
This commit is contained in:
parent
f10cdedce9
commit
5f98198b67
@ -1,8 +1,10 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// --- Chat Widget Logic ---
|
||||
const chatForm = document.getElementById('chat-form');
|
||||
const chatInput = document.getElementById('chat-input');
|
||||
const chatMessages = document.getElementById('chat-messages');
|
||||
|
||||
if (chatForm && chatInput && chatMessages) {
|
||||
const appendMessage = (text, sender) => {
|
||||
const msgDiv = document.createElement('div');
|
||||
msgDiv.classList.add('message', sender);
|
||||
@ -36,4 +38,33 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
appendMessage("Sorry, something went wrong. Please try again.", 'bot');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// --- Patient Form: Auto-calculate DOB from Age ---
|
||||
function calculateDobFromAge(ageInputId, dobInputId) {
|
||||
const ageInput = document.getElementById(ageInputId);
|
||||
const dobInput = document.getElementById(dobInputId);
|
||||
|
||||
if (ageInput && dobInput) {
|
||||
ageInput.addEventListener('input', function() {
|
||||
const age = parseInt(this.value);
|
||||
if (!isNaN(age) && age >= 0) {
|
||||
const currentYear = new Date().getFullYear();
|
||||
const birthYear = currentYear - age;
|
||||
// Default to Jan 1st of the birth year
|
||||
const dob = `${birthYear}-01-01`;
|
||||
dobInput.value = dob;
|
||||
|
||||
// Trigger change event if needed (e.g. for validation or other listeners)
|
||||
dobInput.dispatchEvent(new Event('change'));
|
||||
dobInput.dispatchEvent(new Event('input'));
|
||||
} else {
|
||||
dobInput.value = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
calculateDobFromAge('add_patient_age', 'add_patient_dob');
|
||||
calculateDobFromAge('edit_patient_age', 'edit_patient_dob');
|
||||
});
|
||||
34
lang.php
34
lang.php
@ -307,6 +307,23 @@ $translations = [
|
||||
'upload_failed' => 'File upload failed',
|
||||
'profile_updated_successfully' => 'Profile updated successfully',
|
||||
'error_updating_profile' => 'Error updating profile',
|
||||
'settings_updated_successfully' => 'Settings updated successfully.',
|
||||
'company_details' => 'Company Details',
|
||||
'company_name' => 'Company Name',
|
||||
'company_email' => 'Company Email',
|
||||
'company_phone' => 'Company Phone',
|
||||
'company_address' => 'Company Address',
|
||||
'ctr_no' => 'CR No.',
|
||||
'registration_no' => 'Registration No.',
|
||||
'vat_no' => 'VAT No.',
|
||||
'timezone' => 'Timezone',
|
||||
'working_hours_start' => 'Working Hours Start',
|
||||
'working_hours_end' => 'Working Hours End',
|
||||
'currency_settings' => 'Currency Settings',
|
||||
'currency_symbol' => 'Currency Symbol',
|
||||
'decimal_digits' => 'Decimal Digits',
|
||||
'company_logo' => 'Company Logo',
|
||||
'company_favicon' => 'Company Favicon',
|
||||
],
|
||||
'ar' => [
|
||||
'dashboard' => 'لوحة التحكم',
|
||||
@ -615,5 +632,22 @@ $translations = [
|
||||
'upload_failed' => 'فشل تحميل الملف',
|
||||
'profile_updated_successfully' => 'تم تحديث الملف الشخصي بنجاح',
|
||||
'error_updating_profile' => 'خطأ في تحديث الملف الشخصي',
|
||||
'settings_updated_successfully' => 'تم تحديث الإعدادات بنجاح.',
|
||||
'company_details' => 'تفاصيل الشركة',
|
||||
'company_name' => 'اسم الشركة',
|
||||
'company_email' => 'البريد الإلكتروني للشركة',
|
||||
'company_phone' => 'هاتف الشركة',
|
||||
'company_address' => 'عنوان الشركة',
|
||||
'ctr_no' => 'رقم السجل التجاري',
|
||||
'registration_no' => 'رقم التسجيل',
|
||||
'vat_no' => 'الرقم الضريبي',
|
||||
'timezone' => 'المنطقة الزمنية',
|
||||
'working_hours_start' => 'بداية ساعات العمل',
|
||||
'working_hours_end' => 'نهاية ساعات العمل',
|
||||
'currency_settings' => 'إعدادات العملة',
|
||||
'currency_symbol' => 'رمز العملة',
|
||||
'decimal_digits' => 'الخانات العشرية',
|
||||
'company_logo' => 'شعار الشركة',
|
||||
'company_favicon' => 'أيقونة الموقع',
|
||||
]
|
||||
];
|
||||
Loading…
x
Reference in New Issue
Block a user