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


PHP user::data方法代码示例

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


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

示例1: user

require_once '../core/init.php';
$user = new user();
if ($user->hasPermission('logged in')) {
    redirect::to('index.php');
}
if (input::exists()) {
    if (token::check(input::get('token'))) {
        //make sure $_POST has all the required fields filled out
        $validate = new validate();
        $validation = $validate->check($_POST, array('email' => array('required' => true), 'password' => array('required' => true)));
        if ($validate->passed()) {
            $user = new user();
            //check if the login session should be stored
            $remember = input::get('remember') == 'on';
            //login
            $login = $user->login(input::get('email'), input::get('password'), $remember);
            if ($login) {
                //TODO: make sure user has permission to log in (activated and not banned)
                if ($user->data()->status == 'u') {
                    $user->logout();
                } else {
                    if ($user->data()->status == 'b') {
                        $user->logout();
                    } else {
                        // success
                    }
                }
            }
        }
    }
}
开发者ID:BookerSeaFood,项目名称:GroceryGroup,代码行数:31,代码来源:login.php

示例2:

			<div class="col-xs-12 col-lg-8 col-lg-offset-2">
				<div id="dataSaved" class="alert alert-success" role="alert">Event was successfully updated</div>
				<div id="dataNOTSaved" class="alert alert-danger" role="alert">Event could not be updated</div>
				<div id="eventdeleted" class="alert alert-success" role="alert">Event was successfully deleted</div>
				<div id="eventNotdeleted" class="alert alert-danger" role="alert">Event could not be deleted</div>

				<h3 class="col-xs-12"><span style="color:#00A7E1">Postpone event</span></h3>
              	<p>Please enter new operation date and time below and click Postpone Event.</p>
				<table class="table table-hover" id="mytable">
				<thead>
					<!-- <tr><td>Field</td><td>Input</td></tr> -->
				</thead>
				<tbody >
											
					<tr ><td >Organiser</td><td id="organiser" ><?php 
echo $user->data()->Full_Name;
?>
</td></tr>
					<tr class="hidden" ><td >Username</td><td id="username" ><?php 
echo $user->data()->Username;
?>
</td></tr>
					<tr><td>Hosipital</td><td id="hospital"></td></tr>
					<tr><td>Doctor</td><td id="doctor"></td></tr>
					<tr><td>New Operation Date</td><td><input id="operationdate" class="myInputs date-picker" readonly></td></tr>
					<tr><td>New Operation Time</td><td ><input id="operationtime" class="myInputs input-small" readonly></td></tr>
					
				</tbody>
			</table>
			</div>
开发者ID:jdupreez1,项目名称:smartpoint,代码行数:30,代码来源:postponeEvent.php

示例3: user

<?php

require_once '/opt/lampp/htdocs/MySpace/src/init.php';
$user = new user();
if ($user->isLoggedIn()) {
    if ($user->ShowPosts($user->data()->UserID)) {
        print_r($user->posts());
        foreach ($user->posts() as $post) {
            echo $post->Text . '<br>';
            if ($user->ShowComments($post->PostID)) {
                foreach ($user->comments() as $comment) {
                    echo '<br>';
                    //echo '<br>';
                    if ($comment[0] == $post->PostID) {
                        //print_r($comment);
                        echo '<br>' . $comment[1]->Text . '<br>';
                    }
                }
            }
        }
    }
}
?>


	
开发者ID:pediredla,项目名称:SocialNetwork,代码行数:23,代码来源:login2.php

示例4:

				<div id="dataSaved" class="alert alert-success" role="alert">Event was successfully updated</div>
				<div id="dataNOTSaved" class="alert alert-danger" role="alert">Event could not be updated</div>
				<div id="eventdeleted" class="alert alert-success" role="alert">Event was successfully deleted</div>
				<div id="eventNotdeleted" class="alert alert-danger" role="alert">Event could not be deleted</div>

				<h3 class="col-xs-12"><span style="color:#00A7E1">Edit event</span></h3>
              	<p>Please complete event details below and click Update.</p>
				<table class="table table-hover" id="mytable">
				<thead>
					<!-- <tr><td>Field</td><td>Input</td></tr> -->
				</thead>
				<tbody >
								
					
					<tr ><td >Organiser</td><td id="organiser" ><?php 
echo $user->data()->Full_Name;
?>
</td></tr>
					<tr class="hidden" ><td >Username</td><td id="username" ><?php 
echo $user->data()->Username;
?>
</td></tr>

					<?php 
