本文整理汇总了PHP中searchUser函数的典型用法代码示例。如果您正苦于以下问题:PHP searchUser函数的具体用法?PHP searchUser怎么用?PHP searchUser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了searchUser函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: intDoSearch
function intDoSearch(&$smarty)
{
$user_search_helper = new ReportCollector();
$report_helper = new ReportHelper();
intSetConditions($smarty, $user_search_helper);
list($count, $user_ids, $user_infos) = searchUser($smarty, $user_search_helper->getConds(), $report_helper->getFrom(), $report_helper->getTo(), $report_helper->getOrderBy(), $report_helper->getDesc());
$smarty->assign_by_ref("user_infos", $user_infos);
$smarty->assign_by_ref("user_ids", $user_ids);
$smarty->assign("result_count", $count);
$smarty->assign("show_results", TRUE);
intShowUserSearch($smarty);
}
示例2: myfriendsDispatch
function myfriendsDispatch($op)
{
require_once _base_ . '/lib/lib.urlmanager.php';
$url =& UrlManager::getInstance('myfriends');
$url->setStdQuery('modname=myfriends&op=myfriends');
if (isset($_POST['undo']) || isset($_GET['undo'])) {
$op = 'myfriends';
}
switch ($op) {
case "myfriends":
myfriends($url);
break;
case "searchuser":
searchUser($url);
break;
case "approveuser":
approveuser($url);
break;
case "delfriend":
delfriend($url);
break;
}
}
示例3: while
echo '{"result":1,"users":[';
//start of json object
while ($row) {
echo json_encode($row);
//convert the result array to json object
$row = $obj->fetch();
if ($row) {
echo ",";
//if there are more rows, add comma
}
}
echo "]}";
//end of json array and object
}
switch ($cmd) {
case 1:
addUser($_REQUEST['user_name'], $_REQUEST['user_id'], $_REQUEST['user_pass'], $_REQUEST['user_type']);
break;
case 2:
updateUser($_REQUEST['user_id'], $_REQUEST['user_name'], $_REQUEST['user_pass'], $_REQUEST['user_type']);
break;
case 3:
delete($_REQUEST['user_id']);
break;
case 4:
searchUser();
break;
default:
# code...
break;
}
示例4: searchProjects
} else {
$search = 'Search';
}
?>
<div class="content-block">
<div class="content-title" style="color:#4a77a4">Search for : <?php
echo $search;
//$_POST['search_text'];
?>
</div>
<?php
$projects = searchProjects($search);
$ideathreads = searchIdeathreads($search);
$users = searchUser($search);
$investors = searchInvestor($search);
if ($projects) {
foreach ($projects as $project) {
search_popularity_update($search, $project['project_id']);
$user = getUserData($project['created_by']);
//$user_email = getUserData($project['created_by']);
$title = $project['project_title'];
if (strlen($title) < 20) {
$short_title = $title;
} else {
$short_title = substr($title, 0, 19) . '...';
}
?>
<div class="recent-project-item">
示例5: searchUser
}
//vidage des variables
$arrayusers = [];
$nbusersarchiv = 0;
}
?>
<div class="row">
<!-- Resultats de la recherche -->
<div class="col-xs-12">
<?php
if (strlen($term) >= 2) {
// Recherche d'un adherent
$result = searchUser($term);
if (FALSE == $result or mysqli_num_rows($result) == 0) {
echo "<div class=\"col-xs-6\">";
echo getError(6);
echo "</div><div class=\"col-xs-6\"><div class=\"alert alert-info alert-dismissable\"><i class=\"fa fa-info\"></i>\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button> <a href=\"index.php?a=1&b=1\" >Créer un nouvel utilisateur ?</a></div></div>";
} else {
$nb = mysqli_num_rows($result);
if ($nb > 0) {
?>
<div class="box box-info"><div class="box-header"><h3 class="box-title"><?php
echo "Résultats de la recherche: " . $nb . "";
?>
<small class="badge bg-blue" data-toggle="tooltip" title="Les adhérents inactifs sont grisés"><i class="fa fa-info"></i></small></h3>
<!-- div recherche -->
<div class="box-tools"><div class="input-group"><form method="post" action="index.php?a=1">
<div class="input-group input-group-sm">
示例6: switch
<?php
require_once "_main3.php";
switch ($_GET["a"]) {
case "search_user":
searchUser($_GET["user"]) ? $status = 1 : ($status = 0);
echo json_encode(array("status" => $status));
break;
case "login":
searchPassword($_GET["name"], $_GET["password"]) ? $status = 1 : ($status = 0);
//setcookie("user_logged", true, time() + 3600);
$date_suscription = getDateSuscription($_GET["name"], $_GET["password"]);
echo json_encode(array("status" => $status, "date_suscription" => $date_suscription));
break;
}
示例7: searchUser
<div class="box-header"><h3 class="box-title">Inscrire un adhérent</h3>
<div class="box-tools"><form method="POST" action="index.php?a=30&b=1&idsession=<?php
echo $idsession;
?>
">
<div class="input-group"><input type="text" name="searchuser" class="form-control input-sm pull-right" style="width: 150px;" placeholder="Nom ou numéro de carte"/>
<div class="input-group-btn"><button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button> </div></div></form>
</div>
</div><!-- /.box-header -->
<div class="box-body">
<?php
//resultat de la recherche si -------------------------------------
if ($searchuser != "" and strlen($searchuser) > 2) {
// Recherche d'un adherent
$result = searchUser($searchuser);
if (FALSE == $result or mysqli_num_rows($result) == 0) {
echo getError(6);
} else {
$nb = mysqli_num_rows($result);
if ($nb > 0) {
echo "<p>Résultats de la recherche: " . $nb . "</p>";
?>
<table class="table table-hover">
<thead><tr><th></th><th>Nom Prénom</th><th><span data-toggle="tooltip" title="Inscriptions en cours / total dépensé sur total acheté">Inscriptions/Forfait</span></th></tr></thead><tbody>
<?php
for ($i = 1; $i <= $nb; $i++) {
$row = mysqli_fetch_array($result);
if ($placesrestantes > 0) {
// 0= inscription en cours non validée
$nbASencours = getnbASUserEncours($row['id_user'], 0);
示例8: oci_parse
<?php
$sql = "SELECT user_name FROM users";
$stid = oci_parse($conn, $sql);
$res = oci_execute($stid);
while ($row = oci_fetch_array($stid, OCI_ASSOC)) {
foreach ($row as $name) {
echo "<option value='" . $name . "'>{$name}</option>";
}
}
?>
</select>
<input type="submit" name="search_user" value="Search">
</form>
<?php
searchUser($conn);
?>
</div>
<div id="del_user_btn">Delete User</div>
<div id="del_user_panel">
<form action="" method="post">
<b>Delete user</b><br />
Username: <select name="del_username">
<?php
$sql = "SELECT user_name FROM users";
$stid = oci_parse($conn, $sql);
$res = oci_execute($stid);
while ($row = oci_fetch_array($stid, OCI_ASSOC)) {
foreach ($row as $name) {
示例9: searchProjects
<div class="main-content">
<form action="" method="post">
<div class="content-block">
<div class="content-title">Search for "<?php
echo $_POST['search_text'];
?>
":</div>
<?php
$projects = searchProjects($_POST['search_text']);
$users = searchUser($_POST['search_text']);
if ($projects) {
foreach ($projects as $project) {
$user = getUserData($project['created_by']);
$title = $project['project_title'];
if (strlen($title) < 20) {
$short_title = $title;
} else {
$short_title = substr($title, 0, 19) . '...';
}
?>
<div class="recent-project-item">
<?php
$image = getFeaturingImage($project['project_id']);
if (!empty($image)) {
示例10: session_start
<!DOCTYPE html>
<html lang="tr-TR">
<?php
include 'functions.php';
include 'connectdb.php';
session_start();
if (!isset($_SESSION['firstname'])) {
header("location:index.php");
}
$searching = $_POST["kisi-ara"];
$usersdb = searchUser($searching);
$cnt = 0;
?>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="assets/img/ico/favicon.png">
<title>Mezun Arama Sayfası - İzmir Üniversitesi Mezun Bilgi Sistemi</title>
<!-- Bootstrap core CSS -->
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="assets/css/app.css" rel="stylesheet">
<link href="assets/css/responsive.css" rel="stylesheet">
示例11: showUserResults
function showUserResults($mysqli)
{
if (isset($_POST['search'])) {
$keywords = trim(htmlentities($_POST['search'], ENT_QUOTES, "UTF-8"));
$keywords = $mysqli->real_escape_string($keywords);
if (searchUser($mysqli, $keywords) != false) {
$users = searchUser($mysqli, $keywords);
// Ausgabe der einzelnen Suchergebnisse
foreach ($users as $key => $user) {
?>
<div class="row">
<div class="col-md-12">
<div class="panel-body">
<div class="row note-content">
<div class="col-md-8 col-sm-8 col-xs-8 col-lg-8 panel-note">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title"><a href="<?php
echo PROJECT_HTTP_ROOT . '/profile/' . $user['userName'];
?>
"><?php
echo $user['userName'];
?>
</a></h3>
<ul class="panel-note-control">
<li><?php
echo $user['points'] . " Punkte";
?>
</li>
</ul>
</div>
<div class="panel-body">
<div class="myEditor">
<p>
<?php
if ($user['aboutMe'] != "") {
echo substr($user['aboutMe'], 0, 150) . " ...";
} else {
echo $user['userName'] . " hat noch sich noch nit vorgestellt.";
}
?>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
}
}
}
}
示例12: header
return;
}
if (count($params) == 0) {
header("Location: 403.php");
return;
}
$deny_access = 0;
if ($params['deny_access'] == 0) {
$deny_access = 1;
}
updateUserAccess($params['user_id'], $deny_access);
}
$search_criteria = "";
if (isset($_POST['button_search'])) {
$search_criteria = trim(strip_tags($_POST['search']));
$users = searchUser($search_criteria);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="http://getbootstrap.com/assets/ico/favicon.ico">
示例13: mysqli_connect
<?php
$connection = mysqli_connect("localhost", "e47wong", "Fall2014", "e47wong") or die("Error " . mysqli_error($link));
//This switch determines which function will be performed based on what parameters are passed in.
if (isset($_POST['json_data']) && !empty($_POST['json_data'])) {
insertUser(json_decode($_POST['json_data']));
} else {
if (isset($_GET['phone']) && !empty($_GET['phone'])) {
//run update User
updateUser($_GET['p'], $_GET['phone']);
} else {
$return = array();
$return = searchUser($_GET['p']);
//Retrieve result, encode the array and echo the string back to the application layer.
echo json_encode($return);
}
}
/*Function stores Facebook credentials into the MySQL db.
Input - $fbInfo, a variable for an array decoded from JSON input.
Output - returns nothing. */
function insertUser($fbInfo)
{
global $connection;
//Check if there already exists a user with the same Facebook userID.
$test = "SELECT COUNT(*) FROM `User` WHERE fBLink = '{$fbInfo->profile}'";
$res = $connection->query($test);
$row = $res->fetch_row();
//If the result is 0, proceed with inserting the new user into the MySQL database.
if ($row[0] == 0) {
$sql = "INSERT INTO `User`(`firstName`, `lastName`, `fBLink`) VALUES ('{$fbInfo->fbFirstName}', '{$fbInfo->fbLastName}', '{$fbInfo->profile}')";
$result = $connection->query($sql);
示例14: searchUser
<?php
require "initialize.php";
if (isset($_COOKIE["user_id"]) && !isset($_COOKIE["isLoggedIn"])) {
$user = searchUser($conn);
if ($user->num_rows == 0) {
// echo "niet gevonden";
$registerQuery = "INSERT INTO " . DB_PREFIX . "users (idSpotify) VALUES ('" . $_COOKIE["user_id"] . "')";
$conn->query($registerQuery);
} else {
// echo "gevonden";
}
setcookie("isLoggedIn", true, time() + 3600, "/");
}
function searchUser($conn)
{
$userQuery = "SELECT * FROM " . DB_PREFIX . "users WHERE idSpotify = '" . $_COOKIE['user_id'] . "'";
return $conn->query($userQuery);
}
示例15: isset
break;
case 'banUser':
$sBanned = isset($_REQUEST["banned"]) ? process_db_input($_REQUEST['banned']) : FALSE_VAL;
$sUserId = getValue("SELECT `ID` FROM `" . MODULE_DB_PREFIX . "Profiles` WHERE `ID` = '" . $sId . "' LIMIT 1");
getResult(empty($sUserId) ? "INSERT INTO `" . MODULE_DB_PREFIX . "Profiles`(`ID`, `Banned`) VALUES('" . $sId . "', '" . $sBanned . "')" : "UPDATE `" . MODULE_DB_PREFIX . "Profiles` SET `Banned`='" . $sBanned . "' WHERE `ID`='" . $sId . "'");
break;
case 'kickUser':
getResult("UPDATE `" . MODULE_DB_PREFIX . "CurrentUsers` SET `Status`='" . USER_STATUS_KICK . "', `When`='" . time() . "' WHERE `ID`='" . $sId . "'");
break;
case 'changeUserType':
$sUserId = getValue("SELECT `ID` FROM `" . MODULE_DB_PREFIX . "Profiles` WHERE `ID` = '" . $sId . "' LIMIT 1");
getResult(empty($sUserId) ? "INSERT INTO `" . MODULE_DB_PREFIX . "Profiles`(`ID`, `Type`) VALUES('" . $sId . "', '" . $sType . "')" : "UPDATE `" . MODULE_DB_PREFIX . "Profiles` SET `Type`='" . $sType . "' WHERE `ID`='" . $sId . "'");
break;
case 'searchUser':
$sContents = parseXml($aXmlTemplates['result'], "No User Found.", FAILED_VAL);
$sUserId = searchUser($sParamValue, $sParamName);
if (empty($sUserId)) {
break;
}
$aUser = getUserInfo($sUserId);
$aUser['sex'] = $aUser['sex'] == "female" ? "F" : "M";
$aProfile = getArray("SELECT * FROM `" . MODULE_DB_PREFIX . "Profiles` WHERE `ID` = '" . $sUserId . "' LIMIT 1");
if (!is_array($aProfile) || count($aProfile) == 0) {
$aProfile = array("Banned" => FALSE_VAL, "Type" => CHAT_TYPE_FULL);
}
$sContents = parseXml($aXmlTemplates['result'], "", SUCCESS_VAL);
$sContents .= parseXml($aXmlTemplates['user'], $sUserId, $aUser['nick'], $aUser['sex'], $aUser['age'], $aUser['photo'], $aUser['profile'], $aProfile['Banned'], $aProfile['Type']);
break;
/**
* Get sounds
*/