本文整理汇总了PHP中person类的典型用法代码示例。如果您正苦于以下问题:PHP person类的具体用法?PHP person怎么用?PHP person使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了person类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: show_overdue
function show_overdue($template_name)
{
global $db;
global $TPL;
$current_user =& singleton("current_user");
$db = new db_alloc();
$temp = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
$today = date("Y", $temp) . "-" . date("m", $temp) . "-" . date("d", $temp);
$q = prepare("SELECT itemName,itemType,item.itemID,dateBorrowed,dateToBeReturned,loan.personID \n FROM loan,item \n WHERE dateToBeReturned < '%s' \n\t\t\t\t\t AND dateReturned = '0000-00-00' \n\t\t\t\t\t AND item.itemID = loan.itemID\n ", $today);
if (!have_entity_perm("loan", PERM_READ, $current_user, false)) {
$q .= prepare("AND loan.personID = %d", $current_user->get_id());
}
$db->query($q);
while ($db->next_record()) {
$i++;
$item = new item();
$loan = new loan();
$item->read_db_record($db);
$loan->read_db_record($db);
$item->set_values();
$loan->set_values();
$person = new person();
$person->set_id($loan->get_value("personID"));
$person->select();
$TPL["person"] = $person->get_name();
$TPL["overdue"] = "<a href=\"" . $TPL["url_alloc_item"] . "itemID=" . $item->get_id() . "&return=true\">Overdue!</a>";
include_template($template_name);
}
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:29,代码来源:itemLoan.php
示例2: get_recipients
function get_recipients()
{
$db = new db_alloc();
$type = $this->get_value('reminderType');
if ($type == "project") {
$query = prepare("SELECT * \n FROM projectPerson \n LEFT JOIN person ON projectPerson.personID=person.personID \n WHERE projectPerson.projectID = %d \n ORDER BY person.username", $this->get_value('reminderLinkID'));
} else {
if ($type == "task") {
// Modified query option: to send to all people on the project that this task is from.
$recipients = array("-3" => "Task Manager", "-2" => "Task Assignee");
$db->query("SELECT projectID FROM task WHERE taskID = %d", $this->get_value('reminderLinkID'));
$db->next_record();
if ($db->f('projectID')) {
$query = prepare("SELECT * \n FROM projectPerson \n LEFT JOIN person ON projectPerson.personID=person.personID \n WHERE projectPerson.projectID = %d \n ORDER BY person.username", $db->f('projectID'));
} else {
$query = "SELECT * FROM person WHERE personActive = 1 ORDER BY username";
}
} else {
$query = "SELECT * FROM person WHERE personActive = 1 ORDER BY username";
}
}
$db->query($query);
while ($db->next_record()) {
$person = new person();
$person->read_db_record($db);
$recipients[$person->get_id()] = $person->get_name();
}
return $recipients;
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:29,代码来源:reminder.inc.php
示例3: add
/**
* clone a phone object in under a person object
*
* @param person $person http://www.test.com/info (comment)
* @param phone $phone http://www.test.com/info (comment)
* @return person http://www.test.com/info (comment)
*/
function add($person, $phone)
{
$new_phone = $person->createDataObject('phone');
foreach ($phone as $prop => $val) {
$new_phone[$prop] = $val;
}
return $person;
}
开发者ID:psagi,项目名称:sdo,代码行数:15,代码来源:Component.php
示例4: get_current_user
private function get_current_user($sessID)
{
$sess = new session($sessID);
if ($sess->Started()) {
$person = new person();
$person->load_current_user($sess->Get("personID"));
// update session_started, which affects session lifetime
$sess->Save();
return $person;
}
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:11,代码来源:services.inc.php
示例5: fix_this_comment
function fix_this_comment($r, $num, $from, $messageid)
{
global $db;
global $alloc_from_addresses2;
if ($r["commentEmailUIDORIG"] != $num) {
unset($projectID);
if ($r["commentMaster"] == "task" && $r["commentMasterID"]) {
$q = prepare("select projectID from task where taskID = %d", $r["commentMasterID"]);
$db->query($q);
$task_row = $db->row();
$projectID = $task_row["projectID"];
}
// Try figure out and populate the commentCreatedUser/commentCreatedUserClientContactID fields
list($from_address, $from_name) = parse_email_address($from);
$person = new person();
$personID = $person->find_by_email($from_address);
$personID or $personID = $person->find_by_name($from_name);
$sql = array();
$sql[] = prepare("commentEmailUID = '%s'", trim($num));
if ($personID) {
$sql[] = prepare("commentCreatedUser = %d", $personID);
$sql[] = "commentCreatedUserClientContactID = NULL";
} else {
$sql[] = "commentCreatedUser = NULL";
$cc = new clientContact();
$clientContactID = $cc->find_by_email($from_address, $projectID);
$clientContactID or $clientContactID = $cc->find_by_name($from_name, $projectID);
$clientContactID and $sql[] = prepare("commentCreatedUserClientContactID = %d", $clientContactID);
}
$sql[] = prepare("commentCreatedUserText = '%s'", trim($from));
$sql[] = prepare("commentEmailMessageID = '%s'", trim($messageid));
if (!in_array($from_address, $alloc_from_addresses2)) {
// don't update items that are from alloc
$q = prepare("UPDATE comment SET " . implode(",", $sql) . " WHERE commentID = %d", $r["commentID"]);
$db->query($q);
printorlog("FIXED: " . $q . " (old uid: " . $r["commentEmailUIDORIG"] . ")", "blue");
}
} else {
// Try figure out and populate the commentCreatedUser/commentCreatedUserClientContactID fields
list($from_address, $from_name) = parse_email_address($from);
if (!in_array($from_address, $alloc_from_addresses2)) {
// don't update items that are from alloc
$sql = array();
$sql[] = prepare("commentEmailUID = '%s'", trim($num));
$sql[] = prepare("commentEmailMessageID = '%s'", trim($messageid));
$q = prepare("UPDATE comment SET " . implode(",", $sql) . " WHERE commentID = %d", $r["commentID"]);
$db->query($q);
printorlog("GOOD: " . $q, "green");
}
}
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:51,代码来源:patch-00179-alla.php
示例6: show_people
function show_people($template_name)
{
global $person_query;
global $project;
global $TPL;
$db = new db_alloc();
$db->query($person_query);
while ($db->next_record()) {
$person = new person();
$person->read_db_record($db);
$person->set_values("person_");
$TPL["graphTitle"] = urlencode($person->get_name());
include_template($template_name);
}
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:15,代码来源:personGraph.php
示例7: load_filter
function load_filter($defaults)
{
$current_user =& singleton("current_user");
// display the list of project name.
$db = new db_alloc();
$page_vars = array_keys(timeSheetGraph::get_list_vars());
$_FORM = get_all_form_data($page_vars, $defaults);
if ($_FORM["applyFilter"] && is_object($current_user)) {
// we have a new filter configuration from the user, and must save it
if (!$_FORM["dontSave"]) {
$url = $_FORM["url_form_action"];
unset($_FORM["url_form_action"]);
$current_user->prefs[$_FORM["form_name"]] = $_FORM;
$_FORM["url_form_action"] = $url;
}
} else {
// we haven't been given a filter configuration, so load it from user preferences
$_FORM = $current_user->prefs[$_FORM["form_name"]];
}
$rtn["personOptions"] = page::select_options(person::get_username_list($_FORM["personID"]), $_FORM["personID"]);
$rtn["dateFrom"] = $_FORM["dateFrom"];
$rtn["dateTo"] = $_FORM["dateTo"];
$rtn["personID"] = $_FORM["personID"];
$rtn["groupBy"] = $_FORM["groupBy"];
// GET
$rtn["FORM"] = "FORM=" . urlencode(serialize($_FORM));
return $rtn;
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:28,代码来源:timeSheetGraph.inc.php
示例8: getOAuthToken
/**
* Get or create a token for this person_id for this app
* @return array
*/
public function getOAuthToken()
{
$person_id = $this->person_id();
if (!$person_id) {
static::error('User not specified.');
}
if (!\person::exists($person_id)) {
static::error('Invalid user.');
}
$clause = array('person_id' => $person_id);
if (!$this->app_key()) {
$app_id = null;
} else {
$api_app = static::getApiAppByKey($this->app_key());
if (!$api_app) {
static::error('Invalid app_key.');
}
$app_id = $api_app->getID();
}
$clause[static::getApiAppModelName() . '_id'] = $app_id;
if (!$clause) {
static::error('Unknown Identity.');
}
$m = static::getOauthModelName();
$oauth = $m::getOne($clause);
if (!$oauth || !$oauth->token) {
$oauth = $m::insert($clause);
}
return array('oauth_token' => $oauth->token, 'issued' => $oauth->getTimeIssued(), 'now' => strtotime(\aql::now()), 'expires' => $oauth->getTimeExpires());
}
开发者ID:HotwireCommunications,项目名称:skyphp,代码行数:34,代码来源:Identity.php
示例9: show_people
function show_people()
{
global $defaults;
$_FORM = person::load_form_data($defaults);
#echo "<pre>".print_r($_FORM,1)."</pre>";
echo person::get_list($_FORM);
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:7,代码来源:personList.php
示例10: set_name
function set_name($new_name)
{
//$this->name=strtoupper($new_name);
person::set_name($new_name);
//static access use double colon sign (::)
parent::set_name($new_name);
//static access can access class from parent class 1 level
}
开发者ID:jojo48,项目名称:a1,代码行数:8,代码来源:class_lib.php
示例11: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
$person = person::find($id);
$person->fill($request->all());
$person->save();
Session::flash('message', 'Persona actualizada Correctamente');
return Redirect::to('people');
}
开发者ID:lautaruni,项目名称:billboard,代码行数:15,代码来源:PersonController.php
示例12: postLogin
function postLogin($p)
{
$success = person::auth($_POST['username'], $_POST['password']);
if (!$success) {
$this->redirect('login?auth=bad');
}
$id = person::getLoggedInId();
$this->redirect("main");
}
开发者ID:laiello,项目名称:zoop,代码行数:9,代码来源:ZoneDefault.php
示例13: getLoggedInUser
function getLoggedInUser()
{
$id = person::getLoggedInId();
if ($id) {
return new Person((int) $id);
} else {
return NULL;
}
}
开发者ID:laiello,项目名称:zoop,代码行数:9,代码来源:Person.php
示例14: set_name
protected function set_name($new_name)
{
if ($new_name == "Stefan Sucks") {
$this->name = $new_name;
} else {
if ($new_name == "Johnny Fingers") {
person::set_name($new_name);
}
}
}
开发者ID:analyn34,项目名称:oop-php,代码行数:10,代码来源:class_lib.php
示例15: getModel
/**
* Return Data-Model for the View
*/
private function getModel()
{
require_once 'classes/SQL.php';
$model = new stdClass();
$model->template = 'admin/HighscoreTable';
$model->isAdmin = person::getPermissionName() == 'admin' ? 'true' : 'false';
$model->gameID = $this->getGameId();
$sql = new SQL();
$sql->connect();
$model->data = $sql->get("SELECT * FROM ViewHighscore ORDER BY GamerMainScore DESC");
return $model;
}
开发者ID:roderm,项目名称:mkn151,代码行数:15,代码来源:Highscore.php
示例16: getMain
/**
* Returns Main-Page from the Admin-Section as HTML-View
* @return string
*/
public function getMain()
{
include_once 'classes/person.php';
if (person::getPermissionName() != 'admin') {
$login = Uri::getAction('Login');
header("Location: {$login}");
} else {
require 'classes/view.php';
require './models/admin.php';
$view = new view();
return $view->loadTemplate(new admin_model());
}
}
开发者ID:roderm,项目名称:mkn151,代码行数:17,代码来源:Admin.php
示例17: getMain
/**
* Return Gamer-Main-Page as HTML-View
*/
public function getMain()
{
if (person::getPermissionName() != 'admin' && person::getPermissionName() != 'gameuser') {
$login = Uri::getAction('Login');
header("Location: {$login}");
} else {
require 'classes/view.php';
$model = new stdClass();
$model->template = 'game/main';
$model->hasFrage = isset($_SESSION['tmpFrage']['id']);
$model->user = $_SESSION['username'];
$model->points = 0;
$model->message = $model->hasFrage ? 'Welcome back' : 'Welcome';
$view = new view();
return $view->loadTemplate($model);
}
}
开发者ID:roderm,项目名称:mkn151,代码行数:20,代码来源:Gamer.php
示例18: add_tsiHint
function add_tsiHint($stuff)
{
$current_user =& singleton("current_user");
$errstr = "Failed to record new time sheet item hint. ";
$username = $stuff["username"];
$people = person::get_people_by_username();
$personID = $people[$username]["personID"];
$personID or alloc_error("Person " . $username . " not found.");
$taskID = $stuff["taskID"];
$projectID = $stuff["projectID"];
$duration = $stuff["duration"];
$comment = $stuff["comment"];
$date = $stuff["date"];
if ($taskID) {
$task = new task();
$task->set_id($taskID);
$task->select();
$projectID = $task->get_value("projectID");
$extra = " for task " . $taskID;
}
$projectID or alloc_error(sprintf($errstr . "No project found%s.", $extra));
$row_projectPerson = projectPerson::get_projectPerson_row($projectID, $current_user->get_id());
$row_projectPerson or alloc_error($errstr . "The person(" . $current_user->get_id() . ") has not been added to the project(" . $projectID . ").");
if ($row_projectPerson && $projectID) {
// Add new time sheet item
$tsiHint = new tsiHint();
$d = $date or $d = date("Y-m-d");
$tsiHint->set_value("date", $d);
$tsiHint->set_value("duration", $duration);
if (is_object($task)) {
$tsiHint->set_value("taskID", sprintf("%d", $taskID));
}
$tsiHint->set_value("personID", $personID);
$tsiHint->set_value("comment", $comment);
$tsiHint->save();
$ID = $tsiHint->get_id();
}
if ($ID) {
return array("status" => "yay", "message" => $ID);
} else {
alloc_error($errstr . "Time hint not added.");
}
}
开发者ID:cjbayliss,项目名称:alloc,代码行数:43,代码来源:tsiHint.inc.php
示例19: person
/**
*
*/
protected function person($person)
{
$person = person::finder()->bypk($person);
echo 'This is a (standard) person:' . "\n";
print_r($person);
echo "\n";
echo 'This is its favorite movie:' . "\n";
print_r($person->fav_movie_obj);
echo "\n";
echo 'The person itself hasn\'t changed:' . "\n";
print_r($person);
echo "\n";
echo 'But now I set &cache to true (I can but should never do that inline) and request ' . $person->name . '\'s fav movie again:' . "\n";
$person::$_GETTERS['fav_movie_obj'][1] = true;
// This is uncool and you shouldn't do it :)
print_r($person->fav_movie_obj);
echo "\n";
echo 'And now... ' . $person->name . ' has changed:' . "\n";
print_r($person);
}
开发者ID:rudiedirkx,项目名称:MVC-Framework-3,代码行数:23,代码来源:inc.cls.mod_aro.php
示例20: loggin
/**
* Checks user-Data for Login and Logg In
*/
public function loggin()
{
include_once 'classes/person.php';
$success = false;
$uri = '';
if (isset($_POST['username']) && isset($_POST['passwd'])) {
$username = (string) htmlspecialchars($_POST['username']);
$password = (string) htmlspecialchars($_POST['passwd']);
if (person::logIn($username, $password)) {
$success = true;
switch (person::getPermissionName()) {
case 'admin':
$uri = Uri::getAction('Admin', 'getMain');
break;
case 'gameuser':
$uri = Uri::getAction('Gamer', 'getMain');
break;
}
}
}
return json_encode(array("success" => $success, "uri" => $uri));
}
开发者ID:roderm,项目名称:mkn151,代码行数:25,代码来源:Login.php
注:本文中的person类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论