customer_view.php 542 B

12345678910111213141516171819
  1. <?php
  2. $customer = Customer::get($id);
  3. if(!$customer) throw new Exception("Customer not found.");
  4. $page_title = $customer->name;
  5. Core::addBreadcrumb("/account", "Account");
  6. Core::addBreadcrumb("/account/customers", "Customers");
  7. Core::addBreadcrumb("/account/customers/$id", $page_title);
  8. $projects = Project::query(["customer_id" => $id]);
  9. $locations = $customer->getLocations();
  10. View::includeOnce("header", compact("page_title"));
  11. View::include("customer", compact("customer", "projects", "locations"));
  12. View::includeOnce("footer");
  13. ?>