Exemplo n.º 1
0
 /**
  * 重新获取当前登录用户信息
  */
 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;
 }
Exemplo n.º 2
0
 public function getUser()
 {
     return UserData::getById($this->user_id);
 }
Exemplo n.º 3
0
<?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";
Exemplo n.º 4
0
<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;
Exemplo n.º 5
0
        $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) {
Exemplo n.º 6
0
<?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");
    }
}
Exemplo n.º 7
0
<?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 
Exemplo n.º 8
0
 public function getReceptor()
 {
     return UserData::getById($this->receptor_id);
 }
Exemplo n.º 9
0
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>";
}
Exemplo n.º 10
0
<?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;
}
Exemplo n.º 11
0
<?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;
}
Exemplo n.º 12
0
<?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>
Exemplo n.º 13
0
<?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>";
}
Exemplo n.º 14
0
<?php

$alumn = UserData::getById($_GET["id"]);
$alumn->del();
header("Location: index.php?view=users");
Exemplo n.º 15
0
          </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>
Exemplo n.º 16
0
<?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">
Exemplo n.º 17
0
 public function getSender()
 {
     return UserData::getById($this->author_id);
 }
Exemplo n.º 18
0
<?php

date_default_timezone_set("America/Hermosillo");
$user = UserData::getById(Session::getUID());
$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()));
} else {
    $operations = OperationData::getAllByDateAndCategoryId(date("Y-m-d", time()), $_GET["cat_id"]);
    $spents = SpentData::getAllByDateAndCategoryId(date("Y-m-d", time()), $_GET["cat_id"]);
    $category = CategoryData::getById($_GET["cat_id"]);
}
$sell = 0;
$spent = 0;
$money = 0;
foreach ($operations as $career) {
    $sell += $career->q * $career->price;
}
foreach ($spents as $career) {
    $spent += $career->price;
}
$money = $sell - $spent;
?>
<section class="content-header">
	<h1>Resumen</h1>
<ol class="breadcrumb">
                        <li> Categoria</li>
                        <li class="active"><?php 
if ($category == null) {
Exemplo n.º 19
0
          <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only">Toggle navigation</span>
          </a>
          <!-- Navbar Right Menu -->
          <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">

              <!-- User Account Menu -->
              <li class="dropdown user user-menu">
                <!-- Menu Toggle Button -->
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                  <!-- The user image in the navbar-->
                  <!-- hidden-xs hides the username on small devices so only the image appears. -->
                  <span class=""><?php 
    if (isset($_SESSION["user_id"])) {
        echo UserData::getById($_SESSION["user_id"])->name;
    }
    ?>
 <b class="caret"></b> </span>

                </a>
                <ul class="dropdown-menu">
                  <!-- The user image in the menu -->
                  <li class="">
                      <a href="http://evilnapsis.com/" target="_blank" class="">Ir a Evilnapsis</a>
                      <a href="http://evilnapsis.com/product/inventio-max/" target="_blank" class="">Ver Inventio Max</a>
                  </li>
                  
                  <!-- Menu Footer-->
                  <li class="user-footer">
                    <div class="pull-right">