supplier.php 523 B

12345678910111213141516171819202122232425
  1. <?php /** @noinspection PhpUnhandledExceptionInspection */
  2. namespace App;
  3. use RuntimeException;
  4. /**
  5. * @var int $id
  6. */
  7. $supplier = Supplier::get($id);
  8. if(!$supplier) {
  9. throw new RuntimeException(__("Supplier not found."));
  10. }
  11. $core = Core::getInstance();
  12. $core->addBreadcrumb("/suppliers", __("Suppliers"));
  13. $core->addBreadcrumb($supplier->getUrl(), $supplier->name);
  14. $user = $core->getUser();
  15. $user->requireAdmin();
  16. View::include("header");
  17. View::include("supplier", compact("supplier"));
  18. View::include("footer");