« Back to History
mesr_stock_entry.js
|
20260920_164915.php
Initial Domain Snapshot
Copy Code
document.addEventListener('DOMContentLoaded', function(){ window.showSection = function(name){ ['machine','open_box','closed_box','bobin','kasab'].forEach(function(s){ var el = document.getElementById('section_' + s); if (el) el.style.display = 'none'; }); var t = document.getElementById('section_' + name); if (t) t.style.display = 'block'; }; document.body.addEventListener('click', function(e){ if (e.target.classList.contains('add-row-btn')) { var key = e.target.dataset.target; var body = document.getElementById(key + '_body'); var tpl = document.getElementById(key + '_row_tpl'); if (!body || !tpl) { alert('Template missing for ' + key); return; } body.insertAdjacentHTML('beforeend', tpl.innerHTML); } if (e.target.classList.contains('remove-row-btn')) { e.target.closest('tr').remove(); } }); });