File size: 28,343 Bytes
95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 ae1d430 95604d2 | 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 | <!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Gestion de Stock - CIMENTERIE</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></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;
}
.sidebar.collapsed {
width: 70px;
}
.sidebar.collapsed .sidebar-text {
display: none;
}
.sidebar.collapsed .sidebar-icon {
margin-right: 0;
}
.main-content {
transition: all 0.3s;
}
.sidebar.collapsed+.main-content {
margin-left: 70px;
}
.stock-low {
background-color: rgba(239, 68, 68, 0.1);
border-left: 4px solid #ef4444;
}
.stock-critical {
background-color: rgba(239, 68, 68, 0.2);
border-left: 4px solid #ef4444;
animation: pulse 2s infinite;
}
@keyframes pulse {
0% {
opacity: 1;
}
50% {
opacity: 0.5;
}
100% {
opacity: 1;
}
}
.stock-ok {
border-left: 4px solid #10b981;
}
</style>
</head>
<body class="bg-gray-100 font-sans">
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div class="sidebar bg-blue-800 text-white w-64 flex flex-col">
<div class="p-4 flex items-center justify-between border-b border-blue-700">
<div class="flex items-center">
<i class="fas fa-industry text-2xl sidebar-icon mr-3"></i>
<span class="sidebar-text font-bold text-xl">CIMENTERIE</span>
</div>
<button id="toggleSidebar" class="text-white focus:outline-none">
<i class="fas fa-bars"></i>
</button>
</div>
<div class="flex-1 overflow-y-auto">
<nav class="p-4">
<div class="mb-6">
<p class="sidebar-text uppercase text-xs font-semibold text-blue-300 mb-2">Menu Principal</p>
<ul>
<li class="mb-2">
<a href="#" class="flex items-center p-2 rounded hover:bg-blue-700 bg-blue-700">
<i class="fas fa-tachometer-alt sidebar-icon mr-3"></i>
<span class="sidebar-text">Tableau de bord</span>
</a>
</li>
<li class="mb-2">
<a href="#" class="flex items-center p-2 rounded hover:bg-blue-700">
<i class="fas fa-boxes sidebar-icon mr-3"></i>
<span class="sidebar-text">Gestion des stocks</span>
</a>
</li>
<li class="mb-2">
<a href="#" class="flex items-center p-2 rounded hover:bg-blue-700">
<i class="fas fa-exchange-alt sidebar-icon mr-3"></i>
<span class="sidebar-text">Mouvements</span>
</a>
</li>
<li class="mb-2">
<a href="#" class="flex items-center p-2 rounded hover:bg-blue-700">
<i class="fas fa-truck sidebar-icon mr-3"></i>
<span class="sidebar-text">Fournisseurs</span>
</a>
</li>
</ul>
</div>
<div class="mb-6">
<p class="sidebar-text uppercase text-xs font-semibold text-blue-300 mb-2">Rapports</p>
<ul>
<li class="mb-2">
<a href="#" class="flex items-center p-2 rounded hover:bg-blue-700">
<i class="fas fa-chart-line sidebar-icon mr-3"></i>
<span class="sidebar-text">Statistiques</span>
</a>
</li>
<li class="mb-2">
<a href="#" class="flex items-center p-2 rounded hover:bg-blue-700">
<i class="fas fa-file-pdf sidebar-icon mr-3"></i>
<span class="sidebar-text">Exporter PDF</span>
</a>
</li>
</ul>
</div>
<div>
<p class="sidebar-text uppercase text-xs font-semibold text-blue-300 mb-2">Administration</p>
<ul>
<li class="mb-2">
<a href="#" class="flex items-center p-2 rounded hover:bg-blue-700">
<i class="fas fa-users sidebar-icon mr-3"></i>
<span class="sidebar-text">Utilisateurs</span>
</a>
</li>
<li class="mb-2">
<a href="#" class="flex items-center p-2 rounded hover:bg-blue-700">
<i class="fas fa-cog sidebar-icon mr-3"></i>
<span class="sidebar-text">Paramètres</span>
</a>
</li>
</ul>
</div>
</nav>
</div>
<div class="p-4 border-t border-blue-700">
<div class="flex items-center">
<img src="https://ui-avatars.com/api/?name=Admin+User&background=random" class="w-8 h-8 rounded-full mr-3" alt="User">
<div class="sidebar-text">
<p class="text-sm font-semibold">Admin User</p>
<p class="text-xs text-blue-300">Administrateur</p>
</div>
</div>
</div>
</div>
<!-- Main Content -->
<div class="main-content flex-1 overflow-auto ml-64">
<header class="bg-white shadow-sm p-4 flex justify-between items-center">
<h1 class="text-2xl font-bold text-gray-800">Tableau de bord</h1>
<div class="flex items-center space-x-4">
<div class="relative">
<i class="fas fa-bell text-gray-500 text-xl"></i>
<span class="absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full h-4 w-4 flex items-center justify-center">3</span>
</div>
<div class="relative">
<input type="text" placeholder="Rechercher..." class="pl-8 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>
</div>
</header>
<main class="p-6">
<!-- Stats Cards -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="p-3 rounded-full bg-blue-100 text-blue-600 mr-4">
<i class="fas fa-box-open text-xl"></i>
</div>
<div>
<p class="text-gray-500">Produits en stock</p>
<h3 class="text-2xl font-bold">1,248</h3>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="p-3 rounded-full bg-green-100 text-green-600 mr-4">
<i class="fas fa-arrow-down text-xl"></i>
</div>
<div>
<p class="text-gray-500">Entrées ce mois</p>
<h3 class="text-2xl font-bold">342</h3>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="p-3 rounded-full bg-red-100 text-red-600 mr-4">
<i class="fas fa-arrow-up text-xl"></i>
</div>
<div>
<p class="text-gray-500">Sorties ce mois</p>
<h3 class="text-2xl font-bold">287</h3>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<div class="flex items-center">
<div class="p-3 rounded-full bg-yellow-100 text-yellow-600 mr-4">
<i class="fas fa-exclamation-triangle text-xl"></i>
</div>
<div>
<p class="text-gray-500">Alertes stock</p>
<h3 class="text-2xl font-bold">12</h3>
</div>
</div>
</div>
</div>
<!-- Charts and Forms -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6">
<!-- Stock Chart -->
<div class="bg-white rounded-lg shadow p-6 lg:col-span-2">
<div class="flex justify-between items-center mb-4">
<h2 class="text-lg font-semibold">Niveaux de stock par catégorie</h2>
<select class="border rounded px-3 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
<option>7 derniers jours</option>
<option>30 derniers jours</option>
<option selected>Cette année</option>
</select>
</div>
<div class="h-64">
<canvas id="stockChart"></canvas>
</div>
</div>
<!-- Movement Form -->
<div class="bg-white rounded-lg shadow p-6">
<h2 class="text-lg font-semibold mb-4">Nouveau mouvement</h2>
<form id="movementForm" class="space-y-4">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Type de mouvement</label>
<select name="type" class="w-full border rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" required>
<option value="">Sélectionner...</option>
<option value="entree">Entrée de stock</option>
<option value="sortie">Sortie de stock</option>
<option value="inventaire">Inventaire</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Produit</label>
<select name="produit_id" class="w-full border rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" required>
<option value="">Sélectionner un produit...</option>
<option value="1">Ciment 32.5 (CIM-001)</option>
<option value="2">Ciment 42.5 (CIM-002)</option>
<option value="3">Adjuvant SuperPlast (CIM-003)</option>
<option value="4">Bétonnière 500L (CIM-004)</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Quantité</label>
<input type="number" name="quantite" min="1" class="w-full border rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" required>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Commentaire</label>
<textarea name="commentaire" rows="2" class="w-full border rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"></textarea>
</div>
<button type="submit" class="w-full bg-blue-600 text-white py-2 px-4 rounded hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2">
Enregistrer le mouvement
</button>
</form>
</div>
</div>
<!-- Stock Alerts and Recent Movements -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
<!-- Stock Alerts -->
<div class="bg-white rounded-lg shadow overflow-hidden">
<div class="bg-red-600 text-white px-6 py-3">
<h2 class="font-semibold">Alertes de stock critique</h2>
</div>
<div class="divide-y">
<div class="p-4 stock-critical">
<div class="flex items-center justify-between">
<div>
<p class="font-medium">Ciment 32.5 (CIM-001)</p>
<p class="text-sm text-gray-600">Stock: 12 tonnes (seuil: 50)</p>
</div>
<button class="text-red-600 hover:text-red-800">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
</div>
<div class="p-4 stock-low">
<div class="flex items-center justify-between">
<div>
<p class="font-medium">Adjuvant SuperPlast (CIM-003)</p>
<p class="text-sm text-gray-600">Stock: 32 litres (seuil: 40)</p>
</div>
<button class="text-red-600 hover:text-red-800">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
</div>
<div class="p-4 stock-low">
<div class="flex items-center justify-between">
<div>
<p class="font-medium">Bétonnière 500L (CIM-004)</p>
<p class="text-sm text-gray-600">Stock: 3 unités (seuil: 5)</p>
</div>
<button class="text-red-600 hover:text-red-800">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
</div>
</div>
</div>
<!-- Recent Movements -->
<div class="bg-white rounded-lg shadow overflow-hidden">
<div class="bg-blue-600 text-white px-6 py-3">
<h2 class="font-semibold">Derniers mouvements</h2>
</div>
<div class="divide-y">
<div class="p-4">
<div class="flex items-center justify-between">
<div>
<p class="font-medium">Entrée - Ciment 42.5</p>
<p class="text-sm text-gray-600">+50 tonnes - Aujourd'hui 09:23</p>
</div>
<span class="bg-green-100 text-green-800 text-xs px-2 py-1 rounded">Entrée</span>
</div>
</div>
<div class="p-4">
<div class="flex items-center justify-between">
<div>
<p class="font-medium">Sortie - Adjuvant SuperPlast</p>
<p class="text-sm text-gray-600">-15 litres - Hier 16:45</p>
</div>
<span class="bg-red-100 text-red-800 text-xs px-2 py-1 rounded">Sortie</span>
</div>
</div>
<div class="p-4">
<div class="flex items-center justify-between">
<div>
<p class="font-medium">Inventaire - Bétonnière 500L</p>
<p class="text-sm text-gray-600">Ajustement: +1 unité - Hier 10:12</p>
</div>
<span class="bg-yellow-100 text-yellow-800 text-xs px-2 py-1 rounded">Inventaire</span>
</div>
</div>
</div>
</div>
</div>
<!-- Products Table -->
<div class="bg-white rounded-lg shadow mt-6 overflow-hidden">
<div class="px-6 py-4 border-b flex justify-between items-center">
<h2 class="font-semibold">Liste des produits</h2>
<div class="flex space-x-2">
<button class="bg-blue-600 text-white px-3 py-1 rounded text-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500">
<i class="fas fa-plus mr-1"></i> Ajouter
</button>
<button class="bg-gray-200 text-gray-700 px-3 py-1 rounded text-sm hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-gray-500">
<i class="fas fa-download mr-1"></i> Exporter
</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">Référence
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nom</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Catégorie
</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Stock</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Seuil</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Prix</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 text-sm font-medium text-gray-900">CIM-001</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Ciment 32.5</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">Ciment</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">12 tonnes</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">50 tonnes</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">850 DH</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 text-sm font-medium text-gray-900">CIM-002</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Ciment 42.5</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-blue-100 text-blue-800">Ciment</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">78 tonnes</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">50 tonnes</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">950 DH</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 text-sm font-medium text-gray-900">CIM-003</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Adjuvant SuperPlast</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800">Adjuvant</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">32 litres</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">40 litres</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">120 DH</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 text-sm font-medium text-gray-900">CIM-004</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Bétonnière 500L</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-yellow-100 text-yellow-800">Matériel</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">3 unités</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">5 unités</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">12,500 DH</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="px-6 py-4 border-t flex items-center justify-between">
<div class="text-sm text-gray-500">
Affichage <span class="font-medium">1</span> à <span class="font-medium">4</span> sur
<span class="font-medium">12</span> produits
</div>
<div class="flex space-x-2">
<button class="px-3 py-1 border rounded text-sm text-gray-700 hover:bg-gray-50">
Précédent
</button>
<button class="px-3 py-1 border rounded text-sm text-gray-700 hover:bg-gray-50">
Suivant
</button>
</div>
</div>
</div>
</main>
</div>
</div>
<script>
// Toggle sidebar
document.getElementById('toggleSidebar').addEventListener('click', function() {
document.querySelector('.sidebar').classList.toggle('collapsed');
});
// Initialize charts
document.addEventListener('DOMContentLoaded', function() {
// Stock Chart
const stockCtx = document.getElementById('stockChart').getContext('2d');
const stockChart = new Chart(stockCtx, {
type: 'bar',
data: {
labels: ['Jan', 'Fév', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil', 'Août', 'Sep', 'Oct', 'Nov', 'Déc'],
datasets: [
{
label: 'Ciment 32.5',
data: [1200, 1100, 950, 800, 750, 700, 650, 600, 550, 500, 450, 400],
backgroundColor: '#3b82f6',
},
{
label: 'Ciment 42.5',
data: [900, 850, 800, 750, 700, 650, 600, 550, 500, 450, 400, 350],
backgroundColor: '#10b981',
},
{
label: 'Adjuvants',
data: [300, 280, 260, 240, 220, 200, 180, 160, 140, 120, 100, 80],
backgroundColor: '#f59e0b',
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
y: {
beginAtZero: true,
title: {
display: true,
text: 'Quantité (tonnes/litres)'
}
},
x: {
title: {
display: true,
text: 'Mois'
}
}
},
plugins: {
legend: {
position: 'bottom',
},
tooltip: {
callbacks: {
label: function(context) {
let label = context.dataset.label || '';
if (label) {
label += ': ';
}
if (context.parsed.y !== null) {
label += context.parsed.y + ' ' +
(context.dataset.label.includes('Ciment') ? 'tonnes' : 'litres');
}
return label;
}
}
}
}
}
});
// Movement Form Submission
document.getElementById('movementForm').addEventListener('submit', function(e) {
e.preventDefault();
// Simulate form submission
Swal.fire({
title: 'Mouvement enregistré!',
text: 'Le mouvement de stock a été enregistré avec succès.',
icon: 'success',
confirmButtonText: 'OK'
}).then(() => {
// Reset form
e.target.reset();
});
});
});
// Simulate real-time updates
setInterval(() => {
const alerts = document.querySelectorAll('.stock-low, .stock-critical');
alerts.forEach(alert => {
if (alert.classList.contains('stock-critical')) {
alert.classList.remove('stock-critical');
alert.classList.add('stock-low');
} else {
alert.classList.remove('stock-low');
alert.classList.add('stock-critical');
}
});
}, 3000);
</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=elsecond/gestock" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |