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


PHP person::get_name方法代码示例

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


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

示例1: person

<?php 
include "class_person.php";
?>
<html>
<head>
<title>PHP Class Implementation</title>
</head>

<body>

<?php 
$ram = new person("Ram Krishna Maharjan");
$shyam = new person("Shayam Prashad Karki");
$ram->set_name("Ram Kumar Maharjan");
$shyam->set_name("Shyam Karki");
print "Ram's full name: " . $ram->get_name();
print "<br>Shyam's full name: " . $shyam->get_name();
?>

<?php 
//print "<h2>Private Attribute testing</h2>";
//print "Tell me private stuff: " . $ram->pinn_number; //throws an error
$ram->set_pinn_number("1234-5423-9873");
print "<br><br>Showing Private variable: " . $ram->get_pinn_number();
?>

</body>
</html>
开发者ID:kurtkesu,项目名称:PHP-MYSQL-Class-Basic,代码行数:28,代码来源:person_instance.php

示例2: prepare

 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: 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

示例4: 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

示例5: prepare

$currencyOps = $m->get_assoc_array("currencyTypeID", "currencyTypeID");
$TPL["currencyTypeOptions"] = page::select_options($currencyOps, $transaction_to_edit->get_value("currencyTypeID"));
if (is_object($expenseForm) && $expenseForm->get_value("clientID")) {
    $clientID_sql = prepare(" AND clientID = %d", $expenseForm->get_value("clientID"));
}
$q = "SELECT projectID AS value, projectName AS label \n        FROM project \n       WHERE projectStatus = 'Current' \n             " . $clientID_sql . " \n    ORDER BY projectName";
$TPL["projectOptions"] = page::select_options($q, $selectedProjectID);
if (is_object($expenseForm)) {
    $expenseForm->set_values();
    $TPL["expenseFormID"] = $expenseForm->get_id();
}
if (is_object($expenseForm) && $expenseForm->get_value("expenseFormCreatedUser")) {
    $p = new person();
    $p->set_id($expenseForm->get_value("expenseFormCreatedUser"));
    $p->select();
    $TPL["user"] = $p->get_name();
}
if ($_POST["cancel"]) {
    if (is_object($expenseForm)) {
        $expenseForm->delete_transactions();
        $expenseForm->delete();
        alloc_redirect($TPL["url_alloc_expenseFormList"]);
    } else {
        alloc_error("Unable to delete Expense Form");
    }
} else {
    if ($_POST["changeTransactionStatus"] == "pending") {
        $expenseForm->set_value("expenseFormComment", rtrim($expenseForm->get_value("expenseFormComment")));
        $expenseForm->save();
        $expenseForm->set_status("pending");
        alloc_redirect($TPL["url_alloc_expenseForm"] . "expenseFormID=" . $expenseForm->get_id());
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:expenseForm.php

示例6: person

<?php

include "class_lib.php";
$stefan = new person("Stefan Mischook");
echo "Stefan's full name: " . $stefan->get_name();
echo "Tell me a private stuff: " . $stefan->pinn_number;
$james = new employee("Johnny Fingers");
echo "--->" . $james->get_name();
开发者ID:analyn34,项目名称:oop-php,代码行数:8,代码来源:index.php

示例7: person

 <head>
     <meta charset="UTF-8">
     <title>OOP in PHP</title>

     <?php 
//Include your class in your main PHP page
include "class.php";
?>






     </head>

 <body>
 <?php 
//To create an object out of a class, you need to use the 'new' keyword.
$stephan = new person();
$jimmy = new person();
// Set an objects properties
$stephan->set_name("Stephan Mcgregory");
$jimmy->set_name("Jimmy Wanjala");
//Accessing an object's data using ->
echo "Stephans full name is " . $stephan->get_name();
echo "Jimmy's full name is" . $jimmy->get_name();
?>
 </body>
 </html>
开发者ID:easyguyme,项目名称:LEARN-OBJECT-ORIENTED-PROGRAMMING-OOP-IN-PHP,代码行数:30,代码来源:index.php

示例8: person

    $TPL["task_closed_when"] = $task->get_value("dateClosed");
}
$person = new person();
$person->set_id($task->get_value("personID"));
$person->select();
$TPL["person_username"] = $person->get_name();
$TPL["person_username_personID"] = $person->get_id();
$manager = new person();
$manager->set_id($task->get_value("managerID"));
$manager->select();
$TPL["manager_username"] = $manager->get_name();
$TPL["manager_username_personID"] = $manager->get_id();
$estimator = new person();
$estimator->set_id($task->get_value("estimatorID"));
$estimator->select();
$TPL["estimator_username"] = $estimator->get_name();
$TPL["estimator_username_personID"] = $estimator->get_id();
// If we've been sent here by a "New Message" or "New Fault" option in the Quick List dropdown
if (!$taskID && $_GET["tasktype"]) {
    $task->set_value("taskTypeID", $_GET["tasktype"]);
}
// If we've been sent here by a "New Task" link from the calendar
if (!$taskID && $_GET["dateTargetStart"]) {
    $TPL["task_dateTargetStart"] = $_GET["dateTargetStart"];
    $task->set_value("personID", $_GET["personID"]);
}
// Set options for the dropdown boxen
$task->set_option_tpl_values();
$time_billed = $task->get_time_billed(false);
$time_billed_label = seconds_to_display_format($time_billed);
if ($time_billed != "") {
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:task.php

示例9: person

    }
}
// display the approved by admin and managers name and date
$person = new person();
if ($timeSheet->get_value("approvedByManagerPersonID")) {
    $person_approvedByManager = new person();
    $person_approvedByManager->set_id($timeSheet->get_value("approvedByManagerPersonID"));
    $person_approvedByManager->select();
    $TPL["timeSheet_approvedByManagerPersonID_username"] = $person_approvedByManager->get_name();
    $TPL["timeSheet_approvedByManagerPersonID"] = $timeSheet->get_value("approvedByManagerPersonID");
}
if ($timeSheet->get_value("approvedByAdminPersonID")) {
    $person_approvedByAdmin = new person();
    $person_approvedByAdmin->set_id($timeSheet->get_value("approvedByAdminPersonID"));
    $person_approvedByAdmin->select();
    $TPL["timeSheet_approvedByAdminPersonID_username"] = $person_approvedByAdmin->get_name();
    $TPL["timeSheet_approvedByAdminPersonID"] = $timeSheet->get_value("approvedByAdminPersonID");
}
// display the project name.
if (($timeSheet->get_value("status") == 'edit' || $timeSheet->get_value("status") == 'rejected') && !$timeSheet->get_value("projectID")) {
    $query = prepare("SELECT * FROM project WHERE projectStatus = 'Current' ORDER by projectName");
    #.prepare("  LEFT JOIN projectPerson on projectPerson.projectID = project.projectID ")
    #.prepare("WHERE projectPerson.personID = '%d' ORDER BY projectName", $current_user->get_id());
} else {
    $query = prepare("SELECT * FROM project ORDER by projectName");
}
// This needs to be just above the newTimeSheet_projectID logic
$projectID = $timeSheet->get_value("projectID");
// If we are entering the page from a project link: New time sheet
if ($_GET["newTimeSheet_projectID"] && !$projectID) {
    $_GET["taskID"] and $tid = "&taskID=" . $_GET["taskID"];
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:timeSheet.php

示例10: array

 function get_all_parties($projectID = "")
 {
     $db = new db_alloc();
     $interestedPartyOptions = array();
     if ($_GET["projectID"]) {
         $projectID = $_GET["projectID"];
     } else {
         if (!$projectID) {
             $projectID = $this->get_value("projectID");
         }
     }
     if ($projectID) {
         $project = new project($projectID);
         $interestedPartyOptions = $project->get_all_parties(false, $this->get_id());
     }
     $extra_interested_parties = config::get_config_item("defaultInterestedParties") or $extra_interested_parties = array();
     foreach ($extra_interested_parties as $name => $email) {
         $interestedPartyOptions[$email]["name"] = $name;
     }
     if ($this->get_value("creatorID")) {
         $p = new person();
         $p->set_id($this->get_value("creatorID"));
         $p->select();
         if ($p->get_value("emailAddress")) {
             $interestedPartyOptions[$p->get_value("emailAddress")]["name"] = $p->get_name();
             $interestedPartyOptions[$p->get_value("emailAddress")]["role"] = "creator";
             $interestedPartyOptions[$p->get_value("emailAddress")]["personID"] = $this->get_value("creatorID");
         }
     }
     if ($this->get_value("personID")) {
         $p = new person();
         $p->set_id($this->get_value("personID"));
         $p->select();
         if ($p->get_value("emailAddress")) {
             $interestedPartyOptions[$p->get_value("emailAddress")]["name"] = $p->get_name();
             $interestedPartyOptions[$p->get_value("emailAddress")]["role"] = "assignee";
             $interestedPartyOptions[$p->get_value("emailAddress")]["personID"] = $this->get_value("personID");
             $interestedPartyOptions[$p->get_value("emailAddress")]["selected"] = 1;
         }
     }
     if ($this->get_value("managerID")) {
         $p = new person();
         $p->set_id($this->get_value("managerID"));
         $p->select();
         if ($p->get_value("emailAddress")) {
             $interestedPartyOptions[$p->get_value("emailAddress")]["name"] = $p->get_name();
             $interestedPartyOptions[$p->get_value("emailAddress")]["role"] = "manager";
             $interestedPartyOptions[$p->get_value("emailAddress")]["personID"] = $this->get_value("managerID");
             $interestedPartyOptions[$p->get_value("emailAddress")]["selected"] = 1;
         }
     }
     // return an aggregation of the current task/proj/client parties + the existing interested parties
     $interestedPartyOptions = interestedParty::get_interested_parties("task", $this->get_id(), $interestedPartyOptions);
     return $interestedPartyOptions;
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:55,代码来源:task.inc.php

示例11: while

 if ($_POST["field_quotes"] == "single") {
     $quotes = "'";
 }
 if ($_POST["field_quotes"] == "double") {
     $quotes = "\"";
 }
 while ($db->next_record()) {
     $odd_even = $odd_even == "even" ? "odd" : "even";
     $TPL["result_row"] .= sprintf($start_row_separator, $odd_even);
     foreach ($fields as $k => $field) {
         $field = end(explode(".", $field));
         if (stripos("ModifiedUser", $field) !== FALSE || stripos("personID", $field) !== FALSE) {
             $person = new person();
             $person->set_id($db->f($field));
             $person->select();
             $result = $person->get_name(array("format" => "nick"));
         } else {
             if (stripos("tfID", $field) !== FALSE) {
                 $result = tf::get_name($db->f($field));
             } else {
                 $result = $db->f($field);
             }
         }
         $TPL["result_row"] .= $start_field_separator;
         $TPL["result_row"] .= $quotes . $result . $quotes;
         if (isset($fields[$k + 1]) || !$_POST["generate_file"]) {
             $TPL["result_row"] .= $end_field_separator;
         }
     }
     $TPL["result_row"] .= $end_row_separator;
     $counter++;
开发者ID:cjbayliss,项目名称:alloc,代码行数:31,代码来源:report.php

示例12: singleton

 function load_productSale_filter($_FORM)
 {
     $current_user =& singleton("current_user");
     // display the list of project name.
     $db = new db_alloc();
     if (!$_FORM['showAllProjects']) {
         $filter = "WHERE projectStatus = 'Current' ";
     }
     $query = prepare("SELECT projectID AS value, projectName AS label FROM project {$filter} ORDER by projectName");
     $rtn["show_project_options"] = page::select_options($query, $_FORM["projectID"], 70);
     // display the list of user name.
     if (have_entity_perm("productSale", PERM_READ, $current_user, false)) {
         $rtn["show_userID_options"] = page::select_options(person::get_username_list(), $_FORM["personID"]);
     } else {
         $person = new person();
         $person->set_id($current_user->get_id());
         $person->select();
         $person_array = array($current_user->get_id() => $person->get_name());
         $rtn["show_userID_options"] = page::select_options($person_array, $_FORM["personID"]);
     }
     // display a list of status
     $status_array = productSale::get_statii();
     unset($status_array["create"]);
     $rtn["show_status_options"] = page::select_options($status_array, $_FORM["status"]);
     // display the date from filter value
     $rtn["showAllProjects"] = $_FORM["showAllProjects"];
     $options["clientStatus"] = array("Current");
     $options["return"] = "dropdown_options";
     $ops = client::get_list($options);
     $ops = array_kv($ops, "clientID", "clientName");
     $rtn["clientOptions"] = page::select_options($ops, $_FORM["clientID"]);
     // Get
     $rtn["FORM"] = "FORM=" . urlencode(serialize($_FORM));
     return $rtn;
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:35,代码来源:productSale.inc.php

示例13: person

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"> 
<title> OOP PHP </title>
<?php 
include "class_lib.php";
?>
</head>
<body>
<?php 
$stefn = new person("stf2");
$jimmy = new person("jimmy");
//$stefn->set_name();
//$jimmy->set_name();
echo "name 1: " . $stefn->get_name();
echo "name 2: " . $jimmy->get_name();
?>
</body>
</html>
开发者ID:Simonleek,项目名称:LectureNote,代码行数:20,代码来源:index.php

示例14: get_list

 public static function get_list($_FORM = array())
 {
     global $TPL;
     $current_user =& singleton("current_user");
     list($filter, $filter2) = person::get_list_filter($_FORM);
     $debug = $_FORM["debug"];
     $debug and print "<pre>_FORM: " . print_r($_FORM, 1) . "</pre>";
     $debug and print "<pre>filter: " . print_r($filter, 1) . "</pre>";
     $_FORM["return"] or $_FORM["return"] = "html";
     // Get averages for hours worked over the past fortnight and year
     if ($current_user->have_perm(PERM_PERSON_READ_MANAGEMENT) && $_FORM["showHours"]) {
         $t = new timeSheetItem();
         list($ts_hrs_col_1, $ts_dollars_col_1) = $t->get_averages(date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 14, date("Y"))));
         list($ts_hrs_col_2, $ts_dollars_col_2) = $t->get_fortnightly_average();
     } else {
         unset($_FORM["showHours"]);
     }
     // A header row
     $summary .= person::get_list_tr_header($_FORM);
     if (is_array($filter) && count($filter)) {
         $filter = " WHERE " . implode(" AND ", $filter);
     }
     if (is_array($filter2) && count($filter2)) {
         unset($filter["skill"]);
         $filter .= " AND " . implode(" OR ", $filter2);
     }
     $q = "SELECT person.*\n            FROM person\n       LEFT JOIN proficiency ON person.personID = proficiency.personID\n           " . $filter . "\n        GROUP BY username\n        ORDER BY firstName,surname,username";
     $debug and print "Query: " . $q;
     $db = new db_alloc();
     $db->query($q);
     while ($row = $db->next_record()) {
         $p = new person();
         if (!$p->read_db_record($db)) {
             continue;
         }
         $row = $p->perm_cleanup($row);
         // this is not the right way to do this - alla
         $print = true;
         $_FORM["showHours"] and $row["hoursSum"] = $ts_hrs_col_1[$row["personID"]];
         $_FORM["showHours"] and $row["hoursAvg"] = $ts_hrs_col_2[$row["personID"]];
         $row["name"] = $p->get_name();
         $row["name_link"] = $p->get_link($_FORM);
         $row["personActive_label"] = $p->get_value("personActive") == 1 ? "Y" : "";
         if ($_FORM["showSkills"]) {
             $senior_skills = $p->get_skills('Senior');
             $advanced_skills = $p->get_skills('Advanced');
             $intermediate_skills = $p->get_skills('Intermediate');
             $junior_skills = $p->get_skills('Junior');
             $novice_skills = $p->get_skills('Novice');
             $skills = array();
             $senior_skills and $skills[] = "<img src=\"../images/skill_senior.png\" alt=\"Senior=\"> " . page::htmlentities($senior_skills);
             $advanced_skills and $skills[] = "<img src=\"../images/skill_advanced.png\" alt=\"Advanced=\"> " . page::htmlentities($advanced_skills);
             $intermediate_skills and $skills[] = "<img src=\"../images/skill_intermediate.png\" alt=\"Intermediate=\"> " . page::htmlentities($intermediate_skills);
             $junior_skills and $skills[] = "<img src=\"../images/skill_junior.png\" alt=\"Junior=\"> " . page::htmlentities($junior_skills);
             $novice_skills and $skills[] = "<img src=\"../images/skill_novice.png\" alt=\"Novice\"> " . page::htmlentities($novice_skills);
             $row["skills_list"] = implode("<br>", $skills);
         }
         if ($_FORM["showLinks"]) {
             $row["navLinks"] = '<a href="' . $TPL["url_alloc_taskList"] . 'personID=' . $row["personID"] . '&taskView=byProject&applyFilter=1';
             $row["navLinks"] .= '&dontSave=1&taskStatus=open&projectType=Current">Tasks</a>&nbsp;&nbsp;';
             has("project") and $row["navLinks"] .= '<a href="' . $TPL["url_alloc_personGraph"] . 'personID=' . $row["personID"] . '">Graph</a>&nbsp;&nbsp;';
             $row["navLinks"] .= '<a href="' . $TPL["url_alloc_taskCalendar"] . 'personID=' . $row["personID"] . '">Calendar</a>&nbsp;&nbsp;';
             $dateFrom = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") - 28, date("Y")));
             $dateTo = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") + 1, date("Y")));
             $row["navLinks"] .= '<a href="' . $TPL["url_alloc_timeSheetGraph"] . 'personID=' . $row["personID"] . '&dateFrom=' . $dateFrom . '&dateTo=' . $dateTo . '&applyFilter=1&dontSave=1">Hours</a>';
         }
         $summary .= person::get_list_tr($row, $_FORM);
         $rows[$row["personID"]] = $row;
     }
     $rows or $rows = array();
     if ($print && $_FORM["return"] == "array") {
         return $rows;
     } else {
         if ($print && $_FORM["return"] == "html") {
             return "<table class=\"list sortable\">" . $summary . "</table>";
         } else {
             if (!$print && $_FORM["return"] == "html") {
                 return "<table style=\"width:100%\"><tr><td colspan=\"10\" style=\"text-align:center\"><b>No People Found</b></td></tr></table>";
             }
         }
     }
 }
开发者ID:cjbayliss,项目名称:alloc,代码行数:82,代码来源:person.inc.php

示例15: person

<?php

include "class_lib.php";
$Allen = new person("Allen Ivy");
$Christopher = new person("Christopher Ivy");
echo "Allen full name is " . $Allen->get_name();
$james = new employee("Johnny Fingers");
echo "---> " . $james->get_name();
开发者ID:aivy0011,项目名称:paperplane,代码行数:8,代码来源:index.php


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