CREATE TABLE student_jobs (
id INT AUTO_INCREMENT PRIMARY KEY,
student_id INT NOT NULL,
job_name VARCHAR(100),
start_date DATE,
end_date DATE,
hours_worked INT,
hourly_wage DECIMAL(5,2)
);
]]>
function submitWorkHours(studentId, jobName, startDate, endDate, hours) {
fetch('/api/submit-work-hours', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ studentId, jobName, startDate, endDate, hours })
})
.then(response => response.json())
.then(data => console.log('Success:', data))
.catch(error => console.error('Error:', error));
}
]]>