Header.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Header file.
  4. */
  5. use PhpOffice\PhpSpreadsheet\Helper\Sample;
  6. error_reporting(E_ALL);
  7. require_once __DIR__ . '/../src/Bootstrap.php';
  8. $helper = new Sample();
  9. // Return to the caller script when runs by CLI
  10. if ($helper->isCli()) {
  11. return;
  12. }
  13. ?>
  14. <html>
  15. <head>
  16. <title><?php echo $helper->getPageTitle(); ?></title>
  17. <meta charset="utf-8">
  18. <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
  19. <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  20. <link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css"/>
  21. <link rel="stylesheet" href="/bootstrap/css/font-awesome.min.css"/>
  22. <link rel="stylesheet" href="/bootstrap/css/phpspreadsheet.css"/>
  23. <script src="/bootstrap/js/jquery.min.js"></script>
  24. <script src="/bootstrap/js/bootstrap.min.js"></script>
  25. </head>
  26. <body>
  27. <div class="container">
  28. <div class="navbar navbar-default" role="navigation">
  29. <div class="container-fluid">
  30. <div class="navbar-header">
  31. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
  32. <span class="sr-only">Toggle navigation</span>
  33. <span class="icon-bar"></span>
  34. <span class="icon-bar"></span>
  35. <span class="icon-bar"></span>
  36. </button>
  37. <a class="navbar-brand" href="/">PHPSpreadsheet</a>
  38. </div>
  39. <div class="navbar-collapse collapse">
  40. <ul class="nav navbar-nav"><?php
  41. foreach ($helper->getSamples() as $category => $files) {
  42. ?><li class="dropdown">
  43. <a href="#" class="dropdown-toggle" data-toggle="dropdown"><?php echo $category ?><strong class="caret"></strong></a>
  44. <ul class="dropdown-menu"><?php
  45. foreach ($files as $name => $file) {
  46. echo '<li><a href="/' . $file . '">' . $name . '</a></li>';
  47. } ?></ul>
  48. </li>
  49. <?php
  50. } ?>
  51. </ul>
  52. <ul class="nav navbar-nav navbar-right">
  53. <li><a href="https://github.com/PHPOffice/PHPSpreadsheet"><i class="fa fa-github fa-lg" title="GitHub"></i>&nbsp;</a></li>
  54. <li><a href="https://phpspreadsheet.readthedocs.io"><i class="fa fa-book fa-lg" title="Docs"></i>&nbsp;</a></li>
  55. </ul>
  56. </div>
  57. </div>
  58. </div>
  59. <?php
  60. echo $helper->getPageHeading();