function submitInsertAppointmentForm() { showSpinner(); window.validateAppointmentForm(); } function submitSchedulerDateForm() { showSpinner(); $("#scheduler-date-form").submit(); } function hideAppointmentForm() { $("#form-container").addClass("d-none d-sm-none"); } function showAppointmentForm() { $("#form-container").removeClass("d-none d-sm-none"); window.calcPrependTextSizes(); } function toggleAppointmentForm() { const isVisible = $("#form-container").css("display") === "block"; if(isVisible) { hideAppointmentForm(); } else { showAppointmentForm(); } } function listSearchOnChange(searchInputId, entryClass, textClass) { try { var text = $(`#${searchInputId}`).val().toLowerCase(); const entries = $(`.${entryClass}`); if(text.length === 0) { entries.show(); } $.each(entries, function(index, item) { const customer = $(item); if(customer.find(`.${textClass}`).text().toLowerCase().includes(text)) { customer.show(); } else { customer.hide(); } }); } catch(error) { window.showErrorPopup(error); } } function resetSearch(searchInputId, entryClass) { try { $(`#${searchInputId}`).val(""); $(`.${entryClass}`).show(); } catch (error) { window.showErrorPopup(error); } }