location_view.php 683 B

123456789101112131415161718
  1. <?php
  2. $location = Location::get($id);
  3. if(!$location) throw new Exception("Location not found.");
  4. if(!Core::$user->hasPermission($location)) throw new Exception("You do not have permission to access this page.");
  5. $customer = $location->getCustomer();
  6. $page_title = $location->name;
  7. Core::addBreadcrumb("/account", "Account");
  8. Core::addBreadcrumb("/account/locations", "Locations");
  9. Core::addBreadcrumb("/account/locations?customer_id=$customer->id", "$customer->name Locations");
  10. Core::addBreadcrumb("/account/locations/$location->id", $page_title);
  11. View::includeOnce("header", compact("page_title"));
  12. View::include("location", compact("location"));
  13. View::includeOnce("footer");