Aplikacja Magico Pracownik

This commit is contained in:
2026-05-28 12:56:03 +02:00
parent 9b3c3848a7
commit 83c055cc09
10 changed files with 1248 additions and 0 deletions
+215
View File
@@ -0,0 +1,215 @@
<?php
$enablePrototypeComments = true;
include 'header.php';
?>
<!-- Główny Topbar -->
<div class="app-topbar">
<div class="d-flex align-items-center">
<div class="d-flex justify-content-center align-items-center bg-primary-custom rounded-circle me-2" style="width: 32px; height: 32px;">
<i class='bx bx-cube-alt text-white'></i>
</div>
<h1 class="app-title">Acme Corp</h1>
</div>
<div class="user-avatar shadow-sm">
<i class='bx bx-user'></i>
</div>
</div>
<!-- Pasek tytułowy sekcji -->
<div class="container pt-4">
<div class="d-flex justify-content-between align-items-center pb-3 mb-4" style="border-bottom: 1px solid var(--border-color);">
<div class="d-flex align-items-center">
<a href="home.php" class="text-dark me-2 d-flex align-items-center justify-content-center" style="width: 32px; height: 32px; background: rgba(0,0,0,0.05); border-radius: 50%;">
<i class='bx bx-arrow-back fs-4'></i>
</a>
<h2 class="fw-bold mb-0" style="font-size: 1.25rem;">Moje Urlopy</h2>
</div>
</div>
</div>
<div class="container pb-4">
<!-- Akcja Główna: Wniosek o urlop -->
<div class="mb-4">
<button class="btn btn-primary w-100 py-3 fw-bold shadow-sm" data-bs-toggle="modal" data-bs-target="#vacationModal" style="border-radius: var(--radius-md);">
<i class='bx bx-plus-circle fs-5 me-1 align-middle'></i> Nowy wniosek o urlop
</button>
</div>
<!-- Lista Nadchodzących Urlopów -->
<h6 class="fw-bold mb-3 text-muted text-uppercase small">Nadchodzące wnioski</h6>
<!-- Wniosek 1: Zaakceptowany -->
<div class="card-custom mb-3 border-0 shadow-sm" style="border-left: 4px solid #71dd37 !important;">
<div class="p-3">
<div class="d-flex justify-content-between align-items-start mb-2">
<div>
<span class="badge bg-label-success mb-1">Zaakceptowany</span>
<h5 class="fw-bold mb-0" style="font-size: 1.1rem;">Urlop wypoczynkowy</h5>
</div>
<div class="text-end">
<span class="fw-bold text-dark fs-5">5</span>
<span class="text-muted small d-block" style="margin-top: -5px;">dni</span>
</div>
</div>
<div class="d-flex align-items-center text-muted small mt-3">
<i class='bx bx-calendar me-2 fs-5 text-primary-custom'></i>
<span class="fw-semibold">12 Sierpnia 2026 - 16 Sierpnia 2026</span>
</div>
</div>
</div>
<!-- Wniosek 2: Oczekujący -->
<div class="card-custom mb-3 border-0 shadow-sm" style="border-left: 4px solid #8592a3 !important;">
<div class="p-3">
<div class="d-flex justify-content-between align-items-start mb-2">
<div>
<span class="badge bg-label-secondary mb-1">Oczekuje na akceptację</span>
<h5 class="fw-bold mb-0" style="font-size: 1.1rem;">Urlop wypoczynkowy</h5>
</div>
<div class="text-end">
<span class="fw-bold text-dark fs-5">2</span>
<span class="text-muted small d-block" style="margin-top: -5px;">dni</span>
</div>
</div>
<div class="d-flex align-items-center text-muted small mt-3">
<i class='bx bx-calendar me-2 fs-5 text-primary-custom'></i>
<span class="fw-semibold">27 Sierpnia 2026 - 28 Sierpnia 2026</span>
</div>
</div>
</div>
<!-- Wniosek 3: Odrzucony -->
<div class="card-custom mb-3 border-0 shadow-sm" style="border-left: 4px solid #ff3e1d !important;">
<div class="p-3">
<div class="d-flex justify-content-between align-items-start mb-2">
<div>
<span class="badge bg-label-danger mb-1">Odrzucony</span>
<h5 class="fw-bold mb-0" style="font-size: 1.1rem;">Urlop na żądanie</h5>
</div>
<div class="text-end">
<span class="fw-bold text-dark fs-5">1</span>
<span class="text-muted small d-block" style="margin-top: -5px;">dzień</span>
</div>
</div>
<div class="d-flex align-items-center text-muted small mt-3 mb-2">
<i class='bx bx-calendar me-2 fs-5 text-primary-custom'></i>
<span class="fw-semibold">05 Września 2026</span>
</div>
<div class="bg-light p-2 rounded text-muted small d-flex align-items-start gap-2 mt-2">
<i class='bx bx-info-circle text-danger mt-1'></i>
<div>
<strong class="text-dark">Kierownik:</strong> Niestety w tym terminie mamy inwentaryzację, brak możliwości udzielenia urlopu.
</div>
</div>
</div>
</div>
</div>
<!-- Modal: Nowy Wniosek -->
<div class="modal fade" id="vacationModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
<div class="modal-content border-0 shadow" style="border-radius: var(--radius-lg);">
<div class="modal-header border-bottom-0 pb-0">
<h5 class="modal-title fw-bold">Nowy wniosek o urlop</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="vacation-form">
<div class="mb-3 text-start">
<label class="form-label fw-semibold">Początek urlopu</label>
<div class="input-group input-group-merge">
<span class="input-group-text"><i class="bx bx-calendar"></i></span>
<input type="text" id="date-start" class="form-control datepicker" placeholder="Wybierz datę początkową">
</div>
</div>
<div class="mb-3 text-start">
<label class="form-label fw-semibold">Koniec urlopu</label>
<div class="input-group input-group-merge">
<span class="input-group-text"><i class="bx bx-calendar"></i></span>
<input type="text" id="date-end" class="form-control datepicker" placeholder="Wybierz datę końcową">
</div>
</div>
<div class="mb-3 text-start">
<label class="form-label fw-semibold">Powód</label>
<select class="form-select">
<option value="2">Urlop wypoczynkowy</option>
<option value="4">Zwolnienie - opieka</option>
<option value="3">Zwolnienie lekarskie</option>
<option value="9">Służba wojskowa</option>
<option value="8" selected>Urlop bezpłatny</option>
<option value="5">Urlop macierzyński</option>
<option value="7">Urlop rehabilitacyjny</option>
<option value="6">Urlop wychowawczy</option>
</select>
</div>
<div class="mb-4 text-start">
<label class="form-label fw-semibold">Dodatkowe informacje</label>
<textarea class="form-control" rows="3" placeholder="Opcjonalna uwaga do przełożonego..."></textarea>
</div>
<button type="button" class="btn btn-primary w-100 py-3 fw-bold fs-6" id="btn-submit-vacation">
Wyślij wniosek
</button>
</form>
</div>
</div>
</div>
</div>
<!-- Flatpickr CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<!-- Flatpickr Theme (optional, fits well) -->
<link rel="stylesheet" type="text/css" href="https://npmcdn.com/flatpickr/dist/themes/airbnb.css">
<?php include 'footer.php'; ?>
<!-- Flatpickr JS -->
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<script src="https://npmcdn.com/flatpickr/dist/l10n/pl.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Inicjalizacja datepickera (Flatpickr) z polskim językiem
flatpickr(".datepicker", {
locale: "pl",
dateFormat: "Y-m-d",
disableMobile: "true" // Pozwala na ładny natywny wygląd flatpickr na mobilkach
});
// Symulacja wysyłania
const btnSubmit = document.getElementById('btn-submit-vacation');
if (btnSubmit) {
btnSubmit.addEventListener('click', function() {
const originalText = this.innerHTML;
this.innerHTML = "<i class='bx bx-loader-alt bx-spin me-2'></i> Wysyłanie...";
this.disabled = true;
setTimeout(() => {
this.innerHTML = "<i class='bx bx-check me-2'></i> Wysłano pomyślnie!";
this.classList.replace('btn-primary', 'btn-success');
setTimeout(() => {
const modalEl = document.getElementById('vacationModal');
const modal = bootstrap.Modal.getInstance(modalEl);
if (modal) modal.hide();
// Reset buttona
this.innerHTML = originalText;
this.classList.replace('btn-success', 'btn-primary');
this.disabled = false;
}, 1500);
}, 1500);
});
}
});
</script>