edit filter time

This commit is contained in:
2026-06-02 22:17:47 +03:30
parent 300575930f
commit 41d1036300
7 changed files with 844 additions and 250 deletions
+32 -12
View File
@@ -461,6 +461,8 @@ if (!empty($user->tasks)) {
const lngInput = document.getElementById("longitude");
const distanceInput = document.getElementById("distance");
const form = document.getElementById("attendanceForm");
if (submitBtn && latInput && lngInput && distanceInput && distanceMessage && form) {
// naser
if (existed) {
submitBtn.textContent = "خروج";
@@ -571,10 +573,12 @@ if (!empty($user->tasks)) {
});
attendanceForm.submit();
} catch (error) {
output.textContent = error.name === 'NotAllowedError' ? 'احراز هویت لغو شد یا دسترسی مجاز نبود.' : 'عملیات ناموفق بود. لطفاً دوباره امتحان کنید.';
if (output) {
output.textContent = error.name === 'NotAllowedError' ? 'احراز هویت لغو شد یا دسترسی مجاز نبود.' : 'عملیات ناموفق بود. لطفاً دوباره امتحان کنید.';
}
}
});
}
function openCity(evt, Month) {
@@ -611,20 +615,28 @@ if (!empty($user->tasks)) {
{{-- TASKS MODAL--}}
function openTaskModal(task) {
const modal = document.getElementById('taskModal');
if (!modal) {
return;
}
modal.classList.remove('hidden');
modal.classList.add('flex');
// آپدیت متن دکمه بر اساس وضعیت تسک
updateStatusButtonText(task.started_at, task.ended_at);
if (task) {
// آپدیت متن دکمه بر اساس وضعیت تسک
updateStatusButtonText(task.started_at, task.ended_at);
// تنظیم عملکرد دکمه بر اساس تسک فعلی
const statusBtn = document.getElementById('statusBtn');
statusBtn.onclick = () => handleTaskAction(
task.id,
task.p_id,
task.started_at,
task.ended_at
);
// تنظیم عملکرد دکمه بر اساس تسک فعلی
const statusBtn = document.getElementById('statusBtn');
if (statusBtn) {
statusBtn.onclick = () => handleTaskAction(
task.id,
task.p_id,
task.started_at,
task.ended_at
);
}
}
}
// -------------------------------
@@ -648,6 +660,10 @@ if (!empty($user->tasks)) {
// -------------------------------
function updateStatusButtonText(started_at, ended_at) {
const statusBtn = document.getElementById('statusBtn');
if (!statusBtn) {
return;
}
let text = "شروع";
if (started_at && !ended_at) {
@@ -807,6 +823,10 @@ if (!empty($user->tasks)) {
}
function startBreakCounter(initialSeconds) {
if (!breakBtn) {
return;
}
// ensure no duplicate timer
if (breakTimer) clearInterval(breakTimer);
currentSeconds = initialSeconds || 0;