本文整理汇总了PHP中GetUsers函数的典型用法代码示例。如果您正苦于以下问题:PHP GetUsers函数的具体用法?PHP GetUsers怎么用?PHP GetUsers使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetUsers函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DisplayUserEntries
function DisplayUserEntries()
{
$users = GetUsers();
foreach ($users as $user) {
DisplayEntry($user->ID, $user->Username, $user->PasswordHash, $user->Email, $user->PhoneNumber, $user->Name, $user->Role);
}
}
示例2: DisplayUserEntries
function DisplayUserEntries()
{
$users = GetUsers();
foreach ($users as $user) {
DisplayEntry($user['ID'], $user['Username'], $user['Password'], $user['Email'], $user['Phone'], $user['Name'], $user['Role']);
}
}
示例3: DoesUserExist
function DoesUserExist()
{
$userList = GetUsers();
$noUser = true;
foreach ($userList as $userVal) {
if ($userVal["name"] == $targetUser) {
$noUser = false;
}
}
return $noUser;
}
示例4: displayActivity
//.........这里部分代码省略.........
<?php
echo _FILE;
?>
:
<input type="Text" name="srchFile" value="<?php
echo $srchFile;
?>
" width="30">
<?php
echo _ACTION;
?>
:
<select name="srchAction">
<option value="">-- <?php
echo _ALL;
?>
--</option>
<?php
$selected = "";
foreach ($cfg["constants"] as $action) {
$selected = "";
if ($action != $cfg["constants"]["hit"]) {
if ($srchAction == $action) {
$selected = "selected";
}
echo "<option value=\"" . $action . "\" " . $selected . ">" . htmlentities($action, ENT_QUOTES) . "</option>";
}
}
?>
</select>
<?php
echo _USER;
?>
:
<select name="user_id">
<option value="">-- <?php
echo _ALL;
?>
--</option>
<?php
$users = GetUsers();
$selected = "";
for ($inx = 0; $inx < sizeof($users); $inx++) {
$selected = "";
if ($user == $users[$inx]) {
$selected = "selected";
}
echo "<option value=\"" . $users[$inx] . "\" " . $selected . ">" . htmlentities($users[$inx], ENT_QUOTES) . "</option>";
}
?>
</select>
<input type="Submit" value="<?php
echo _SEARCH;
?>
">
</td>
</tr>
</form>
</table>
</div>
<?php
echo "<table width=\"760\" border=1 bordercolor=\"" . $cfg["table_admin_border"] . "\" cellpadding=\"2\" cellspacing=\"0\" bgcolor=\"" . $cfg["table_data_bg"] . "\">";
echo "<tr><td colspan=6 bgcolor=\"" . $cfg["table_header_bg"] . "\" background=\"themes/" . $cfg["theme"] . "/images/bar.gif\">";
echo "<table width=\"100%\" cellpadding=0 cellspacing=0 border=0><tr><td>";
echo "<img src=\"images/properties.png\" width=18 height=13 border=0> <font class=\"title\">" . _ACTIVITYLOG . " " . $cfg["days_to_keep"] . " " . _DAYS . " (" . $userdisplay . ")</font>";
if (!empty($prevlink) && !empty($morelink)) {
echo "</td><td align=\"right\">" . $prevlink . $morelink . "</td></tr></table>";
} elseif (!empty($prevlink)) {
echo "</td><td align=\"right\">" . $prevlink . "</td></tr></table>";
} elseif (!empty($prevlink)) {
echo "</td><td align=\"right\">" . $morelink . "</td></tr></table>";
} else {
echo "</td><td align=\"right\"></td></tr></table>";
}
echo "</td></tr>";
echo "<tr>";
echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\"><div align=center class=\"title\">" . _USER . "</div></td>";
echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\"><div align=center class=\"title\">" . _ACTION . "</div></td>";
echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\"><div align=center class=\"title\">" . _FILE . "</div></td>";
echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\" width=\"13%\"><div align=center class=\"title\">" . _IP . "</div></td>";
echo "<td bgcolor=\"" . $cfg["table_header_bg"] . "\" width=\"15%\"><div align=center class=\"title\">" . _TIMESTAMP . "</div></td>";
echo "</tr>";
echo $output;
if (!empty($prevlink) || !empty($morelink)) {
echo "<tr><td colspan=6 bgcolor=\"" . $cfg["table_header_bg"] . "\">";
echo "<table width=\"100%\" cellpadding=0 cellspacing=0 border=0><tr><td align=\"left\">";
if (!empty($prevlink)) {
echo $prevlink;
}
echo "</td><td align=\"right\">";
if (!empty($morelink)) {
echo $morelink;
}
echo "</td></tr></table>";
echo "</td></tr>";
}
echo "</table>";
}
示例5: CheckForRefresh
$confirmationMsg = "";
// Get selectedRole
if (FirstTimeHere($pageName)) {
$refreshRequested = true;
$selectedRole = ADMIN_ROLE;
} else {
if (array_key_exists($selectedRoleID, $_POST)) {
$selectedRole = $_POST[$selectedRoleID];
} else {
$selectedRole = ADMIN_ROLE;
}
$refreshRequested = CheckForRefresh();
}
// Are we refreshing?
if ($refreshRequested) {
$userList = GetUsers();
GetUsersOrGroupsByRole(true, $selectedRole, $usersSelected);
$usersNotSelected = array_diff($userList, $usersSelected);
$groupList = GetGroups();
GetUsersOrGroupsByRole(false, $selectedRole, $groupsSelected);
$groupsNotSelected = array_diff($groupList, $groupsSelected);
} else {
// Get submitted data
if (array_key_exists($usersSelectedID, $_POST)) {
$usersSelected = $_POST[$usersSelectedID];
}
if (array_key_exists($usersNotSelectedID, $_POST)) {
$usersNotSelected = $_POST[$usersNotSelectedID];
}
if (array_key_exists($groupsSelectedID, $_POST)) {
$groupsSelected = $_POST[$groupsSelectedID];
示例6: GetDataForGroup
$errorMsg = "";
$confirmationMsg = "";
// Is this our first time here?
if (FirstTimeHere($pageName)) {
// Was the selected group passed in the URL?
if (array_key_exists($selectedGroupID, $_GET)) {
$selectedGroup = $_GET[$selectedGroupID];
}
// Get info for selected user
$selectedGroupData = GetDataForGroup($selectedGroup, true);
if ($selectedGroupData == NULL) {
throw new Exception(sprintf($errNotFound, $selectedGroup));
}
$description = $selectedGroupData->description;
CopyArray($selectedGroupData->users, $usersSelected);
$allUsers = GetUsers();
$usersNotSelected = array_diff($allUsers, $usersSelected);
} else {
// Get submitted data
if (array_key_exists($selectedGroupID, $_POST)) {
$selectedGroup = $_POST[$selectedGroupID];
}
if (array_key_exists($descriptionID, $_POST)) {
$description = $_POST[$descriptionID];
}
if (array_key_exists($usersSelectedID, $_POST)) {
$usersSelected = $_POST[$usersSelectedID];
}
if (array_key_exists($usersNotSelectedID, $_POST)) {
$usersNotSelected = $_POST[$usersNotSelectedID];
}
示例7: GetLinks
<table width="100%" cellpadding="1" border="0">
<tr>
<td valign="top">
<b><?php
echo _TORRENTLINKS;
?>
:</b><br>
<?php
$arLinks = GetLinks();
if (is_array($arLinks)) {
foreach ($arLinks as $link) {
echo "<a href=\"" . $link['url'] . "\" target=\"_blank\"><img src=\"images/arrow.gif\" width=9 height=9 title=\"" . $link['url'] . "\" border=0 align=\"baseline\">" . $link['sitename'] . "</a><br>\n";
}
}
echo "</ul></td>";
$arUsers = GetUsers();
$arOnlineUsers = array();
$arOfflineUsers = array();
for ($inx = 0; $inx < count($arUsers); $inx++) {
if (IsOnline($arUsers[$inx])) {
array_push($arOnlineUsers, $arUsers[$inx]);
} else {
array_push($arOfflineUsers, $arUsers[$inx]);
}
}
echo "<td bgcolor=\"" . $cfg["table_data_bg"] . "\" valign=\"top\">";
echo "<b>" . _ONLINE . ":</b><br>";
for ($inx = 0; $inx < count($arOnlineUsers); $inx++) {
echo "<a href=\"message.php?to_user=" . $arOnlineUsers[$inx] . "\">";
echo "<img src=\"images/user.gif\" width=17 height=14 title=\"\" border=0 align=\"bottom\">" . $arOnlineUsers[$inx];
echo "</a><br>\n";
示例8: UserDataDelete
/**
* Удаление ключа индивидуальной настройки пользователя в базе данных.
* @param $Name Имя настройки.
* @param null $UserId Идентификатор пользователя. Если не указан, то используется идентификатор текущего пользователя.
* @return var|null Возвращает значение удаленной настройки, или null, если настройка не найдена.
*/
function UserDataDelete($Name, $UserId = null)
{
$this_user = false;
if (!isset($UserId)) {
if (System::user()->Auth) {
$UserId = SafeEnv($this->Get('u_id'), 11, int);
$this_user = true;
} else {
return null;
}
}
$Data = GetUserInfo($UserId);
$Data = $Data['data'];
if (isset($Data[$Name])) {
$value = $Data[$Name];
unset($Data[$Name]);
$system_users_cache = GetUsers();
$system_users_cache[$UserId]['data'] = $Data;
if ($this_user) {
System::user()->Session('u_data', $Data);
}
System::database()->Update('users', "`data`='" . SafeEnv(serialize($Data), 0, str) . "'", "`id`='{$UserId}'");
return $value;
}
}
示例9: header
<?php
header('Content-Type: text/html; charset=utf-8');
/// set the content charset to utf-8 for php
error_reporting(E_ALL);
ini_set('display_errors', '1');
session_start();
$temp = $_POST["param"];
$temp = str_replace("[", "", $temp);
$temp = str_replace("]", "", $temp);
//echo $temp;
$param = json_decode($temp);
$ordr = (int) $param->order;
switch ($ordr) {
case 1:
GetUsers();
break;
case 2:
InsertUser($param);
break;
case 3:
UpdateUser($param);
break;
case 4:
GetUserInfo($param);
break;
case 5:
DelUser($param);
break;
}
function GetUsers()
{
示例10: GetUsers
<?php
//Insersion des fichiers ".php"
require_once 'mysql.inc.php';
require_once 'DbFunctions.php';
require_once 'DisplayFunctions.php';
$tabUser = GetUsers();
$tableHTMLUsers = AssocToHtml($tabUser);
?>
<!DOCTYPE html>
<html>
<head>
<title>Accueil</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<?php
require_once 'header.php';
?>
<body>
<div id="corpsForm">
<div id="insideCorpsForm">
<?php
if (isset($_GET['id'])) {
$tableHTMLUser = TableUsersToHtmlUser($_GET['id'], $tabUser);
echo $tableHTMLUser;
} else {
echo $tableHTMLUsers;
}
示例11: ConnectDB
?>
<!--Done adding profile pic to page-->
</td>
</tr>
<tr>
<td>
<div style="text-align:center">
<strong>Other Users</strong>
</div>
<br />
</td>
</tr>
<?php
$dbh = ConnectDB();
$userdata = GetUsers($dbh);
foreach ($userdata as $thisone) {
$photo_id = GetProfilePic($dbh, $thisone->username);
if ($photo_id != 0) {
$pic = GetPic($dbh, $photo_id);
echo '<tr><td><img src="' . $pic . '
" alt="" style="width:auto;height:auto;
max-width:20px;max-height:20px;"/>
<a href="./show_pix.php?username=' . $thisone->username . '">' . $thisone->username . '</a></td></tr>';
} else {
echo '<tr><td><img src="/~mclaug67/Images/johnfreeman.png"
alt="" style="width:auto;height:auto;
max-width:20px;max-height:20px;"/>
<a href="./show_pix.php?username=' . $thisone->username . '">' . $thisone->username . '</a></td></tr>';
}
}
示例12: ActivedUsers
<input type="checkbox" id="callapp_checkbox_' . $aRow[$hidden] . '" name="check_' . $aRow[$hidden] . '" value="' . $aRow[$hidden] . '" class="check" />
<label for="callapp_checkbox_' . $aRow[$hidden] . '"></label>
</div>';
}
}
$data['aaData'][] = $row;
}
break;
case 'save_actived':
ActivedUsers($user_id, $actived_number, $operator);
break;
case 'save_actived_select':
ActivedUsersSelect($user_id, $operator, $ids);
break;
case 'get_user':
$page = GetUsers();
$data = array('user' => $page);
break;
default:
$error = 'Action is Null';
}
$data['error'] = $error;
echo json_encode($data);
/* ******************************
* Request Functions
* ******************************
*/
function GetUsers()
{
$data = '';
$req = mysql_query("SELECT `users`.`id`,\r\n\t\t\t\t `user_info`.`name`\r\n FROM `users`\r\n JOIN `user_info` ON `users`.`id` = `user_info`.`user_id`\r\n WHERE `users`.`actived` = 1");
示例13: array
$formName = 'AddGroupForm';
$homePage = 'groupmanagement.php';
$helpPage = 'HelpDocs/adding_and_deleting_groups.htm';
$groupName = "";
$groupNameID = 'groupName';
$description = "";
$descriptionID = 'description';
$usersSelected = array();
$usersSelectedID = 'usersSelected';
$usersNotSelected = array();
$usersNotSelectedID = 'usersNotSelected';
$confirmationMsg = "";
$errorMsg = "";
// Is this our first time here?
if (FirstTimeHere($pageName)) {
$usersNotSelected = GetUsers();
} else {
// Get submitted data
if (array_key_exists($groupNameID, $_POST)) {
$groupName = $_POST[$groupNameID];
}
if (array_key_exists($descriptionID, $_POST)) {
$description = $_POST[$descriptionID];
}
if (array_key_exists($usersSelectedID, $_POST)) {
$usersSelected = $_POST[$usersSelectedID];
}
if (array_key_exists($usersNotSelectedID, $_POST)) {
$usersNotSelected = $_POST[$usersNotSelectedID];
}
// Validate inputs.
示例14: switch
<?php
include "../modules/Application/src/Application/View/Helper/Form.php";
include "../modules/Application/src/Application/View/Helper/FormUpdate.php";
include "../modules/Application/src/Application/Mapper/User/GetUsers.php";
include "../modules/Application/src/Application/Mapper/User/GetUser.php";
include "../modules/Application/src/Application/Mapper/User/DeleteUser.php";
include "../modules/Utils/src/Utils/View/RenderView.php";
$formdef = "../modules/Application/src/Application/Forms/register.json";
switch ($route['action']) {
case 'index':
case 'select':
$users = GetUsers($config);
$content = RenderView($route, array('users' => $users));
break;
case 'insert':
if ($_POST) {
include '../modules/Utils/src/Utils/Form/FilterData.php';
$formdef = "../modules/Application/src/Application/Forms/register.json";
$data = FilterData($_POST, $formdef);
$validate = ValidateData($data, $formdef);
if ($validate['result'] === true) {
// Write to repo
$array = $_POST;
$array['photo'] = $_FILES['photo']['name'];
Save($array, $filename);
header("Location: /user/select");
} else {
echo "<pre>";
print_r($valid);
echo "</pre>";
示例15: trim
exit;
}
if (isset($_GET['GroupId']) and is_numeric($_GET['GroupId'])) {
$GroupId = (int) $_GET['GroupId'];
if (isset($_GET['GroupName']) and mb_strlen($_GET['GroupName']) <= 100 and !ContainsIllegalCharacters($_GET['GroupName'])) {
$GroupName = trim($_GET['GroupName']);
} else {
prnMsg(_('The Group Name should be less than 100 and cannot contains illegal characters'), 'error');
include 'includes/footer.inc';
exit;
}
}
$sql = "DELETE FROM mailgroupdetails WHERE userid = '" . $UserId . "' AND groupname = '" . $GroupName . "'";
$ErrMsg = 'Failed to delete the userid ' . $UserId . ' from group ' . $GroupName;
$result = DB_query($sql, $db, $ErrMsg);
GetUsers($GroupId, $GroupName);
}
if (!isset($_GET['Edit'])) {
//display the input form
?>
<form id="MailGroups" action="<?php
echo htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8');
?>
" method="post">
<input type="hidden" name="FormID" value="<?php
echo $_SESSION['FormID'];
?>
" />
<label for="MailGroup"><?php
echo _('Mail Group');
?>