Spaces:
Running
Running
File size: 55,723 Bytes
9f7fada | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Construction Site Manager</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.sidebar {
transition: all 0.3s ease;
}
.sidebar.collapsed {
width: 70px;
}
.sidebar.collapsed .nav-text {
display: none;
}
.sidebar.collapsed .logo-text {
display: none;
}
.sidebar.collapsed .nav-item {
justify-content: center;
}
.content {
transition: all 0.3s ease;
}
.content.expanded {
margin-left: 70px;
}
.active-tab {
background-color: #3b82f6;
color: white;
}
.chart-container {
height: 300px;
}
.receipt-preview {
max-height: 120px;
object-fit: contain;
}
@media (max-width: 768px) {
.sidebar {
position: absolute;
z-index: 100;
height: 100vh;
}
.sidebar.collapsed {
transform: translateX(-100%);
}
}
.settings-tab {
padding: 0.75rem 1rem;
border-radius: 0.375rem;
cursor: pointer;
transition: all 0.2s;
}
.settings-tab:hover {
background-color: #f3f4f6;
}
.settings-tab.active {
background-color: #3b82f6;
color: white;
}
.toggle-switch {
position: relative;
display: inline-block;
width: 50px;
height: 24px;
}
.toggle-switch input {
opacity: 0;
width: 0;
height: 0;
}
.toggle-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .4s;
border-radius: 24px;
}
.toggle-slider:before {
position: absolute;
content: "";
height: 16px;
width: 16px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked + .toggle-slider {
background-color: #3b82f6;
}
input:checked + .toggle-slider:before {
transform: translateX(26px);
}
</style>
</head>
<body class="bg-gray-100">
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div id="sidebar" class="sidebar bg-blue-800 text-white w-64 h-full fixed flex flex-col">
<div class="p-4 flex items-center border-b border-blue-700">
<div class="flex items-center">
<i class="fas fa-hard-hat text-2xl mr-3"></i>
<span class="logo-text text-xl font-bold">Site Manager</span>
</div>
<button id="toggle-sidebar" class="ml-auto text-white focus:outline-none">
<i class="fas fa-bars"></i>
</button>
</div>
<div class="p-4 flex-1 overflow-y-auto">
<div class="mb-8">
<h3 class="text-xs uppercase tracking-wider text-blue-300 mb-2 px-2">Main</h3>
<ul>
<li class="mb-1">
<a href="#" class="nav-item flex items-center px-3 py-2 rounded hover:bg-blue-700 transition active-tab" id="dashboard-tab">
<i class="fas fa-tachometer-alt mr-3"></i>
<span class="nav-text">Dashboard</span>
</a>
</li>
<li class="mb-1">
<a href="#" class="nav-item flex items-center px-3 py-2 rounded hover:bg-blue-700 transition" id="attendance-tab">
<i class="fas fa-clipboard-check mr-3"></i>
<span class="nav-text">Attendance</span>
</a>
</li>
<li class="mb-1">
<a href="#" class="nav-item flex items-center px-3 py-2 rounded hover:bg-blue-700 transition" id="expenses-tab">
<i class="fas fa-receipt mr-3"></i>
<span class="nav-text">Expenses</span>
</a>
</li>
<li class="mb-1">
<a href="#" class="nav-item flex items-center px-3 py-2 rounded hover:bg-blue-700 transition" id="reports-tab">
<i class="fas fa-chart-bar mr-3"></i>
<span class="nav-text">Reports</span>
</a>
</li>
</ul>
</div>
<div>
<h3 class="text-xs uppercase tracking-wider text-blue-300 mb-2 px-2">Settings</h3>
<ul>
<li class="mb-1">
<a href="#" class="nav-item flex items-center px-3 py-2 rounded hover:bg-blue-700 transition" id="workers-tab">
<i class="fas fa-users mr-3"></i>
<span class="nav-text">Workers</span>
</a>
</li>
<li class="mb-1">
<a href="#" class="nav-item flex items-center px-3 py-2 rounded hover:bg-blue-700 transition" id="settings-tab">
<i class="fas fa-cog mr-3"></i>
<span class="nav-text">Settings</span>
</a>
</li>
</ul>
</div>
</div>
<div class="p-4 border-t border-blue-700">
<div class="flex items-center">
<img src="https://randomuser.me/api/portraits/men/32.jpg" alt="User" class="w-8 h-8 rounded-full mr-2">
<div class="nav-text">
<div class="text-sm font-medium">John Doe</div>
<div class="text-xs text-blue-300">Site Manager</div>
</div>
</div>
</div>
</div>
<!-- Main Content -->
<div id="content" class="content flex-1 flex flex-col ml-64">
<!-- Header -->
<header class="bg-white shadow-sm py-4 px-6 flex items-center justify-between">
<h1 class="text-2xl font-semibold text-gray-800" id="page-title">Dashboard</h1>
<div class="flex items-center space-x-4">
<div class="relative">
<input type="text" placeholder="Search..." class="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
</div>
<button class="p-2 rounded-full bg-gray-100 text-gray-600 hover:bg-gray-200">
<i class="fas fa-bell"></i>
</button>
</div>
</header>
<!-- Main Content Area -->
<main class="flex-1 overflow-y-auto p-6">
<!-- Dashboard Section -->
<div id="dashboard-section">
<!-- Previous dashboard content remains the same -->
<!-- ... -->
</div>
<!-- Attendance Section -->
<div id="attendance-section" class="hidden">
<!-- Previous attendance content remains the same -->
<!-- ... -->
</div>
<!-- Expenses Section -->
<div id="expenses-section" class="hidden">
<!-- Previous expenses content remains the same -->
<!-- ... -->
</div>
<!-- Reports Section -->
<div id="reports-section" class="hidden">
<!-- Previous reports content remains the same -->
<!-- ... -->
</div>
<!-- Workers Section -->
<div id="workers-section" class="hidden">
<div class="bg-white p-6 rounded-lg shadow mb-6">
<h2 class="text-lg font-semibold mb-4">Manage Workers</h2>
<div class="flex justify-between items-center mb-4">
<button class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 flex items-center">
<i class="fas fa-plus mr-2"></i> Add Worker
</button>
<div class="flex items-center space-x-2">
<input type="text" placeholder="Search workers..." class="px-4 py-2 border rounded-lg">
<button class="px-4 py-2 bg-gray-100 rounded-lg hover:bg-gray-200">
<i class="fas fa-filter"></i>
</button>
</div>
</div>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Position</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Contact</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Hourly Rate</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/men/1.jpg" alt="">
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">John Smith</div>
<div class="text-sm text-gray-500">ID: W001</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">Carpenter</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">john.smith@example.com</div>
<div class="text-sm text-gray-500">(555) 123-4567</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">$25.00/hr</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Active</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-600 hover:text-blue-900 mr-2"><i class="fas fa-edit"></i></button>
<button class="text-red-600 hover:text-red-900"><i class="fas fa-trash"></i></button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/women/2.jpg" alt="">
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">Maria Garcia</div>
<div class="text-sm text-gray-500">ID: W002</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">Electrician</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">maria.garcia@example.com</div>
<div class="text-sm text-gray-500">(555) 234-5678</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">$30.00/hr</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Active</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-600 hover:text-blue-900 mr-2"><i class="fas fa-edit"></i></button>
<button class="text-red-600 hover:text-red-900"><i class="fas fa-trash"></i></button>
</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="flex items-center">
<div class="flex-shrink-0 h-10 w-10">
<img class="h-10 w-10 rounded-full" src="https://randomuser.me/api/portraits/men/3.jpg" alt="">
</div>
<div class="ml-4">
<div class="text-sm font-medium text-gray-900">Robert Johnson</div>
<div class="text-sm text-gray-500">ID: W003</div>
</div>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">Plumber</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">robert.johnson@example.com</div>
<div class="text-sm text-gray-500">(555) 345-6789</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<div class="text-sm text-gray-900">$28.00/hr</div>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">On Leave</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-600 hover:text-blue-900 mr-2"><i class="fas fa-edit"></i></button>
<button class="text-red-600 hover:text-red-900"><i class="fas fa-trash"></i></button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="mt-4 flex items-center justify-between">
<div class="text-sm text-gray-500">
Showing <span class="font-medium">1</span> to <span class="font-medium">3</span> of <span class="font-medium">12</span> workers
</div>
<div class="flex space-x-2">
<button class="px-3 py-1 border rounded-lg hover:bg-gray-100">
<i class="fas fa-chevron-left"></i>
</button>
<button class="px-3 py-1 bg-blue-600 text-white rounded-lg">1</button>
<button class="px-3 py-1 border rounded-lg hover:bg-gray-100">2</button>
<button class="px-3 py-1 border rounded-lg hover:bg-gray-100">3</button>
<button class="px-3 py-1 border rounded-lg hover:bg-gray-100">
<i class="fas fa-chevron-right"></i>
</button>
</div>
</div>
</div>
</div>
<!-- Settings Section -->
<div id="settings-section" class="hidden">
<div class="bg-white p-6 rounded-lg shadow mb-6">
<h2 class="text-lg font-semibold mb-6">System Settings</h2>
<div class="flex border-b mb-6">
<div class="settings-tab active" data-tab="general-settings">General</div>
<div class="settings-tab" data-tab="attendance-settings">Attendance</div>
<div class="settings-tab" data-tab="expense-settings">Expenses</div>
<div class="settings-tab" data-tab="notification-settings">Notifications</div>
<div class="settings-tab" data-tab="security-settings">Security</div>
</div>
<!-- General Settings -->
<div id="general-settings" class="settings-content">
<h3 class="text-md font-medium mb-4">General Settings</h3>
<div class="space-y-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Company Name</label>
<input type="text" class="w-full px-4 py-2 border rounded-lg" value="ABC Construction Co.">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Site Location</label>
<input type="text" class="w-full px-4 py-2 border rounded-lg" value="123 Main St, Anytown">
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Company Logo</label>
<div class="flex items-center">
<div class="mr-4">
<img src="https://via.placeholder.com/100" alt="Company Logo" class="w-16 h-16 rounded">
</div>
<div>
<input type="file" class="hidden" id="logo-upload">
<button class="px-4 py-2 bg-gray-100 rounded-lg hover:bg-gray-200 mr-2" onclick="document.getElementById('logo-upload').click()">
Change Logo
</button>
<button class="px-4 py-2 text-red-600 border rounded-lg hover:bg-gray-100">
Remove
</button>
</div>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Time Zone</label>
<select class="w-full px-4 py-2 border rounded-lg">
<option>(UTC-05:00) Eastern Time (US & Canada)</option>
<option>(UTC-06:00) Central Time (US & Canada)</option>
<option>(UTC-07:00) Mountain Time (US & Canada)</option>
<option>(UTC-08:00) Pacific Time (US & Canada)</option>
</select>
</div>
<div class="flex items-center justify-between">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Enable Dark Mode</label>
<p class="text-xs text-gray-500">Switch between light and dark theme</p>
</div>
<label class="toggle-switch">
<input type="checkbox">
<span class="toggle-slider"></span>
</label>
</div>
</div>
</div>
<!-- Attendance Settings -->
<div id="attendance-settings" class="settings-content hidden">
<h3 class="text-md font-medium mb-4">Attendance Settings</h3>
<div class="space-y-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Standard Work Hours</label>
<div class="flex items-center space-x-2">
<input type="time" class="w-full px-4 py-2 border rounded-lg" value="08:00">
<span>to</span>
<input type="time" class="w-full px-4 py-2 border rounded-lg" value="17:00">
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Lunch Break Duration</label>
<select class="w-full px-4 py-2 border rounded-lg">
<option>30 minutes</option>
<option>45 minutes</option>
<option selected>1 hour</option>
</select>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Overtime Threshold</label>
<div class="flex items-center">
<input type="number" class="w-20 px-4 py-2 border rounded-lg mr-2" value="8">
<span>hours per day</span>
</div>
</div>
<div class="flex items-center justify-between">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Enable GPS Tracking</label>
<p class="text-xs text-gray-500">Require workers to be on-site to check in</p>
</div>
<label class="toggle-switch">
<input type="checkbox" checked>
<span class="toggle-slider"></span>
</label>
</div>
<div class="flex items-center justify-between">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Enable QR Code Check-in</label>
<p class="text-xs text-gray-500">Allow workers to check in using QR codes</p>
</div>
<label class="toggle-switch">
<input type="checkbox">
<span class="toggle-slider"></span>
</label>
</div>
</div>
</div>
<!-- Expense Settings -->
<div id="expense-settings" class="settings-content hidden">
<h3 class="text-md font-medium mb-4">Expense Settings</h3>
<div class="space-y-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Default Expense Categories</label>
<div class="border rounded-lg p-2">
<div class="flex flex-wrap gap-2">
<span class="bg-blue-100 text-blue-800 px-3 py-1 rounded-full text-sm flex items-center">
Materials <button class="ml-1 text-blue-600 hover:text-blue-900"><i class="fas fa-times"></i></button>
</span>
<span class="bg-blue-100 text-blue-800 px-3 py-1 rounded-full text-sm flex items-center">
Labor <button class="ml-1 text-blue-600 hover:text-blue-900"><i class="fas fa-times"></i></button>
</span>
<span class="bg-blue-100 text-blue-800 px-3 py-1 rounded-full text-sm flex items-center">
Equipment <button class="ml-1 text-blue-600 hover:text-blue-900"><i class="fas fa-times"></i></button>
</span>
<span class="bg-blue-100 text-blue-800 px-3 py-1 rounded-full text-sm flex items-center">
Food <button class="ml-1 text-blue-600 hover:text-blue-900"><i class="fas fa-times"></i></button>
</span>
<span class="bg-blue-100 text-blue-800 px-3 py-1 rounded-full text-sm flex items-center">
Transportation <button class="ml-1 text-blue-600 hover:text-blue-900"><i class="fas fa-times"></i></button>
</span>
</div>
<div class="mt-2 flex">
<input type="text" placeholder="Add new category" class="flex-1 px-3 py-1 border rounded-l-lg">
<button class="px-3 py-1 bg-blue-600 text-white rounded-r-lg">Add</button>
</div>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Expense Approval Workflow</label>
<select class="w-full px-4 py-2 border rounded-lg">
<option>No approval required</option>
<option selected>Manager approval required</option>
<option>Admin approval required</option>
</select>
</div>
</div>
<div class="flex items-center justify-between">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Require Receipt for Expenses</label>
<p class="text-xs text-gray-500">Mandatory receipt upload for all expenses</p>
</div>
<label class="toggle-switch">
<input type="checkbox" checked>
<span class="toggle-slider"></span>
</label>
</div>
<div class="flex items-center justify-between">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Enable Expense Limits</label>
<p class="text-xs text-gray-500">Set maximum amounts for expense categories</p>
</div>
<label class="toggle-switch">
<input type="checkbox">
<span class="toggle-slider"></span>
</label>
</div>
</div>
</div>
<!-- Notification Settings -->
<div id="notification-settings" class="settings-content hidden">
<h3 class="text-md font-medium mb-4">Notification Settings</h3>
<div class="space-y-6">
<div class="flex items-center justify-between">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Email Notifications</label>
<p class="text-xs text-gray-500">Receive important updates via email</p>
</div>
<label class="toggle-switch">
<input type="checkbox" checked>
<span class="toggle-slider"></span>
</label>
</div>
<div class="flex items-center justify-between">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">SMS Notifications</label>
<p class="text-xs text-gray-500">Receive urgent alerts via text message</p>
</div>
<label class="toggle-switch">
<input type="checkbox">
<span class="toggle-slider"></span>
</label>
</div>
<div class="flex items-center justify-between">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Push Notifications</label>
<p class="text-xs text-gray-500">Get instant alerts on your mobile device</p>
</div>
<label class="toggle-switch">
<input type="checkbox" checked>
<span class="toggle-slider"></span>
</label>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Notification Schedule</label>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
<div class="border rounded-lg p-3">
<div class="flex items-center justify-between mb-2">
<span class="font-medium">Daily Reports</span>
<label class="toggle-switch">
<input type="checkbox" checked>
<span class="toggle-slider"></span>
</label>
</div>
<select class="w-full px-3 py-1 border rounded-lg text-sm">
<option>6:00 AM</option>
<option selected>7:00 AM</option>
<option>8:00 AM</option>
</select>
</div>
<div class="border rounded-lg p-3">
<div class="flex items-center justify-between mb-2">
<span class="font-medium">Weekly Reports</span>
<label class="toggle-switch">
<input type="checkbox" checked>
<span class="toggle-slider"></span>
</label>
</div>
<div class="flex items-center space-x-2">
<select class="flex-1 px-3 py-1 border rounded-lg text-sm">
<option>Monday</option>
<option selected>Friday</option>
</select>
<select class="flex-1 px-3 py-1 border rounded-lg text-sm">
<option>5:00 PM</option>
<option selected>6:00 PM</option>
</select>
</div>
</div>
<div class="border rounded-lg p-3">
<div class="flex items-center justify-between mb-2">
<span class="font-medium">Overtime Alerts</span>
<label class="toggle-switch">
<input type="checkbox" checked>
<span class="toggle-slider"></span>
</label>
</div>
<select class="w-full px-3 py-1 border rounded-lg text-sm">
<option>Immediately</option>
<option selected>End of day</option>
</select>
</div>
</div>
</div>
</div>
</div>
<!-- Security Settings -->
<div id="security-settings" class="settings-content hidden">
<h3 class="text-md font-medium mb-4">Security Settings</h3>
<div class="space-y-6">
<div class="flex items-center justify-between">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Two-Factor Authentication</label>
<p class="text-xs text-gray-500">Add an extra layer of security to your account</p>
</div>
<label class="toggle-switch">
<input type="checkbox">
<span class="toggle-slider"></span>
</label>
</div>
<div class="flex items-center justify-between">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Session Timeout</label>
<p class="text-xs text-gray-500">Automatically log out after inactivity</p>
</div>
<select class="w-32 px-4 py-2 border rounded-lg">
<option>15 minutes</option>
<option>30 minutes</option>
<option selected>1 hour</option>
<option>4 hours</option>
<option>Never</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Password Requirements</label>
<div class="space-y-2 mt-2">
<div class="flex items-center">
<input type="checkbox" id="req-length" class="mr-2" checked>
<label for="req-length" class="text-sm">Minimum 8 characters</label>
</div>
<div class="flex items-center">
<input type="checkbox" id="req-uppercase" class="mr-2" checked>
<label for="req-uppercase" class="text-sm">At least one uppercase letter</label>
</div>
<div class="flex items-center">
<input type="checkbox" id="req-number" class="mr-2" checked>
<label for="req-number" class="text-sm">At least one number</label>
</div>
<div class="flex items-center">
<input type="checkbox" id="req-special" class="mr-2">
<label for="req-special" class="text-sm">At least one special character</label>
</div>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Change Password</label>
<div class="space-y-3">
<div>
<input type="password" placeholder="Current password" class="w-full px-4 py-2 border rounded-lg">
</div>
<div>
<input type="password" placeholder="New password" class="w-full px-4 py-2 border rounded-lg">
</div>
<div>
<input type="password" placeholder="Confirm new password" class="w-full px-4 py-2 border rounded-lg">
</div>
<button class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700">Update Password</button>
</div>
</div>
</div>
</div>
<div class="mt-8 pt-6 border-t flex justify-end">
<button class="px-4 py-2 border border-gray-300 rounded-lg mr-2 hover:bg-gray-100">Cancel</button>
<button class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700">Save Changes</button>
</div>
</div>
</div>
</main>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
// Sidebar toggle functionality
document.getElementById('toggle-sidebar').addEventListener('click', function() {
const sidebar = document.getElementById('sidebar');
const content = document.getElementById('content');
sidebar.classList.toggle('collapsed');
content.classList.toggle('expanded');
});
// Tab switching functionality
const tabs = ['dashboard-tab', 'attendance-tab', 'expenses-tab', 'reports-tab', 'workers-tab', 'settings-tab'];
const sections = ['dashboard-section', 'attendance-section', 'expenses-section', 'reports-section', 'workers-section', 'settings-section'];
const pageTitles = ['Dashboard', 'Attendance', 'Expenses', 'Reports', 'Workers', 'Settings'];
tabs.forEach((tabId, index) => {
document.getElementById(tabId).addEventListener('click', function(e) {
e.preventDefault();
// Update active tab styling
tabs.forEach(t => {
document.getElementById(t).classList.remove('active-tab');
});
this.classList.add('active-tab');
// Show corresponding section
sections.forEach(s => {
document.getElementById(s).classList.add('hidden');
});
document.getElementById(sections[index]).classList.remove('hidden');
// Update page title
document.getElementById('page-title').textContent = pageTitles[index];
});
});
// Settings tabs functionality
document.querySelectorAll('.settings-tab').forEach(tab => {
tab.addEventListener('click', function() {
// Remove active class from all tabs
document.querySelectorAll('.settings-tab').forEach(t => {
t.classList.remove('active');
});
// Add active class to clicked tab
this.classList.add('active');
// Hide all settings content
document.querySelectorAll('.settings-content').forEach(content => {
content.classList.add('hidden');
});
// Show corresponding content
const tabName = this.getAttribute('data-tab');
document.getElementById(tabName).classList.remove('hidden');
});
});
// Receipt preview functionality
document.getElementById('expense-receipt').addEventListener('change', function(e) {
const file = e.target.files[0];
if (file) {
const reader = new FileReader();
reader.onload = function(event) {
const previewContainer = document.getElementById('receipt-preview-container');
const preview = document.getElementById('receipt-preview');
preview.src = event.target.result;
previewContainer.classList.remove('hidden');
};
reader.readAsDataURL(file);
}
});
// Custom date range toggle
document.getElementById('report-period').addEventListener('change', function() {
const customRange = document.getElementById('custom-date-range');
if (this.value === 'custom') {
customRange.classList.remove('hidden');
} else {
customRange.classList.add('hidden');
}
});
// Set today's date as default for date inputs
const today = new Date().toISOString().split('T')[0];
document.getElementById('attendance-date').value = today;
document.getElementById('expense-date').value = today;
// Charts initialization
function initCharts() {
// Weekly Chart
const weeklyCtx = document.getElementById('weeklyChart').getContext('2d');
new Chart(weeklyCtx, {
type: 'bar',
data: {
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
datasets: [
{
label: 'Hours Worked',
data: [120, 135, 115, 140, 125, 60],
backgroundColor: 'rgba(59, 130, 246, 0.7)',
borderColor: 'rgba(59, 130, 246, 1)',
borderWidth: 1
},
{
label: 'Overtime Hours',
data: [12, 15, 8, 20, 15, 0],
backgroundColor: 'rgba(239, 68, 68, 0.7)',
borderColor: 'rgba(239, 68, 68, 1)',
borderWidth: 1
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
y: {
beginAtZero: true
}
}
}
});
// Attendance Chart
const attendanceCtx = document.getElementById('attendanceChart').getContext('2d');
new Chart(attendanceCtx, {
type: 'line',
data: {
labels: ['Week 1', 'Week 2', 'Week 3', 'Week 4'],
datasets: [
{
label: 'Present Workers',
data: [18, 20, 22, 19],
backgroundColor: 'rgba(16, 185, 129, 0.2)',
borderColor: 'rgba(16, 185, 129, 1)',
borderWidth: 2,
tension: 0.1
},
{
label: 'Absent Workers',
data: [4, 2, 0, 3],
backgroundColor: 'rgba(239, 68, 68, 0.2)',
borderColor: 'rgba(239, 68, 68, 1)',
borderWidth: 2,
tension: 0.1
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
y: {
beginAtZero: true
}
}
}
});
// Expense Pie Chart
const expenseCtx = document.getElementById('expenseChart').getContext('2d');
new Chart(expenseCtx, {
type: 'pie',
data: {
labels: ['Materials', 'Labor', 'Equipment', 'Food', 'Other'],
datasets: [{
data: [58, 28, 11, 2, 1],
backgroundColor: [
'rgba(59, 130, 246, 0.7)',
'rgba(16, 185, 129, 0.7)',
'rgba(245, 158, 11, 0.7)',
'rgba(139, 92, 246, 0.7)',
'rgba(156, 163, 175, 0.7)'
],
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false
}
});
// Expense Trend Chart
const expenseTrendCtx = document.getElementById('expenseTrendChart').getContext('2d');
new Chart(expenseTrendCtx, {
type: 'bar',
data: {
labels: ['Week 1', 'Week 2', 'Week 3', 'Week 4'],
datasets: [
{
label: 'Materials',
data: [1200, 1500, 1100, 1700],
backgroundColor: 'rgba(59, 130, 246, 0.7)'
},
{
label: 'Labor',
data: [600, 700, 500, 350],
backgroundColor: 'rgba(16, 185, 129, 0.7)'
},
{
label: 'Equipment',
data: [200, 250, 150, 250],
backgroundColor: 'rgba(245, 158, 11, 0.7)'
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
x: {
stacked: true,
},
y: {
stacked: true,
beginAtZero: true
}
}
}
});
}
// Initialize charts when DOM is loaded
document.addEventListener('DOMContentLoaded', initCharts);
// Form submission handlers
document.getElementById('attendance-form').addEventListener('submit', function(e) {
e.preventDefault();
alert('Attendance record submitted successfully!');
this.reset();
});
document.getElementById('expense-form').addEventListener('submit', function(e) {
e.preventDefault();
alert('Expense record submitted successfully!');
this.reset();
document.getElementById('receipt-preview-container').classList.add('hidden');
});
document.getElementById('report-form').addEventListener('submit', function(e) {
e.preventDefault();
alert('Report generated successfully! Check the reports section.');
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=CodeLee2025/site-manager" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |