Files
a.montask/resources/views/app.blade.php
T
2026-04-23 14:49:46 +03:30

491 lines
15 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="{{ asset('/packages/clockpicker/bootstrap-clockpicker.min.css') }}">
<script src="{{ asset('/packages/clockpicker/jquery.min.js')}}"></script>
<script src="{{ asset('/packages/clockpicker/bootstrap-clockpicker.min.js')}}"></script>
{{-- --}}{{--تاریخ--}}
<link rel="stylesheet" href="{{ asset('/packages/datepicker/persian-datepicker.css')}}">
<script src="{{ asset("/packages/datepicker/persian-date.js")}}"></script>
<script src="{{ asset('/packages/datepicker/persian-datepicker.js') }}"></script>
{{-- <link rel="manifest" href="manifest.json">--}}
{{-- font awesome--}}
<link href="{{url('fontawesome-pro-6.5.2/css/all.css')}}" rel="stylesheet"/>
{{-- <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: {{ \App\Models\Setting::where('key','primary_color')->value('value') ?? '#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;
/* چپ به راست */
background-color: #c8c8c8 !important;
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.3);
}
.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: {{ \App\Models\Setting::where('key','primary_color')->value('value')}};
}
.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: {{ \App\Models\Setting::where('key','primary_color')->value('value')}};
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;
}
.btn {
display: flex !important;
justify-content: center !important;
width: 100%;
}
.btn-sm {
display: flex !important;
justify-content: center !important;
}
</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 w-14 ">
<a class="bg-[var(--primary-color)] rounded-full size-14 flex justify-center items-center "
href="/create_task">
<i class=" fa-solid fa-plus " style="color: white"></i>
</a>
</div>
@endif
@if(url()->current() != url('/tasks'))
<div class="flex mr-6 object-right-bottom bottom-20 fixed z-10 w-14 ">
<a class="bg-[var(--primary-color)] 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-[var(--primary-color)]"
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--}}
{{-- footer--}}
<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-[var(--primary-color)] 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--}}
{{-- BACK BOTTUN--}}
{{-- @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']!=null))
<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']!=null))
<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()
}
})
function autoDismissFlashMessage() {
const errorBox = document.getElementById('error-box')
if (!errorBox) return
setTimeout(() => {
errorBox.classList.add('opacity-0')
errorBox.addEventListener('transitionend', () => {
errorBox.remove()
})
}, 5000)
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', autoDismissFlashMessage)
} else {
autoDismissFlashMessage()
}
</script>
@yield('script')
</div>
</body>
</html>