File size: 48,880 Bytes
70963da |
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 |
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DataCollect - Application de Collecte de Données</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>
.form-builder {
min-height: 500px;
border: 2px dashed #ccc;
transition: all 0.3s;
}
.form-builder:hover {
border-color: #4f46e5;
}
.question-item {
transition: all 0.2s;
}
.question-item:hover {
transform: translateY(-2px);
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.drag-enter {
border: 2px dashed #4f46e5;
background-color: #eef2ff;
}
.chart-container {
height: 400px;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.fade-in {
animation: fadeIn 0.3s ease-out forwards;
}
</style>
</head>
<body class="bg-gray-50 font-sans">
<div class="min-h-screen flex flex-col">
<!-- Header -->
<header class="bg-indigo-600 text-white shadow-lg">
<div class="container mx-auto px-4 py-4 flex justify-between items-center">
<div class="flex items-center space-x-2">
<i class="fas fa-database text-2xl"></i>
<h1 class="text-2xl font-bold">DataCollect</h1>
</div>
<nav>
<ul class="flex space-x-6">
<li><a href="#" class="hover:text-indigo-200 transition" onclick="showSection('dashboard')"><i class="fas fa-home mr-1"></i> Tableau de bord</a></li>
<li><a href="#" class="hover:text-indigo-200 transition" onclick="showSection('forms')"><i class="fas fa-list mr-1"></i> Mes formulaires</a></li>
<li><a href="#" class="hover:text-indigo-200 transition" onclick="showSection('responses')"><i class="fas fa-chart-bar mr-1"></i> Réponses</a></li>
</ul>
</nav>
<div class="flex items-center space-x-4">
<button class="bg-indigo-700 hover:bg-indigo-800 px-4 py-2 rounded-lg transition flex items-center" onclick="showSection('new-form')">
<i class="fas fa-plus mr-2"></i> Nouveau formulaire
</button>
<div class="w-10 h-10 rounded-full bg-indigo-400 flex items-center justify-center cursor-pointer">
<i class="fas fa-user text-white"></i>
</div>
</div>
</div>
</header>
<!-- Main Content -->
<main class="flex-grow container mx-auto px-4 py-8">
<!-- Dashboard Section -->
<section id="dashboard" class="section">
<div class="mb-8">
<h2 class="text-3xl font-bold text-gray-800 mb-2">Tableau de bord</h2>
<p class="text-gray-600">Vue d'ensemble de vos activités de collecte de données</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
<div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition">
<div class="flex justify-between items-start">
<div>
<p class="text-gray-500">Formulaires actifs</p>
<h3 class="text-3xl font-bold text-indigo-600" id="active-forms-count">5</h3>
</div>
<div class="bg-indigo-100 p-3 rounded-lg">
<i class="fas fa-file-alt text-indigo-600 text-xl"></i>
</div>
</div>
<p class="text-sm text-gray-500 mt-4">+2 depuis la semaine dernière</p>
</div>
<div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition">
<div class="flex justify-between items-start">
<div>
<p class="text-gray-500">Réponses totales</p>
<h3 class="text-3xl font-bold text-green-600" id="total-responses">124</h3>
</div>
<div class="bg-green-100 p-3 rounded-lg">
<i class="fas fa-check-circle text-green-600 text-xl"></i>
</div>
</div>
<p class="text-sm text-gray-500 mt-4">+24% depuis hier</p>
</div>
<div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition">
<div class="flex justify-between items-start">
<div>
<p class="text-gray-500">Taux de complétion</p>
<h3 class="text-3xl font-bold text-blue-600" id="completion-rate">78%</h3>
</div>
<div class="bg-blue-100 p-3 rounded-lg">
<i class="fas fa-chart-line text-blue-600 text-xl"></i>
</div>
</div>
<p class="text-sm text-gray-500 mt-4">Moyenne globale</p>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md mb-8">
<div class="flex justify-between items-center mb-6">
<h3 class="text-xl font-semibold text-gray-800">Activité récente</h3>
<select class="border rounded-lg px-3 py-2 text-sm">
<option>7 derniers jours</option>
<option>30 derniers jours</option>
<option>90 derniers jours</option>
</select>
</div>
<div class="chart-container">
<canvas id="activityChart"></canvas>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div class="bg-white p-6 rounded-xl shadow-md">
<h3 class="text-xl font-semibold text-gray-800 mb-4">Formulaires récents</h3>
<div class="space-y-4">
<div class="flex items-center justify-between p-3 hover:bg-gray-50 rounded-lg transition">
<div>
<h4 class="font-medium">Enquête de satisfaction</h4>
<p class="text-sm text-gray-500">12 questions • 56 réponses</p>
</div>
<button class="text-indigo-600 hover:text-indigo-800 transition">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
<div class="flex items-center justify-between p-3 hover:bg-gray-50 rounded-lg transition">
<div>
<h4 class="font-medium">Formulaire d'inscription</h4>
<p class="text-sm text-gray-500">8 questions • 34 réponses</p>
</div>
<button class="text-indigo-600 hover:text-indigo-800 transition">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
<div class="flex items-center justify-between p-3 hover:bg-gray-50 rounded-lg transition">
<div>
<h4 class="font-medium">Évaluation produit</h4>
<p class="text-sm text-gray-500">10 questions • 28 réponses</p>
</div>
<button class="text-indigo-600 hover:text-indigo-800 transition">
<i class="fas fa-ellipsis-v"></i>
</button>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md">
<h3 class="text-xl font-semibold text-gray-800 mb-4">Réponses récentes</h3>
<div class="space-y-4">
<div class="flex items-center space-x-3 p-3 hover:bg-gray-50 rounded-lg transition">
<div class="w-10 h-10 rounded-full bg-indigo-100 flex items-center justify-center">
<i class="fas fa-user text-indigo-600"></i>
</div>
<div>
<h4 class="font-medium">Jean Dupont</h4>
<p class="text-sm text-gray-500">A répondu à "Enquête de satisfaction"</p>
</div>
<div class="ml-auto text-sm text-gray-500">Il y a 2h</div>
</div>
<div class="flex items-center space-x-3 p-3 hover:bg-gray-50 rounded-lg transition">
<div class="w-10 h-10 rounded-full bg-green-100 flex items-center justify-center">
<i class="fas fa-user text-green-600"></i>
</div>
<div>
<h4 class="font-medium">Marie Lambert</h4>
<p class="text-sm text-gray-500">A répondu à "Formulaire d'inscription"</p>
</div>
<div class="ml-auto text-sm text-gray-500">Il y a 5h</div>
</div>
<div class="flex items-center space-x-3 p-3 hover:bg-gray-50 rounded-lg transition">
<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>
<div>
<h4 class="font-medium">Thomas Martin</h4>
<p class="text-sm text-gray-500">A répondu à "Évaluation produit"</p>
</div>
<div class="ml-auto text-sm text-gray-500">Aujourd'hui</div>
</div>
</div>
</div>
</div>
</section>
<!-- Forms Section -->
<section id="forms" class="section hidden">
<div class="mb-8">
<h2 class="text-3xl font-bold text-gray-800 mb-2">Mes formulaires</h2>
<p class="text-gray-600">Gérez tous vos formulaires de collecte de données</p>
</div>
<div class="flex justify-between items-center mb-6">
<div class="relative w-64">
<input type="text" placeholder="Rechercher un formulaire..." class="w-full pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500">
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
</div>
<button class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg transition flex items-center" onclick="showSection('new-form')">
<i class="fas fa-plus mr-2"></i> Créer un formulaire
</button>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition group">
<div class="flex justify-between items-start mb-4">
<div>
<h3 class="font-bold text-lg text-gray-800 group-hover:text-indigo-600 transition">Enquête de satisfaction</h3>
<p class="text-sm text-gray-500">12 questions</p>
</div>
<div class="flex space-x-2">
<button class="text-gray-400 hover:text-indigo-600 transition">
<i class="fas fa-edit"></i>
</button>
<button class="text-gray-400 hover:text-red-600 transition">
<i class="fas fa-trash"></i>
</button>
</div>
</div>
<p class="text-gray-600 mb-4">Collectez les retours de vos clients sur votre service.</p>
<div class="flex justify-between items-center text-sm">
<span class="text-indigo-600 font-medium">56 réponses</span>
<span class="text-gray-500">Dernière mise à jour: 12/06/2023</span>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition group">
<div class="flex justify-between items-start mb-4">
<div>
<h3 class="font-bold text-lg text-gray-800 group-hover:text-indigo-600 transition">Formulaire d'inscription</h3>
<p class="text-sm text-gray-500">8 questions</p>
</div>
<div class="flex space-x-2">
<button class="text-gray-400 hover:text-indigo-600 transition">
<i class="fas fa-edit"></i>
</button>
<button class="text-gray-400 hover:text-red-600 transition">
<i class="fas fa-trash"></i>
</button>
</div>
</div>
<p class="text-gray-600 mb-4">Inscrivez de nouveaux membres à votre programme.</p>
<div class="flex justify-between items-center text-sm">
<span class="text-indigo-600 font-medium">34 réponses</span>
<span class="text-gray-500">Dernière mise à jour: 05/06/2023</span>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition group">
<div class="flex justify-between items-start mb-4">
<div>
<h3 class="font-bold text-lg text-gray-800 group-hover:text-indigo-600 transition">Évaluation produit</h3>
<p class="text-sm text-gray-500">10 questions</p>
</div>
<div class="flex space-x-2">
<button class="text-gray-400 hover:text-indigo-600 transition">
<i class="fas fa-edit"></i>
</button>
<button class="text-gray-400 hover:text-red-600 transition">
<i class="fas fa-trash"></i>
</button>
</div>
</div>
<p class="text-gray-600 mb-4">Évaluez la satisfaction des utilisateurs avec votre produit.</p>
<div class="flex justify-between items-center text-sm">
<span class="text-indigo-600 font-medium">28 réponses</span>
<span class="text-gray-500">Dernière mise à jour: 30/05/2023</span>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition group">
<div class="flex justify-between items-start mb-4">
<div>
<h3 class="font-bold text-lg text-gray-800 group-hover:text-indigo-600 transition">Sondage employés</h3>
<p class="text-sm text-gray-500">15 questions</p>
</div>
<div class="flex space-x-2">
<button class="text-gray-400 hover:text-indigo-600 transition">
<i class="fas fa-edit"></i>
</button>
<button class="text-gray-400 hover:text-red-600 transition">
<i class="fas fa-trash"></i>
</button>
</div>
</div>
<p class="text-gray-600 mb-4">Mesurez le moral et la satisfaction de vos employés.</p>
<div class="flex justify-between items-center text-sm">
<span class="text-indigo-600 font-medium">42 réponses</span>
<span class="text-gray-500">Dernière mise à jour: 22/05/2023</span>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition group">
<div class="flex justify-between items-start mb-4">
<div>
<h3 class="font-bold text-lg text-gray-800 group-hover:text-indigo-600 transition">Formulaire de contact</h3>
<p class="text-sm text-gray-500">5 questions</p>
</div>
<div class="flex space-x-2">
<button class="text-gray-400 hover:text-indigo-600 transition">
<i class="fas fa-edit"></i>
</button>
<button class="text-gray-400 hover:text-red-600 transition">
<i class="fas fa-trash"></i>
</button>
</div>
</div>
<p class="text-gray-600 mb-4">Permettez aux visiteurs de votre site de vous contacter.</p>
<div class="flex justify-between items-center text-sm">
<span class="text-indigo-600 font-medium">19 réponses</span>
<span class="text-gray-500">Dernière mise à jour: 15/05/2023</span>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition group border-2 border-dashed border-gray-300 flex flex-col items-center justify-center">
<i class="fas fa-plus text-4xl text-gray-400 mb-3"></i>
<h3 class="text-lg font-medium text-gray-600">Créer un nouveau formulaire</h3>
<button class="mt-4 text-indigo-600 hover:text-indigo-800 transition" onclick="showSection('new-form')">
Commencer
</button>
</div>
</div>
</section>
<!-- Responses Section -->
<section id="responses" class="section hidden">
<div class="mb-8">
<h2 class="text-3xl font-bold text-gray-800 mb-2">Réponses</h2>
<p class="text-gray-600">Analysez les données collectées à partir de vos formulaires</p>
</div>
<div class="bg-white rounded-xl shadow-md mb-8">
<div class="p-6 border-b">
<div class="flex flex-col md:flex-row md:justify-between md:items-center">
<div class="mb-4 md:mb-0">
<h3 class="text-xl font-semibold text-gray-800">Enquête de satisfaction</h3>
<p class="text-gray-600">56 réponses collectées</p>
</div>
<div class="flex space-x-3">
<select class="border rounded-lg px-3 py-2 text-sm">
<option>Toutes les questions</option>
<option>Question 1</option>
<option>Question 2</option>
<option>Question 3</option>
</select>
<button class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg transition flex items-center">
<i class="fas fa-download mr-2"></i> Exporter
</button>
</div>
</div>
</div>
<div class="p-6">
<div class="mb-8">
<h4 class="font-medium text-gray-800 mb-4">1. Comment évaluez-vous notre service ?</h4>
<div class="chart-container">
<canvas id="question1Chart"></canvas>
</div>
</div>
<div class="mb-8">
<h4 class="font-medium text-gray-800 mb-4">2. Quel aspect de notre service appréciez-vous le plus ?</h4>
<div class="chart-container">
<canvas id="question2Chart"></canvas>
</div>
</div>
<div class="mb-8">
<h4 class="font-medium text-gray-800 mb-4">3. Recommanderiez-vous notre service à d'autres ?</h4>
<div class="chart-container">
<canvas id="question3Chart"></canvas>
</div>
</div>
<div>
<h4 class="font-medium text-gray-800 mb-4">Réponses individuelles</h4>
<div class="overflow-x-auto">
<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-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Évaluation</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Aspect préféré</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Recommandation</th>
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Commentaires</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">12/06/2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">4/5</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Rapidité</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Oui</td>
<td class="px-6 py-4 text-sm text-gray-500">Très bon service dans l'ensemble</td>
</tr>
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">11/06/2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">5/5</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Support client</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Oui</td>
<td class="px-6 py-4 text-sm text-gray-500">L'équipe est très réactive et professionnelle</td>
</tr>
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">10/06/2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">3/5</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Prix</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Peut-être</td>
<td class="px-6 py-4 text-sm text-gray-500">Un peu cher pour ce que c'est</td>
</tr>
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">09/06/2023</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">5/5</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Facilité d'utilisation</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">Oui</td>
<td class="px-6 py-4 text-sm text-gray-500">-</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
<!-- New Form Section -->
<section id="new-form" class="section hidden">
<div class="mb-8">
<div class="flex justify-between items-center">
<div>
<h2 class="text-3xl font-bold text-gray-800 mb-2">Créer un nouveau formulaire</h2>
<p class="text-gray-600">Concevez votre formulaire de collecte de données</p>
</div>
<div class="flex space-x-3">
<button class="border border-gray-300 hover:bg-gray-50 px-4 py-2 rounded-lg transition flex items-center">
<i class="fas fa-save mr-2"></i> Enregistrer
</button>
<button class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg transition flex items-center">
<i class="fas fa-eye mr-2"></i> Prévisualiser
</button>
</div>
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
<div class="lg:col-span-2">
<div class="bg-white p-6 rounded-xl shadow-md mb-6">
<div class="mb-4">
<label class="block text-gray-700 font-medium mb-2">Titre du formulaire</label>
<input type="text" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500" placeholder="Ex: Enquête de satisfaction" value="Nouveau formulaire de collecte">
</div>
<div class="mb-4">
<label class="block text-gray-700 font-medium mb-2">Description</label>
<textarea class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500" rows="2" placeholder="Décrivez l'objectif de ce formulaire"></textarea>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md mb-6">
<h3 class="text-lg font-semibold text-gray-800 mb-4">Paramètres du formulaire</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label class="block text-gray-700 font-medium mb-2">Date de début</label>
<input type="date" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500">
</div>
<div>
<label class="block text-gray-700 font-medium mb-2">Date de fin</label>
<input type="date" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500">
</div>
<div class="md:col-span-2">
<label class="flex items-center">
<input type="checkbox" class="form-checkbox h-5 w-5 text-indigo-600">
<span class="ml-2 text-gray-700">Rendre les réponses anonymes</span>
</label>
</div>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md">
<div class="flex justify-between items-center mb-4">
<h3 class="text-lg font-semibold text-gray-800">Questions</h3>
<div class="relative">
<button id="add-question-btn" class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg transition flex items-center">
<i class="fas fa-plus mr-2"></i> Ajouter une question
</button>
<div id="question-type-menu" class="absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg z-10 hidden">
<div class="py-1">
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" onclick="addQuestion('text')"><i class="fas fa-font mr-2"></i> Texte court</a>
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" onclick="addQuestion('textarea')"><i class="fas fa-align-left mr-2"></i> Texte long</a>
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" onclick="addQuestion('radio')"><i class="fas fa-dot-circle mr-2"></i> Choix unique</a>
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" onclick="addQuestion('checkbox')"><i class="fas fa-check-square mr-2"></i> Choix multiples</a>
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" onclick="addQuestion('dropdown')"><i class="fas fa-caret-down mr-2"></i> Liste déroulante</a>
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" onclick="addQuestion('rating')"><i class="fas fa-star mr-2"></i> Évaluation</a>
</div>
</div>
</div>
</div>
<div id="form-builder" class="form-builder p-4 rounded-lg">
<div id="no-questions" class="text-center py-10 text-gray-500">
<i class="fas fa-question-circle text-4xl mb-3"></i>
<p>Commencez par ajouter votre première question</p>
</div>
<div id="questions-container" class="space-y-4 hidden">
<!-- Questions will be added here dynamically -->
</div>
</div>
</div>
</div>
<div>
<div class="bg-white p-6 rounded-xl shadow-md sticky top-6">
<h3 class="text-lg font-semibold text-gray-800 mb-4">Options de publication</h3>
<div class="space-y-4">
<div>
<label class="block text-gray-700 font-medium mb-2">Lien de partage</label>
<div class="flex">
<input type="text" class="flex-grow px-4 py-2 border rounded-l-lg focus:outline-none focus:ring-2 focus:ring-indigo-500" value="https://datacollect.com/form/abc123" readonly>
<button class="bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-r-lg transition">
<i class="fas fa-copy"></i>
</button>
</div>
</div>
<div>
<label class="block text-gray-700 font-medium mb-2">Intégration</label>
<select class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500">
<option>Sélectionnez une option</option>
<option>Code HTML</option>
<option>Lien direct</option>
<option>API</option>
</select>
</div>
<div>
<label class="flex items-center">
<input type="checkbox" class="form-checkbox h-5 w-5 text-indigo-600">
<span class="ml-2 text-gray-700">Activer les notifications par email</span>
</label>
</div>
<div class="pt-4">
<button class="w-full bg-green-600 hover:bg-green-700 text-white px-4 py-3 rounded-lg transition flex items-center justify-center">
<i class="fas fa-paper-plane mr-2"></i> Publier le formulaire
</button>
</div>
</div>
<div class="mt-8 pt-6 border-t">
<h3 class="text-lg font-semibold text-gray-800 mb-4">Aperçu du formulaire</h3>
<div class="bg-gray-50 p-4 rounded-lg">
<div class="mb-4">
<h4 class="font-medium text-gray-800 mb-1">Nouveau formulaire de collecte</h4>
<p class="text-sm text-gray-500">Description du formulaire</p>
</div>
<div id="form-preview" class="space-y-3">
<div class="bg-white p-3 rounded border">
<p class="text-sm text-gray-500">Question 1</p>
</div>
<div class="bg-white p-3 rounded border">
<p class="text-sm text-gray-500">Question 2</p>
</div>
</div>
<button class="w-full mt-4 bg-indigo-600 hover:bg-indigo-700 text-white px-4 py-2 rounded-lg transition text-sm">
Soumettre
</button>
</div>
</div>
</div>
</div>
</div>
</section>
</main>
<!-- Footer -->
<footer class="bg-gray-100 py-6">
<div class="container mx-auto px-4">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="mb-4 md:mb-0">
<p class="text-gray-600">© 2023 DataCollect. Tous droits réservés.</p>
</div>
<div class="flex space-x-6">
<a href="#" class="text-gray-600 hover:text-indigo-600 transition">Conditions d'utilisation</a>
<a href="#" class="text-gray-600 hover:text-indigo-600 transition">Politique de confidentialité</a>
<a href="#" class="text-gray-600 hover:text-indigo-600 transition">Aide</a>
</div>
</div>
</div>
</footer>
</div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
// Show/hide sections
function showSection(sectionId) {
document.querySelectorAll('.section').forEach(section => {
section.classList.add('hidden');
});
document.getElementById(sectionId).classList.remove('hidden');
}
// Initialize charts
function initCharts() {
// Activity Chart
const activityCtx = document.getElementById('activityChart').getContext('2d');
const activityChart = new Chart(activityCtx, {
type: 'line',
data: {
labels: ['Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam', 'Dim'],
datasets: [{
label: 'Réponses',
data: [12, 19, 8, 15, 22, 18, 24],
backgroundColor: 'rgba(79, 70, 229, 0.1)',
borderColor: 'rgba(79, 70, 229, 1)',
borderWidth: 2,
tension: 0.4,
fill: true
}]
},
options: {
responsive: true,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
beginAtZero: true
}
}
}
});
// Question 1 Chart
const q1Ctx = document.getElementById('question1Chart').getContext('2d');
const q1Chart = new Chart(q1Ctx, {
type: 'bar',
data: {
labels: ['1 (Mauvais)', '2', '3', '4', '5 (Excellent)'],
datasets: [{
label: 'Nombre de réponses',
data: [2, 5, 12, 20, 17],
backgroundColor: 'rgba(79, 70, 229, 0.7)'
}]
},
options: {
responsive: true,
plugins: {
legend: {
display: false
}
}
}
});
// Question 2 Chart
const q2Ctx = document.getElementById('question2Chart').getContext('2d');
const q2Chart = new Chart(q2Ctx, {
type: 'doughnut',
data: {
labels: ['Rapidité', 'Support client', 'Prix', 'Facilité d\'utilisation', 'Fonctionnalités'],
datasets: [{
data: [22, 18, 8, 24, 12],
backgroundColor: [
'rgba(79, 70, 229, 0.7)',
'rgba(99, 102, 241, 0.7)',
'rgba(129, 140, 248, 0.7)',
'rgba(165, 180, 252, 0.7)',
'rgba(199, 210, 254, 0.7)'
]
}]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'right'
}
}
}
});
// Question 3 Chart
const q3Ctx = document.getElementById('question3Chart').getContext('2d');
const q3Chart = new Chart(q3Ctx, {
type: 'pie',
data: {
labels: ['Oui', 'Non', 'Peut-être'],
datasets: [{
data: [42, 5, 9],
backgroundColor: [
'rgba(79, 70, 229, 0.7)',
'rgba(239, 68, 68, 0.7)',
'rgba(156, 163, 175, 0.7)'
]
}]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'right'
}
}
}
});
}
// Form builder functionality
let questionCount = 0;
document.getElementById('add-question-btn').addEventListener('click', function(e) {
e.stopPropagation();
const menu = document.getElementById('question-type-menu');
menu.classList.toggle('hidden');
});
// Close menu when clicking elsewhere
document.addEventListener('click', function() {
document.getElementById('question-type-menu').classList.add('hidden');
});
function addQuestion(type) {
questionCount++;
document.getElementById('no-questions').classList.add('hidden');
document.getElementById('questions-container').classList.remove('hidden');
const questionsContainer = document.getElementById('questions-container');
const questionId = `question-${questionCount}`;
let questionHtml = '';
switch(type) {
case 'text':
questionHtml = `
<div id="${questionId}" class="question-item bg-white p-4 rounded-lg border border-gray-200 fade-in" draggable="true">
<div class="flex justify-between items-start mb-3">
<div class="w-full">
<input type="text" class="w-full px-3 py-2 border-b border-gray-300 focus:outline-none focus:border-indigo-500 font-medium" placeholder="Question ${questionCount}" value="Question ${questionCount}">
</div>
<div class="flex space-x-2 ml-3">
<button class="text-gray-400 hover:text-indigo-600 transition" onclick="moveQuestionUp('${questionId}')">
<i class="fas fa-arrow-up"></i>
</button>
<button class="text-gray-400 hover:text-indigo-600 transition" onclick="moveQuestionDown('${questionId}')">
<i class="fas fa-arrow-down"></i>
</button>
<button class="text-gray-400 hover:text-red-600 transition" onclick="removeQuestion('${questionId}')">
<i class="fas fa-trash"></i>
</button>
</div>
</div>
<div class="mt-2">
<input type="text" class="w-full px-3 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500" placeholder="Réponse courte" disabled>
</div>
<div class="mt-3 flex justify-between items-center text-sm">
<div class="flex space-x-3">
<button class="text-gray-500 hover:text-indigo-600 transition">
<i class="fas fa-copy mr-1"></i> Dupliquer
</button>
<button class="text-gray-500 hover:text-indigo-600 transition">
<i class="fas fa-cog mr-1"></i> Paramètres
</button>
</div>
<div>
<span class="text-xs bg-indigo-100 text-indigo-800 px-2 py-1 rounded">Texte court</span>
</div>
</div>
</div>
`;
break;
case 'textarea':
questionHtml = `
<div id="${questionId}" class="question-item bg-white p-4 rounded-lg border border-gray-200 fade-in" draggable="true">
<div class="flex justify-between items-start mb-3">
<div class="w-full">
<input type="text" class="w-full px-3 py-2 border-b border-gray-300 focus:outline-none focus:border-indigo-500 font-medium" placeholder="Question ${questionCount}" value="Question ${questionCount}">
</div>
<div class="flex space-x-2 ml-3">
<button class="text-gray-400 hover:text-indigo-600 transition" onclick="moveQuestionUp('${questionId}')">
<i class="fas fa-arrow-up"></i>
</button>
<button class="text-gray-400 hover:text-indigo-600 transition" onclick="moveQuestionDown('${questionId}')">
<i class="fas fa-arrow-down"></i>
</button>
<button class="text-gray-400 hover:text-red-600 transition" onclick="removeQuestion('${questionId}')">
<i class="fas fa-trash"></i>
</button>
</div>
</div>
<div class="mt-2">
<textarea class="w-full px-3 py-2 border rounded
</html> |