本文整理汇总了PHP中person::get_skills方法的典型用法代码示例。如果您正苦于以下问题:PHP person::get_skills方法的具体用法?PHP person::get_skills怎么用?PHP person::get_skills使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类person
的用法示例。
在下文中一共展示了person::get_skills方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_person
function add_person(person $person)
{
connect();
$result = mysql_query("SELECT * FROM PERSON WHERE ID = '" . $person->get_ID() . "'");
if (!$result) {
error_log('ERROR on select in add_person() ' . mysql_error());
die('Invalid query: ' . mysql_error());
}
// the function get_MS_ID does not exist in the original Homebase code
// this code causes and error and should be deleted
// not clear what the logic was
/* if (mysql_num_rows($result) != 0)
{
delete_dbMasterSchedule($person->get_MS_ID());
connect();
} */
error_log('will insert person id= ' . $person->get_id() . ' avail= ' . $person->get_availability());
$avail = implode(",", $person->get_availability());
$schedule = implode(",", $person->get_schedule());
$query = "INSERT INTO PERSON VALUES ('" . $person->get_id() . "','" . $person->get_first_name() . "','" . $person->get_last_name() . "','" . $person->get_birthday() . "','" . $person->get_gender() . "','" . $person->get_address() . "','" . $person->get_city() . "','" . $person->get_state() . "','" . $person->get_zip() . "','" . $person->get_phone1() . "','" . $person->get_phone2() . "','" . $person->get_email() . "','" . $person->get_type() . "','" . $person->get_status() . "','" . $schedule . "','" . $person->get_notes() . "','" . $person->get_skills() . "','" . $person->get_reason_interested() . "','" . $person->get_date_added() . "','" . $person->get_password() . "','" . $avail . "','" . $person->get_contact_preference() . "');";
error_log('query is ' . $query);
$result = mysql_query($query);
if (!$result) {
error_log("error doing insert in add_person " . mysql_error());
echo mysql_error() . " - Unable to insert in PERSON: " . $person->get_ID() . "\n";
mysql_close();
return false;
}
mysql_close();
return true;
}
示例2: 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> ';
has("project") and $row["navLinks"] .= '<a href="' . $TPL["url_alloc_personGraph"] . 'personID=' . $row["personID"] . '">Graph</a> ';
$row["navLinks"] .= '<a href="' . $TPL["url_alloc_taskCalendar"] . 'personID=' . $row["personID"] . '">Calendar</a> ';
$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>";
}
}
}
}