Issues fixes : ps
This commit is contained in:
parent
a64b21566f
commit
daa526b65d
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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'];
|
||||
|
||||
@ -57,8 +57,6 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<!-- <a href="auth-recoverpw-2.html" class="text-muted float-right"><small>Forgot your password?</small></a> -->
|
||||
<!-- <a href="<?= base_url()."auth_confirm_mail"; ?>" class="text-muted float-right"><small>Forgot your password?</small></a> -->
|
||||
<a href="#" id="resetLink" class="text-muted float-right"><small>Forgot your password?</small></a>
|
||||
<label for="password">Password</label>
|
||||
<div class="input-group input-group-merge">
|
||||
@ -81,7 +79,7 @@
|
||||
<span class="widget-simple text-center">
|
||||
<div class="media-body align-self-center font-24 avatar-title">
|
||||
|
||||
<small class="mt-3" style="color: black; font-size:18px;"><?= $validationErrors; ?></small>
|
||||
<small class="mt-3" style="color: black; font-size:18px;"><?= $validationErrors; ?></small>
|
||||
|
||||
</div>
|
||||
</span>
|
||||
@ -123,21 +121,26 @@
|
||||
<script src="<?= base_url() . "public/assets/js/app.min.js" ?>"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Fetch email value and set it as href for the reset link
|
||||
$('#emailaddress').on('input', function() {
|
||||
var emailValue = $(this).val();
|
||||
$('#resetLink').attr('href', emailValue ? 'auth_confirm_mail?email=' + emailValue : '#');
|
||||
});
|
||||
|
||||
// Check if email is entered before clicking on forgot password link
|
||||
$('#resetLink').on('click', function(event) {
|
||||
if (!$('#emailaddress').val()) {
|
||||
event.preventDefault();
|
||||
alert('Please enter your email before clicking on "Forgot your password?"');
|
||||
}
|
||||
});
|
||||
$(document).ready(function() {
|
||||
// Fetch email value and set it as href for the reset link
|
||||
$('#emailaddress').on('input', function() {
|
||||
var emailValue = $(this).val();
|
||||
var baseUrl = "<?php echo base_url(); ?>";
|
||||
$('#resetLink').attr('href', emailValue ? baseUrl+'auth_confirm_mail?email='+emailValue : '#');
|
||||
});
|
||||
|
||||
// Check if email is entered before clicking on forgot password link
|
||||
// $('#resetLink').on('click', function(event) {
|
||||
// if (!$('#emailaddress').val()) {
|
||||
// event.preventDefault();
|
||||
// console.log('Please enter your email before clicking on "Forgot your password?"');
|
||||
// alert('Please enter your email before clicking on "Forgot your password?"');
|
||||
// } else {
|
||||
// console.log('Proceeding to password reset link for email:', $('#emailaddress').val());
|
||||
// $('#resetLink').attr('href', 'auth_confirm_mail?email=' + $('#emailaddress').val());
|
||||
// }
|
||||
// });
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
@ -142,6 +142,7 @@
|
||||
<div class="form-group col-md-6">
|
||||
<label for="site_name" class="col-form-label">Site Name</label>
|
||||
<input type="text" class="form-control" id="site_name" name="site_name" value="<?= isset($businesses['site_name']) ? $businesses['site_name'] : '' ?>" placeholder="Site Name" />
|
||||
<?php if ($loged_user === 'sadmin') : ?> <span class="help-block"><small>Auto-Text Copied from Buiness title field (First time only)</small></span> <?php endif; ?>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="site_title" class="col-form-label">Site Title</label>
|
||||
@ -165,7 +166,7 @@
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="currency" class="col-form-label">Currency</label>
|
||||
<input type="text" class="form-control" id="currency" name="currency" placeholder="currency (eg : Rupees,Dollar,Euro)" value="<?= isset($businesses['currency']) ? $businesses['currency'] : '' ?>" />
|
||||
<input type="text" class="form-control" id="currency" name="currency" placeholder="Currency (eg : Rupees,Dollar,Euro)" value="<?= isset($businesses['currency']) ? $businesses['currency'] : '' ?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -192,7 +193,7 @@
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="title" class="col-form-label">Name<span class="text-danger">*</span></label>
|
||||
<select class="form-control" placeholder="PAN Number" id="name" name="name[]" required data-toggle="select2" multiple>
|
||||
<select class="form-control" placeholder="Donation Accepted Name" id="name" name="name[]" required data-toggle="select2" multiple>
|
||||
<option value="0" disabled>--Select--</option>
|
||||
<?php foreach ($donation as $val) : ?>
|
||||
<option value="<?= $val["id"] ?>" <?php if ($val["is_active"] == 1) echo "selected"; ?>> <?= $val["name"] ?> </option>
|
||||
@ -232,8 +233,8 @@
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="mobile_no" class="col-form-label">Contact Person Mobile Number<span class="text-danger"></span></label>
|
||||
<input type="number" class="form-control" id="mobile_no" name="mobile_no[]" placeholder="Contact Person Mobile Number" required data-parsley-type="number" maxlength="10" />
|
||||
<label for="mobile_no" class="col-form-label">Contact Person Mobile <span class="text-danger"></span></label>
|
||||
<input type="number" class="form-control" id="mobile_no" name="mobile_no[]" placeholder="Contact Person Mobile " required data-parsley-type="number" maxlength="10" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
@ -275,7 +276,7 @@
|
||||
</div>
|
||||
<?php if (!empty($businesses['business_logo'])) { ?>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="business_logo" class="col-form-label"> Logo</label>
|
||||
<label for="business_logo" class="col-form-label"> Logo <?= '('.$businesses['business_logo'].')'; ?></label>
|
||||
<img src="<?= base_url('public/uploads/' . $businesses['business_logo']) ?>" alt="Logo" class="preview-image" />
|
||||
</div>
|
||||
<?php } ?>
|
||||
@ -287,7 +288,7 @@
|
||||
</div>
|
||||
<?php if (!empty($businesses['favicon'])) { ?>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="favicon" class="col-form-label">Favicon</label>
|
||||
<label for="favicon" class="col-form-label">Favicon <?= '('.$businesses['favicon'].')'; ?></label>
|
||||
<img src="<?= base_url('public/uploads/' . $businesses['favicon']) ?>" alt="Icon" class="preview-image" />
|
||||
</div>
|
||||
<?php } ?>
|
||||
@ -304,7 +305,7 @@
|
||||
|
||||
<?php if (!empty($businesses['signature'])) { ?>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="bfile" class="col-form-label">Current Signature</label>
|
||||
<label for="bfile" class="col-form-label">Current Signature <?= '('.$businesses['signature'].')'; ?></label>
|
||||
<img src="<?= base_url('public/uploads/' . $businesses['signature']) ?>" alt="Signature" class="preview-image" />
|
||||
</div>
|
||||
<?php } ?>
|
||||
@ -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);
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function toggleSettings(id) {
|
||||
@ -500,6 +512,20 @@
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
var Role = <?php echo json_encode($loged_user); ?>;
|
||||
$('#bname').on('input', function() {
|
||||
if($('#site_name').val() != "" && $('#site_title').val() != "" && Role === 'sadmin'){
|
||||
var bname = $(this).val();
|
||||
$('#site_name').val(bname);
|
||||
$('#site_title').val(bname);
|
||||
if (bname === '' ) {
|
||||
$('#site_name').val('');
|
||||
$('#site_title').val('');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var busiBranchArray = <?php echo json_encode($branches); ?>;
|
||||
|
||||
if (busiBranchArray.length > 0) {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="customerMobile" class="col-form-label">Donor Mobile<span class="text-danger"> *</span></label>
|
||||
<label for="customerMobile" class="col-form-label dm_label">Donor Mobile<span class="text-danger"> *</span></label>
|
||||
<!-- <?php if (get_user_role() != 'accounts') { ?>
|
||||
|
||||
<i type="button" class="fe-plus-circle" id="add-quk-donar" style="font-size: 24px;" data-toggle="modal" data-target="#standard-modal" title="Add Donor"></i>
|
||||
@ -229,7 +229,18 @@
|
||||
var data = <?php echo json_encode($typebaseddonors); ?>;
|
||||
var alldonors = <?php echo json_encode($alldonors); ?>;
|
||||
var editdata = <?php echo json_encode($receipt_details); ?>;
|
||||
var Rt = <?php echo json_encode($receipt_type); ?>;
|
||||
$(function() {
|
||||
|
||||
if (Rt == 'option2') {
|
||||
$('#donor_mobile').prop('disabled', true).removeAttr('required');
|
||||
$('.dm_label').find('.text-danger').remove();
|
||||
} else {
|
||||
$('#donor_mobile').prop('disabled', false).attr('required', true);
|
||||
if ($('.dm_label').find('.text-danger').length == 0) {
|
||||
$('.dm_label').append('<span class="text-danger"> *</span>');
|
||||
}
|
||||
}
|
||||
|
||||
$('#donor_mobile').on('change', function() {
|
||||
if ($(this).val()) {
|
||||
@ -586,7 +597,15 @@
|
||||
});
|
||||
|
||||
function get_donor_details(option) {
|
||||
|
||||
if (option == 'option2') {
|
||||
$('#donor_mobile').prop('disabled', true).removeAttr('required');
|
||||
$('.dm_label').find('.text-danger').remove();
|
||||
} else {
|
||||
$('#donor_mobile').prop('disabled', false).attr('required', true);
|
||||
if ($('.dm_label').find('.text-danger').length == 0) {
|
||||
$('.dm_label').append('<span class="text-danger"> *</span>');
|
||||
}
|
||||
}
|
||||
$('#donor_mobile').val("");
|
||||
$('#donor_first_name').val("");
|
||||
$.ajax({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user