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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<!DOCTYPE html>
|
3 |
+
|
4 |
+
<html lang="en">
|
5 |
+
<head>
|
6 |
+
<meta charset="utf-8"/>
|
7 |
+
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
8 |
+
<title>
|
9 |
+
Work Hours Calculator
|
10 |
+
</title>
|
11 |
+
<meta content="noindex, nofollow" name="robots"/>
|
12 |
+
<meta content="noindex, nofollow" name="robots"/></head>
|
13 |
+
<body>
|
14 |
+
<!-- Navigation Bar -->
|
15 |
+
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
|
16 |
+
<a class="navbar-brand" href="#" rel="nofollow noindex">
|
17 |
+
WorkCalc
|
18 |
+
</a>
|
19 |
+
<button aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation" class="navbar-toggler" data-target="#navbarNav" data-toggle="collapse" type="button">
|
20 |
+
<span class="navbar-toggler-icon">
|
21 |
+
</span>
|
22 |
+
</button>
|
23 |
+
<div class="collapse navbar-collapse justify-content-end" id="navbarNav">
|
24 |
+
<ul class="navbar-nav">
|
25 |
+
<li class="nav-item active">
|
26 |
+
<a class="nav-link" href="#" rel="nofollow noindex">
|
27 |
+
Home
|
28 |
+
</a>
|
29 |
+
</li>
|
30 |
+
<li class="nav-item">
|
31 |
+
<a class="nav-link" href="#" rel="nofollow noindex">
|
32 |
+
Reports
|
33 |
+
</a>
|
34 |
+
</li>
|
35 |
+
<li class="nav-item">
|
36 |
+
<a class="nav-link" href="#" rel="nofollow noindex">
|
37 |
+
Settings
|
38 |
+
</a>
|
39 |
+
</li>
|
40 |
+
</ul>
|
41 |
+
</div>
|
42 |
+
</nav>
|
43 |
+
<!-- Main Container -->
|
44 |
+
<div class="container my-5">
|
45 |
+
<h2 class="text-center mb-4">
|
46 |
+
Mesai Hesaplama
|
47 |
+
</h2>
|
48 |
+
<!-- Data Input Section -->
|
49 |
+
<div class="card mb-4">
|
50 |
+
<div class="card-header bg-secondary text-white">
|
51 |
+
Veri Girişi
|
52 |
+
</div>
|
53 |
+
<div class="card-body">
|
54 |
+
<form id="dataForm">
|
55 |
+
<div class="form-group">
|
56 |
+
<label for="timeInput">
|
57 |
+
Kopyala ve Yapıştır:
|
58 |
+
</label>
|
59 |
+
<textarea class="form-control" id="timeInput" placeholder="Örnek:
|
60 |
+
10:01 18:00
|
61 |
+
10:06 18:00
|
62 |
+
..." rows="6"></textarea>
|
63 |
+
</div>
|
64 |
+
<button class="btn btn-primary" type="submit">
|
65 |
+
Hesapla
|
66 |
+
</button>
|
67 |
+
</form>
|
68 |
+
</div>
|
69 |
+
</div>
|
70 |
+
<!-- Report Section -->
|
71 |
+
<div class="card">
|
72 |
+
<div class="card-header bg-success text-white">
|
73 |
+
Haftalık Rapor
|
74 |
+
</div>
|
75 |
+
<div class="card-body">
|
76 |
+
<div id="reportContent">
|
77 |
+
<!-- Dynamic Report will be inserted here -->
|
78 |
+
</div>
|
79 |
+
</div>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
<!-- Footer -->
|
83 |
+
<footer class="bg-dark text-white text-center py-3">
|
84 |
+
© 2023 WorkCalc. Tüm hakları saklıdır.
|
85 |
+
</footer>
|
86 |
+
</body>
|
87 |
+
</html>
|
88 |
+
|
89 |
+
|
90 |
+
<style>
|
91 |
+
body {
|
92 |
+
background-color: #f0f4f7;
|
93 |
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
94 |
+
}
|
95 |
+
|
96 |
+
.navbar-brand {
|
97 |
+
font-weight: bold;
|
98 |
+
font-size: 1.5rem;
|
99 |
+
}
|
100 |
+
|
101 |
+
.card-header {
|
102 |
+
font-size: 1.2rem;
|
103 |
+
font-weight: bold;
|
104 |
+
}
|
105 |
+
|
106 |
+
#reportContent {
|
107 |
+
white-space: pre-wrap;
|
108 |
+
font-family: Consolas, monospace;
|
109 |
+
}
|
110 |
+
|
111 |
+
footer {
|
112 |
+
position: fixed;
|
113 |
+
width: 100%;
|
114 |
+
bottom: 0;
|
115 |
+
}
|
116 |
+
|
117 |
+
@media (max-width: 576px) {
|
118 |
+
.navbar-brand {
|
119 |
+
font-size: 1.2rem;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
</style>
|
123 |
+
|
124 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
|
125 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.1/js/bootstrap.min.js"></script>
|
126 |
+
<script>
|
127 |
+
(function() {
|
128 |
+
window.onload = function() {
|
129 |
+
parent.iframeLoaded();
|
130 |
+
}
|
131 |
+
})();
|
132 |
+
try {
|
133 |
+
$(document).ready(function() {
|
134 |
+
$('#dataForm').submit(function(e) {
|
135 |
+
e.preventDefault();
|
136 |
+
const input = $('#timeInput').val().trim();
|
137 |
+
if (input === "") {
|
138 |
+
alert("Lütfen zaman girişlerini giriniz.");
|
139 |
+
return;
|
140 |
+
}
|
141 |
+
|
142 |
+
const lines = input.split('\n').filter(line => line.trim() !== "");
|
143 |
+
const sessions = [];
|
144 |
+
|
145 |
+
// Parse input lines
|
146 |
+
lines.forEach(line => {
|
147 |
+
const times = line.trim().split(/\s+/);
|
148 |
+
if (times.length === 2) {
|
149 |
+
const start = parseTime(times[0]);
|
150 |
+
const end = parseTime(times[1]);
|
151 |
+
if (start && end) {
|
152 |
+
sessions.push({ start, end });
|
153 |
+
}
|
154 |
+
}
|
155 |
+
});
|
156 |
+
|
157 |
+
if (sessions.length === 0) {
|
158 |
+
alert("Geçerli zaman girişleri bulunamadı.");
|
159 |
+
return;
|
160 |
+
}
|
161 |
+
|
162 |
+
// Calculate reports
|
163 |
+
const report = calculateWeeklyReport(sessions);
|
164 |
+
|
165 |
+
// Display report
|
166 |
+
displayReport(report);
|
167 |
+
});
|
168 |
+
|
169 |
+
function parseTime(timeStr) {
|
170 |
+
const parts = timeStr.split(':');
|
171 |
+
if (parts.length !== 2) return null;
|
172 |
+
const hours = parseInt(parts[0], 10);
|
173 |
+
const minutes = parseInt(parts[1], 10);
|
174 |
+
if (isNaN(hours) || isNaN(minutes)) return null;
|
175 |
+
// Assuming all entries are on the same arbitrary day
|
176 |
+
return new Date(2023, 0, 1, hours, minutes);
|
177 |
+
}
|
178 |
+
|
179 |
+
function calculateWeeklyReport(sessions) {
|
180 |
+
let totalWorkMinutes = 0;
|
181 |
+
let overtimeMinutes = 0;
|
182 |
+
let nightOvertimeMinutes = 0;
|
183 |
+
let restOvertimeMinutes = 0;
|
184 |
+
|
185 |
+
sessions.forEach(session => {
|
186 |
+
let duration = (session.end - session.start) / (1000 * 60); // minutes
|
187 |
+
totalWorkMinutes += duration;
|
188 |
+
|
189 |
+
if (duration > 11 * 60) { // More than 11 hours
|
190 |
+
overtimeMinutes += duration - 11 * 60;
|
191 |
+
}
|
192 |
+
|
193 |
+
// Check for night shift
|
194 |
+
if (session.start.getHours() >= 20 || session.end.getHours() <= 6) {
|
195 |
+
if (duration > 7.5 * 60) {
|
196 |
+
nightOvertimeMinutes += duration - 7.5 * 60;
|
197 |
+
}
|
198 |
+
}
|
199 |
+
|
200 |
+
// Assuming rest day overtime is calculated separately
|
201 |
+
// Placeholder for actual logic
|
202 |
+
});
|
203 |
+
|
204 |
+
return {
|
205 |
+
totalWorkHours: (totalWorkMinutes / 60).toFixed(2),
|
206 |
+
overtimeHours: (overtimeMinutes / 60).toFixed(2),
|
207 |
+
nightOvertimeHours: (nightOvertimeMinutes / 60).toFixed(2),
|
208 |
+
restOvertimeHours: (restOvertimeMinutes / 60).toFixed(2),
|
209 |
+
dailyDetails: sessions.map((s, index) => ({
|
210 |
+
day: `Gün ${index + 1}`,
|
211 |
+
start: formatTime(s.start),
|
212 |
+
end: formatTime(s.end),
|
213 |
+
duration: ( (s.end - s.start) / (1000 * 60) / 60 ).toFixed(2) + ' saat'
|
214 |
+
}))
|
215 |
+
};
|
216 |
+
}
|
217 |
+
|
218 |
+
function formatTime(date) {
|
219 |
+
const hours = date.getHours().toString().padStart(2, '0');
|
220 |
+
const minutes = date.getMinutes().toString().padStart(2, '0');
|
221 |
+
return `${hours}:${minutes}`;
|
222 |
+
}
|
223 |
+
|
224 |
+
function displayReport(report) {
|
225 |
+
let html = `<h4>Toplam Çalışma: ${report.totalWorkHours} saat</h4>`;
|
226 |
+
html += `<h4>Fazla Mesai: ${report.overtimeHours} saat</h4>`;
|
227 |
+
html += `<h4>Gece Çalışması Fazla Mesai: ${report.nightOvertimeHours} saat</h4>`;
|
228 |
+
html += `<h4>Hafta Tatili Fazla Mesai: ${report.restOvertimeHours} saat</h4>`;
|
229 |
+
html += `<hr>`;
|
230 |
+
html += `<h5>Günlük Detaylar:</h5>`;
|
231 |
+
html += `<table class="table table-striped">
|
232 |
+
<thead>
|
233 |
+
<tr>
|
234 |
+
<th>Gün</th>
|
235 |
+
<th>Başlangıç</th>
|
236 |
+
<th>Bitiş</th>
|
237 |
+
<th>Toplam Süre</th>
|
238 |
+
</tr>
|
239 |
+
</thead>
|
240 |
+
<tbody>`;
|
241 |
+
report.dailyDetails.forEach(detail => {
|
242 |
+
html += `<tr>
|
243 |
+
<td>${detail.day}</td>
|
244 |
+
<td>${detail.start}</td>
|
245 |
+
<td>${detail.end}</td>
|
246 |
+
<td>${detail.duration}</td>
|
247 |
+
</tr>`;
|
248 |
+
});
|
249 |
+
html += `</tbody></table>`;
|
250 |
+
|
251 |
+
$('#reportContent').html(html);
|
252 |
+
}
|
253 |
+
});
|
254 |
+
} catch (e) {
|
255 |
+
console.log("Error in JS code", e);
|
256 |
+
}
|
257 |
+
</script>
|
258 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
259 |
+
</html>
|
260 |
+
|