FIX_SalesTracker3
This commit is contained in:
parent
57ff91a9c8
commit
6f3032d20d
@ -431,8 +431,7 @@ function resetFlatpicker(){
|
|||||||
|
|
||||||
const activityIcons = { Call: "📞", Email: "✉️", Meeting: "📅", Visit: "🚗",Demo: "🎬", Share: "📄", Todo: "✓" };
|
const activityIcons = { Call: "📞", Email: "✉️", Meeting: "📅", Visit: "🚗",Demo: "🎬", Share: "📄", Todo: "✓" };
|
||||||
const salesManagerIds = <?= json_encode($sales_manager_ids ?? []) ?>;
|
const salesManagerIds = <?= json_encode($sales_manager_ids ?? []) ?>;
|
||||||
console.log("***********************");
|
|
||||||
console.log(salesManagerIds);return;
|
|
||||||
const API = '<?= base_url('sales') ?>';
|
const API = '<?= base_url('sales') ?>';
|
||||||
let filter = 'all';
|
let filter = 'all';
|
||||||
let lead_id = null;
|
let lead_id = null;
|
||||||
@ -1124,8 +1123,9 @@ document.getElementById('do_follow').addEventListener('change', function () {
|
|||||||
selectedFollowUpActivityType = ''; // Reset global variable
|
selectedFollowUpActivityType = ''; // Reset global variable
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
const btnSaveContact = document.getElementById('btnSaveContact');
|
||||||
document.getElementById('btnSaveContact').onclick = async (e) => {
|
if (btnSaveContact) {
|
||||||
|
btnSaveContact.onclick = async (e) => {
|
||||||
e.preventDefault(); // Prevent accidental form submission
|
e.preventDefault(); // Prevent accidental form submission
|
||||||
|
|
||||||
// 1. Get and Trim Values
|
// 1. Get and Trim Values
|
||||||
@ -1229,9 +1229,12 @@ document.getElementById('btnSaveContact').onclick = async (e) => {
|
|||||||
console.error("Fetch Error:", error);
|
console.error("Fetch Error:", error);
|
||||||
toastr.error('Network error or server is unreachable.');
|
toastr.error('Network error or server is unreachable.');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById('savedContactsContainer').onclick = async (e) => {
|
const savedContactsContainer = document.getElementById('savedContactsContainer');
|
||||||
|
if (savedContactsContainer) {
|
||||||
|
savedContactsContainer.onclick = async (e) => {
|
||||||
// Check if the clicked element is a Remove button
|
// Check if the clicked element is a Remove button
|
||||||
if (e.target.classList.contains('btnRemoveContact')) {
|
if (e.target.classList.contains('btnRemoveContact')) {
|
||||||
const btn = e.target;
|
const btn = e.target;
|
||||||
@ -1262,6 +1265,7 @@ document.getElementById('savedContactsContainer').onclick = async (e) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function convertDBFormatted(input) {
|
function convertDBFormatted(input) {
|
||||||
|
|
||||||
|
|||||||
@ -1580,7 +1580,9 @@ document.getElementById('do_follow').addEventListener('change', function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('btnSaveContact').onclick = async (e) => {
|
const btnSaveContact = document.getElementById('btnSaveContact');
|
||||||
|
if (btnSaveContact) {
|
||||||
|
btnSaveContact.onclick = async (e) => {
|
||||||
// Use .value instead of .val()
|
// Use .value instead of .val()
|
||||||
let name = document.getElementById('contact_name').value.trim();
|
let name = document.getElementById('contact_name').value.trim();
|
||||||
let mobile = document.getElementById('contact_mobile').value.trim();
|
let mobile = document.getElementById('contact_mobile').value.trim();
|
||||||
@ -1677,8 +1679,11 @@ document.getElementById('btnSaveContact').onclick = async (e) => {
|
|||||||
toastr.error('An error occurred');
|
toastr.error('An error occurred');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
const savedContactsContainer = document.getElementById('savedContactsContainer');
|
||||||
|
if (savedContactsContainer) {
|
||||||
|
savedContactsContainer.onclick = async (e) => {
|
||||||
|
|
||||||
document.getElementById('savedContactsContainer').onclick = async (e) => {
|
|
||||||
// Check if the clicked element is a Remove button
|
// Check if the clicked element is a Remove button
|
||||||
if (e.target.classList.contains('btnRemoveContact')) {
|
if (e.target.classList.contains('btnRemoveContact')) {
|
||||||
const btn = e.target;
|
const btn = e.target;
|
||||||
@ -1709,6 +1714,7 @@ document.getElementById('savedContactsContainer').onclick = async (e) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
async function openEditLeadModal(id) {
|
async function openEditLeadModal(id) {
|
||||||
// 1. Reset UI State
|
// 1. Reset UI State
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user