当前位置: 首页>>代码示例>>PHP>>正文


PHP UserData::getById方法代码示例

本文整理汇总了PHP中UserData::getById方法的典型用法代码示例。如果您正苦于以下问题:PHP UserData::getById方法的具体用法?PHP UserData::getById怎么用?PHP UserData::getById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserData的用法示例。


在下文中一共展示了UserData::getById方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: refreshCurrentUser

 /**
  * 重新获取当前登录用户信息
  */
 protected function refreshCurrentUser()
 {
     $currUser = $this->getCurrentUser();
     $currUser = UserData::getById($currUser['id']);
     $_SESSION['user'] = array('id' => $currUser['id'], 'mobile' => $currUser['mobile'], 'email' => $currUser['email'], 'passwd' => $currUser['passwd'], 'name' => $currUser['name']);
     return $currUser;
 }
开发者ID:jianchengdu,项目名称:dangjia,代码行数:10,代码来源:BaseController.php

示例2: getUser

 public function getUser()
 {
     return UserData::getById($this->user_id);
 }
开发者ID:evilnapsis,项目名称:imayik,代码行数:4,代码来源:FollowerData.php

示例3: like

<?php

$user = UserData::getById($_GET["uid"]);
$profile = ProfileData::getByUserId($user->id);
?>

<div class="container">
<div class="row">
    <div class="col-md-3">
<?php 
Action::execute("_userbadge", array("user" => $user, "profile" => $profile, "from" => "logged"));
Action::execute("_usermenu", array("user" => $user));
?>
    </div>
    <div class="col-md-7">
    <!-- -->
    <?php 
echo Action::execute("_photos", array("user" => $user, "profile" => $profile, "from" => "logged"));
?>
      <!-- -->
    </div>
    <div class="col-md-2">
    </div>
  </div>
</div>


