本文整理汇总了PHP中UserModel::getUsers方法的典型用法代码示例。如果您正苦于以下问题:PHP UserModel::getUsers方法的具体用法?PHP UserModel::getUsers怎么用?PHP UserModel::getUsers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserModel
的用法示例。
在下文中一共展示了UserModel::getUsers方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listUsersView
public static function listUsersView()
{
$userModel = new UserModel();
$users = $userModel->getUsers();
$paginationNumber = (new ConfigurationModel())->getPaginationNumber();
$usersAmount = $userModel->getUsersAmount();
$view = new ListUsersView();
$view->show($users, $paginationNumber, $usersAmount, $_SESSION["username"]);
}
示例2: actionNormalUsers
function actionNormalUsers($params = '')
{
$objUsers = new UserModel();
$users = $objUsers->getUsers('user');
$this->view->assign('userList', $users);
$this->view->assign('userType', 'Normal');
$this->view->assign('content', $this->view->fetch('tpl/administration/users.tpl'));
$this->view->assign('messages', $this->messages);
$this->finish();
}
示例3: getUsersTable
function getUsersTable()
{
$userModel = new UserModel();
$users = $userModel->getUsers();
$result = "<div style='height:400px;overflow:auto;'>\n\t\t\t\t\t<table class='tables'>\n\t\t\t\t\t <thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t <th>Id</th>\n\t\t\t\t\t\t <th>First name</th>\n\t\t\t\t\t\t <th>Last name</th>\n\t\t\t\t\t\t <th>Email</th>\n\t\t\t\t\t\t <th>Username</th>\n\t\t\t\t\t\t <th>Remove</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t </thead>\n\t\t\t\t\t <tbody>";
foreach ($users as $user) {
$result = $result . "<tr>\n\t\t\t\t\t\t <td>{$user->idUser}</td>\n\t\t\t\t\t\t <td>{$user->firstname}</td>\n\t\t\t\t\t\t <td>{$user->lastname}</td>\n\t\t\t\t\t\t <td>{$user->email}</td>\n\t\t\t\t\t\t <td>{$user->username}</td>\n\t\t\t\t\t\t <td>\n\t\t\t\t\t\t\t<form action='' method='post'>\n\t\t\t\t\t\t\t\t<input type='hidden' name='user_to_del' value='{$user->idUser}' />\n\t\t\t\t\t\t\t\t<input type='submit' name='delete_user' value='' id='del_user'/>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t </td>\n\t\t\t\t\t\t</tr>";
}
$result = $result . "</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t\t</div>";
return $result;
}
示例4:
<br />
<div id="main">
<h2>Column 1</h2>
<table border="2" cellspacing="2" cellpadding="2">
<tr>
<th><font face="Arial, Helvetica, sans-serif">Id</font></th>
<th><font face="Arial, Helvetica, sans-serif">fname</font></th>
<th><font face="Arial, Helvetica, sans-serif">username</font></th>
<th><font face="Arial, Helvetica, sans-serif">password</font></th>
<th><font face="Arial, Helvetica, sans-serif">email</font></th>
<th><font face="Arial, Helvetica, sans-serif">Date</font></th>
</tr>
<?php
$users = $userM->getUsers();
for ($y = 1; $y - 1 < sizeof($users); $y++) {
// $categorie = $CategorieM->getCategories($categories[$y]);
// $categories[$y]
// echo $catID[$y];
//echo "<li><a href='".$catID[$y]."'>".$catID[$y]."</a></li>";
$field1 = $users[$y]->getId();
$field2 = $users[$y]->getFull_name();
$field3 = $users[$y]->getUsername();
$field4 = $users[$y]->getPassword();
$field5 = $users[$y]->getEmail();
$field6 = $users[$y]->getDate();
echo "<tr><td>" . $field1 . "</td><td>" . $field2 . "</td><td>" . $field3 . "</td><td>" . $field4 . "</td><td>" . $field5 . "</td></tr>";
}
?>
</table>
示例5: actionEditArticle
function actionEditArticle($params = '')
{
$objBlog = new BlogModel();
$article_id = !empty($params['article_id']) ? intval($params['article_id']) : false;
if (!empty($params['dosave'])) {
$saveData = array();
$saveData['id'] = !empty($params['article_id']) ? intval($params['article_id']) : false;
$saveData['title'] = !empty($params['article_title']) ? $params['article_title'] : 'Unnamed';
$saveData['keyName'] = !empty($params['article_keyName']) ? $params['article_keyName'] : '';
$saveData['article'] = !empty($params['article_article']) ? $params['article_article'] : '';
$saveData['author_id'] = !empty($params['article_author_id']) ? intval($params['article_author_id']) : false;
$saveData['category_id'] = !empty($params['article_category_id']) ? intval($params['article_category_id']) : '';
$saveData['publishDate'] = !empty($params['article_publishDate']) ? date("Y-m-d H:i:s", strtotime($params['article_publishDate'])) : date("Y-m-d H:i:s");
$saveData['allow_comments'] = !empty($params['article_allow_comments']) ? intval($params['article_allow_comments']) : false;
$saveData['layout_id'] = !empty($params['article_layout_id']) ? intval($params['article_layout_id']) : false;
$saveData['status'] = !empty($params['article_status']) ? $params['article_status'] : 'draft';
$saveData['url'] = !empty($params['article_url']) ? $params['article_url'] : false;
$saveData['meta']['title'] = !empty($params['meta_title']) ? $params['meta_title'] : '';
$saveData['meta']['description'] = !empty($params['meta_description']) ? $params['meta_description'] : '';
$saveData['meta']['keywords'] = !empty($params['meta_keywords']) ? $params['meta_keywords'] : '';
$article_id = $objBlog->saveArticle($saveData);
if (!empty($params['ajaxsave'])) {
$articleInfo = $objBlog->loadArticle($article_id);
echo json_encode($articleInfo);
return;
}
$this->messages[] = array('type' => 'success', 'message' => 'Blog article has been saved.');
if ($params['submit'] == 'Save and Close') {
$this->actionArticles();
return;
}
}
$categoryList = $objBlog->getCategories();
$this->view->assign('categoryList', $categoryList);
$objUsers = new UserModel();
$this->view->assign('userList', $objUsers->getUsers('admin'));
$objLayouts = new LayoutModel();
$layouts = $objLayouts->getLayouts();
$this->view->assign('layouts', $layouts);
if (!empty($article_id)) {
$articleInfo = $objBlog->loadArticle($article_id);
} else {
$articleInfo['layout_id'] = $objBlog->getDefaultArticleLayout();
}
$this->view->assign('articleInfo', $articleInfo);
$this->view->assign('content', $this->view->fetch('tpl/blog/article.tpl'));
$this->view->assign('messages', $this->messages);
$this->finish();
}