本文整理汇总了PHP中getUserData函数的典型用法代码示例。如果您正苦于以下问题:PHP getUserData函数的具体用法?PHP getUserData怎么用?PHP getUserData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getUserData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getData
function getData(&$queryobj)
{
$userqueryinfo = $queryobj["userinfo"];
$machinequeryinfo = $queryobj["machineinfo"];
$begin_ts = $queryobj["from_ts"];
$end_ts = $queryobj["end_ts"];
if ($begin_ts < 0) {
$end_ts = time();
$begin_ts = $end_ts + $begin_ts;
} else {
if ($begin_ts > $end_ts) {
$end_ts = time();
}
}
$alldata = array();
if (0 !== sizeof($userqueryinfo)) {
$user = $userqueryinfo["user"];
$selections = $userqueryinfo["selection"];
foreach ($selections as $product => $typeobj) {
$alldata[$product] = getUserData($user, $product, $typeobj, $begin_ts, $end_ts);
}
}
if (0 !== sizeof($machinequeryinfo)) {
$alldata["_machineinfo_"] = getMachineData($machinequeryinfo, $begin_ts, $end_ts);
}
return $alldata;
}
示例2: createInvoice
function createInvoice($data)
{
global $dbh;
$userdata = getUserData($data['userid']);
$recipient = $data['userid'];
$address = json_encode(array($userdata[15], $userdata[14], $userdata[9], "{$userdata[10]} {$userdata[11]}", $userdata[12]));
$products = json_encode($data['products']);
$subTotal = 0;
$invoicedate = date("Y-m-d H:i:s", strtotime($data['invoice_date']));
$invoiceduedate = date("Y-m-d H:i:s", strtotime('+14 days', strtotime($data['invoice_date'])));
foreach ($data['products'] as $product) {
$subTotal += $product[2] * $product[1];
}
$tax = 0.21 * $subTotal;
$grandTotal = $subTotal + $tax;
$sth = $dbh->prepare("\n\tINSERT INTO invoice_invoices (invoice_recipient, invoice_date, invoice_products, invoice_status, invoice_subtotal, invoice_tax, invoice_total, invoice_duedate, invoice_adress, invoice_number, invoice_ordernum) VALUES (:invoice_recipient, :invoice_date, :invoice_products, '0', :invoice_subtotal, :invoice_tax, :invoice_total, :invoice_duedate, :invoice_adress, :invoice_number, :invoice_ordernum);");
$sth->bindParam(':invoice_recipient', $recipient, PDO::PARAM_STR);
$sth->bindParam(':invoice_products', $products, PDO::PARAM_STR);
$sth->bindParam(':invoice_subtotal', $subTotal, PDO::PARAM_INT);
$sth->bindParam(':invoice_tax', $tax, PDO::PARAM_INT);
$sth->bindParam(':invoice_total', $grandTotal, PDO::PARAM_INT);
$sth->bindParam(':invoice_adress', $address, PDO::PARAM_STR);
$sth->bindParam(':invoice_date', $invoicedate, PDO::PARAM_STR);
$sth->bindParam(':invoice_duedate', $invoiceduedate, PDO::PARAM_STR);
$sth->bindParam(':invoice_number', $data['invoice_number'], PDO::PARAM_INT);
$sth->bindParam(':invoice_ordernum', $data['order_number'], PDO::PARAM_INT);
$sth->execute();
sendMail($userdata['user_email'], "Uw Factuur van D3 Creative Agency", "Beste {$userdata[14]},<br/><br/><div>In je account <strong>{$userdata['user_login']}</strong> is een nieuwe factuur voor je aangemaakt met factuurnummer {$data['invoice_number']}. We hebben de factuur ook onderaan dit bericht toegevoegd.<br/><br/>Je hebt aangegeven gebruik te willen maken van overboeking. Let er op dat de factuur op tijd word betaald op om pauzering van je diensten te voorkomen.<br/><br/>Voor eventuele vragen kan je ons altijd bereiken via <a href=\"mailto:sem@thisisd3.com\">sem@thisisd3.com</a> of via de knop 'Contact' in je <a href=\"http://cp.thisisd3.com/contact/\">controlepaneel</a>.<br/></div><p>Met vriendelijke groet,<br/><br />D3 - Creative Agency<br /></p><br><br><hr><br><br>" . showInvoice($data['invoice_number']));
global $invoiceCreateOk;
$invoiceCreateOk = "Factuur is toegevoegd! En ge-e-mailed naar <i>{$userdata['user_email']}</i>";
}
示例3: publishnews
public function publishnews($id, $date)
{
$user = getUserData($this->loadModel('AuthenticationModel'));
require 'application/views/_templates/header.json.php';
if ($user != NULL) {
$newsTeaser_model = $this->loadModel('NewsTeaserModel');
$newsTeaser_model->publishNews($id, urlencode($date));
$ver = $newsTeaser_model->getNewsVersions($id)[0]->version;
require 'application/views/_templates/header.json.php';
$output = array("type" => 'success', "id" => $id, "version" => $ver);
} else {
$output = array("type" => 'error');
}
require 'application/views/_templates/footer.json.php';
}
示例4: eval_ccpc_getNoFormData
/**
* eval_ccpc_getNoFormData - Récupère les informations non contenues dans le formulaire au cours d'une évaluation
*
* @category : eval_ccpc_functions
* @param array $evaluationData Array contenant les informations relatives à l'évaluation
* @param array $erreur Array contenant la liste des erreurs rencontrées avant execution de la fonction
* @return array Array contenant les informations non contenues dans le formulaire et les erreurs rencontrés lors de l'execution de la fonction
*
* @Author Ali Bellamine
*
* Contenu de l'array retourné :<br>
* ['data'][identifiant du service où est affecté l'utilisateur]['date'] => (string) Date de remplissage de l'évaluation, sous forme de timestamp<br>
* ['data'][identifiant du service où est affecté l'utilisateur]['promotion'] => (int) Identifiant de la promotion de l'utilisateur<br>
* ['data'][identifiant du service où est affecté l'utilisateur]['debutStage'] => (string) Date de début de l'affectation de l'étudiant dans le service<br>
* ['data'][identifiant du service où est affecté l'utilisateur]['finStage'] => (string) Date de fin de l'affectation de l'étudiant dans le service<br>
* ['data'][identifiant du service où est affecté l'utilisateur]['service'] => (int) Identifiant du service<br>
* ['data'][identifiant du service où est affecté l'utilisateur]['nbExternesPeriode'] => (int) Nombre d'étudiants actuellement enregistrés dans le service<br>
* ['erreur'][identifiant du service où est affecté l'utilisateur][] => (array) Array contenant la liste des erreurs rencontrés
*
*/
function eval_ccpc_getNoFormData($evaluationData, $erreur)
{
global $db;
$data = array();
/**
On remplit l'array $data['date']
**/
// Date
$tempData['date'] = TimestampToDatetime(time());
// On récupère les dates à tester
$evaluationSettings = eval_ccpc_getSettings($evaluationData['id']);
// Promotion de l'utilisateur
if ($userData = getUserData($_SESSION['id']) && isset($tempData['promotion'])) {
$tempData['promotion'] = $userData['promotion']['id'];
} else {
if ($userData = getUserData($_SESSION['id']) && !isset($tempData['promotion'])) {
$tempData['promotion'] = 'NULL';
} else {
$tempErreur['LANG_ERROR_CCPC_NOPROMOTION'] = true;
}
}
// Informations concernant le service et la durée du stage
$sql = 'SELECT ae.service service, ae.dateDebut dateDebut, ae.dateFin dateFin
FROM affectationexterne ae
WHERE ae.dateDebut >= :dateDebutEval AND ae.dateFin >= :dateDebutEval AND ae.dateDebut <= :dateFinEval AND ae.dateFin <= :dateFinEval AND userId = :id';
$res = $db->prepare($sql);
$res->execute(array('dateDebutEval' => TimestampToDatetime($evaluationSettings['dateDebut']), 'dateFinEval' => TimestampToDatetime($evaluationSettings['dateFin']), 'id' => $_SESSION['id']));
if ($res) {
while ($res_f = $res->fetch()) {
$data['data'][$res_f['service']]['debutStage'] = $res_f['dateDebut'];
$data['data'][$res_f['service']]['finStage'] = $res_f['dateFin'];
$data['data'][$res_f['service']]['service'] = $res_f['service'];
$data['data'][$res_f['service']]['promotion'] = $tempData['promotion'];
$data['data'][$res_f['service']]['date'] = $tempData['date'];
$sql = 'SELECT count(*) nbExterne
FROM affectationexterne
WHERE (dateDebut >= :dateDebutUser AND dateDebut <= :dateFinUser ) AND (dateDebut <= :dateDebutUser AND dateFin >= :dateDebutUser)';
$res2 = $db->prepare($sql);
$res2->execute(array('dateDebutUser' => $data['data'][$res_f['service']]['debutStage'], 'dateFinUser' => $data['data'][$res_f['service']]['finStage']));
if ($res2_f = $res2->fetch()) {
$data['data'][$res_f['service']]['nbExternesPeriode'] = $res2_f['nbExterne'];
} else {
$data['erreur'][$res_f['service']]['LANG_ERROR_CCPC_NONBEXTERNE'] = true;
}
}
}
return $data;
}
示例5: passwordCheck
function passwordCheck($params)
{
if (password_verify($params['senha'], $params['hash'])) {
if (password_needs_rehash($params['hash'], PASSWORD_DEFAULT, ['cost' => 10])) {
$hash = password_hash($params['senha'], PASSWORD_DEFAULT, ['cost' => 10]);
defineNewHash($params['hash']);
}
session_unset($_SESSION['error']);
//Chama o método de para recuperaros dados do usuário
getUserData($params['email']);
return true;
} else {
$_SESSION['error'] = 'Senha invalida.';
return false;
}
}
示例6: logUserIn
function logUserIn($name, $password, $keepLog = false)
{
$name = secureString($name);
$password = hashPassword(secureString($password), getUserData(array('name' => $name))['salt']);
$userData = getUserData(array('name' => $name, 'password' => $password));
if ($userData) {
setSessionVar('login', true);
setSessionVar('userID', $userData['id']);
if ($keepLog) {
setSessionVar('saveKeepLog', true);
}
return true;
} else {
return false;
}
}
示例7: base
function base()
{
//$this->load->model('leave_transactions_model','mods');
//$result = $this->mods->getTransactionSummary(getUserId($this));
//var_dump($result);
//exit;
$data = initializeData($this, "Profile");
$data['data'] = getUserData($this);
$data['title_here'] = $data['data'][0]->lname . ', ' . $data['data'][0]->fname . ' ' . $data['data'][0]->mname . ' (' . $data['data'][0]->empno . ')';
//error_reporting(E_ALL);
$sDept = $this->mod->getDeptOfEmployee(getUserId($this));
$aDept = $this->mod->getObjectById('departments', 'id', $sDept[0]->department_id);
$sStat = $this->mod->getStatOfEmployee(getUserId($this));
$aStat = $this->mod->getObjectById('status', 'id', $sStat[0]->id);
$sEmp = $this->mod->getEmpTypeOfEmployee(getUserId($this));
$aEmp = $this->mod->getObjectById('emp_types', 'id', $sEmp[0]->id);
//var_dump($aDept);
//var_dump($aStat);
//var_dump($aEmp);
$data['leave_balance'] = $this->mod->getLeaveBalanceOfEmployee(getUserId($this));
$data['own_department'] = $aDept[0]->department_name;
$data['own_employment'] = $aEmp[0]->emp_description . ' (' . $aStat[0]->status_name . ')';
/*function getEmpTypeOfEmployee($employee_id){
$query = $this->db->query("SELECT de.id FROM emp_types de,employment e,emp_types_stat d WHERE e.employee_id = {$employee_id} AND e.emp_types_stat_id = d.id AND d.emp_types_id = de.id");
return $query->result();
}
function getStatOfEmployee($employee_id){
$query = $this->db->query("SELECT s.id FROM status s,employment e,emp_types_stat d WHERE e.employee_id = {$employee_id} AND e.emp_types_stat_id = d.id AND d.status_id = s.id");
return $query->result();
}
function getDeptOfEmployee($employee_id){
$query = $this->db->query("SELECT department_id FROM employees WHERE id = {$employee_id}");
return $query->result();
}
function getRankOfEmployee($employee_id){
$query = $this->db->query("SELECT ranks_id FROM employees WHERE id = {$employee_id}");
return $query->result();
}
function getRoleOfEmployee($employee_id){
$query = $this->db->query("SELECT roles_id FROM employees WHERE id = {$employee_id}");
return $query->result();
} */
renderPage($this, $this->table . '/base', $data);
}
示例8: intval
<div class="main-content">
<form action="" method="post">
<?php
if (!empty($message)) {
echo '<div class="form-item">' . $message . '</div>';
}
?>
<form action="" method="post">
<?php
$uid = intval($_GET['iuid']);
$investor = getInvestorById($uid);
$userverification = getUserData($_SESSION['uid']);
if (!$investor) {
echo ' <div class="content-titles">Investor does not exist.</div>';
exit;
}
?>
<form action="" method="post" enctype="multipart/form-data">
<div class="content-block">
<div
class="content-title"><?php
echo $investor['company_name'];
?>
<?php
if ($investor['verified'] == True) {
?>
<img src="images/4.png" title="Verified." "><?php
示例9: getUserLink
function getUserLink($useid)
{
global $_getUserLinkCache;
$useid = intval($useid);
if (isset($_getUserLinkCache[$useid])) {
return $_getUserLinkCache[$useid];
}
$useData = getUserData($useid);
if ($useData["useid"] == 0) {
$str = '???';
$_getUserLinkCache[$useid] = $str;
return $str;
}
$str = '<span class="nowrap">' . getOnlineLamp($useData) . '<a href="' . url("user/" . strtolower($useData["useUsername"])) . '">' . $useData["useUsername"] . '</a></span>';
$_getUserLinkCache[$useid] = $str;
return $str;
}
示例10: getRoutersForUser
<div class="my-routers content-block">
<div class="content-title"><?php
if ($own_profile) {
echo 'My';
} else {
echo $user['first_name'] . "'s";
}
?>
Routers</div>
<div class="form-item no-height">
<?php
$routers = getRoutersForUser($uid);
if (!empty($routers)) {
foreach ($routers as $router) {
$u = getUserData($router['user_id']);
?>
<div class="router-user-photo">
<a href="user.php?uid=<?php
echo $u['user_id'];
?>
">
<?php
if (empty($u['photo'])) {
?>
<img src="uploads/avatars/nophoto.jpg" alt="">
<?php
} else {
?>
<img src="uploads/avatars/<?php
echo $u['photo'];
示例11: foreach
echo LANG_ADMIN_SERVICES_NOM;
?>
</th>
<th><?php
echo LANG_ADMIN_AFFECTATIONS_DATE_DEBUT;
?>
</th>
<th><?php
echo LANG_ADMIN_AFFECTATIONS_DATE_FIN;
?>
</th>
<th></th>
</tr>
<?php
foreach ($affectationsErreur as $affectationErreurId => $affectationErreurData) {
$userData = getUserData($_SESSION['affectations']['data']['insert'][$affectationErreurId]['etudiant']);
$serviceData = getServiceInfo($_SESSION['affectations']['data']['insert'][$affectationErreurId]['service']);
?>
<tr class = "bodyTR">
<td><?php
echo $userData['nom'] . ' ' . $userData['prenom'];
?>
</td>
<td><?php
echo $serviceData['FullName'];
?>
</td>
<td><?php
echo $_SESSION['affectations']['data']['insert'][$affectationErreurId]['dateDebut'];
?>
</td>
示例12: header
require_once 'init.php';
if (!isSignin()) {
$signin_url = 'signin.php';
header("Location: {$signin_url}");
exit;
}
$user_id = $_SESSION['user_id'];
//error_log("user id debug output" . $user_id, 4);
$db = connectDb();
$place = 0;
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST['place'])) {
$place = $_POST['place'];
}
}
$user_data = getUserData($db, $user_id);
$user_name = $user_data["user_name"];
$user_id = $user_data["id"];
$event_data = getEventData($db, $user_id);
$event_name = $event_data["event_name"];
$event_content = $event_data["content"];
$lastEvent = getLastEvent($db, $user_id);
$leName = "イベントがありません";
$last = "イベントがありません";
$lastId = $lastEvent["user_id"];
$lastEId = $lastEvent["id"];
if ($lastId == $user_id) {
$last = $lastEvent["content"];
$leName = $lastEvent["event_name"];
}
function h($str)
示例13: getPassword
<?php
if ($_POST['uname'] != "") {
#$password = getPassword($_POST['uname']);
$userdata = getUserData($_POST['uname']);
$password = $userdata['password'];
if ($password == $_POST['pass']) {
$expire = time() + 60 * 60;
setcookie("name", $_POST['uname'], $expire);
setcookie("gid", $userdata['gid'], $expire);
#echo "cookie set for: [" . $_COOKIE['name'] . "]<br/>";
} else {
$login_failed = true;
}
}
if ($_GET['logout']) {
setcookie("name", "", time() - 3600);
setcookie("gid", "", time() - 3600);
}
/*if ($_COOKIE['name'] != "") {
echo "cookie set for: [" . $_COOKIE['name'] . "]<br/>";
}*/
function getUserData($username)
{
try {
$userarray = array();
#echo "username: $username<br/>";
$db = new PDO('mysql:dbname=michaeq6_mheartsj', 'michaeq6_mj', 'mj060708');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $db->prepare("SELECT group_id FROM users WHERE name=?");
$stmt->bindParam(1, $username);
示例14: checkid
function checkid($realm, &$attributes)
{
logger('checkid: ' . $realm);
logger('checkid attrs: ' . print_r($attributes, true));
if (isset($_POST['cancel'])) {
$this->cancel();
}
$data = getUserData();
if (!$data) {
return false;
}
$q = get_pconfig(local_channel(), 'openid', $realm);
$attrs = array();
if ($q) {
$attrs = $q;
} elseif (isset($_POST['attributes'])) {
$attrs = array_keys($_POST['attributes']);
} elseif (!isset($_POST['once']) && !isset($_POST['always'])) {
return false;
}
$attributes = array();
foreach ($attrs as $attr) {
if (isset($this->attrFieldMap[$attr])) {
$attributes[$attr] = $data[$this->attrFieldMap[$attr]];
}
}
if (isset($_POST['always'])) {
set_pconfig(local_channel(), 'openid', $realm, array_keys($attributes));
}
return z_root() . '/id/' . $data['channel_address'];
}
示例15: TimestampToDatetime
?>
</th>
<th><?php
echo LANG_ADMIN_AFFECTATIONS_DATE_FIN;
?>
</th>
<th></th>
</tr>
<?php
// Récupération de la liste des étudiants affectés au service
$sql = 'SELECT userId idEtudiant, ae.id affectationId FROM affectationexterne ae INNER JOIN user u ON u.id = ae.userId WHERE ae.service = :service AND ae.dateDebut <= :now AND ae.dateFin >= :now ORDER BY u.promotion ASC, nom ASC, prenom ASC';
$res = $db->prepare($sql);
$res->execute(array('service' => $serviceInfo['id'], 'now' => TimestampToDatetime(time())));
if ($res_f = $res->fetch()) {
$userData = getUserData($res_f['idEtudiant']);
?>
<tr style = "text-align: center;">
<td><?php
echo $userData['prenom'];
?>
</td>
<td><?php
echo $userData['nom'];
?>
</td>
<td><?php
echo $userData['promotion']['nom'];
?>
</td>
<td><?php