Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Employee Database Search</title>
- </head>
- <body>
- <?php
- require_once './library/Employee.php';
- $filters = (isset($_GET['filters']) ? $_GET['filters'] : array());
- $emps = Employee::getEmpList($filters);
- ?>
- <h2>Song List</h2>
- <div class="filters">
- <form method="get">
- <h3>Search Employee</h3>
- <label for="filter-first_name">First Name:</label>
- <input type="text" id="filter-first_name" maxlength="49" name="filters[FIRST_NAME]"
- value="<?php if (isset($filters['FIRST_NAME'])) echo htmlspecialchars($filters['FIRST_NAME']) ?>" />
- <label for="filter-surname">Surname:</label>
- <input type="text" id="filter-surname" maxlength="49" name="filters[SURNAME]"
- value="<?php if (isset($filters['SURNAME'])) echo htmlspecialchars($filters['SURNAME']) ?>" />
- <label for="filter-company">Company:</label>
- <input type="text" id="filter-company" maxlength="49" name="filters[COMPANY]"
- value="<?php if (isset($filters['COMPANY'])) echo htmlspecialchars($filters['COMPANY']) ?>" />
- <input type="submit" id="filter-submit" value="Search »" />
- <a href="index.php">Reset</a>
- </form>
- </div>
- <?php if (empty($emps)): // No songs were found in the library ?>
- No employees were find in the library.
- <?php else: // We do have songs?>
- <table class="empList">
- <tr>
- <th>FIRIST_NAME</th>
- <th>SURNAME</th>
- <th>COMPANY</th>
- </tr>
- <?php endif ?>
- <?php foreach($emps as $emp): ?>
- <tr>
- <td><?php echo htmlspecialchars($emp['FIRST_NAME']) ?></td>
- <td><?php echo htmlspecialchars($emp['SURNAME']) ?></td>
- <td><?php echo htmlspecialchars($emp['COMPANY']) ?></td>
- </tr>
- <?php endforeach; ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement