diff --git a/app/Controllers/Authentication.php b/app/Controllers/Authentication.php index b73c5a7..c3cdeb2 100644 --- a/app/Controllers/Authentication.php +++ b/app/Controllers/Authentication.php @@ -83,6 +83,8 @@ class Authentication extends BaseController ## Load Forgot password Confirmation Alert public function auth_confirm_mail() { + $this->logger->info("auth confirm mail: auth confirm mail"); + // Get the email address from the request $mail_id = $this->request->getGet('email'); $url_domain = base_url(); @@ -117,7 +119,7 @@ class Authentication extends BaseController // Compose the email $email->setTo($recipient); - $email->setFrom('no-reply@tripapprovaltool.com', 'BB-VBP'); + $email->setFrom('no-reply@tripapprovaltool.com', 'BB-Donor'); $email->setSubject('Email Notification'); // $email->setMessage('This is a notification email from CodeIgniter.'); $email->setMessage($content); diff --git a/app/Controllers/Business.php b/app/Controllers/Business.php index 9083c10..0c52e5d 100644 --- a/app/Controllers/Business.php +++ b/app/Controllers/Business.php @@ -176,14 +176,12 @@ class Business extends BaseController $BusinessModel->update($business_id, $data); } - ## Donation Business Data (Note: not a super-admin means) + ## Donation Business Data (Note: not a super-admin means just updated only) if ($session_role !== 'sadmin') { - if (empty($business_id)) { - $BusinessModel->insertDonationBusiness($businessId); - }else{ - $selectedDonations = $this->request->getPost('name'); - $BusinessModel->updateDonationData($businessId, $selectedDonations); - } + $selectedDonations = $this->request->getPost('name'); + $BusinessModel->updateDonationData($businessId, $selectedDonations); + }else if ($session_role === 'sadmin' && $businessId) { + $BusinessModel->insertDonationBusiness($businessId); } ## Buiness Branch Data diff --git a/app/Controllers/Users.php b/app/Controllers/Users.php index f27ea38..964488a 100644 --- a/app/Controllers/Users.php +++ b/app/Controllers/Users.php @@ -135,7 +135,7 @@ class Users extends BaseController $db = db_connect(); $builder = $db->table('business_branches'); - $branches = $builder->where('business_id', $businessId)->get()->getResultArray(); + $branches = $builder->where(['business_id'=>$businessId,'isactive'=>1])->get()->getResultArray(); return $branches; } diff --git a/app/Models/AuthenticationModel.php b/app/Models/AuthenticationModel.php index 931b74d..34b8cb5 100644 --- a/app/Models/AuthenticationModel.php +++ b/app/Models/AuthenticationModel.php @@ -10,8 +10,7 @@ class AuthenticationModel extends Model public function getheringDetailsForHeader($user_id) { $builder = $this->db->table('users'); - $builder->select('users.user_id,users.business_id,users.profile_picture,users.role,settings.site_name,settings.site_title,settings.favicon,settings.logo as company_logo_large,business.business_logo as company_logo_small,business.email as company_email,business.address as company_address,business.mobile_no as company_mobile_no,business.title,settings.footer_about'); - $builder->join('settings', 'settings.business_id = users.business_id', 'left'); + $builder->select('users.user_id,users.business_id,users.profile_picture,users.role,business.site_name,business.site_title,business.favicon,business.business_logo as company_logo_large,business.business_logo as company_logo_small,business.email as company_email,business.address as company_address,business.mobile_no as company_mobile_no,business.title,business.footer_about'); $builder->join('business', 'business.business_id = users.business_id', 'left'); $builder->where('user_id', $user_id); //$template_mapping_details['fk_entity_id']; @@ -23,8 +22,7 @@ class AuthenticationModel extends Model public function getheringSuperAdminDetailsForHeader($user_id) { $builder = $this->db->table('users'); - $builder->select('users.user_id,users.business_id,users.profile_picture,users.role,app_settings.site_name,app_settings.site_title,app_settings.favicon,app_settings.logo as company_logo_large,business.business_logo as company_logo_small,business.email as company_email,business.address as company_address,business.mobile_no as company_mobile_no,business.title,app_settings.footer_about'); - $builder->join('app_settings', 'app_settings.business_id = users.business_id', 'left'); + $builder->select('users.user_id,users.business_id,users.profile_picture,users.role,business.site_name,business.site_title,business.favicon,business.business_logo as company_logo_large,business.business_logo as company_logo_small,business.email as company_email,business.address as company_address,business.mobile_no as company_mobile_no,business.title,business.footer_about'); $builder->join('business', 'business.business_id = users.business_id', 'left'); $builder->where('user_id', $user_id); //$template_mapping_details['fk_entity_id']; diff --git a/app/Views/auth_login.php b/app/Views/auth_login.php index 79a9713..cca17b5 100644 --- a/app/Views/auth_login.php +++ b/app/Views/auth_login.php @@ -57,8 +57,6 @@
- - Forgot your password?
@@ -81,7 +79,7 @@
- +
@@ -123,21 +121,26 @@ diff --git a/app/Views/business_form.php b/app/Views/business_form.php index 4abb38f..0557984 100644 --- a/app/Views/business_form.php +++ b/app/Views/business_form.php @@ -142,6 +142,7 @@
+ Auto-Text Copied from Buiness title field (First time only)
@@ -165,7 +166,7 @@
- +
@@ -192,7 +193,7 @@
- @@ -232,8 +233,8 @@
- - + +
Please provide.
@@ -275,7 +276,7 @@
- + Logo
@@ -287,7 +288,7 @@
- + Icon
@@ -304,7 +305,7 @@
- + Signature
@@ -400,32 +401,43 @@ }); function validateImage(input) { + const errorMessageElement = document.getElementById('error-message'); + errorMessageElement.textContent = ''; - const errorMessageElement = document.getElementById('error-message'); - errorMessageElement.textContent = ''; + const image = input.files[0]; - - const image = input.files[0]; - - // Check image type - const allowedImageTypes = ['image/jpeg', 'image/png', 'image/gif']; // Add more if needed - if (!allowedImageTypes.includes(image.type)) { - errorMessageElement.textContent = 'Invalid image type. Please select a JPEG, PNG, or GIF image.'; - return; - } - - const maxWidth = 150; - const maxHeight = 100; - - const img = new Image(); - img.onload = function() { - if (img.width > maxWidth || img.height > maxHeight) { - errorMessageElement.textContent = `Image dimensions should not exceed ${maxWidth}x${maxHeight}.`; - } - }; - - img.src = URL.createObjectURL(image); + // Check image type + const allowedImageTypes = ['image/jpeg', 'image/png', 'image/gif']; // Add more if needed + if (!allowedImageTypes.includes(image.type)) { + errorMessageElement.textContent = 'Invalid image type. Please select a JPEG, PNG, or GIF image.'; + input.value = ""; // Clear the input field + return; } + + const maxWidth = 150; + const maxHeight = 100; + + const img = new Image(); + img.onload = function() { + console.log("Image loaded successfully"); + console.log("Image dimensions:", img.width, "x", img.height); + if (img.width > maxWidth || img.height > maxHeight) { + errorMessageElement.textContent = `Image dimensions should not exceed ${maxWidth}x${maxHeight}`; + input.value = ""; // Clear the input field + } else { + // If the image dimensions are within limits, you can proceed with displaying the image + img.src = URL.createObjectURL(image); + } + }; + + img.onerror = function() { + console.error("Error loading image"); + errorMessageElement.textContent = "Error loading image."; + }; + + // Set the src after attaching onload and onerror handlers + img.src = URL.createObjectURL(image); + }