NASER add admin levels & fix break button

This commit is contained in:
mobin
2026-04-08 09:22:17 +00:00
parent a6b5f27343
commit fcc50d8ec8
8 changed files with 8543 additions and 8374 deletions
+38 -31
View File
@@ -42,7 +42,7 @@ foreach ($users as $u) {
else
$us = false;
$u->working = $us ? 1 : 0;
}else
} else
$u->working = 0;
foreach ($u->attendances as $u_att) {
@@ -93,7 +93,9 @@ $usersChunked = $users->chunk(3);
<th class="px-2 py-2 border w-1/6">تاریخ</th>
<th class="px-2 py-2 border w-1/6">ورود</th>
<th class="px-2 py-2 border w-1/6">خروج</th>
<th class="px-2 py-2 border w-1/6">تعیین وضعیت</th>
@if($userType == 'admin')
<th class="px-2 py-2 border w-1/6">تعیین وضعیت</th>
@endif
</tr>
</thead>
@@ -115,7 +117,7 @@ $usersChunked = $users->chunk(3);
$newEnter = $rec->newenter ? Carbon::parse($rec->newenter)->format('H:i') : null;
$oldExit = $rec->oldexit ? Carbon::parse($rec->oldexit)->format('H:i') : null;
$newExit = $rec->newexit ? Carbon::parse($rec->newexit)->format('H:i') : null;
@endphp
@endphp
@if( $oldEnter == $newEnter || $newEnter == null)
<td class="px-4 py-2 border">{{ $oldEnter ?? '-' }}</td>
@@ -129,28 +131,30 @@ $usersChunked = $users->chunk(3);
<td class="px-4 py-2 border">{{ $oldExit || $newExit ? ($rec->id=='new' || $oldExit==($newExit ?? '') ? $oldExit : $oldExit.'👇🏻'.$newExit) : '-' }}</td>
@endif
<td class="px-4 py-2 border">
<form method="post" action="{{route('admin.update')}}">
@csrf
<input type="hidden" name="update" id="update" value="approve">
<input type="hidden" name="data" id="data"
value="{{json_encode($rec)}}">
<button class="bg-white rounded w-full"
style="background-color: #81ff65; margin-bottom: 5px">
تایید
</button>
</form>
<form method="post" action="{{route('admin.update')}}">
@csrf
<input type="hidden" name="update" id="update" value="reject">
<input type="hidden" name="data" id="data"
value="{{json_encode($rec)}}">
<button class="bg-white rounded w-full"
style="background-color: #ff6565">
رد
</button>
</form>
</td>
@if($userType == 'admin')
<td class="px-4 py-2 border">
<form method="post" action="{{route('admin.update')}}">
@csrf
<input type="hidden" name="update" id="update" value="approve">
<input type="hidden" name="data" id="data"
value="{{json_encode($rec)}}">
<button class="bg-white rounded w-full"
style="background-color: #81ff65; margin-bottom: 5px">
تایید
</button>
</form>
<form method="post" action="{{route('admin.update')}}">
@csrf
<input type="hidden" name="update" id="update" value="reject">
<input type="hidden" name="data" id="data"
value="{{json_encode($rec)}}">
<button class="bg-white rounded w-full"
style="background-color: #ff6565">
رد
</button>
</form>
</td>
@endif
</tr>
@empty
<tr>
@@ -196,13 +200,16 @@ $usersChunked = $users->chunk(3);
</p>
</a>
<button type="button"
class="rounded-lg bg-cyan-500 hover:bg-cyan-600"
onclick="window.location.href='{{ url('attendance/profile').'?username='.$u->user_name }}'"
style=" border: none; color: white; padding: 5px 10px; text-align: center; text-decoration: none;
@if($userType == 'admin')
<button type="button"
class="rounded-lg bg-cyan-500 hover:bg-cyan-600"
onclick="window.location.href='{{ url('attendance/profile').'?username='.$u->user_name }}'"
style=" border: none; color: white; padding: 5px 10px; text-align: center; text-decoration: none;
display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; ">
ویرایش
</button>
ویرایش
</button>
@endif
</div>
@endforeach