_steps.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. $step = get_step();
  3. $navigation = array(
  4. 1 => "Suche läuft",
  5. 2 => "Suche abgeschlossen",
  6. 3 => "Treffer gefunden",
  7. 4 => "Gefahrstoff-Prüfung",
  8. 5 => "Gefahrgut-Prüfung",
  9. 6 => "Fertig"
  10. );
  11. $links = array(
  12. 0 => "index-smartify.php",
  13. 1 => "step1.php",
  14. 2 => "step2.php",
  15. 3 => "step3.php",
  16. 4 => "step4.php",
  17. 5 => "step5.php",
  18. 6 => "step6.php"
  19. );
  20. ?>
  21. <?php if ($step > 0): ?>
  22. <ol class="ch-ggs-web-suite-order-steps row mb-7">
  23. <?php for ($i = 1; $i <= 6; $i++): ?>
  24. <li class="col-md-6 col-lg-4 <?php echo ($i == $step && $i != 1 ? ' active' : '') ?> <?php echo ($i < $step && $step != 1 ? ' done' : '') ?> <?php echo ($step == 1 && $i == 1 ? ' loading' : '') ?><?php echo ($step == 2 && $i == 2 ? ' error' : '') ?>">
  25. <a href="<?php echo $links[$i]?>" class="nav-link">
  26. <?php if ($step == 1 && $i == 1): ?>
  27. <div class="ch-ggs-web-suite-order-steps-loader spinner-border text-white" role="status">
  28. <span class="visually-hidden">Loading...</span>
  29. </div>
  30. <?php endif ?>
  31. <span class="d-inline-block">
  32. <span class="d-block nav-link-title"><?php echo $navigation[$i] ?></span>
  33. </span>
  34. </a>
  35. </li>
  36. <?php endfor; ?>
  37. </ol>
  38. <?php endif ?>
  39. <?php
  40. function get_step() {
  41. $phpself = explode('/', $_SERVER['PHP_SELF']);
  42. if (count($phpself) == 0) return 1;
  43. $script = array_pop($phpself);
  44. $script = str_replace(array('.php', 'step'), '', $script);
  45. if ($script == 'index-smartify') return 1;
  46. return intval($script);
  47. }
  48. ?>