tsks
This commit is contained in:
Regular → Executable
+237
-81
@@ -1,5 +1,13 @@
|
||||
<?php
|
||||
use App\Models\User;
|
||||
if(isset($_COOKIE['token-0']))
|
||||
$user_p = User::select('name')->where('user_name', $_COOKIE['user_identity'])->first();
|
||||
//dd($user_p);
|
||||
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en" dir="rtl">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
@@ -7,12 +15,25 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<script src="{{url('/src/tailwindcss.js')}}"></script>
|
||||
<title>سامانه حضور و غیاب</title>
|
||||
|
||||
{{--ساعت--}}
|
||||
<link rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/clockpicker/0.0.7/bootstrap-clockpicker.min.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clockpicker/0.0.7/bootstrap-clockpicker.min.js"></script>
|
||||
{{--تاریخ--}}
|
||||
<link rel="stylesheet" href="https://unpkg.com/persian-datepicker@1.2.0/dist/css/persian-datepicker.css">
|
||||
|
||||
<script src="https://unpkg.com/persian-date@1.1.0/dist/persian-date.js"></script>
|
||||
<script src="https://unpkg.com/persian-datepicker@1.2.0/dist/js/persian-datepicker.js"></script>
|
||||
|
||||
|
||||
<link rel="manifest" href="manifest.json">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" rel="stylesheet"/>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Baloo+Bhaijaan+2:wght@600&display=swap" rel="stylesheet">
|
||||
|
||||
|
||||
<style>
|
||||
/* Ignore CSS variable inspection */
|
||||
:root {
|
||||
@@ -21,6 +42,25 @@
|
||||
--text-color: #ffffff;
|
||||
|
||||
}
|
||||
|
||||
.clockpicker-popover {
|
||||
position: fixed !important;
|
||||
/* مهم: fixed نسبت به viewport */
|
||||
left: 50% !important;
|
||||
/* افقی وسط */
|
||||
top: 50% !important;
|
||||
/* عمودی وسط */
|
||||
transform: translate(-50%, -50%) !important;
|
||||
/* دقیقاً وسط */
|
||||
z-index: 99999 !important;
|
||||
direction: ltr !important;
|
||||
/* چپ به راست */
|
||||
}
|
||||
|
||||
.hidden-row {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -32,6 +72,7 @@
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
||||
.title {
|
||||
padding-right: 28px;
|
||||
font-size: 28px;
|
||||
@@ -44,7 +85,8 @@
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.title::before, .title::after {
|
||||
.title::before,
|
||||
.title::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
height: 16px;
|
||||
@@ -65,7 +107,8 @@
|
||||
animation: pulse 1s linear infinite;
|
||||
}
|
||||
|
||||
.message, .signin {
|
||||
.message,
|
||||
.signin {
|
||||
color: rgba(88, 87, 87, 0.822);
|
||||
font-size: 14px;
|
||||
}
|
||||
@@ -114,7 +157,8 @@
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
.form label .input:focus + span, .form label .input:valid + span {
|
||||
.form label .input:focus + span,
|
||||
.form label .input:valid + span {
|
||||
left: 10px;
|
||||
top: 30px;
|
||||
font-size: 0.7em;
|
||||
@@ -145,6 +189,7 @@
|
||||
transform: scale(0.9);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
to {
|
||||
transform: scale(1.8);
|
||||
opacity: 0;
|
||||
@@ -153,7 +198,8 @@
|
||||
|
||||
@font-face {
|
||||
font-family: 'MyCustomFont';
|
||||
src: url('{{url('/src/fonts/woff/iranyekanwebregularfanum.woff')}}') format('woff2'), url('{{url('/src/fonts/woff/iranyekanwebregularfanum.woff')}}') format('woff');
|
||||
src: url('{{url('/src/fonts/woff/iranyekanwebregularfanum.woff')}}') format('woff2'),
|
||||
url('{{url('/src/fonts/woff/iranyekanwebregularfanum.woff')}}') format('woff');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
@@ -176,59 +222,157 @@
|
||||
max-width: 420px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
/* Style the tab */
|
||||
.tab {
|
||||
overflow: hidden;
|
||||
/*border: 1px solid #ccc;*/
|
||||
/*background-color: #f1f1f1;*/
|
||||
}
|
||||
|
||||
/* Style the buttons inside the tab */
|
||||
.tab button {
|
||||
background-color: #cfcfcf;
|
||||
float: left;
|
||||
border: 1px solid rgba(0, 0, 0, 0);
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
padding: 10px 16px 8px 16px;
|
||||
transition: 0.3s;
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
/* Change background color of buttons on hover */
|
||||
.tab button:hover {
|
||||
background-color: #ededed;
|
||||
}
|
||||
|
||||
/* Create an active/current tablink class */
|
||||
.tab button.active {
|
||||
background-color: #feffff;
|
||||
|
||||
}
|
||||
|
||||
/* Style the tab content */
|
||||
.tabcontent {
|
||||
display: none;
|
||||
padding: 0px 0px;
|
||||
/*border: 1px solid #ccc;*/
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
@yield('style')
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@if (session('message'))
|
||||
<div id="error-box"
|
||||
class="bg-red-500 text-white p-4 rounded shadow-md fixed top-5 left-1/2 transform -translate-x-1/2 transition-opacity duration-1000 ease-in-out opacity-100"
|
||||
style="z-index: 100; background:{{ session('message.color') }};width: 80%;">
|
||||
{{ session('message.text') }}
|
||||
</div>
|
||||
<center>
|
||||
<div id="error-box"
|
||||
class="bg-red-500 text-white p-4 rounded shadow-md fixed top-5 left-1/2 transform -translate-x-1/2 transition-opacity
|
||||
duration-1000 ease-in-out opacity-100"
|
||||
style="z-index: 100; background:{{ session('message.color') }};width: 90%;">
|
||||
{{ session('message.text') }}
|
||||
</div>
|
||||
</center>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
<div style="max-width: 420px; width: 100%;">
|
||||
<div class="header"
|
||||
style="position: fixed;padding: 6px; top: 0;max-width: 420px; width: 100%; z-index: 11; background-color: #16c8ce;font-size: 24px;font-weight: 600; color: #FFFFFF">
|
||||
<div style="max-width: 420px; width: 100%; ">
|
||||
@if(url()->current() != url('/tasks'))
|
||||
<div class="flex mr-6 object-right-bottom bottom-20 fixed z-10 ">
|
||||
<a class="bg-cyan-500 rounded-full size-14 flex justify-center items-center "
|
||||
href="/tasks">
|
||||
<i class=" fa-solid fa-list-check " style="color: white"></i>
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
<div class="header bg-cyan-500"
|
||||
style="position: fixed;padding: 6px; top: 0;max-width: 420px; width: 100%; z-index: 11;
|
||||
/*background-color: #16c8ce;*/
|
||||
font-size: 24px;font-weight: 600; color: #FFFFFF">
|
||||
<div style="padding: 5px 30px 5px 30px; display: flex;justify-content:center">
|
||||
<div class="headerItems">
|
||||
<label>wolog</label>
|
||||
{{-- <label>{{$user->name}}</label>--}}
|
||||
{{-- @if(isset($_COOKIE['token_0']) || isset($_COOKIE['token_1']) || isset($_COOKIE['token_2']))--}}
|
||||
{{-- <label style="font-size: 12px">({{ $user->type == 0 ? 'ادمین' : ($user->type == 1 ? 'میزبان' :($user->type == 2 ? 'دعوت کننده' : 'مهمان')) }}--}}
|
||||
{{-- )</label>--}}
|
||||
{{-- @endif--}}
|
||||
<div class="headerItems flex items-center justify-between text-white">
|
||||
<!-- Logout -->
|
||||
<label class=" items-center space-x-2 cursor-pointer"
|
||||
onclick="window.location.href = '{{url('attendance/logMeOut')}}'">
|
||||
<i class="fa-solid fa-right-from-bracket"></i>
|
||||
</label>
|
||||
|
||||
<!-- Logo وسط -->
|
||||
@if(isset($_COOKIE['token-0']))
|
||||
<label class="mx-auto font-bold">{{$user_p->name}}<br>
|
||||
</label>
|
||||
@else
|
||||
<label class="mx-auto font-bold">مُنتسک<br>
|
||||
</label>
|
||||
@endif
|
||||
|
||||
|
||||
<!-- Refresh -->
|
||||
<label class=" items-center cursor-pointer"
|
||||
onclick="window.location.href = '{{url('')}}'">
|
||||
<i class="fa-solid fa-arrows-rotate"></i>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-bottom: 48px;"></div>
|
||||
|
||||
@if(isset($attendance_recorder) and $attendance_recorder==1 or true)
|
||||
|
||||
@else
|
||||
<div class="fixed bottom-0 max-w-[420px] w-full z-20">
|
||||
<form id="actionForm" method="POST" class="flex justify-around gap-4 items-center px-4 py-1 bg-[#16c8ce] text-[25px]" style="padding: 15px 0 10px 0">
|
||||
@csrf
|
||||
@if(isset($_COOKIE['token_0']) || isset($_COOKIE['token_1']) || isset($_COOKIE['token_2']))
|
||||
<button type="button" onclick="submitForm('up')"><i class="fa-solid fa-arrow-up text-white"></i></button>
|
||||
@endif
|
||||
<button type="button" onclick="submitForm('logout')"><i class="fa-solid fa-right-from-bracket text-white"></i></button>
|
||||
<button type="button" onclick="submitForm('', 'GET')"><i class="fa-solid fa-house text-white"></i></button>
|
||||
{{-- @if(isset($attendance_recorder) and $attendance_recorder == 1 or true)--}}
|
||||
|
||||
<button type="button" onclick="submitForm('edit')"><i class="fa-solid fa-user text-white"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
@endif
|
||||
{{-- @else--}}
|
||||
<div class="fixed bottom-0 max-w-[420px] w-full z-20">
|
||||
<form id="actionForm" method="POST"
|
||||
class="flex justify-around gap-4 items-center px-4 py-1 bg-cyan-500 text-[25px]"
|
||||
style="padding: 15px 0 10px 0">
|
||||
@csrf
|
||||
@if(isset($_COOKIE['token_0']) || isset($_COOKIE['token_1']) || isset($_COOKIE['token_2']))
|
||||
<button type="button" onclick="submitForm('up')"><i
|
||||
class="fa-solid fa-arrow-up text-white"></i></button>
|
||||
@endif
|
||||
{{-- attendances list--}}
|
||||
@if(isset($_COOKIE['token-0']))
|
||||
<button type="button" onclick="submitForm('/back')"><i
|
||||
class="fa-solid fa-backward-step text-white"></i>
|
||||
</button>
|
||||
@endif
|
||||
@if(isset($_COOKIE['user_identity']))
|
||||
<button type="button" onclick="submitForm('{{route('attendance.show')}}','')"><i
|
||||
class="fa-solid fa-clipboard-user text-white"></i></button>
|
||||
@endif
|
||||
|
||||
<button type="button" onclick="submitForm('/', 'GET')"><i
|
||||
class="fa-solid fa-house text-white"></i></button>
|
||||
@if(!request()->is("admin") && (isset($_COOKIE['ad']) && $_COOKIE['ad']==1))
|
||||
|
||||
<button type="button" onclick="submitForm('{{route('admin.dashboard')}}', 'GET')"><i
|
||||
class="fa-solid fa-users text-white"></i></button>
|
||||
@elseif(request()->is("admin") && (isset($_COOKIE['ad']) && $_COOKIE['ad']==1))
|
||||
<button type="button" onclick="submitForm('/', 'GET')"><i
|
||||
class="fa-solid fa-users text-white"></i></button>
|
||||
@endif
|
||||
@if(isset($_COOKIE['user_identity']))
|
||||
|
||||
<button type="button" onclick="submitForm('{{route('user.profile')}}', 'GET')"><i
|
||||
class="fa-solid fa-user text-white"></i></button>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
{{-- @endif--}}
|
||||
|
||||
<script>
|
||||
function submitForm(action, method = 'POST') {
|
||||
const form = document.getElementById('actionForm');
|
||||
form.action = `{{ url('/') }}/${action}`;
|
||||
form.action = `${action}`;
|
||||
form.method = method; // Sets method dynamically
|
||||
if (method === 'GET') {
|
||||
window.location.href = form.action; // Redirect for GET request
|
||||
@@ -238,58 +382,70 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
{{-- {{dd(session('admin'))}}--}}
|
||||
|
||||
@yield('content')
|
||||
<div style="margin-top: 88px;"></div>
|
||||
<script>
|
||||
function openModal(title, id) {
|
||||
// Set the modal content
|
||||
const modalTitle = document.getElementById('modal-title')
|
||||
const modalBody = document.getElementById('modal-body')
|
||||
modalTitle.innerText = title
|
||||
{{-- <div class="flex justify-center items-center mt-20">--}}
|
||||
{{-- @if(!request()->is("admin") && (isset($_COOKIE['ad']) && $_COOKIE['ad']==1))--}}
|
||||
|
||||
// Set the correct link for Panel Access based on the item's ID
|
||||
const panelLink = document.getElementById('panel-access-link')
|
||||
panelLink.href = `/go_down/${id}`
|
||||
{{-- onclick="window.location.href='{{ route('admin.dashboard') }}'">--}}
|
||||
{{-- ورود به پنل ادمین--}}
|
||||
{{-- </button>--}}
|
||||
|
||||
// Show the modal
|
||||
document.getElementById('modal-container').classList.remove('hidden')
|
||||
}
|
||||
{{-- @elseif(request()->is("admin") && (isset($_COOKIE['ad']) && $_COOKIE['ad']==1))--}}
|
||||
{{-- <button class=" bg-white rounded-[23px] shadow-lg flex justify-center px-4 py-2"--}}
|
||||
{{-- style="max-width: 150px; margin: 0 0 20px 0"--}}
|
||||
{{-- onclick="window.location.href='/'">--}}
|
||||
{{-- ثبت ساعت کاری--}}
|
||||
{{-- </button>--}}
|
||||
{{-- @endif--}}
|
||||
{{-- </div>--}}
|
||||
|
||||
// Close modal function
|
||||
function closeModal() {
|
||||
document.getElementById('modal-container').classList.add('hidden')
|
||||
}
|
||||
@yield('content')
|
||||
<div style="margin-top: 88px;"></div>
|
||||
<script>
|
||||
function openModal(title, id) {
|
||||
// Set the modal content
|
||||
const modalTitle = document.getElementById('modal-title')
|
||||
const modalBody = document.getElementById('modal-body')
|
||||
modalTitle.innerText = title
|
||||
|
||||
// Close modal when clicking outside the modal content
|
||||
document.getElementById('modal-container').addEventListener('click', (e) => {
|
||||
if (e.target === document.getElementById('modal-container')) {
|
||||
closeModal()
|
||||
// Set the correct link for Panel Access based on the item's ID
|
||||
const panelLink = document.getElementById('panel-access-link')
|
||||
panelLink.href = `/go_down/${id}`
|
||||
|
||||
// Show the modal
|
||||
document.getElementById('modal-container').classList.remove('hidden')
|
||||
}
|
||||
})
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const errorBox = document.getElementById('error-box')
|
||||
if (errorBox) {
|
||||
// Fade out the error box after 3 seconds
|
||||
setTimeout(() => {
|
||||
errorBox.classList.add('opacity-0') // Add fade-out class
|
||||
// Remove the error box after the fade-out transition ends
|
||||
errorBox.addEventListener('transitionend', () => {
|
||||
errorBox.remove()
|
||||
})
|
||||
}, 3000) // Duration before starting fade out
|
||||
|
||||
// Close modal function
|
||||
function closeModal() {
|
||||
document.getElementById('modal-container').classList.add('hidden')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@yield('script')
|
||||
|
||||
// Close modal when clicking outside the modal content
|
||||
document.getElementById('modal-container').addEventListener('click', (e) => {
|
||||
if (e.target === document.getElementById('modal-container')) {
|
||||
closeModal()
|
||||
}
|
||||
})
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const errorBox = document.getElementById('error-box')
|
||||
if (errorBox) {
|
||||
// Fade out the error box after 3 seconds
|
||||
setTimeout(() => {
|
||||
errorBox.classList.add('opacity-0') // Add fade-out class
|
||||
// Remove the error box after the fade-out transition ends
|
||||
errorBox.addEventListener('transitionend', () => {
|
||||
errorBox.remove()
|
||||
})
|
||||
}, 3000) // Duration before starting fade out
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@yield('script')
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user