Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $lines = file("Project/books.txt");
- $employees = [];
- foreach ($lines as $line) {
- list($id, $title, $grade) = explode(";", $line);
- $employees[] = ["id" => $id, "title" => $title, "grade" => $grade];
- }
- ?>
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <link rel="stylesheet" type="text/css" href="Project/styles.css">
- <title>Raamatud</title>
- </head>
- <body id="book-list-page">
- <div id="root">
- <nav>
- <div>
- <a href="index.php" id="book-list-link">Raamatud</a>
- <a href="Project/book-add.php" id="book-form-link">Lisa raamat</a>
- <a href="Project/author-list.php" id="author-list-link">Autorid</a>
- <a href="Project/author-add.php" id="author-form-link">Lisa autor</a>
- </div>
- </nav>
- <main>
- <div id="authors">
- <div class="title header">Pealkiri</div>
- <div class="author header">Autorid</div>
- <div class="grade header">Hinne</div>
- <div class="br header-divider"></div>
- <div>
- <?php foreach ($employees as $each): ?>
- <?php print $each["title"] . PHP_EOL; ?>
- <?php endforeach; ?>
- </div>
- <div>
- </div>
- <div class="score">
- <?php foreach ($employees as $each): ?>
- <?php print $each["grade"] . PHP_EOL; ?>
- <?php endforeach; ?>
- </div>
- </div>
- </main>
- <footer>
- ICD0007 Näidisrakendus
- </footer>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement