You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
755 B
27 lines
755 B
3 years ago
|
<?php
|
||
|
|
||
|
require './configuration.php';
|
||
|
|
||
|
$page = new common\Page;
|
||
|
$users = new app\UserRepository;
|
||
|
|
||
|
// Generate the user options
|
||
|
$user_options = array_map(function($user) {
|
||
|
return '<option value="' . $user['user_id'] . '">' . $user['username'] . '</option>';
|
||
|
}, $users->find());
|
||
|
|
||
|
$page->title('EECS 448 Lab 10 - Exercise 6')
|
||
|
->header('View Posts by User')
|
||
|
->form(system_url('ViewUserPosts.php'), function() use($page, $user_options) {
|
||
|
$page->writes('
|
||
|
<label for="user-select">Select a user:</label>
|
||
|
<select name="user_id" id="user-select" style="min-width: 300px;" required>
|
||
|
' . implode("\n", $user_options) . '
|
||
|
</select>
|
||
|
');
|
||
|
|
||
|
$page->submit();
|
||
|
});
|
||
|
|
||
|
$page->write();
|