// //this section of code creates the doctor dropdown HTML
// $doctordropdown = "";
// $doctordropdown .="<select class=\"selectpicker\" id=\"doctor\">";
// if($dbh = $_db->get('Doctors', array())){
// 	if($dbh->counts() > 0){
// 		foreach($dbh->results() as $key){
// 			$doctordropdown .= "<option>{$key->Name}</option>";
开发者ID:jdupreez1,项目名称:smartpoint,代码行数:31,代码来源:editEvent.php

示例5: user_list

function user_list($vars = null)
{
    $maxperpage = isset($vars['row']) ? (int) $vars['row'] : "100";
    $cache_time = isset($vars['time']) ? (int) $vars['time'] : "-1";
    $where_sql = "WHERE `status`='1'";
    isset($vars['userid']) && ($where_sql .= " AND `uid`='{$vars['userid']}'");
    isset($vars['gid']) && ($where_sql .= " AND `gid` ='{$vars['gid']}'");
    isset($vars['type']) && ($where_sql .= " AND `type` ='{$vars['type']}'");
    if (isset($vars['pid']) && !isset($vars['pids'])) {
        $where_sql .= iPHP::where($vars['pid'], 'pid');
    }
    if (isset($vars['pids']) && !isset($vars['pid'])) {
        iPHP::import(iPHP_APP_CORE . '/iMAP.class.php');
        map::init('prop', iCMS_APP_USER);
        //$where_sql.= map::exists($vars['pid'],'`#iCMS@__user`.uid'); //map 表大的用exists
        $map_where = map::where($vars['pids']);
    }
    $by = $vars['by'] == "ASC" ? "ASC" : "DESC";
    switch ($vars['orderby']) {
        case "id":
            $order_sql = " ORDER BY `uid` {$by}";
            break;
        case "article":
            $order_sql = " ORDER BY `article` {$by}";
            break;
        case "comments":
            $order_sql = " ORDER BY `comments` {$by}";
            break;
        case "follow":
            $order_sql = " ORDER BY `follow` {$by}";
            break;
        case "fans":
            $order_sql = " ORDER BY `fans` {$by}";
            break;
        case "hits":
            $order_sql = " ORDER BY `hits` {$by}";
            break;
        default:
            $order_sql = " ORDER BY `uid` {$by}";
    }
    if ($map_where) {
        $map_sql = iCMS::map_sql($map_where);
        $where_sql = ",({$map_sql}) map {$where_sql} AND `uid` = map.`iid`";
    }
    $offset = 0;
    $limit = "LIMIT {$maxperpage}";
    if ($vars['page']) {
        $total = iPHP::total('sql.md5', "SELECT count(*) FROM `#iCMS@__user` {$where_sql} ");
        $multi = iCMS::page(array('total' => $total, 'perpage' => $maxperpage, 'unit' => iPHP::lang('iCMS:page:sql'), 'nowindex' => $GLOBALS['page']));
        $offset = $multi->offset;
        $limit = "LIMIT {$offset},{$maxperpage}";
        iPHP::assign("user_list_total", $total);
    }
    $hash = md5($where_sql . $order_sql . $limit);
    if ($map_sql || $offset) {
        if ($vars['cache']) {
            $map_cache_name = iPHP_DEVICE . '/user_map/' . $hash;
            $ids_array = iCache::get($map_cache_name);
        }
        if (empty($ids_array)) {
            $ids_array = iDB::all("SELECT `id` FROM `#iCMS@__user` {$where_sql} {$order_sql} {$limit}");
            iPHP_SQL_DEBUG && iDB::debug(1);
            $vars['cache'] && iCache::set($map_cache_name, $ids_array, $cache_time);
        }
        //iDB::debug(1);
        $ids = iCMS::get_ids($ids_array, 'uid');
        $ids = $ids ? $ids : '0';
        $where_sql = "WHERE `uid` IN({$ids})";
    }
    if ($vars['cache']) {
        $cache_name = iPHP_DEVICE . '/user_list/' . $hash;
        $resource = iCache::get($cache_name);
    }
    if (empty($resource)) {
        $resource = iDB::all("SELECT * FROM `#iCMS@__user` {$where_sql} {$order_sql} {$limit}");
        iPHP_SQL_DEBUG && iDB::debug(1);
        if ($resource) {
            foreach ($resource as $key => $value) {
                $value['url'] = user::router($value['uid'], "url");
                $value['urls'] = user::router($value['uid'], "urls");
                $value['avatar'] = user::router($value['uid'], "avatar", $vars['size'] ? $vars['size'] : 0);
                $value['at'] = '<a href="' . $value['url'] . '" class="iCMS_user_link" target="_blank" data-tip="iCMS:ucard:' . $value['uid'] . '">@' . $value['nickname'] . '</a>';
                $value['link'] = '<a href="' . $value['url'] . '" class="iCMS_user_link" target="_blank" data-tip="iCMS:ucard:' . $value['uid'] . '">' . $value['nickname'] . '</a>';
                $value['gender'] = $value['gender'] ? 'male' : 'female';
                isset($vars['data']) && ($value['data'] = (array) user::data($value['uid']));
                $resource[$key] = $value;
            }
        }
        $vars['cache'] && iCache::set($cache_name, $resource, $cache_time);
    }
    return $resource;
}
开发者ID:sunhk25,项目名称:iCMS,代码行数:92,代码来源:user.func.php

