本文整理汇总了PHP中Users::getUserById方法的典型用法代码示例。如果您正苦于以下问题:PHP Users::getUserById方法的具体用法?PHP Users::getUserById怎么用?PHP Users::getUserById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Users
的用法示例。
在下文中一共展示了Users::getUserById方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkLogStatusForSite
static function checkLogStatusForSite()
{
if (!isset($_SESSION)) {
session_start();
}
if (!isset($_SESSION['user_id'])) {
if (Cookies::isSetLoginCookies()) {
if (Cookies::verifyLoginCookies()) {
$id = Cookies::getLoginIdFromCookie();
$username = Users::getUserById($id)['username'];
self::staticSetSession($id, $username);
}
}
}
}
示例2: actionTech
function actionTech()
{
$ri = $_COOKIE['ri'];
$log = $_COOKIE['login'];
if (!isset($ri)) {
header('Location: /' . SITE_DIR . '/auth/showAuth');
}
//получить список технологов
$userList6 = User_post::getUsersByPost(6);
$userList7 = User_post::getUsersByPost(7);
$userList = $userList6 + $userList7;
$techList = array();
foreach ($userList as $techid) {
$datatech = Users::getUserById($techid['uid']);
if ($datatech['validation'] == 1) {
$techList[] = array('uid' => $datatech['id'], 'name' => Datas::nameAbr($datatech['name']));
}
}
// var_dump($techList);die;
$no_reckoning = array();
$orderList = Order::getOrdersNoReckoning();
foreach ($orderList as $order) {
$techdate = strtotime($order['tech_date']);
if ($techdate < strtotime('today')) {
$order['tech_date'] = date('Y-m-d', strtotime('yesterday'));
}
$no_reckoning[$order['technologist'] . '-' . $order['tech_date']][$order['oid']] = $order['contract'];
}
//var_dump($no_reckoning); die;
$no_appoint = Order::getOrdersNoaAppointTech();
//список дизайнеров
$userList5 = User_post::getUsersByPost(5);
$disList = array();
foreach ($userList5 as $disid) {
$datadis = Users::getUserById($disid['uid']);
$disList[$datadis['id']] = Datas::nameAbr($datadis['name']);
}
//var_dump($disList);die;
$page = SITE_PATH . 'views/plantech.php';
include SITE_PATH . 'views/layout.php';
return true;
}
示例3: _e
_e('post');
?>
</th>
<th style="vertical-align: middle;"><?php
_e('status');
?>
</th>
<th style="vertical-align: middle;"><?php
_e('submitted_date');
?>
</th>
</tr>
<?php
while ($row = $res->fetch_assoc()) {
if (isset($row['user_id'])) {
$user = Users::getUserById($row['user_id']);
}
if ($row['status'] == 'Trashed') {
$status = _e('trashed', '', '', true);
$statcolor = "style='text-align: center; color: red;'";
$t_button = "<a href='?switch=comments&sub=clean_comment&id=" . $row['ID'] . "'>" . _e('clean', '', '', true) . "</a>";
} else {
$status = _e('published', '', '', true);
$statcolor = "style='text-align: center;'";
$t_button = "<a href='?switch=comments&sub=trash_comment&id=" . $row['ID'] . "'>" . _e('trash', '', '', true) . "</a>";
}
echo "<tr><td style='text-align: center; vertical-align: middle;'>" . $row['ID'] . "</td><td style='text-align: center; vertical-align: middle;'><a href='?switch=users&sub=edit_user&id=" . $row['user_id'] . "'>" . $user['username'] . "</a></td><td>" . $row['content'] . "</td><td>" . Posts::getPostTitleById($row['post_id']) . "</td><td " . $statcolor . ">" . $status . "<br>" . "<span style='text-align: center;'><a onclick=\"return confirm('Are you sure?');\" href='?switch=comments&sub=delete_comment&id=" . $row['ID'] . "'>" . _e('delete', '', '', true) . "</a></span>" . "<br>" . "<span style='text-align: center;'>" . $t_button . "</span></td><td style='text-align: center; vertical-align: middle;'>" . addZerosToShow(LBDP($row['date'])) . "</td></tr>";
}
$res->free();
?>
</table>
示例4: getConfEmailTemplateVars
function getConfEmailTemplateVars($user_id)
{
$user = Users::getUserById($user_id);
$values = ['{username}' => $user['username'], '{email}' => $user['user_email'], '{site_title}' => getSiteTitle(), '{site_url}' => SITE_DOMAIN, '{activate}' => $user['activate']];
return $values;
}
示例5: actionCollHoliday
function actionCollHoliday()
{
if (!empty($_POST['date'])) {
$datedb = Datas::dateToDb($_POST['date']);
$uid = $_POST['uid'];
//проверка наличия записи
$list = Freemen::getFreeday($uid);
if (!in_array($datedb, $list)) {
Freemen::addFree($uid, $datedb);
$user = Users::getUserById($uid);
$name = Datas::nameAbr($user['name']);
echo $name . 'f' . $datedb . 'f' . $uid;
}
}
return true;
}
示例6: actionIndex
function actionIndex($oid)
{
$ri = $_COOKIE['ri'];
$log = $_COOKIE['login'];
if (!isset($ri)) {
header('Location: /' . SITE_DIR . '/auth/showAuth');
}
$zagol = array('Просчет', 'Материал', 'Распил', 'ЧПУ', 'Кромка', 'Присадка', 'Гнутье', 'Эмаль', 'ПВХ', 'Фотопечать', 'Пескоструй', 'Витраж', 'oracal', 'Фасады', 'Упакован', 'Отгружен');
$db = array("tech_end", "mater", "raspil", "cpu", "kromka", "pris_end", "gnutje", "emal", "pvh", "photo", "pesok", "vitrag", "oracal", "fas", "upak_end", "otgruz_end");
$order = Order::getOrderById($oid);
$order_stan = OrderStan::getOrdersByPole('oid', $oid);
$stan = $order_stan[$oid];
$us_dis = Users::getUserById($order['designer']);
$dis = $us_dis['name'];
$us_tech = Users::getUserById($order['technologist']);
$tech = $us_tech['name'];
//сборщик
$mount = Mounting::getMountingLast($oid);
if (!$mount) {
$coll = '';
$date_mount = '';
$m_phone = '';
} else {
$coll_id = $mount['uid'];
$user = Users::getUserById($coll_id);
$coll = $user['name'];
$m_phone = $user['tel'];
$date_mount = date("d.m.y", strtotime($mount['m_date']));
}
//шаблоны смс
$sample = Sms::getSamples();
$search = array('%name%', '%con%', '%date%', '%m_date%', '%collector%', '%phone%');
$replace = array($order['name'], $order['contract'], date("d.m.y", strtotime($stan['plan'])), $date_mount, $coll, $m_phone);
foreach ($sample as $key => $sampleone) {
$str = $sampleone['text_sms'];
$newstr = str_replace($search, $replace, $str);
$sample[$key]['text_sms'] = $newstr;
}
$notes = Notes::getNotesByOid($oid);
if (isset($_POST['sendsms'])) {
$phone = $_POST['phone'];
$message = $_POST['message'];
$sms = Sms::send($phone, $message);
$errorsms = array();
switch ($sms) {
case 100:
$errorsms[] = 'Сообщение отправлено';
Sms::save($oid, $message);
break;
case 201:
$errorsms[] = 'Не хватает средств на лицевом счету';
break;
case 202:
$errorsms[] = 'Неправильно указан получатель';
break;
case 203:
$errorsms[] = 'Нет текста сообщения';
break;
case 205:
$errorsms[] = 'Сообщение слишком длинное (превышает 8 СМС)';
break;
case 206:
$errorsms[] = 'Будет превышен или уже превышен дневной лимит на отправку сообщений';
break;
case 207:
$errorsms[] = 'На этот номер (или один из номеров) нельзя отправлять сообщения';
break;
case 220:
$errorsms[] = 'Сервис временно недоступен, попробуйте чуть позже';
break;
default:
$errorsms[] = 'Сообщение не отправлено, обратитесь к администратору';
}
}
$page = SITE_PATH . 'views/order.php';
include SITE_PATH . 'views/layout.php';
return true;
}
示例7: _e
_e('category');
?>
</th>
<th style="vertical-align: middle;"><?php
_e('status');
?>
</th>
<th style="vertical-align: middle;"><?php
_e('submitted_date');
?>
</th>
</tr>
<?php
while ($row = $res->fetch_assoc()) {
if (isset($row['post_author'])) {
$username = Users::getUserById($row['post_author']);
}
if ($row['post_status'] == 'Initialized') {
$status = _e('initialized', '', '', true);
$statcolor = "style='text-align: center; color: red;'";
} else {
$status = _e('published', '', '', true);
$statcolor = "style='text-align: center;'";
}
$first_cat = getPostCategories($row['ID'])[0];
echo "<tr><td style='text-align: center; vertical-align: middle;'>" . $row['ID'] . "</td><td style='text-align: center; vertical-align: middle;'><a href='?switch=users&sub=edit_user&id=" . $row['post_author'] . "'>" . $username['username'] . "</a></td><td>" . $row['post_title'] . "</td><td style='text-align: center; vertical-align: middle;'><a href='?switch=categories&sub=edit_category&id=" . $first_cat . "'>" . getCategoryById($first_cat) . "</a></td><td " . $statcolor . ">" . $status . "<br>" . "<span style='text-align: center;'><a onclick=\"return confirm('Are you sure?');\" href='?switch=manage_posts&sub=delete_post&id=" . $row['ID'] . "'>" . _e('delete', '', '', true) . "</a></span>" . "<br>" . "<span style='text-align: center;'><a href='?switch=new_post&sub=edit_post&id=" . $row['ID'] . "'>" . _e('edit', '', '', true) . "</a></span></td><td style='text-align: center; vertical-align: middle;'>" . addZerosToShow(LBDP($row['post_date'])) . "</td></tr>";
}
$res->free();
?>
</table>
<?php
示例8: updateTutorial
/**
*
* @param usersData $data
* @return type
*/
public function updateTutorial($data)
{
$userModel = new Users();
$tutorialModel = new Tutorial();
$user = $userModel->getUserById($data->id);
$tutorialId = $user->attributes['tutorial_id'];
$tutorialModel->unsetAttributes();
$result = $tutorialModel->updateByPk($tutorialId, $data->tutorials);
$body = $this->renderPartial('tutorial/result', array('format' => $data->format, 'result' => $result), true);
return $this->response->type('json')->goodResponse($body);
}
示例9: _e
_e('manage_vip_users');
?>
</a></li>
<li><a class="btn btn-default" data-toggle="tab" href="#gateways"><?php
_e('gateways');
?>
</a></li>
</ul>
</div><hr>
<div class="tab-content col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-3">
<div>
<?php
if (isset($_GET['sub']) && $_GET['sub'] == 'edit_user') {
if (isset($_GET['id'])) {
$data = Users::getUserById($_GET['id']);
}
require_once 'new_user.php';
}
?>
<br>
</div>
<div id="info" class="tab-pane fade col-md-10 col-md-offset-1" <?php
if (isset($_GET['sub'])) {
echo 'style="display: none;"';
}
?>
>
<div>
<span style="float: <?php
echo getLBA();
示例10: while
<div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 col-md-offset-4 col-lg-offset-4">
<h3><i class="mdi mdi-forum"></i> Comments:</h3><br>
<div id="comments">
<?php
$comment_status = $row['comment_status'];
?>
<?php
while ($row = $comments->getCommentsLoop()) {
?>
<p><em><?php
echo Users::getUserById($row['user_id'])['username'];
?>
</em> on <span class="help-block" style="display: inline;"><?php
echo englishConvertDate($row['date']);
?>
</span> said:</p>
<div><?php
echo $row['content'];
?>
</div><br>
<?php
}
?>
</div>
<script src="<?php
echo THEME_BASE;
?>
js/spin.min.js"></script>
<script src="<?php
echo THEME_BASE;
?>
示例11: actionIndex
function actionIndex()
{
$ri = $_COOKIE['ri'];
$log = $_COOKIE['login'];
if (!isset($ri)) {
header('Location: /' . SITE_DIR . '/auth/showAuth');
}
$contract = '';
$con_date = '';
$name = '';
$prod = '';
$termin = '';
$otkr = 0;
$sum = '';
$rassr = 0;
$beznal = 0;
$pred = '';
$dis = '';
$adress = '';
$phone = '';
$note = '';
//получить список дизайнеров
$userList = User_post::getUsersByPost(5);
$disList = array();
foreach ($userList as $disid) {
$datadis = Users::getUserById($disid['uid']);
if ($datadis['validation'] == 1) {
$disList[] = array('uid' => $datadis['id'], 'name' => $datadis['name']);
}
}
// var_dump($disList);
if (isset($_POST['submit'])) {
//текстовые поля
if (isset($_POST['num'])) {
$contract = $_POST['num'];
}
if (isset($_POST['con_date'])) {
$con_date = $_POST['con_date'];
}
if (isset($_POST['name'])) {
$name = $_POST['name'];
}
if (isset($_POST['prod'])) {
$prod = $_POST['prod'];
}
if (isset($_POST['term'])) {
$termin = $_POST['term'];
$term = Datas::checkSunday($termin);
}
if (isset($_POST['sum'])) {
$sum = str_replace(",", ".", $_POST['sum']);
}
if (isset($_POST['pred'])) {
$pred = str_replace(",", ".", $_POST['pred']);
}
if (isset($_POST['adress'])) {
$adress = $_POST['adress'];
}
if (isset($_POST['phone'])) {
$phone = $_POST['phone'];
}
if (isset($_POST['note'])) {
$note = $_POST['note'];
}
//чекбоксы
if (isset($_POST['beznal'])) {
$beznal = 1;
}
if (isset($_POST['otkr'])) {
$otkr = 1;
}
if (isset($_POST['rassr'])) {
$rassr = 1;
}
//селект
if (isset($_POST['dis'])) {
$dis = $_POST['dis'];
}
$errors = false;
if (!Datas::checkPole($contract)) {
$errors[] = 'Не введен номер заказа';
}
if (!Datas::checkPole($name)) {
$errors[] = 'Как обращаться к заказчику?';
}
if (!Datas::checkPole($termin) && $otkr == 0) {
$errors[] = 'Не указан срок договора';
}
if (!Datas::checkPole($sum)) {
$errors[] = 'Укажите сумму договора';
}
if (!Datas::checkPole($phone)) {
$errors[] = 'Введите номер телефона';
}
$dubl = Order::getOrdersByParam('contract', $contract);
if (!empty($dubl)) {
$errors[] = 'Уже есть заказ с таким номером';
}
$result = NULL;
if (!$errors) {
//.........这里部分代码省略.........