|
|
|
@ -173,81 +173,7 @@
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
<script>
|
|
|
|
|
<!--document.addEventListener('DOMContentLoaded', function () {-->
|
|
|
|
|
<!-- const getDetailsButton = document.getElementById('getDetailsButton');-->
|
|
|
|
|
<!-- if (getDetailsButton) {-->
|
|
|
|
|
<!-- console.log('Button found, adding event listener.'); // This should print if the button is successfully found-->
|
|
|
|
|
<!-- getDetailsButton.addEventListener('click', function() {-->
|
|
|
|
|
<!-- console.log('Get Details clicked'); // This should print when the button is clicked-->
|
|
|
|
|
<!-- const clientId = document.getElementById('ClientDropdown').value;-->
|
|
|
|
|
<!-- const department = 'hiring_managers'; // Example, adjust as necessary-->
|
|
|
|
|
<!-- fetchContacts(clientId, department);-->
|
|
|
|
|
<!-- });-->
|
|
|
|
|
<!-- } else {-->
|
|
|
|
|
<!-- console.log('Get Details button not found.'); // This helps identify if there's a problem in finding the button-->
|
|
|
|
|
<!-- }-->
|
|
|
|
|
<!--});-->
|
|
|
|
|
|
|
|
|
|
<!-- // Initialize with hiring managers data-->
|
|
|
|
|
<!-- fetchContacts(clientDropdown.value, currentDepartment);-->
|
|
|
|
|
|
|
|
|
|
<!-- // Event listener for "Get Details" button-->
|
|
|
|
|
<!-- getDetailsButton.addEventListener('click', () => {-->
|
|
|
|
|
<!-- fetchContacts(clientDropdown.value, currentDepartment);-->
|
|
|
|
|
<!-- });-->
|
|
|
|
|
|
|
|
|
|
<!-- // Event listeners for department links-->
|
|
|
|
|
<!-- departmentLinks.forEach(link => {-->
|
|
|
|
|
<!-- link.addEventListener('click', (e) => {-->
|
|
|
|
|
<!-- e.preventDefault();-->
|
|
|
|
|
<!-- currentDepartment = e.target.getAttribute('data-department');-->
|
|
|
|
|
<!-- fetchContacts(clientDropdown.value, currentDepartment);-->
|
|
|
|
|
<!-- // Update active class-->
|
|
|
|
|
<!-- departmentLinks.forEach(lnk => lnk.classList.remove('active'));-->
|
|
|
|
|
<!-- e.target.classList.add('active');-->
|
|
|
|
|
<!-- });-->
|
|
|
|
|
<!-- });-->
|
|
|
|
|
|
|
|
|
|
<!-- const updateContactsDisplay = (contacts) => {-->
|
|
|
|
|
<!-- const tableBody = document.querySelector('#originalEmployeeTable tbody');-->
|
|
|
|
|
<!-- tableBody.innerHTML = ''; // Clear existing rows-->
|
|
|
|
|
<!-- contacts.forEach(contact => {-->
|
|
|
|
|
<!-- const row = tableBody.insertRow();-->
|
|
|
|
|
<!-- Object.values(contact).forEach(text => {-->
|
|
|
|
|
<!-- const cell = row.insertCell();-->
|
|
|
|
|
<!-- cell.textContent = text;-->
|
|
|
|
|
<!-- });-->
|
|
|
|
|
<!-- // Add action buttons if needed-->
|
|
|
|
|
<!-- });-->
|
|
|
|
|
|
|
|
|
|
<!-- // Show a message if no contacts found-->
|
|
|
|
|
<!-- if (contacts.length === 0) {-->
|
|
|
|
|
<!-- const row = tableBody.insertRow();-->
|
|
|
|
|
<!-- const cell = row.insertCell();-->
|
|
|
|
|
<!-- cell.textContent = "No data available";-->
|
|
|
|
|
<!-- cell.colSpan = 7;-->
|
|
|
|
|
<!-- }-->
|
|
|
|
|
<!-- };-->
|
|
|
|
|
<!--});-->
|
|
|
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
|
// Console log to confirm the script is running
|
|
|
|
|
console.log('Script is running');
|
|
|
|
|
|
|
|
|
|
// Function to be called when the button is clicked
|
|
|
|
|
function buttonClicked() {
|
|
|
|
|
console.log('Get Details button was clicked');
|
|
|
|
|
// You can place your fetchContacts logic here
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Attach the event listener to the button
|
|
|
|
|
const getDetailsButton = document.getElementById('getDetailsButton');
|
|
|
|
|
if (getDetailsButton) {
|
|
|
|
|
getDetailsButton.addEventListener('click', buttonClicked);
|
|
|
|
|
} else {
|
|
|
|
|
console.log('Get Details button not found');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|