File size: 87,507 Bytes
1cb9f3f 73efcab 1cb9f3f 73efcab 4dbd840 73efcab 1cb9f3f 73efcab 4dbd840 73efcab |
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 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 |
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>نظام ERP المحاسبي المتكامل</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;
}
.menu-item.active-tab {
background-color: rgba(255, 255, 255, 0.2);
}
.sidebar.collapsed {
width: 70px;
}
.sidebar.collapsed .sidebar-text {
display: none;
}
.sidebar.collapsed .logo-text {
display: none;
}
.sidebar.collapsed .menu-item {
justify-content: center;
}
.content-area {
transition: all 0.3s ease;
}
.content-area.expanded {
margin-right: 250px;
}
.content-area.collapsed {
margin-right: 70px;
}
.rtl {
direction: rtl;
}
.ltr {
direction: ltr;
}
.table-responsive {
overflow-x: auto;
}
@media (max-width: 768px) {
.sidebar {
position: fixed;
z-index: 1000;
height: 100vh;
transform: translateX(-100%);
}
.sidebar.show {
transform: translateX(0);
}
.content-area {
margin-right: 0 !important;
}
}
</style>
</head>
<body class="bg-gray-100 rtl">
<!-- Mobile Menu Button -->
<button id="mobileMenuButton" class="md:hidden fixed top-4 right-4 z-50 bg-blue-600 text-white p-2 rounded-lg shadow-lg">
<i class="fas fa-bars"></i>
</button>
<!-- Sidebar -->
<div id="sidebar" class="sidebar bg-blue-800 text-white h-screen fixed top-0 right-0 w-64 shadow-lg">
<div class="p-4 flex items-center justify-between border-b border-blue-700">
<div class="flex items-center">
<i class="fas fa-calculator text-2xl"></i>
<span class="logo-text text-xl font-bold mr-2">نظام ERP</span>
</div>
<button id="toggleSidebar" class="text-white focus:outline-none">
<i class="fas fa-chevron-right"></i>
</button>
</div>
<div class="p-4">
<div class="flex items-center mb-6">
<div class="w-10 h-10 rounded-full bg-blue-600 flex items-center justify-center">
<i class="fas fa-user"></i>
</div>
<div class="sidebar-text mr-3">
<div class="font-semibold">مدير النظام</div>
<div class="text-xs text-blue-200">Admin</div>
</div>
</div>
<nav class="mt-6">
<div class="mb-2 text-blue-300 uppercase text-xs sidebar-text">القوائم الرئيسية</div>
<a href="#" class="menu-item flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 transition mb-1 active-tab" data-tab="dashboard">
<i class="fas fa-tachometer-alt w-6 text-center"></i>
<span class="sidebar-text mr-2">لوحة التحكم</span>
</a>
<a href="#" class="menu-item flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 transition mb-1" data-tab="invoices">
<i class="fas fa-file-invoice-dollar w-6 text-center"></i>
<span class="sidebar-text mr-2">الفواتير</span>
</a>
<a href="#" class="menu-item flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 transition mb-1" data-tab="customers">
<i class="fas fa-users w-6 text-center"></i>
<span class="sidebar-text mr-2">العملاء</span>
</a>
<a href="#" class="menu-item flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 transition mb-1" data-tab="suppliers">
<i class="fas fa-truck w-6 text-center"></i>
<span class="sidebar-text mr-2">الموردين</span>
</a>
<a href="#" class="menu-item flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 transition mb-1" data-tab="inventory">
<i class="fas fa-boxes w-6 text-center"></i>
<span class="sidebar-text mr-2">المخزون</span>
</a>
<a href="#" class="menu-item flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 transition mb-1" data-tab="reports">
<i class="fas fa-chart-bar w-6 text-center"></i>
<span class="sidebar-text mr-2">التقارير</span>
</a>
<div class="mb-2 mt-6 text-blue-300 uppercase text-xs sidebar-text">الإعدادات</div>
<a href="#" class="menu-item flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 transition mb-1" data-tab="settings">
<i class="fas fa-cog w-6 text-center"></i>
<span class="sidebar-text mr-2">الإعدادات</span>
</a>
<a href="#" class="menu-item flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 transition mb-1" data-tab="users">
<i class="fas fa-user-shield w-6 text-center"></i>
<span class="sidebar-text mr-2">المستخدمون</span>
</a>
</nav>
</div>
<div class="absolute bottom-0 w-full p-4 border-t border-blue-700">
<a href="#" class="menu-item flex items-center py-2 px-2 rounded-lg hover:bg-blue-700 transition">
<i class="fas fa-sign-out-alt w-6 text-center"></i>
<span class="sidebar-text mr-2">تسجيل الخروج</span>
</a>
</div>
</div>
<!-- Main Content -->
<div id="contentArea" class="content-area min-h-screen bg-gray-100">
<header class="bg-white shadow-sm">
<div class="max-w-7xl mx-auto py-4 px-4 sm:px-6 lg:px-8 flex justify-between items-center">
<h1 class="text-xl font-semibold text-gray-900" id="pageTitle">لوحة التحكم</h1>
<div class="flex items-center">
<div class="relative">
<button id="notificationsBtn" class="p-1 rounded-full text-gray-400 hover:text-gray-500 focus:outline-none mr-4">
<span class="sr-only">الإشعارات</span>
<i class="fas fa-bell text-xl"></i>
<span class="absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500"></span>
</button>
</div>
<div class="relative">
<button id="searchBtn" class="p-1 rounded-full text-gray-400 hover:text-gray-500 focus:outline-none">
<span class="sr-only">بحث</span>
<i class="fas fa-search text-xl"></i>
</button>
</div>
</div>
</div>
</header>
<!-- Tab Content -->
<main>
<!-- Dashboard Tab -->
<div id="dashboard" class="tab-content active">
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
<!-- Stats Cards -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
<div class="bg-white overflow-hidden shadow rounded-lg">
<div class="p-5">
<div class="flex items-center">
<div class="flex-shrink-0 bg-blue-500 rounded-md p-3">
<i class="fas fa-money-bill-wave text-white text-xl"></i>
</div>
<div class="mr-3 w-0 flex-1">
<p class="text-sm font-medium text-gray-500 truncate">إجمالي المبيعات</p>
<p class="text-2xl font-semibold text-gray-900">25,000 ر.س</p>
</div>
</div>
</div>
</div>
<div class="bg-white overflow-hidden shadow rounded-lg">
<div class="p-5">
<div class="flex items-center">
<div class="flex-shrink-0 bg-green-500 rounded-md p-3">
<i class="fas fa-users text-white text-xl"></i>
</div>
<div class="mr-3 w-0 flex-1">
<p class="text-sm font-medium text-gray-500 truncate">عدد العملاء</p>
<p class="text-2xl font-semibold text-gray-900">142</p>
</div>
</div>
</div>
</div>
<div class="bg-white overflow-hidden shadow rounded-lg">
<div class="p-5">
<div class="flex items-center">
<div class="flex-shrink-0 bg-yellow-500 rounded-md p-3">
<i class="fas fa-box-open text-white text-xl"></i>
</div>
<div class="mr-3 w-0 flex-1">
<p class="text-sm font-medium text-gray-500 truncate">المنتجات</p>
<p class="text-2xl font-semibold text-gray-900">56</p>
</div>
</div>
</div>
</div>
<div class="bg-white overflow-hidden shadow rounded-lg">
<div class="p-5">
<div class="flex items-center">
<div class="flex-shrink-0 bg-red-500 rounded-md p-3">
<i class="fas fa-file-invoice text-white text-xl"></i>
</div>
<div class="mr-3 w-0 flex-1">
<p class="text-sm font-medium text-gray-500 truncate">الفواتير</p>
<p class="text-2xl font-semibold text-gray-900">87</p>
</div>
</div>
</div>
</div>
</div>
<!-- Recent Invoices -->
<div class="bg-white shadow rounded-lg mb-6">
<div class="px-4 py-5 sm:px-6 border-b border-gray-200">
<h3 class="text-lg leading-6 font-medium text-gray-900">أحدث الفواتير</h3>
</div>
<div class="px-4 py-5 sm:p-6">
<div class="table-responsive">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">رقم الفاتورة</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">العميل</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">التاريخ</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">المبلغ</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الحالة</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الإجراءات</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">INV-2023-001</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">شركة التقنية المحدودة</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-06-15</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">5,250 ر.س</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">مدفوعة</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-3"><i class="fas fa-eye"></i></button>
<button class="text-yellow-600 hover:text-yellow-900 mr-3"><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 text-sm font-medium text-gray-900">INV-2023-002</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">شركة البناء الحديث</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-06-14</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">12,750 ر.س</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">قيد الانتظار</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-3"><i class="fas fa-eye"></i></button>
<button class="text-yellow-600 hover:text-yellow-900 mr-3"><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 text-sm font-medium text-gray-900">INV-2023-003</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">مؤسسة النور للتجارة</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-06-12</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">8,400 ر.س</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800">ملغاة</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-3"><i class="fas fa-eye"></i></button>
<button class="text-yellow-600 hover:text-yellow-900 mr-3"><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>
</div>
<!-- Charts -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div class="bg-white shadow rounded-lg p-6">
<h3 class="text-lg font-medium text-gray-900 mb-4">إحصائيات المبيعات</h3>
<canvas id="salesChart" height="300"></canvas>
</div>
<div class="bg-white shadow rounded-lg p-6">
<h3 class="text-lg font-medium text-gray-900 mb-4">توزيع العملاء</h3>
<canvas id="customersChart" height="300"></canvas>
</div>
</div>
</div>
</div>
<!-- Invoices Tab -->
<div id="invoices" class="tab-content hidden">
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
<div class="bg-white shadow rounded-lg mb-6">
<div class="px-4 py-5 sm:px-6 border-b border-gray-200 flex justify-between items-center">
<h3 class="text-lg leading-6 font-medium text-gray-900">إدارة الفواتير</h3>
<button id="addInvoiceBtn" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm font-medium">
<i class="fas fa-plus mr-1"></i> إضافة فاتورة جديدة
</button>
</div>
<div class="px-4 py-5 sm:p-6">
<div class="mb-4 flex flex-col md:flex-row md:items-center md:justify-between">
<div class="mb-2 md:mb-0">
<div class="relative">
<input type="text" placeholder="بحث..." class="pl-10 pr-4 py-2 border rounded-md w-full md:w-64">
<div class="absolute left-3 top-3 text-gray-400">
<i class="fas fa-search"></i>
</div>
</div>
</div>
<div class="flex items-center">
<label for="filter" class="mr-2 text-sm text-gray-600">تصفية حسب:</label>
<select id="filter" class="border rounded-md px-3 py-1 text-sm">
<option>الكل</option>
<option>مدفوعة</option>
<option>قيد الانتظار</option>
<option>ملغاة</option>
</select>
</div>
</div>
<div class="table-responsive">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">رقم الفاتورة</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">العميل</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">التاريخ</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">المبلغ</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الحالة</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الإجراءات</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="invoicesTableBody">
<!-- Invoices will be loaded here -->
</tbody>
</table>
</div>
<div class="mt-4 flex flex-col md:flex-row justify-between items-center">
<div class="text-sm text-gray-500 mb-2 md:mb-0">
عرض <span id="startItem">1</span> إلى <span id="endItem">10</span> من <span id="totalItems">25</span> فاتورة
</div>
<div class="flex">
<button class="px-3 py-1 border rounded-md text-sm disabled:opacity-50" id="prevPage" disabled>السابق</button>
<div class="mx-2 flex">
<button class="px-3 py-1 border rounded-md text-sm bg-blue-600 text-white">1</button>
<button class="px-3 py-1 border rounded-md text-sm ml-1">2</button>
<button class="px-3 py-1 border rounded-md text-sm ml-1">3</button>
</div>
<button class="px-3 py-1 border rounded-md text-sm" id="nextPage">التالي</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Customers Tab -->
<div id="customers" class="tab-content hidden">
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
<div class="bg-white shadow rounded-lg mb-6">
<div class="px-4 py-5 sm:px-6 border-b border-gray-200 flex justify-between items-center">
<h3 class="text-lg leading-6 font-medium text-gray-900">إدارة العملاء</h3>
<button id="addCustomerBtn" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm font-medium">
<i class="fas fa-plus mr-1"></i> إضافة عميل جديد
</button>
</div>
<div class="px-4 py-5 sm:p-6">
<div class="mb-4 flex flex-col md:flex-row md:items-center md:justify-between">
<div class="mb-2 md:mb-0">
<div class="relative">
<input type="text" placeholder="بحث..." class="pl-10 pr-4 py-2 border rounded-md w-full md:w-64">
<div class="absolute left-3 top-3 text-gray-400">
<i class="fas fa-search"></i>
</div>
</div>
</div>
<div class="flex items-center">
<label for="customerFilter" class="mr-2 text-sm text-gray-600">تصفية حسب:</label>
<select id="customerFilter" class="border rounded-md px-3 py-1 text-sm">
<option>الكل</option>
<option>نشط</option>
<option>غير نشط</option>
</select>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4" id="customersGrid">
<!-- Customers will be loaded here -->
</div>
<div class="mt-4 flex flex-col md:flex-row justify-between items-center">
<div class="text-sm text-gray-500 mb-2 md:mb-0">
عرض <span id="customerStartItem">1</span> إلى <span id="customerEndItem">6</span> من <span id="customerTotalItems">15</span> عميل
</div>
<div class="flex">
<button class="px-3 py-1 border rounded-md text-sm disabled:opacity-50" id="customerPrevPage" disabled>السابق</button>
<div class="mx-2 flex">
<button class="px-3 py-1 border rounded-md text-sm bg-blue-600 text-white">1</button>
<button class="px-3 py-1 border rounded-md text-sm ml-1">2</button>
<button class="px-3 py-1 border rounded-md text-sm ml-1">3</button>
</div>
<button class="px-3 py-1 border rounded-md text-sm" id="customerNextPage">التالي</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Suppliers Tab -->
<div id="suppliers" class="tab-content hidden">
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
<div class="bg-white shadow rounded-lg mb-6">
<div class="px-4 py-5 sm:px-6 border-b border-gray-200 flex justify-between items-center">
<h3 class="text-lg leading-6 font-medium text-gray-900">إدارة الموردين</h3>
<button id="addSupplierBtn" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm font-medium">
<i class="fas fa-plus mr-1"></i> إضافة مورد جديد
</button>
</div>
<div class="px-4 py-5 sm:p-6">
<div class="mb-4 flex flex-col md:flex-row md:items-center md:justify-between">
<div class="mb-2 md:mb-0">
<div class="relative">
<input type="text" placeholder="بحث..." class="pl-10 pr-4 py-2 border rounded-md w-full md:w-64">
<div class="absolute left-3 top-3 text-gray-400">
<i class="fas fa-search"></i>
</div>
</div>
</div>
</div>
<div class="table-responsive">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">اسم المورد</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">البريد الإلكتروني</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الهاتف</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">المنتجات</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الإجراءات</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="suppliersTableBody">
<!-- Suppliers will be loaded here -->
</tbody>
</table>
</div>
<div class="mt-4 flex flex-col md:flex-row justify-between items-center">
<div class="text-sm text-gray-500 mb-2 md:mb-0">
عرض <span id="supplierStartItem">1</span> إلى <span id="supplierEndItem">10</span> من <span id="supplierTotalItems">12</span> مورد
</div>
<div class="flex">
<button class="px-3 py-1 border rounded-md text-sm disabled:opacity-50" id="supplierPrevPage" disabled>السابق</button>
<div class="mx-2 flex">
<button class="px-3 py-1 border rounded-md text-sm bg-blue-600 text-white">1</button>
<button class="px-3 py-1 border rounded-md text-sm ml-1">2</button>
</div>
<button class="px-3 py-1 border rounded-md text-sm" id="supplierNextPage">التالي</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Inventory Tab -->
<div id="inventory" class="tab-content hidden">
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
<div class="bg-white shadow rounded-lg mb-6">
<div class="px-4 py-5 sm:px-6 border-b border-gray-200 flex justify-between items-center">
<h3 class="text-lg leading-6 font-medium text-gray-900">إدارة المخزون</h3>
<div>
<button id="addProductBtn" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm font-medium mr-2">
<i class="fas fa-plus mr-1"></i> إضافة منتج
</button>
<button id="importProductsBtn" class="bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-md text-sm font-medium">
<i class="fas fa-file-import mr-1"></i> استيراد
</button>
</div>
</div>
<div class="px-4 py-5 sm:p-6">
<div class="mb-4 flex flex-col md:flex-row md:items-center md:justify-between">
<div class="mb-2 md:mb-0">
<div class="relative">
<input type="text" placeholder="بحث..." class="pl-10 pr-4 py-2 border rounded-md w-full md:w-64">
<div class="absolute left-3 top-3 text-gray-400">
<i class="fas fa-search"></i>
</div>
</div>
</div>
<div class="flex items-center">
<label for="categoryFilter" class="mr-2 text-sm text-gray-600">تصفية حسب:</label>
<select id="categoryFilter" class="border rounded-md px-3 py-1 text-sm">
<option>الكل</option>
<option>إلكترونيات</option>
<option>أثاث</option>
<option>مواد غذائية</option>
<option>أدوات مكتبية</option>
</select>
</div>
</div>
<div class="table-responsive">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الصورة</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">المنتج</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الكمية</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">سعر الشراء</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">سعر البيع</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الحالة</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الإجراءات</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="inventoryTableBody">
<!-- Inventory items will be loaded here -->
</tbody>
</table>
</div>
<div class="mt-4 flex flex-col md:flex-row justify-between items-center">
<div class="text-sm text-gray-500 mb-2 md:mb-0">
عرض <span id="inventoryStartItem">1</span> إلى <span id="inventoryEndItem">10</span> من <span id="inventoryTotalItems">56</span> منتج
</div>
<div class="flex">
<button class="px-3 py-1 border rounded-md text-sm disabled:opacity-50" id="inventoryPrevPage" disabled>السابق</button>
<div class="mx-2 flex">
<button class="px-3 py-1 border rounded-md text-sm bg-blue-600 text-white">1</button>
<button class="px-3 py-1 border rounded-md text-sm ml-1">2</button>
<button class="px-3 py-1 border rounded-md text-sm ml-1">3</button>
<button class="px-3 py-1 border rounded-md text-sm ml-1">4</button>
<button class="px-3 py-1 border rounded-md text-sm ml-1">5</button>
<button class="px-3 py-1 border rounded-md text-sm ml-1">6</button>
</div>
<button class="px-3 py-1 border rounded-md text-sm" id="inventoryNextPage">التالي</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Reports Tab -->
<div id="reports" class="tab-content hidden">
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
<div class="bg-white shadow rounded-lg mb-6">
<div class="px-4 py-5 sm:px-6 border-b border-gray-200">
<h3 class="text-lg leading-6 font-medium text-gray-900">التقارير</h3>
</div>
<div class="px-4 py-5 sm:p-6">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
<div class="bg-white border border-gray-200 rounded-lg p-4 shadow-sm">
<h4 class="text-lg font-medium mb-4">تقرير المبيعات</h4>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">الفترة الزمنية</label>
<select class="border rounded-md px-3 py-2 w-full">
<option>هذا الشهر</option>
<option>الشهر الماضي</option>
<option>هذا العام</option>
<option>العام الماضي</option>
<option>مخصص</option>
</select>
</div>
<button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm font-medium w-full">
<i class="fas fa-download mr-1"></i> إنشاء التقرير
</button>
</div>
<div class="bg-white border border-gray-200 rounded-lg p-4 shadow-sm">
<h4 class="text-lg font-medium mb-4">تقرير المخزون</h4>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">نوع التقرير</label>
<select class="border rounded-md px-3 py-2 w-full">
<option>منتوش منتهية</option>
<option>منتوش قاربت على الانتهاء</option>
<option>حركة المخزون</option>
<option>تقرير كامل</option>
</select>
</div>
<button class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm font-medium w-full">
<i class="fas fa-download mr-1"></i> إنشاء التقرير
</button>
</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<h4 class="text-lg font-medium mb-4">التقارير المحفوظة</h4>
<div class="table-responsive">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-100">
<tr>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">اسم التقرير</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">النوع</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">تاريخ الإنشاء</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الإجراءات</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">تقرير المبيعات - يونيو 2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">مبيعات</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-06-30</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-600 hover:text-blue-900 mr-3"><i class="fas fa-download"></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 text-sm font-medium text-gray-900">تقرير المخزون - مايو 2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">مخزون</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">2023-05-31</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<button class="text-blue-600 hover:text-blue-900 mr-3"><i class="fas fa-download"></i></button>
<button class="text-red-600 hover:text-red-900"><i class="fas fa-trash"></i></button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Settings Tab -->
<div id="settings" class="tab-content hidden">
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
<div class="bg-white shadow rounded-lg mb-6">
<div class="px-4 py-5 sm:px-6 border-b border-gray-200">
<h3 class="text-lg leading-6 font-medium text-gray-900">إعدادات النظام</h3>
</div>
<div class="px-4 py-5 sm:p-6">
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<div class="md:col-span-1">
<div class="bg-gray-50 p-4 rounded-lg">
<h4 class="text-lg font-medium mb-4">الإعدادات</h4>
<ul class="space-y-2">
<li><a href="#" class="text-blue-600 font-medium settings-tab active" data-tab="general-settings">عام</a></li>
<li><a href="#" class="text-gray-600 settings-tab" data-tab="company-settings">بيانات الشركة</a></li>
<li><a href="#" class="text-gray-600 settings-tab" data-tab="invoice-settings">إعدادات الفواتير</a></li>
<li><a href="#" class="text-gray-600 settings-tab" data-tab="tax-settings">الضرائب</a></li>
<li><a href="#" class="text-gray-600 settings-tab" data-tab="email-settings">إعدادات البريد</a></li>
<li><a href="#" class="text-gray-600 settings-tab" data-tab="backup-settings">النسخ الاحتياطي</a></li>
</ul>
</div>
</div>
<div class="md:col-span-2">
<!-- General Settings -->
<div id="general-settings" class="settings-tab-content active">
<h4 class="text-lg font-medium mb-4">الإعدادات العامة</h4>
<form>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">اسم النظام</label>
<input type="text" class="border rounded-md px-3 py-2 w-full" value="نظام ERP المحاسبي">
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">العملة</label>
<select class="border rounded-md px-3 py-2 w-full">
<option>ريال سعودي (ر.س)</option>
<option>دولار أمريكي ($)</option>
<option>يورو (€)</option>
</select>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">اللغة</label>
<select class="border rounded-md px-3 py-2 w-full">
<option>العربية</option>
<option>الإنجليزية</option>
</select>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">التوقيت</label>
<select class="border rounded-md px-3 py-2 w-full">
<option>Asia/Riyadh (توقيت السعودية)</option>
<option>UTC (توقيت عالمي)</option>
</select>
</div>
<button type="submit" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm font-medium">حفظ التغييرات</button>
</form>
</div>
<!-- Company Settings -->
<div id="company-settings" class="settings-tab-content hidden">
<h4 class="text-lg font-medium mb-4">بيانات الشركة</h4>
<form>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">اسم الشركة</label>
<input type="text" class="border rounded-md px-3 py-2 w-full" value="شركة التقنية المحدودة">
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">الشعار</label>
<div class="flex items-center">
<div class="w-16 h-16 bg-gray-200 rounded-md flex items-center justify-center overflow-hidden">
<i class="fas fa-building text-gray-400 text-2xl"></i>
</div>
<button class="bg-gray-200 hover:bg-gray-300 text-gray-700 px-3 py-1 rounded-md text-sm font-medium mr-3">تغيير</button>
<button class="text-red-600 hover:text-red-800 text-sm font-medium">إزالة</button>
</div>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">العنوان</label>
<textarea class="border rounded-md px-3 py-2 w-full" rows="3">الرياض، المملكة العربية السعودية</textarea>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">رقم السجل التجاري</label>
<input type="text" class="border rounded-md px-3 py-2 w-full" value="1234567890">
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">رقم الهاتف</label>
<input type="text" class="border rounded-md px-3 py-2 w-full" value="+966112345678">
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">البريد الإلكتروني</label>
<input type="email" class="border rounded-md px-3 py-2 w-full" value="info@techcompany.com">
</div>
<button type="submit" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm font-medium">حفظ التغييرات</button>
</form>
</div>
<!-- Invoice Settings -->
<div id="invoice-settings" class="settings-tab-content hidden">
<h4 class="text-lg font-medium mb-4">إعدادات الفواتير</h4>
<form>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">بادئة رقم الفاتورة</label>
<input type="text" class="border rounded-md px-3 py-2 w-full" value="INV-">
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">تنسيق رقم الفاتورة</label>
<select class="border rounded-md px-3 py-2 w-full">
<option>INV-YYYY-NNNN (INV-2023-0001)</option>
<option>INV-NNNN (INV-0001)</option>
<option>NNNN (0001)</option>
</select>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">شروط الدفع الافتراضية</label>
<textarea class="border rounded-md px-3 py-2 w-full" rows="3">يجب سداد الفاتورة خلال 30 يوم من تاريخ الاصدار.</textarea>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">ملاحظات الفاتورة الافتراضية</label>
<textarea class="border rounded-md px-3 py-2 w-full" rows="3">شكرا لتعاملكم معنا.</textarea>
</div>
<button type="submit" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm font-medium">حفظ التغييرات</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Users Tab -->
<div id="users" class="tab-content hidden">
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
<div class="bg-white shadow rounded-lg mb-6">
<div class="px-4 py-5 sm:px-6 border-b border-gray-200 flex justify-between items-center">
<h3 class="text-lg leading-6 font-medium text-gray-900">إدارة المستخدمين</h3>
<button id="addUserBtn" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md text-sm font-medium">
<i class="fas fa-plus mr-1"></i> إضافة مستخدم
</button>
</div>
<div class="px-4 py-5 sm:p-6">
<div class="mb-4">
<div class="relative">
<input type="text" placeholder="بحث..." class="pl-10 pr-4 py-2 border rounded-md w-full md:w-64">
<div class="absolute left-3 top-3 text-gray-400">
<i class="fas fa-search"></i>
</div>
</div>
</div>
<div class="table-responsive">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الصورة</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الاسم</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">البريد الإلكتروني</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الدور</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الحالة</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الإجراءات</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<div class="w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center">
<i class="fas fa-user text-blue-600"></i>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">أحمد محمد</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">ahmed@example.com</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">مدير النظام</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">نشط</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-3"><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="w-10 h-10 rounded-full bg-purple-100 flex items-center justify-center">
<i class="fas fa-user text-purple-600"></i>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">سارة عبدالله</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">sara@example.com</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">محاسب</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">نشط</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-3"><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="w-10 h-10 rounded-full bg-yellow-100 flex items-center justify-center">
<i class="fas fa-user text-yellow-600"></i>
</div>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">خالد سعيد</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">khaled@example.com</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">موظف مبيعات</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">نشط</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-3"><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 flex-col md:flex-row justify-between items-center">
<div class="text-sm text-gray-500 mb-2 md:mb-0">
عرض <span id="usersStartItem">1</span> إلى <span id="usersEndItem">3</span> من <span id="usersTotalItems">3</span> مستخدم
</div>
<div class="flex">
<button class="px-3 py-1 border rounded-md text-sm disabled:opacity-50" id="usersPrevPage" disabled>السابق</button>
<div class="mx-2 flex">
<button class="px-3 py-1 border rounded-md text-sm bg-blue-600 text-white">1</button>
</div>
<button class="px-3 py-1 border rounded-md text-sm disabled:opacity-50" id="usersNextPage" disabled>التالي</button>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
<script>
// Navigation between tabs
document.addEventListener('DOMContentLoaded', function() {
const menuItems = document.querySelectorAll('.menu-item[data-tab]');
const tabContents = document.querySelectorAll('.tab-content');
const pageTitle = document.getElementById('pageTitle');
menuItems.forEach(item => {
item.addEventListener('click', function(e) {
e.preventDefault();
// Remove active class from all menu items
menuItems.forEach(i => i.classList.remove('active-tab'));
// Add active class to clicked item
this.classList.add('active-tab');
// Hide all tab contents
tabContents.forEach(content => {
content.classList.add('hidden');
content.classList.remove('active');
});
// Show the clicked tab content
const tabId = this.getAttribute('data-tab');
const targetContent = document.getElementById(tabId);
if (targetContent) {
targetContent.classList.remove('hidden');
targetContent.classList.add('active');
// Update page title
pageTitle.textContent = this.querySelector('.sidebar-text').textContent;
}
});
});
// Settings tabs
const settingsTabs = document.querySelectorAll('.settings-tab');
const settingsContents = document.querySelectorAll('.settings-tab-content');
settingsTabs.forEach(tab => {
tab.addEventListener('click', function(e) {
e.preventDefault();
// Remove active class from all settings tabs
settingsTabs.forEach(t => {
t.classList.remove('font-bold', 'text-blue-600');
t.classList.add('text-gray-600');
});
// Add active class to clicked tab
this.classList.add('font-bold', 'text-blue-600');
this.classList.remove('text-gray-600');
// Hide all settings contents
settingsContents.forEach(content => {
content.classList.add('hidden');
content.classList.remove('active');
});
// Show the clicked settings content
const tabId = this.getAttribute('data-tab');
const targetContent = document.getElementById(tabId);
if (targetContent) {
targetContent.classList.remove('hidden');
targetContent.classList.add('active');
}
});
});
});
</script>
<!-- Modals -->
<!-- Add Invoice Modal -->
<div id="addInvoiceModal" class="fixed inset-0 z-50 overflow-y-auto hidden">
<div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
</div>
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
<div class="inline-block align-bottom bg-white rounded-lg text-right overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-4xl sm:w-full">
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div class="sm:flex sm:items-start">
<div class="mt-3 text-center sm:mt-0 sm:mr-4 sm:text-right w-full">
<h3 class="text-lg leading-6 font-medium text-gray-900 mb-4" id="modalTitle">إضافة فاتورة جديدة</h3>
<div class="mt-2">
<form id="invoiceForm">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">العميل</label>
<select class="border rounded-md px-3 py-2 w-full">
<option>اختر عميل...</option>
<option>شركة التقنية المحدودة</option>
<option>شركة البناء الحديث</option>
<option>مؤسسة النور للتجارة</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">تاريخ الفاتورة</label>
<input type="date" class="border rounded-md px-3 py-2 w-full">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">تاريخ الاستحقاق</label>
<input type="date" class="border rounded-md px-3 py-2 w-full">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">حالة الفاتورة</label>
<select class="border rounded-md px-3 py-2 w-full">
<option>قيد الانتظار</option>
<option>مدفوعة</option>
<option>ملغاة</option>
</select>
</div>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">عناصر الفاتورة</label>
<div class="border rounded-md">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">المنتج</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الكمية</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">السعر</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">المجموع</th>
<th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">الإجراءات</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200" id="invoiceItems">
<tr>
<td class="px-6 py-4 whitespace-nowrap">
<select class="border rounded-md px-2 py-1 w-full">
<option>اختر منتج...</option>
<option>حاسوب محمول</option>
<option>هاتف ذكي</option>
<option>طابعة</option>
</select>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<input type="number" value="1" min="1" class="border rounded-md px-2 py-1 w-20">
</td>
<td class="px-6 py-4 whitespace-nowrap">
<input type="number" value="0" min="0" step="0.01" class="border rounded-md px-2 py-1 w-24">
</td>
<td class="px-6 py-4 whitespace-nowrap">0 ر.س</td>
<td class="px-6 py-4 whitespace-nowrap">
<button type="button" class="text-red-600 hover:text-red-900 remove-item"><i class="fas fa-trash"></i></button>
</td>
</tr>
</tbody>
</table>
<div class="p-3">
<button type="button" id="addItemBtn" class="text-blue-600 hover:text-blue-900 text-sm font-medium">
<i class="fas fa-plus mr-1"></i> إضافة عنصر
</button>
</div>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">الخصم</label>
<div class="flex">
<input type="number" value="0" min="0" max="100" class="border rounded-r-md px-3 py-2 w-20">
<span class="flex items-center px-3 bg-gray-100 border border-r-0 rounded-l-md">%</span>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">الضريبة</label>
<div class="flex">
<input type="number" value="15" min="0" max="100" class="border rounded-r-md px-3 py-2 w-20">
<span class="flex items-center px-3 bg-gray-100 border border-r-0 rounded-l-md">%</span>
</div>
</div>
</div>
<div class="bg-gray-50 p-4 rounded-md mb-4">
<div class="flex justify-between mb-2">
<span class="font-medium">المجموع الفرعي:</span>
<span>0 ر.س</span>
</div>
<div class="flex justify-between mb-2">
<span class="font-medium">الخصم:</span>
<span>0 ر.س (0%)</span>
</div>
<div class="flex justify-between mb-2">
<span class="font-medium">الضريبة:</span>
<span>0 ر.س (15%)</span>
</div>
<div class="flex justify-between font-bold text-lg border-t border-gray-200 pt-2">
<span>الإجمالي:</span>
<span>0 ر.س</span>
</div>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">ملاحظات</label>
<textarea class="border rounded-md px-3 py-2 w-full" rows="3"></textarea>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">شروط الدفع</label>
<textarea class="border rounded-md px-3 py-2 w-full" rows="2"></textarea>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
<button type="button" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none sm:ml-3 sm:w-auto sm:text-sm">
حفظ الفاتورة
</button>
<button type="button" class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm close-modal">
إلغاء
</button>
</div>
</div>
</div>
</div>
<!-- Add Customer Modal -->
<div id="addCustomerModal" class="fixed inset-0 z-50 overflow-y-auto hidden">
<div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
</div>
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
<div class="inline-block align-bottom bg-white rounded-lg text-right overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full">
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div class="sm:flex sm:items-start">
<div class="mt-3 text-center sm:mt-0 sm:mr-4 sm:text-right w-full">
<h3 class="text-lg leading-6 font-medium text-gray-900 mb-4">إضافة عميل جديد</h3>
<div class="mt-2">
<form id="customerForm">
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">الاسم</label>
<input type="text" class="border rounded-md px-3 py-2 w-full">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">البريد الإلكتروني</label>
<input type="email" class="border rounded-md px-3 py-2 w-full">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">الهاتف</label>
<input type="tel" class="border rounded-md px-3 py-2 w-full">
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">الشركة</label>
<input type="text" class="border rounded-md px-3 py-2 w-full">
</div>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">العنوان</label>
<textarea class="border rounded-md px-3 py-2 w-full" rows="2"></textarea>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">ملاحظات</label>
<textarea class="border rounded-md px-3 py-2 w-full" rows="2"></textarea>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">الحالة</label>
<select class="border rounded-md px-3 py-2 w-full">
<option>نشط</option>
<option>غير نشط</option>
</select>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
<button type="button" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none sm:ml-3 sm:w-auto sm:text-sm">
حفظ العميل
</button>
<button type="button" class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm close-modal">
إلغاء
</button>
</div>
</div>
</div>
</div>
<!-- Add Product Modal -->
<div id="addProductModal" class="fixed inset-0 z-50 overflow-y-auto hidden">
<div class="flex items-center justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0">
<div class="fixed inset-0 transition-opacity" aria-hidden="true">
<div class="absolute inset-0 bg-gray-500 opacity-75"></div>
</div>
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">​</span>
<div class="inline-block align-bottom bg-white rounded-lg text-right overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full">
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div class="sm:flex sm:items-start">
<div class="mt-3 text-center sm:mt-0 sm:mr-4 sm:text-right
<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=BADRNOMAN/https-wa-me-967773299164" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |