Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.73 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Employee Database Search</title>
  4. </head>
  5. <body>
  6.  
  7. <?php
  8. require_once './library/Employee.php';
  9.  
  10. $filters = (isset($_GET['filters']) ? $_GET['filters'] : array());
  11. $emps = Employee::getEmpList($filters);
  12.  
  13. ?>
  14.  
  15. <h2>Song List</h2>
  16.    
  17.     <div class="filters">
  18.         <form method="get">
  19.             <h3>Search Employee</h3>
  20.  
  21.             <label for="filter-first_name">First Name:</label>
  22.             <input type="text" id="filter-first_name" maxlength="49" name="filters[FIRST_NAME]"
  23.                 value="<?php if (isset($filters['FIRST_NAME'])) echo htmlspecialchars($filters['FIRST_NAME']) ?>" />
  24.  
  25.             <label for="filter-surname">Surname:</label>
  26.             <input type="text" id="filter-surname" maxlength="49" name="filters[SURNAME]"
  27.                 value="<?php if (isset($filters['SURNAME'])) echo htmlspecialchars($filters['SURNAME']) ?>" />
  28.                        
  29.             <label for="filter-company">Company:</label>
  30.             <input type="text" id="filter-company" maxlength="49" name="filters[COMPANY]"
  31.                 value="<?php if (isset($filters['COMPANY'])) echo htmlspecialchars($filters['COMPANY']) ?>" />
  32.            
  33.             <input type="submit" id="filter-submit" value="Search &raquo;" />
  34.             <a href="index.php">Reset</a>
  35.         </form>
  36.     </div> 
  37. <?php if (empty($emps)): // No songs were found in the library ?>
  38.     No employees were find in the library.
  39.  
  40.    
  41. <?php else: // We do have songs?>
  42.     <table class="empList">
  43.         <tr>
  44.             <th>FIRIST_NAME</th>
  45.             <th>SURNAME</th>
  46.             <th>COMPANY</th>
  47.         </tr>
  48. <?php endif ?>
  49.        
  50. <?php foreach($emps as $emp): ?>
  51.         <tr>
  52.             <td><?php echo htmlspecialchars($emp['FIRST_NAME']) ?></td>
  53.             <td><?php echo htmlspecialchars($emp['SURNAME']) ?></td>
  54.             <td><?php echo htmlspecialchars($emp['COMPANY']) ?></td>
  55.         </tr>
  56. <?php endforeach; ?>
  57.     </table>
  58.  
  59.  
  60.  
  61. </body>
  62. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement