DRAFT
MGT Business Solutons Sdn Bhd
1-9, 2-9 Jalan Bukit Jalil Indah 4,
Komplex Niaga LTAT, Bukit Jalil,
Kuala Lumpur
sales@mugattionline.com.my
01154095478
http://www.mgtbusinesssolutions.com
Kick Start Package
Quote Number Quote_000002
Quote Date 11/09/2025
Valid Until Date 12/09/2025
Total MYR20.00

To

Mugatti Sdn Bhd
quanpolo@gmail.com
123
Service Qty Rate Adjust (%) Total
Marketing service
For testing purposes, you may simulate transactions using these test credentials, and view all test transactions via the sandbox portal. To access the sandbox portal, please login with your registered email address and password: "Password".
1 MYR20.00 MYR20.00
Sub Total:MYR20.00
Total:MYR20.00

Terms & Conditions

1.up of the automated deduction of 2.monthly payment from your bank account using this mandate link. Please note that your 3.settlement may be withheld if this step is not completed.
DRAFT
`; // Write the content to the new window printWindow.document.write(printHTML); printWindow.document.close(); // Wait for content to load, then print printWindow.onload = function() { setTimeout(function() { printWindow.print(); printWindow.close(); }, 500); }; } document.addEventListener('DOMContentLoaded', function() { const quoteId = '13'; const acceptActionDescription = 'This will convert the quote to an invoice.'; const declinedMessage = ''; const isDeclineReasonRequired = false; // Utility: Show loading spinner in a button function setButtonLoading(btn, loadingText) { btn.disabled = true; btn.innerHTML = ` ${loadingText}`; } // resetButtonLoading function is now defined globally above // Accept Quote Button const acceptButton = document.querySelector('.quote-actions .accept'); if (acceptButton) { acceptButton.addEventListener('click', function() { let message = 'Accept this quote?'; if (acceptActionDescription) { message += '\n\n' + acceptActionDescription; } showConfirmationModal( 'Accept Quote', message, 'Accept Quote', 'Cancel', 'primary', function(modal, confirmBtn, originalText) { handleAcceptQuote(quoteId, confirmBtn, originalText); } ); }); } // Decline Quote Button const declineButton = document.querySelector('.quote-actions .decline'); if (declineButton) { declineButton.addEventListener('click', function() { let message = 'Decline this quote?'; if (declinedMessage) { message += '\n\n' + declinedMessage; } if (isDeclineReasonRequired) { showDeclineModalWithReason(); } else { showConfirmationModal( 'Decline Quote', message, 'Decline Quote', 'Cancel', 'danger', function(modal, confirmBtn, originalText) { handleDeclineQuote(quoteId, confirmBtn, originalText); } ); } }); } // Note: Download and Send Email buttons are handled via inline onclick attributes to avoid duplicate bindings // Custom Modal System function showConfirmationModal(title, message, confirmText, cancelText, confirmType, onConfirm) { // Remove existing modal if any const existingModal = document.querySelector('.ei-modal-overlay'); if (existingModal) { existingModal.remove(); } // Create modal overlay const overlay = document.createElement('div'); overlay.className = 'ei-modal-overlay'; // Create modal content const modal = document.createElement('div'); modal.className = 'ei-modal'; const confirmBtnClass = confirmType === 'danger' ? 'ei-modal-btn-danger' : 'ei-modal-btn-primary'; const iconClass = confirmType === 'danger' ? 'danger' : 'info'; const icon = confirmType === 'danger' ? '' : ''; modal.innerHTML = `
${icon}

${title}

${message}
`; overlay.appendChild(modal); document.body.appendChild(overlay); // Show modal with animation setTimeout(() => { overlay.classList.add('show'); modal.classList.add('show'); }, 10); // Handle button clicks const confirmBtn = modal.querySelector('#modal-confirm'); const cancelBtn = modal.querySelector('#modal-cancel'); confirmBtn.addEventListener('click', function() { const originalText = confirmBtn.innerHTML; setButtonLoading(confirmBtn, confirmBtn.textContent.trim()); onConfirm(modal, confirmBtn, originalText); }); cancelBtn.addEventListener('click', function() { hideModal(overlay); }); // Handle overlay click to close overlay.addEventListener('click', function(e) { if (e.target === overlay) { hideModal(overlay); } }); // Handle escape key const handleEscape = function(e) { if (e.key === 'Escape') { hideModal(overlay); document.removeEventListener('keydown', handleEscape); } }; document.addEventListener('keydown', handleEscape); // Focus on confirm button setTimeout(() => { confirmBtn.focus(); }, 100); } // Decline Modal with Reason Field function showDeclineModalWithReason() { // Remove existing modal if any const existingModal = document.querySelector('.ei-modal-overlay'); if (existingModal) { existingModal.remove(); } // Create modal overlay const overlay = document.createElement('div'); overlay.className = 'ei-modal-overlay'; // Create modal content const modal = document.createElement('div'); modal.className = 'ei-modal'; let message = 'Decline this quote?'; if (declinedMessage) { message += '\n\n' + declinedMessage; } modal.innerHTML = `