</div>
<script>
function like(type,id){
  var base = "lk";
开发者ID:evilnapsis,项目名称:smile,代码行数:31,代码来源:widget-default.php

示例4: foreach

<tr>
    <td><b><?php 
    echo $career->name;
    ?>
</b></td>
    <td>
<?php 
    $sells = SellData::getAllUnAppliedByItemId($career->id);
    if (count($sells) > 0) {
        ?>
    <?php 
        foreach ($sells as $s) {
            ?>
    <?php 
            $operations = OperationData::getAllProductsBySellId($s->id);
            $mesero = UserData::getById($s->mesero_id);
            ?>
        <?php 
            if (count($operations) > 0) {
                ?>
            <table class="table table-bordered">
            <tr>
                <td><a href="./?view=onesell&id=<?php 
                echo $s->id;
                ?>
" class="btn btn-xs btn-default">Id: <?php 
                echo $s->id;
                ?>
</a></td>
                <td>Mesero: <?php 
                echo $mesero->name . " " . $mesero->lastname;
开发者ID:evilnapsis,项目名称:thunder,代码行数:31,代码来源:widget-default.php

示例5: count

        $notifications5 = NotificationData::getLast5ByChannelId($channels[0]->id);
        if (count($notifications) > 0) {
            ?>
<li class="dropdown messages-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-bell-o"></i> <span class="label label-danger"><?php 
            echo count($notifications);
            ?>
</span> <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li class="dropdown-header"><?php 
            echo count($notifications);
            ?>
 Notificaciones</li>
                <?php 
            foreach ($notifications5 as $notif) {
                $theuser = UserData::getById($notif->user_id);
                ?>
                <li class="message-preview">
                  <a href="#">
                    <span class="name"><?php 
                echo $theuser->name;
                ?>
:</span>

                    <span class="message">

                    <?php 
                if ($notif->notification_type_id == NotificationTypeData::getByName("Nuevo Comentario")->id) {
                    echo "<i class='fa fa-comment'></i> Nuevo comentario&nbsp;";
                } else {
                    if ($notif->notification_type_id == NotificationTypeData::getByName("Nuevo Seguidor")->id) {
开发者ID:evilnapsis,项目名称:imayik,代码行数:31,代码来源:layout.php

示例6:

<?php

/**
* @author evilnapsis
* @brief Algoritmo para cambiar la contrase~a
**/
if (isset($_SESSION["user_id"]) && !empty($_POST)) {
    $user = UserData::getById($_SESSION["user_id"]);
    if ($user->password == sha1(md5($_POST["password"]))) {
        if ($_POST["new_password"] == $_POST["confirm_password"]) {
            $user->password = sha1(md5($_POST["new_password"]));
            $user->update_passwd();
            $_SESSION["password_updated"] = true;
            Core::alert("La contrase~a ha sido actualizada exitosamente!");
            Core::redir("./?view=configuration");
        } else {
            Core::alert("Las contrase~as no coinciden.");
            Core::redir("./?view=configuration");
        }
    } else {
        Core::alert("La contrase~a introducida es incorrecta.");
        Core::redir("./?view=configuration");
    }
}
开发者ID:rogelino,项目名称:smile,代码行数:24,代码来源:action-default.php

示例7:

<?php

$u = UserData::getById($_GET["id"]);
?>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h2>Editar Usuario</h2>
<form class="form-horizontal" method="post" action="index.php?view=updateuser" role="form">
  <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Nombre</label>
    <div class="col-lg-10">
      <input type="text" class="form-control" name="name" value="<?php 
echo $u->name;
?>
" id="name" placeholder="Nombre">
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Apellidos</label>
    <div class="col-lg-10">
      <input type="text" class="form-control" name="lastname" value="<?php 
echo $u->lastname;
?>
" id="lastname" placeholder="Apellidos">
    </div>
  </div>

  <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Email</label>
    <div class="col-lg-10">
      <input type="text" class="form-control" name="email" value="<?php 
开发者ID:evilnapsis,项目名称:cazueliyas,代码行数:31,代码来源:widget-default.php

示例8: getReceptor

 public function getReceptor()
 {
     return UserData::getById($this->receptor_id);
 }
开发者ID:rogelino,项目名称:smile,代码行数:4,代码来源:FriendData.php

示例9: sha1

include "core/controller/Executor.php";
include "core/controller/Model.php";
include "core/modules/index/model/UserData.php";
$user = $_POST['mail'];
$pass = sha1(md5($_POST['password']));
$base = new Database();
$con = $base->connect();
$sql = "select * from user where (email= \"" . $user . "\" and password= \"" . $pass . "\") or (nick= \"" . $user . "\" and password= \"" . $pass . "\") ";
//print $sql;
$query = $con->query($sql);
$found = false;
$userid = null;
while ($r = $query->fetch_array()) {
    $found = true;
    $userid = $r['id'];
}
if ($found == true) {
    session_start();
    //	print $userid;
    $_SESSION['user_id'] = $userid;
    //	setcookie('userid',$userid);
    //	print $_SESSION['userid'];
    print "Cargando ... {$user}";
    $u = UserData::getById($userid);
    if ($u->image == "") {
        print "<script>window.location='./index.php?view=mychannel';</script>";
    }
    print "<script>window.location='./index.php?view=mychannel';</script>";
} else {
    print "<script>window.location='index.php?view=login';</script>";
}
开发者ID:evilnapsis,项目名称:imayik,代码行数:31,代码来源:login.php

示例10: date_default_timezone_set

<?php

date_default_timezone_set("America/Hermosillo");
$mesero = UserData::getById($_GET["mesero_id"]);
///// por dia
$sellsdayli = SellData::getAllDayliByMesero($mesero->id);
$totaldayli = 0;
foreach ($sellsdayli as $selldayli) {
    $totaldayli += $selldayli->total;
}
///// totales
$sellstotal = SellData::getAllTotalByMesero($mesero->id);
$totaltotal = 0;
foreach ($sellstotal as $selltotal) {
    $totaltotal += $selltotal->total;
}
$operations = null;
$category = null;
if (!isset($_GET["cat_id"])) {
    $operations = OperationData::getAllByDate(date("Y-m-d", time()));
    $spents = SpentData::getAllByDate(date("Y-m-d", time()));
}
$sell = 0;
$spent = 0;
$money = 0;
foreach ($operations as $career) {
    $sell += $career->q * $career->price;
}
foreach ($spents as $career) {
    $spent += $career->price;
}
开发者ID:evilnapsis,项目名称:cazueliyas,代码行数:31,代码来源:widget-default.php

示例11: session_start

<?php

include "lib/config.php";
include "lib/UserData.php";
include "Zend/Db.php";
session_start();
function redirect($path = '')
{
    global $cfg_base_url;
    if (strpos($path, "http") === 0) {
        $url = $path;
    } else {
        $url = "{$cfg_base_url}{$path}";
    }
    header("Location: {$url}");
    exit(0);
}
$g_db = Zend_Db::factory('Pdo_Pgsql', array('host' => $cfg_db_host, 'port' => 5432, 'username' => $cfg_db_user, 'password' => $cfg_db_password, 'dbname' => $cfg_db_name));
if (isset($_SESSION['user'])) {
    $id = intval($_SESSION['user']);
    $g_user = UserData::getById($id);
} else {
    $g_user = null;
}
开发者ID:nemesit,项目名称:acoustid-server,代码行数:24,代码来源:init.php

示例12:

<?php

$user = UserData::getById($_GET['id']);
if ($user != null) {
    $url = "storage/user/{$user->id}/{$user->image}";
    ?>
<br><div class='row'>
	<div class='col-md-4'>
<div class="media">
  <a class="pull-left" href="#">
<?php 
    if ($user->image == "") {
        ?>
    <img class="media-object" data-src="holder.js/64x64">
<?php 
    } else {
        ?>
    <img class="media-object" data-src="holder.js/64x64" src='<?php 
        echo $url;
        ?>
' style='width:64px;height:64px;'>	
<?php 
    }
    ?>
  </a>
  <div class="media-body">
    <div class="f28 roboto media-heading"><?php 
    echo "{$user->name} {$user->lastname}";
    ?>
</div>
<br>	<p class='alert alert-info'>Te mostramos las imagenes que le gustan a este usuario.</p>
开发者ID:evilnapsis,项目名称:imayik,代码行数:31,代码来源:widget-default.php

示例13:

<?php

if (count($_POST) > 0) {
    $is_admin = 0;
    if (isset($_POST["is_admin"])) {
        $is_admin = 1;
    }
    $is_active = 0;
    if (isset($_POST["is_active"])) {
        $is_active = 1;
    }
    $user = UserData::getById($_POST["user_id"]);
    $user->name = $_POST["name"];
    $user->lastname = $_POST["lastname"];
    $user->username = $_POST["username"];
    $user->email = $_POST["email"];
    $user->is_admin = $is_admin;
    $user->is_active = $is_active;
    $user->update();
    if ($_POST["password"] != "") {
        $user->password = sha1(md5($_POST["password"]));
        $user->update_passwd();
        print "<script>alert('Se ha actualizado el password');</script>";
    }
    print "<script>window.location='index.php?view=users';</script>";
}
开发者ID:mriveros,项目名称:library-php,代码行数:26,代码来源:action-default.php

示例14:

          </ul>




<?php 
}
?>



<?php 
if (isset($_SESSION["admin_id"]) && $_SESSION["admin_id"] != "") {
    $u = null;
    if ($_SESSION["admin_id"] != "") {
        $u = UserData::getById($_SESSION["admin_id"]);
        $user = $u->name . " " . $u->lastname;
    }
    ?>
          <ul class="nav navbar-nav navbar-right navbar-user">
            <li class="dropdown user-dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
        <?php 
    echo $user;
    ?>
 <b class="caret"></b>
        </a>
        <ul class="dropdown-menu">
          <li><a href="index.php?view=configuration">Configuracion</a></li>
          <li><a href="logout.php">Salir</a></li>
        </ul>
开发者ID:alfieris,项目名称:katana,代码行数:31,代码来源:layout.php

示例15:

<?php

if (Session::exists("user_id")) {
    Session::$user = UserData::getById(Session::get("user_id"));
    Session::$profile = ProfileData::getByUserId(Session::get("user_id"));
}
?>
<html>
<head>
<title>SMILE :) | Red Social de Proposito General</title>
<link rel="stylesheet" type="text/css" href="res/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="res/messages.css">
<script src="res/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="res/font-awesome/css/font-awesome.min.css">

</head>

<body>
<header class="navbar navbar-default navbar-static-top" role="banner">
  <div class="container">
    <div class="navbar-header">
      <button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="./"><i class="fa fa-smile-o"></i> SMILE</a>
    </div>
    <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
      <ul class="nav navbar-nav">
开发者ID:rogelino,项目名称:smile,代码行数:31,代码来源:layout.php


注:本文中的UserData::getById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。