mirror of
https://github.com/glmdev/eecs448-lab10
synced 2026-03-02 03:39:24 +00:00
Initial commit
This commit is contained in:
26
ViewUserPosts.html
Normal file
26
ViewUserPosts.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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();
|
||||
Reference in New Issue
Block a user