當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserModel::getUsers方法代碼示例

本文整理匯總了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"]);
 }
開發者ID:Pablord,項目名稱:SchoolPaymentManagementSystem,代碼行數:9,代碼來源:UserController.php

示例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();
 }
開發者ID:ngardner,項目名稱:BentoCMS,代碼行數:10,代碼來源:Users.php

示例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;
 }
開發者ID:ralucabolba,項目名稱:E-Biblio,代碼行數:11,代碼來源:user_controller.php

示例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>  
開發者ID:sachinimalindi,項目名稱:simphpcms,代碼行數:30,代碼來源:allUsers.php

示例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();
 }
開發者ID:ngardner,項目名稱:BentoCMS,代碼行數:49,代碼來源:Blog.php


注:本文中的UserModel::getUsers方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。