Files
a.montask/resources/views/app.blade.php
T
2025-10-11 13:38:30 +00:00

451 lines
14 KiB
PHP
Executable File

<?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"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<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 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 {
/* @phpstorm-ignore */
--primary-color: #16c8ce;
--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;
gap: 10px;
max-width: 350px;
background-color: #fff;
padding: 20px;
border-radius: 20px;
position: relative;
}
.title {
padding-right: 28px;
font-size: 28px;
color: #424e54;
font-weight: 600;
letter-spacing: -1px;
display: flex;
align-items: center;
padding-left: 30px;
position: relative;
}
.title::before,
.title::after {
content: "";
position: absolute;
height: 16px;
width: 16px;
border-radius: 50%;
right: 0;
background-color: #16c8ce;
}
.title::before {
width: 18px;
height: 18px;
}
.title::after {
width: 18px;
height: 18px;
animation: pulse 1s linear infinite;
}
.message,
.signin {
color: rgba(88, 87, 87, 0.822);
font-size: 14px;
}
.signin {
text-align: center;
}
.signin a {
color: royalblue;
}
.signin a:hover {
text-decoration: underline royalblue;
}
.flex {
display: flex;
width: 100%;
gap: 6px;
}
.form label {
position: relative;
}
.form label .input {
width: 100%;
padding: 10px 10px 14px 10px;
outline: 0;
border: 1px solid rgba(105, 105, 105, 0.397);
border-radius: 10px;
}
.form label .input + span {
position: absolute;
right: 10px;
color: grey;
font-size: 0.9em;
cursor: text;
transition: 0.3s ease;
}
.form label .input:placeholder-shown + span {
top: 15px;
font-size: 0.9em;
}
.form label .input:focus + span,
.form label .input:valid + span {
left: 10px;
top: 30px;
font-size: 0.7em;
font-weight: 600;
}
.form label .input:valid + span {
color: green;
}
.submit {
border: none;
outline: none;
background-color: #16c8ce;
padding: 10px;
border-radius: 10px;
color: #fff;
font-size: 16px;
transform: .3s ease;
}
.submit:hover {
background-color: rgb(255, 0, 0);
}
@keyframes pulse {
from {
transform: scale(0.9);
opacity: 1;
}
to {
transform: scale(1.8);
opacity: 0;
}
}
@font-face {
font-family: 'MyCustomFont';
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;
}
* {
font-family: "MyCustomFont", cursive;
letter-spacing: 0 !important;
}
body {
background-color: #e1e1e1;
display: flex;
justify-content: center;
align-items: center;
margin: 0;
}
.header {
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'))
<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%; ">
@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 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-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 = `${action}`;
form.method = method; // Sets method dynamically
if (method === 'GET') {
window.location.href = form.action; // Redirect for GET request
} else {
form.submit(); // Submit for POST request
}
}
</script>
{{-- {{dd(session('admin'))}}--}}
{{-- <div class="flex justify-center items-center mt-20">--}}
{{-- @if(!request()->is("admin") && (isset($_COOKIE['ad']) && $_COOKIE['ad']==1))--}}
{{-- onclick="window.location.href='{{ route('admin.dashboard') }}'">--}}
{{-- ورود به پنل ادمین--}}
{{-- </button>--}}
{{-- @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>--}}
@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
// 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')
}
// Close modal function
function closeModal() {
document.getElementById('modal-container').classList.add('hidden')
}
// 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>