link for javascript
document.addEventListener('DOMContentLoaded', function () {
const calculateButton = document.getElementById('calculate');
const generatePDFButton = document.getElementById('generatePDF');
calculateButton.addEventListener('click', calculateTotalCost);
generatePDFButton.addEventListener('click', generatePDF);
function calculateTotalCost() {
const startTime = document.getElementById('startTime').valueAsDate;
const endTime = document.getElementById('endTime').valueAsDate;
const bandType = document.getElementById('bandType').value;
const drumKit = document.getElementById('drumKit').checked;
const guitarAmp = document.getElementById('guitarAmp').checked;
const bassAmp = document.getElementById('bassAmp').checked;
const microphones = document.getElementById('microphones').checked;
const paSystem = document.getElementById('paSystem').checked;
const otherEquipment = document.getElementById('otherEquipment').value;
if (!startTime || !endTime) {
alert('Please select valid start and end times.');
return;
}
const hours = (endTime - startTime) / 3600000; // Convert milliseconds to hours
let rate;
if (bandType === 'local') {
rate = 300;
} else {
rate = 500;
0 Comments