aboutsummaryrefslogtreecommitdiffstats
path: root/admin/page/insert.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/page/insert.php')
-rw-r--r--admin/page/insert.php60
1 files changed, 25 insertions, 35 deletions
diff --git a/admin/page/insert.php b/admin/page/insert.php
index d95a33d..ec903e7 100644
--- a/admin/page/insert.php
+++ b/admin/page/insert.php
@@ -37,43 +37,33 @@ if(HTTP::issetPOST('id', 'user', 'slug', 'name', 'body', 'argv', 'time_insert',
}
}
-#===============================================================================
-# TRY: Template\Exception
-#===============================================================================
-try {
- $userIDs = $Database->query(sprintf('SELECT id FROM %s ORDER BY fullname ASC', User\Attribute::TABLE));
-
- foreach($userIDs->fetchAll($Database::FETCH_COLUMN) as $userID) {
- $User = User\Factory::build($userID);
- $userAttributes[] = [
- 'ID' => $User->attr('id'),
- 'FULLNAME' => $User->attr('fullname'),
- 'USERNAME' => $User->attr('username'),
- ];
- }
-
- $FormTemplate = Template\Factory::build('page/form');
- $FormTemplate->set('FORM', [
- 'TYPE' => 'INSERT',
- 'INFO' => $messages ?? [],
- 'DATA' => array_change_key_case($Attribute->getAll(), CASE_UPPER),
- 'USER_LIST' => $userAttributes ?? [],
- 'TOKEN' => Application::getSecurityToken()
- ]);
+$userIDs = $Database->query(sprintf('SELECT id FROM %s ORDER BY fullname ASC', User\Attribute::TABLE));
- $InsertTemplate = Template\Factory::build('page/insert');
- $InsertTemplate->set('HTML', $FormTemplate);
-
- $MainTemplate = Template\Factory::build('main');
- $MainTemplate->set('NAME', $Language->text('title_page_insert'));
- $MainTemplate->set('HTML', $InsertTemplate);
- echo $MainTemplate;
+foreach($userIDs->fetchAll($Database::FETCH_COLUMN) as $userID) {
+ $User = User\Factory::build($userID);
+ $userAttributes[] = [
+ 'ID' => $User->attr('id'),
+ 'FULLNAME' => $User->attr('fullname'),
+ 'USERNAME' => $User->attr('username'),
+ ];
}
#===============================================================================
-# CATCH: Template\Exception
+# Build document
#===============================================================================
-catch(Template\Exception $Exception) {
- Application::exit($Exception->getMessage());
-}
-?> \ No newline at end of file
+$FormTemplate = Template\Factory::build('page/form');
+$FormTemplate->set('FORM', [
+ 'TYPE' => 'INSERT',
+ 'INFO' => $messages ?? [],
+ 'DATA' => array_change_key_case($Attribute->getAll(), CASE_UPPER),
+ 'USER_LIST' => $userAttributes ?? [],
+ 'TOKEN' => Application::getSecurityToken()
+]);
+
+$InsertTemplate = Template\Factory::build('page/insert');
+$InsertTemplate->set('HTML', $FormTemplate);
+
+$MainTemplate = Template\Factory::build('main');
+$MainTemplate->set('NAME', $Language->text('title_page_insert'));
+$MainTemplate->set('HTML', $InsertTemplate);
+echo $MainTemplate;