示例6: do_profile

 public function do_profile()
 {
     $pgArray = array('base', 'avatar', 'setpassword', 'bind', 'custom');
     $pg = iS::escapeStr($_GET['pg']);
     $pg or $pg = 'base';
     if (in_array($pg, $pgArray)) {
         $this->user();
         iPHP::assign('pg', $pg);
         if ($pg == 'bind') {
             $platform = user::openid(user::$userid);
             iPHP::assign('platform', $platform);
         }
         if ($pg == 'base') {
             iPHP::assign('userdata', (array) user::data(user::$userid));
         }
         iPHP::view("iCMS://user/profile.htm");
     }
 }
开发者ID:sunhk25,项目名称:iCMS,代码行数:18,代码来源:user.app.php

示例7: user

<?php

require_once '/opt/lampp/htdocs/MySpace/src/init.php';
$user = new user();
if (!$user->isLoggedIn()) {
    redirect::to('index.php');
}
if (input::exists()) {
    if (token::check(input::get('token'))) {
        $validate = new validation();
        $validation = $validate->check($_POST, array('Password' => array('required' => true, 'min' => 8), 'Npassword' => array('required' => true, 'min' => 8), 'Rpassword' => array('required' => true, 'min' => 8, 'matches' => 'Npassword')));
        if ($validation->passed()) {
            if (hash::make(input::get('Password')) !== $user->data()->Password) {
                echo 'your old password did not match';
            } else {
                if ($user->update(array('Password' => hash::make(input::get('Npassword'))))) {
                    session::flash('home', 'Your password have been updated!!');
                    redirect::to('index.php');
                }
            }
        }
    }
}
?>
<link href="<?php 
echo 'register.css';
?>
" rel='stylesheet' type='text/css'>
<form action="" method="post">
  <div class="field">
  <label id="icon" for="Password"><i class="icon-shield"></i></label>
开发者ID:pediredla,项目名称:SocialNetwork,代码行数:31,代码来源:changepassword.php

示例8: Clear

 public static function Clear()
 {
     $user = new user();
     return DB::GetInstance()->Query("DELETE FROM logs WHERE scheduledposts = (SELECT id FROM scheduledposts WHERE userid = ?)", array($user->data()->id));
 }
开发者ID:andersoonluan,项目名称:PHP,代码行数:5,代码来源:logs.php

示例9: user

<?php

require_once 'core/init.php';
$user2 = new user();
if (!$user2->isLoggedIn()) {
    Redirect::to('index.php');
}
switch ($user2->data()->user_type_id) {
    case 1:
        Redirect::to('userProfile.php');
        break;
    case 2:
        Redirect::to('admin.php');
        break;
    case 3:
        Redirect::to('teamLeaderProfile.php');
        break;
    case 4:
        Redirect::to('admin.php');
        break;
}
开发者ID:hatemali510,项目名称:carservice,代码行数:21,代码来源:profile.php

示例10:

<html>
<!DOCTYPE html>
<html lang="en">
<head>
	<title>Orchestrate</title>
	<?php 
require_once 'headinfo.php';
?>
   

</head> 
		
<body>
	<?php 
require_once 'slideMenu.php';
$myid = $user->data()->Id;
$myname = $user->data()->Full_Name;
$eventid = $_GET['id'];
?>
	

	<div class="container">

	<?php 
