1
0

customer_select.php 820 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <div class="container pt-3 my-4">
  2. <h2>Select Customer</h2>
  3. <div class="list-group">
  4. <?php
  5. $uri = $_SERVER["REQUEST_URI"];
  6. $uri_parts = explode("?", $uri);
  7. $path = array_shift($uri_parts);
  8. if(Core::$user->isAdmin() && Core::$allow_all_customers) {
  9. $query = $_GET;
  10. unset($query["path"]);
  11. $query["customer_id"] = "ALL";
  12. ?>
  13. <a class="list-group-item list-group-item-action" href="<?=htmlspecialchars($path)?>?<?=http_build_query($query)?>">
  14. <?=__("All")?>
  15. </a>
  16. <?php
  17. }
  18. foreach($customers as $customer) {
  19. $query = $_GET;
  20. unset($query["path"]);
  21. $query["customer_id"] = $customer->id;
  22. ?>
  23. <a class="list-group-item list-group-item-action" href="<?=htmlspecialchars($path)?>?<?=http_build_query($query)?>">
  24. <?=htmlspecialchars($customer->name)?>
  25. </a>
  26. <?php
  27. }
  28. ?>
  29. </div>
  30. </div>