Decline Quote

${message}
`; overlay.appendChild(modal); document.body.appendChild(overlay); setTimeout(() => { overlay.classList.add('show'); modal.classList.add('show'); }, 10); // Handle button clicks const confirmBtn = modal.querySelector('#modal-confirm'); const cancelBtn = modal.querySelector('#modal-cancel'); const reasonField = modal.querySelector('#decline-reason'); confirmBtn.addEventListener('click', function() { const reason = reasonField.value.trim(); if (!reason) { reasonField.focus(); reasonField.classList.add('error'); return; } const originalText = confirmBtn.innerHTML; setButtonLoading(confirmBtn, confirmBtn.textContent.trim()); handleDeclineQuote(quoteId, confirmBtn, reason, originalText); }); cancelBtn.addEventListener('click', function() { hideModal(overlay); }); overlay.addEventListener('click', function(e) { if (e.target === overlay) { hideModal(overlay); } }); const handleEscape = function(e) { if (e.key === 'Escape') { hideModal(overlay); document.removeEventListener('keydown', handleEscape); } }; document.addEventListener('keydown', handleEscape); setTimeout(() => { reasonField.focus(); }, 100); reasonField.addEventListener('input', function() { this.classList.remove('error'); }); } function hideModal(overlay) { const modal = overlay.querySelector('.ei-modal'); modal.classList.remove('show'); overlay.classList.remove('show'); setTimeout(() => { if (overlay.parentNode) { overlay.remove(); } }, 300); } // Show message in modal (used for AJAX responses) function showModalMessage(type, message, onClose) { // Remove existing modal if any const existingModal = document.querySelector('.ei-modal-overlay'); if (existingModal) { existingModal.remove(); } // Create modal overlay const overlay = document.createElement('div'); overlay.className = 'ei-modal-overlay'; // Create modal content const modal = document.createElement('div'); modal.className = 'ei-modal'; const iconClass = type === 'success' ? 'info' : 'danger'; const icon = type === 'success' ? '' : ''; modal.innerHTML = `
${icon}

${type === 'success' ? 'Success' : 'Error'}

${message}
`; overlay.appendChild(modal); document.body.appendChild(overlay); setTimeout(() => { overlay.classList.add('show'); modal.classList.add('show'); }, 10); const closeBtn = modal.querySelector('#modal-close'); closeBtn.addEventListener('click', function() { hideModal(overlay); if (onClose) onClose(); }); overlay.addEventListener('click', function(e) { if (e.target === overlay) { hideModal(overlay); if (onClose) onClose(); } }); const handleEscape = function(e) { if (e.key === 'Escape') { hideModal(overlay); document.removeEventListener('keydown', handleEscape); if (onClose) onClose(); } }; document.addEventListener('keydown', handleEscape); setTimeout(() => { closeBtn.focus(); }, 100); } // Show loading state in modal function showModalLoading(message) { // Remove existing modal if any const existingModal = document.querySelector('.ei-modal-overlay'); if (existingModal) { existingModal.remove(); } // Create modal overlay const overlay = document.createElement('div'); overlay.className = 'ei-modal-overlay'; // Create modal content const modal = document.createElement('div'); modal.className = 'ei-modal'; modal.innerHTML = `

Please wait...

${message}
`; overlay.appendChild(modal); document.body.appendChild(overlay); setTimeout(() => { overlay.classList.add('show'); modal.classList.add('show'); }, 10); } // Handle Accept Quote — only defined when the viewer can act on // this quote. When the viewer can't (e.g. unauthenticated visitor // with no access token), the function is not emitted and the // per-quote nonce never reaches the DOM (CVE-2026-9021). // Functions moved to global scope above });