if (!isset($_GET['id'])) {
    ?>

		<div class="row" id="main1">
			<div class="col-xs-12 col-lg-10">
				<div id="dataSaved" class="alert alert-success" role="alert">Event was successfully saved</div>
				<div id="dataNOTSaved" class="alert alert-danger" role="alert">Event was not saved</div>
开发者ID:jdupreez1,项目名称:smartpoint,代码行数:31,代码来源:refillUpdate.php

示例11: user

<?php

require_once 'core/init.php';
include 'includes/header.php';
?>
<div class="box4">
			<div class="container">
				<div class="row">
					<h1>
						Hello <?php 
$user = new user();
if ($user->isLoggedIn()) {
    echo $user->data()->name;
}
?>
					</h1>
					<div class="grid_12">
						<p class="txt1">No better car service anywhere</p>
						<a href="Services.php" class="more_btn btn1">Request an appointment</a>
						<i class="icon-calendar icon1"></i>
					</div>

				</div>
			</div>
		</div>
		
<?php 
include 'includes/footer.php';
开发者ID:hatemali510,项目名称:carservice,代码行数:28,代码来源:welcome.php

示例12: array



<div class="box3">
	<div class="container">
   
<?php 
$resu = DB::getInstance()->get('reservation_details', array('reservation_id', '=', session::get('re_id')));
if ($resu->count()) {
    foreach ($resu->results() as $row) {
        $service_id = $row->service_id;
    }
}
?>
 
		Welcome, <?php 
echo $user2->data()->name, ' "';
?>
 
		<?php 
echo $user2->data()->username, '"</br>', 'Reschedualing Done successfully ^^ </br>';
?>
		<?php 
$id = session::get('re_id');
echo "reservation id = ", $id, '<br>';
$user_id = session::get('user_id');
echo "user id = ", $user_id, '<br>';
$date = session::get('datei');
$date--;
$start = session::get('start');
$status = session::get('status');
echo "status : ", $status, '<br>';
开发者ID:hatemali510,项目名称:carservice,代码行数:29,代码来源:resprocess.php

示例13: foreach

        foreach ($message->results() as $message) {
            echo " <div class='well'>";
            //echo"<p>Created by :<a href='profile.php?user=".$message->usera."'".$message->usera."";
            echo "<p>Created by:  <a href='profile.php?user=" . $message->sender . "'>" . $message->sender . "</a> and sent to <a href='profile.php?user=" . $message->reciever . "'>" . $message->reciever . "</a></p>";
            echo "<p>Message: " . $message->message . "</p>";
            echo "</br><p>Sent on: " . $message->added . "</p>";
            echo "</div>";
        }
    }
    if (Input::exists()) {
        $validate = new Validate();
        $validation = $validate->check($_POST, array('message' => array('required' => true, 'min' => 2, 'max' => 500)));
        if ($validation->passed()) {
            $user = new user();
            try {
                $user->message(array('sender' => $user->data()->username, 'reciever' => $data->username, 'message' => Input::get('message')));
                Redirect::to('viewmessage.php?user=' . $data->username . '#form');
            } catch (Exception $e) {
                die($e->getMessage());
            }
        } else {
            foreach ($validation->errors() as $error) {
                echo $error, '<br>';
            }
        }
    }
    ?>

  </div>
    </div>
    <a href="#top">Back to top</a>
开发者ID:s-gto,项目名称:HonoursProject,代码行数:31,代码来源:viewmessage.php

示例14:

            continue;
        }
        ?>
						<option name='type' id='type' value='<?php 
        echo $type->name;
        ?>
'><?php 
        echo $type->name;
        ?>
</option>
					   <?php 
    }
}
?>
					   <?php 
if ($user->data()->user_type_id == 4) {
    ?>
<option name='type' id='type' value='admin'>admin</option>
					   <?php 
}
?>
					</select>

        
          <input type="hidden" name="token" value="<?php 
echo token::generate();
?>
">
							</label>
								<div class="btns">
									         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
开发者ID:hatemali510,项目名称:carservice,代码行数:31,代码来源:add.php

示例15: user

 * }
 */
if (session::exists('home')) {
    echo '<p>' . session::flash('home') . '</p>';
}
$user = new user();
if ($user->isLoggedIn()) {
    ?>
<link href="<?php 
    echo 'style.css';
    ?>
" rel='stylesheet' type='text/css'>
<p>
	Hello <a
		href="profile.php?User=<?php 
    echo escape($user->data()->UserID);
    ?>
"><?php 
    echo escape($user->data()->FirstName);
    ?>
</a>!
</p>
<ul>
	<li><a href="update.php">Update</a></li>
	<li><a href="logout.php">Logout</a></li>
	<li><a href="changepassword.php">Settings</a></li>
	<li><a href="friends.php">Friends directory</a></li>
	<!-- <li><a href="login2.php">Pending Requests</a> -->
</ul>
<form name="form" method="post" action="">
	<input type="text" name="FirstName" placeholder="Search">
开发者ID:pediredla,项目名称:SocialNetwork,代码行数:31,代码来源:index.php


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